| Summary: | CSSOM fails to serialize some shorthands set to 'initial' (or any css-wide keyword) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Oriol Brufau <obrufau> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=247771 | ||
| Bug Depends on: | 242775, 247988 | ||
| Bug Blocks: | |||
Improved in bug 247988, then fixed by bug 242775. |
Run this code: var allCSSProps = new Set(); for (let obj = document.createElement("div").style; obj; obj = Reflect.getPrototypeOf(obj)) { for (let name of Object.getOwnPropertyNames(obj)) { let prop = name.replace(/[A-Z]/g, c => "-" + c.toLowerCase()); if (CSS.supports(prop, "initial")) { allCSSProps.add(prop); } } } var style = document.createElement("div").style; var bad = new Map(); for (let prop of allCSSProps) { style.cssText = ""; style.setProperty(prop, "initial"); let result = style.getPropertyValue(prop); if (result !== "initial") { bad.set(prop, result); } } bad; Expected: empty map Actual: a map with some failures: Map { "-webkit-border-radius" => "", "-webkit-column-break-after" => "", "-webkit-column-break-before" => "", "-webkit-column-break-inside" => "", "-webkit-perspective" => "", "grid" => "", "grid-area" => "initial / initial / initial / initial" "grid-column" => "initial / initial" "grid-row" => "initial / initial" "offset" => "", }