Prepare CSSStyleDeclaration-impl.js and CSSStyleProperties-impl.js#3957
Prepare CSSStyleDeclaration-impl.js and CSSStyleProperties-impl.js#3957asamuzaK wants to merge 25 commits intojsdom:mainfrom
Conversation
domenic
left a comment
There was a problem hiding this comment.
Thanks for doing this. The overall approach looks very promising.
| "Inherited system color keyword is observable on caret-color": [fail, computedStyleMap not implemented] | ||
| "Inherited system color keyword is observable on fill": [fail, computedStyleMap not implemented] | ||
| "Inherited system color keyword is observable on stroke": [fail, computedStyleMap not implemented] | ||
| "System color doesn't compute to itself on box-shadow": [fail, Need cssstyle fix] |
There was a problem hiding this comment.
It is because cssstyle does not yet properly implement parsers for box-shadow and other color related properties.
There was a problem hiding this comment.
But why did they pass before, and fail with this PR?
There was a problem hiding this comment.
I haven't looked into the details, but I suspect that this may have coincidentally matched a color conversion table that jsdom had locally before.
My personal opinion is that it's expected to fail at this point.
There was a problem hiding this comment.
Found the reason.
For example, in the case of box-shadow, the propertyList.js contains:
[
"box-shadow",
{
"href": "https://drafts.csswg.org/css-borders-4/#propdef-box-shadow",
"initial": "none",
"inherited": "no",
"computedValue": "see individual properties",
"name": "box-shadow",
"styleDeclaration": [
"box-shadow",
"boxShadow"
]
}
],
"computedValue" is set to "see individual properties" and not to "a/the computed color"
See lib/jsdom/living/helpers/style-rules.js#161
test/web-platform-tests/to-upstream/css/cssom/inline-style.html
Outdated
Show resolved
Hide resolved
test/web-platform-tests/to-upstream/css/cssom/CSSStyleProperties.html
Outdated
Show resolved
Hide resolved
da91718 to
fe6cb7d
Compare
| } | ||
|
|
||
| throw new TypeError(`Internal error: unrecognized computed value instruction '${computedValue}'`); | ||
| function setDeclarationForElement(elementImpl, opt, initialize = false) { |
There was a problem hiding this comment.
Updated the function
de1ccd8 to
e7f4332
Compare
WIP
Depends on
Fixes
el.style.transform = "translate((10%), 10%)"whitespace is removed (worked in v26, fails in v27) #3939getPropertyPrioritymethod return nothing #3940getComputedStylecan calculate inherited styles based on document context, but cannot beyond shadow dom boundary #3941getComputedStyleof aborder-colorrepeats the color thrice #3972