summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select-popup/popup-menu-nested-style.html
blob: e5e13d8b7d6d9cb0ead031c8125e03f3a5d5f3e0 (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
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu" style="background-color:white; color:black;">
  <option>foo</option>
  <optgroup label="Group" style="background-color:black; color:white;">
    <option style="background-color:white; color:black;">bar</option>
  </optgroup>
  <optgroup label="Group2" style="display:none;">
    <option>baz</option>
  </optgroup>
</select>
<script>
description('Check if an OPTION style is serialized with comparison with the parent OPTGROUP style.');
var menuElement = document.getElementById('menu');
var params = null;

function openPickerErrorCallback() {
    testFailed('picker didn\'t open')
    finishJSTest();
}
openPicker(menu, test1, openPickerErrorCallback);
function test1() {
    params = window.internals.pagePopupWindow.global.params;
    shouldBeEqualToString('params.children[1].type', 'optgroup');
    shouldBeUndefined('params.children[1].children[0].type');
    shouldBeEqualToString('params.children[1].children[0].style.color', '#000000');
    shouldBeEqualToString('params.children[1].children[0].style.backgroundColor', '#ffffff');

    finishJSTest();
}
</script>
</body>
</html>