| Summary: | [SVG] default for x1, y1 and y2 is 0% for LinearGradient | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | karlcow, sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ahmad Saleem
2022-11-22 03:35:14 PST
Ahmad, that one is easy. SVGLinearGradientElement.h contains the default values as strings for WebKit, x2 is 100%, the rest is unset, aka 0.
Ref<SVGAnimatedLength> m_x1 { SVGAnimatedLength::create(this, SVGLengthMode::Width) };
Ref<SVGAnimatedLength> m_y1 { SVGAnimatedLength::create(this, SVGLengthMode::Height) };
Ref<SVGAnimatedLength> m_x2 { SVGAnimatedLength::create(this, SVGLengthMode::Width, "100%"_s) };
Ref<SVGAnimatedLength> m_y2 { SVGAnimatedLength::create(this, SVGLengthMode::Height) };
(In reply to Nikolas Zimmermann from comment #1) > Ahmad, that one is easy. SVGLinearGradientElement.h contains the default > values as strings for WebKit, x2 is 100%, the rest is unset, aka 0. > > Ref<SVGAnimatedLength> m_x1 { SVGAnimatedLength::create(this, > SVGLengthMode::Width) }; > Ref<SVGAnimatedLength> m_y1 { SVGAnimatedLength::create(this, > SVGLengthMode::Height) }; > Ref<SVGAnimatedLength> m_x2 { SVGAnimatedLength::create(this, > SVGLengthMode::Width, "100%"_s) }; > Ref<SVGAnimatedLength> m_y2 { SVGAnimatedLength::create(this, > SVGLengthMode::Height) }; Should I give it a try or you want to take it? (In reply to Ahmad Saleem from comment #2) > Should I give it a try or you want to take it? Give it a shot -- you might want to check if there's WPT test coverage for the default values, if so your patch will be a progression for WebKit on that front. Committed 257032@main (7a2abd482abc): <https://commits.webkit.org/257032@main> Reviewed commits have been landed. Closing PR #6731 and removing active labels. The specs link is: https://www.w3.org/TR/SVG2/pservers.html#LinearGradients |