summaryrefslogtreecommitdiff
path: root/documentation/frames.mdwn
blob: 236277fcf5364f965f243dcbb5e6eb2800a49e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[[!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

    <nowiki>
      <frameset rows="50%,50%">
        <frameset cols="40,200">
          <frame name="A" src="aaa">
          <frame name="B" src="bbb">
        </frameset>
        <frameset cols="3*,*">
          <frame name="C" src="ccc">
          <frame name="D" src="ddd">
        </frameset>
      </frameset>
    </nowiki>

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' <aaa> (scrolling auto) border 0
        (0 1): 0x608daeb0 (0 0) w200px h100% (margin w0 h0) 'B' <bbb> (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' <ccc> (scrolling auto) border 0
        (0 1): 0x608d9b88 (0 0) w1* h100% (margin w0 h0) 'D' <ddd> (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"]]