Summary: | CSS transform doesn't override transform attribute on SVG element | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | leewhite128 | ||||
Component: | SVG | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | ahmad.saleem792, bfulgham, dino, graouts, krit, simon.fraser, webkit-bug-importer, zalan, zimmermann | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
leewhite128
2020-10-03 17:39:31 PDT
I bet this is due to this in SVGGraphicsElement::animatedLocalTransform(): bool hasSpecifiedTransform = style && style->hasTransform(); I don't think this can tell whether the transform property was set explicitly on the element, it only checks whether there are operations in the StyleTransformData. We need a different call that determines whether the transform property was explicitly set on this element. Created attachment 411749 [details]
Testcase
The attached test only has the behavior expected by the originator in Chrome. In Firefox and Safari setting `transform: none` in CSS does not affect the element. Actually, if I understand the spec correctly, presentation attributes should be considered during style resolution, per https://www.w3.org/TR/css-transforms-1/#transform-attribute-specificity: "The participation in the CSS cascade is determined by the specificity of presentation attributes in the SVG specification. According to SVG, user agents conceptually insert a new author style sheet for presentation attributes, which is the first in the author style sheet collection." So I think we should always be using what is set in the RenderStyle, assuming the RenderStyle accounts for presentation attributes :) I am not sure on web-spec but Safari 15.6.1, Safari Technology Preview 152 and Firefox Nightly 106 are matching each other in test case and showing circle 'bigger / larger' in size compared to Chrome Canary 107. Just wanted to share updated testing results. Thanks! |