Bug 248442
Summary: | cssText serialization in inline style for "padding" | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | obrufau |
Priority: | P2 | ||
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While going through Blink commit's, which can be merged or where we are failing some test cases, I came across another one:
Failing Test Case (not taken from patch but updated from source.chromium.org) - https://jsfiddle.net/r5u0c9wh/show
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/1b84d2a68d373efab9a6e571274ffefdeefe6c58
Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/Source/WebCore/css/StyleProperties.cpp#L704
Just wanted to raise a bug, where this can be tracked for future fix purposes.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Tim Nguyen (:ntim)
I think we already fixed the !important issue, but CSS-wide keywords may still need extra work? Oriol, is there a bug on file for this?
Ahmad Saleem
I don't have Trunk build locally so in STP158, we do fail "padding" test case from JSFiddle in Comment 0 w while the browsers (Chrome Canary 110 & Firefox Nightly 109) pass all of them.
Oriol Brufau
Yeah, !important was fixed in bug 247771, you can test with e.g. 'inherit':
var {style} = document.createElement("div");
style.cssText = "padding: inherit; padding-top: inherit !important";
style.cssText; // "padding-right: inherit; padding-bottom: inherit; padding-left: inherit; padding-top: inherit !important;"
The problem with 'initial' is bug 185953, caused by this piece of code: https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/Source/WebCore/css/StyleProperties.cpp#L1759-L1760
It was a workaround for some other problem that I don't remember, probably that the serialization of several shorthands does not properly handle CSS-wide keywords (https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssom-getPropertyValue-common-checks-expected.txt) or that during parsing a shorthand can set omitted longhands to literally 'initial' instead of the actual initial value.
*** This bug has been marked as a duplicate of bug 185953 ***