Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / frameset-frameborder-inheritance.html
blob7adb7f3a05658c06cc103e86ad8ba5ba7b2974fa
1 <!doctype html>
3 <script src="../../resources/js-test.js"></script>
5 <iframe
6 data-test="missing frameborder attribute should inherit it"
7 data-assert-frame-width="150">
8 <!doctype html>
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>">
13 </frameset>
14 </frameset>
15 </iframe>
17 <iframe
18 data-test="inherited frameborder=no should inherit border=0"
19 data-assert-frame-width="150">
20 <!doctype html>
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>">
25 </frameset>
26 </frameset>
27 </iframe>
29 <iframe
30 data-test="frameborder=yes and border should override inherited value"
31 data-assert-frame-width="145">
32 <!doctype html>
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>">
37 </frameset>
38 </frameset>
39 </iframe>
41 <iframe
42 data-test="inherited frameborder=0 should have border=0 even if specified differently"
43 data-assert-frame-width="150">
44 <!doctype html>
45 <frameset rows="*" cols="*" frameborder="0" border="10">
46 <!--
48 This inherits frameborder="0" so the border="20" should be ignored
49 and children of it should inherit border="0".
50 -->
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>">
55 </frameset>
56 </frameset>
57 </frameset>
58 </iframe>
60 <iframe
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)">
64 <!doctype html>
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>">
70 </frameset>
71 </frameset>
72 </frameset>
73 </iframe>
75 <script>
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);
96 debug('<br>');
97 });
98 </script>