blob: f319924cbff5b156b1cd08847ae7c8423c9b34a9 [file] [log] [blame]
This test tests and documents the behavior of CSS style rules with a massive number of selectors. Rules with >8192 selector components get split into multiple rules at the parsing stage. Setting a rule's selectorText via CSSOM will do nothing if there are more than 8192 components.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS rule().selectorText = selectorListWithLength(1); rule().selectorText is selectorListWithLength(1)
PASS rule().selectorText = selectorListWithLength(8192); rule().selectorText is selectorListWithLength(8192)
PASS rule().selectorText = '.reset'; rule().selectorText is '.reset'
PASS rule().selectorText = selectorListWithLength(8193); rule().selectorText is '.reset'
PASS rule().selectorText = '.reset'; rule().selectorText is '.reset'
PASS rule().selectorText = selectorListWithLength(8193); sheet().rules.length is 1
PASS rule().selectorText = selectorListWithLength(8192); rule().selectorText is selectorListWithLength(8192)
PASS rule().selectorText = selectorListWithLength(8192); sheet().rules.length is 1
PASS rule().selectorText = '.reset'; rule().selectorText is '.reset'
PASS rule().selectorText = selectorListWithLength(8193); rule().selectorText is '.reset'
PASS rule().selectorText = selectorListWithLength(8193); sheet().rules.length is 1
PASS rule().selectorText = fatSelectorListWithLength(1); sheet().rules.length is 1
PASS rule().selectorText = fatSelectorListWithLength(1); rule().selectorText is fatSelectorListWithLength(1)
PASS rule().selectorText = fatSelectorListWithLength(2048); rule().selectorText is fatSelectorListWithLength(2048)
PASS rule().selectorText = '.reset'; rule().selectorText is '.reset'
PASS rule().selectorText = fatSelectorListWithLength(2049); rule().selectorText is '.reset'
PASS styleElement.innerText = styleSheetWithSelectorLength(1); rule().selectorText is selectorListWithLength(1)
PASS styleElement.innerText = styleSheetWithSelectorLength(8192); rule().selectorText is selectorListWithLength(8192)
PASS styleElement.innerText = styleSheetWithSelectorLength(8192); sheet().rules.length is 1
PASS styleElement.innerText = styleSheetWithSelectorLength(8193); rule().selectorText is selectorListWithLength(8192)
PASS styleElement.innerText = styleSheetWithSelectorLength(8193); sheet().rules.length is 2
PASS styleElement.innerText = styleSheetWithSelectorLength(16384); sheet().rules.length is 2
PASS styleElement.innerText = styleSheetWithSelectorLength(16385); sheet().rules.length is 3
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(1); sheet().rules.length is 1
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(2048); sheet().rules.length is 1
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(2049); sheet().rules.length is 2
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(4096); sheet().rules.length is 2
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(4097); sheet().rules.length is 3
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(16385); sheet().rules.length is 9
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(16384); sheet().rules.length is 8
PASS styleElement.innerText = fatStyleSheetWithSelectorLength(16385); sheet().rules.length is 9
PASS successfullyParsed is true
TEST COMPLETE