3 <script src=
"../../resources/js-test.js"></script>
6 data-test=
"missing frameborder attribute should inherit it"
7 data-assert-frame-width=
"150">
9 <frameset rows=
"*" cols=
"*" frameborder=
"0">
10 <frameset rows=
"*" cols=
"50,50">
11 <frame src=
"data:text/html,<body bgcolor=red>">
12 <frame src=
"data:text/html,<body bgcolor=blue>">
18 data-test=
"inherited frameborder=no should inherit border=0"
19 data-assert-frame-width=
"150">
21 <frameset rows=
"*" cols=
"*" frameborder=
"0">
22 <frameset rows=
"*" cols=
"50,50" frameborder=
"1">
23 <frame src=
"data:text/html,<body bgcolor=green>">
24 <frame src=
"data:text/html,<body bgcolor=yellow>">
30 data-test=
"frameborder=yes and border should override inherited value"
31 data-assert-frame-width=
"145">
33 <frameset rows=
"*" cols=
"*" frameborder=
"0">
34 <frameset rows=
"*" cols=
"50,50" frameborder=
"1" border=
"10">
35 <frame src=
"data:text/html,<body bgcolor=orange>">
36 <frame src=
"data:text/html,<body bgcolor=pink>">
42 data-test=
"inherited frameborder=0 should have border=0 even if specified differently"
43 data-assert-frame-width=
"150">
45 <frameset rows=
"*" cols=
"*" frameborder=
"0" border=
"10">
48 This inherits frameborder="0" so the border="20" should be ignored
49 and children of it should inherit border="0".
51 <frameset rows=
"*" cols=
"*" border=
"20">
52 <frameset rows=
"*" cols=
"50,50" frameborder=
"1">
53 <frame src=
"data:text/html,<body bgcolor=green>">
54 <frame src=
"data:text/html,<body bgcolor=yellow>">
61 data-test=
"bordercolor should inherit even if frameborder=0"
62 data-assert-frame-width=
"145"
63 data-assert-border-color=
"rgb(0, 128, 0)">
65 <frameset rows=
"*" cols=
"*" frameborder=
"0" bordercolor=
"green">
66 <frameset rows=
"*" cols=
"*" frameborder=
"1">
67 <frameset rows=
"*" cols=
"50,50" border=
"10">
68 <frame src=
"data:text/html,<body bgcolor=red>">
69 <frame src=
"data:text/html,<body bgcolor=blue>">
76 description('Check frameset frameborder and border attribute inheritance');
78 iframes
= [].slice
.call(document
.querySelectorAll('iframe'));
79 iframes
.forEach(function(iframe
) {
80 // Can't use srcdoc since that wouldn't synchronously load the content.
81 iframe
.contentDocument
.write(iframe
.textContent
);
82 iframe
.contentDocument
.close();
84 frameset
= iframe
.contentDocument
.querySelector('frameset');
85 expectedWidth
= iframe
.dataset
.assertFrameWidth
;
86 expectedBorderColor
= iframe
.dataset
.assertBorderColor
;
87 frames
= frameset
.querySelectorAll('frame');
88 debug(iframe
.dataset
.test
);
89 shouldBe('frames[0].offsetWidth', expectedWidth
);
90 shouldBe('frames[1].offsetWidth', expectedWidth
);
91 if (expectedBorderColor
) {
92 // This check won't work in Gecko since they don't expose the border color properly.
93 frameset
= frames
[0].parentNode
;
94 shouldBeEqualToString('getComputedStyle(frameset).borderColor', expectedBorderColor
);