[[!meta title="Documentation/Frames"]] [[!meta author="James Bursa"]] [[!meta date="2010-03-01T02:56:32Z"]] [[!toc]] Frames cut across many parts of the browser. Representation in content ------------------------- During box-tree construction (box\_construct.c), frameset, frame, and iframe elements are converted into structures in the 'struct content' for the HTML document. Framesets and frames form a tree of 'struct content\_html\_frames' at content-\>data.html.frameset. For example, the source results in the tree 0x6099f2f4 (2 1) w0px h0px (margin w0 h0) (scrolling no) (0 0): 0x608b730c (1 2) w100% h50% (margin w0 h0) (scrolling no) (0 0): 0x608dae74 (0 0) w40px h100% (margin w0 h0) 'A' (scrolling auto) border 0 (0 1): 0x608daeb0 (0 0) w200px h100% (margin w0 h0) 'B' (scrolling auto) border 0 (1 0): 0x608b7348 (1 2) w100% h50% (margin w0 h0) (scrolling no) (0 0): 0x608d9b4c (0 0) w3* h100% (margin w0 h0) 'C' (scrolling auto) border 0 (0 1): 0x608d9b88 (0 0) w1* h100% (margin w0 h0) 'D' (scrolling auto) border 0 (output from html\_dump\_frameset()). Creation of browser windows --------------------------- When a document containing frames is displayed in a browser window, child windows are created for frames and iframes. This occurs when a browser window receives a CONTENT\_MSG\_READY in browser\_window\_callback(), which calls browser\_window\_create\_frameset(). browser\_window\_create\_frameset() constructs a tree of 'struct browser\_window' corresponding to the tree of 'struct content\_html\_frames'. For each new browser\_window, it calls gui\_create\_browser\_window() to create and open the actual platform-specific window (represented by a 'struct gui\_window'). When this is completed it calls browser\_window\_recalculate\_frameset() which calculates the positions of each frame in pixels and calls gui\_window\_position\_frame() to position each one. [[!inline raw=yes pages="Documentation"]]