| 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/ | ||
|
Description
hurin8888
2015-09-13 11:22:15 PDT
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 = ''. Aswell the ElementCSSInlineStyle forwards to cssText https://drafts.csswg.org/cssom/#cssstyledeclaration which says "2. Empty the declarations". Added a more obvious test case to show the problem https://jsfiddle.net/f557bLq4/6/ 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. As of build 246014, `.style =` setter works as expected. 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 |