| Nazım Can Altınova | 19d2b1e | 2017-02-06 10:33:36 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <title>CSSOM - Overlow property has different serialization than other shorthands.</title> |
| 6 | <script src="/resources/testharness.js"></script> |
| 7 | <script src="/resources/testharnessreport.js"></script> |
| 8 | <style> |
| 9 | div { overflow: inherit; } |
| 10 | div { overflow: hidden; } |
| 11 | div { overflow-x: initial; overflow-y: initial; } |
| 12 | div { overflow-x: scroll; overflow-y: scroll; } |
| 13 | div { overflow-x: inherit; overflow-y: unset; } |
| 14 | </style> |
| 15 | |
| 16 | <script> |
| 17 | test(function () { |
| 18 | var styleSheet = document.styleSheets[0]; |
| 19 | |
| 20 | assert_equals(styleSheet.cssRules[0].style.cssText, "overflow: inherit;", "Single value overflow with CSS-wide keyword should serialize correctly."); |
| 21 | assert_equals(styleSheet.cssRules[1].style.cssText, "overflow: hidden;", "Single value overflow with non-CSS-wide keyword should serialize correctly."); |
| 22 | assert_equals(styleSheet.cssRules[2].style.cssText, "overflow: initial;", "Overflow-x/y longhands with same CSS-wide keyword should serialize correctly."); |
| 23 | assert_equals(styleSheet.cssRules[3].style.cssText, "overflow: scroll;", "Overflow-x/y longhands with same non-CSS-wide keyword should serialize correctly."); |
| 24 | assert_equals(styleSheet.cssRules[4].style.cssText, "overflow-x: inherit; overflow-y: unset;", "Overflow-x/y longhands with different keywords should serialize correctly."); |
| 25 | |
| 26 | var div = document.createElement('div'); |
| 27 | div.style.overflow = "inherit"; |
| 28 | assert_equals(div.style.overflow, "inherit", "Single value overflow with CSS-wide keyword should serialize correctly."); |
| 29 | |
| 30 | div.style.overflow = "hidden"; |
| 31 | assert_equals(div.style.overflow, "hidden", "Single value overflow with non-CSS-wide keyword should serialize correctly."); |
| 32 | |
| 33 | div.style.overflow = ""; |
| 34 | div.style.overflowX = "initial"; |
| 35 | div.style.overflowY = "initial"; |
| 36 | assert_equals(div.style.overflow, "initial", "Overflow-x/y longhands with same CSS-wide keyword should serialize correctly."); |
| 37 | |
| 38 | div.style.overflowX = "scroll"; |
| 39 | div.style.overflowY = "scroll"; |
| 40 | assert_equals(div.style.overflow, "scroll", "Overflow-x/y longhands with same non-CSS-wide keyword should serialize correctly."); |
| 41 | |
| 42 | div.style.overflowX = "inherit"; |
| 43 | div.style.overflowY = "unset"; |
| 44 | assert_equals(div.style.overflow, "", "Overflow-x/y longhands with different keywords shouldn't serialize."); |
| 45 | }); |
| 46 | </script> |
| 47 | </head> |
| 48 | </html> |