Bug 242775
| Summary: | shorthand serialization for background and mask should not include "initial" in the middle of the value | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> |
| Component: | CSS | Assignee: | Darin Adler <darin> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | darin, karlcow, ntim, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=244657 | ||
| Bug Depends on: | |||
| Bug Blocks: | 185953, 247769 | ||
Cameron McCormack (:heycam)
For example:
<!DOCTYPE html>
<style>
div { background: none; background-position: initial; }
</style>
<pre id=log></pre>
<script>
log.textContent = "background: " + document.styleSheets[0].cssRules[0].style.getPropertyValue("background");
</script>
This outputs "background: none initial initial", which is not valid.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/97405629>
Darin Adler
There is a straightforward way to make sure we don’t serialize any shorthands when one of the longhands has a keyword like "initial". I wrote the code for it and it’s super-simple.
But a prerequisite for doing that is that we have to stop setting longhands to "initial" as a side effect of *using* a shorthand. Otherwise, we’ll be getting the empty string way too often. That means we probably need to fix bug 244657 *before* fixing this one.
Tim Nguyen (:ntim)
Does removing `case CSSPropertyBackground:` from the `canUseShorthandForLonghand` blocklist in StyleProperties help?
Darin Adler
It does not fix this problem, no, but it should be done for other reasons.
Darin Adler
Pull request: https://github.com/WebKit/WebKit/pull/7025
EWS
Committed 257429@main (a0488d1bf07c): <https://commits.webkit.org/257429@main>
Reviewed commits have been landed. Closing PR #7025 and removing active labels.