Bug 149105
| Summary: | Rendering of style doesn't update | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | hurin8888 |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Critical | CC: | ashvayka, koivisto, zalan |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | https://jsfiddle.net/f557bLq4/1/ | ||
hurin8888
The background of the <li> should be undefined, it shows green instead.
This bug appeared on the last stable android webview and last stable desktop version of webkit and didn't exist before.
https://jsfiddle.net/f557bLq4/1/
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
hurin8888
The CSS object model specification says
"Mutating the declarations must set the style content attribute on the context object to the serialization of the declarations."
https://drafts.csswg.org/cssom/#elementcssinlinestyle
So it confirms this behavior is not wanted.
A hotfix for webdevelopers is to mute the wanted property namely, element.style.backgroundColor = ''.
hurin8888
Aswell the ElementCSSInlineStyle forwards to cssText https://drafts.csswg.org/cssom/#cssstyledeclaration which says "2. Empty the declarations".
hurin8888
Added a more obvious test case to show the problem https://jsfiddle.net/f557bLq4/6/
Alexey Shvayka
Inline styles is now a thing because, and I see people get stumbled upon this issue in Safari more and more often (I counted 5 complaints this year alone in our 2200 members chat room).
Setter polyfill, `setAttribute`, or `.style.cssText =` may be used instead, but I think this should be fixed to improve developer experience & spec compliance.
Alexey Shvayka
As of build 246014, `.style =` setter works as expected.
Alexey Shvayka
This issue was caused by spec-imperfect implementation of [PutForwards] extended attribute and was fixed in https://bugs.webkit.org/show_bug.cgi?id=172956.
Test: web-platform-tests/WebIDL/ecmascript-binding/put-forwards.html