Bug 248212
| 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 | ||
Ahmad Saleem
Hi Team,
While going through Blink's commit, I come across following commit and while testing, noticed that we are still failing three out of four tests compared to Chrome Canary 110 and Firefox Nightly 109.
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/219dff463987f53c22f5f96f35a794246a13538d
Failing Test Case - https://jsfiddle.net/hpdbe0mr/show
Just wanted to raise bug for someone to tackle it.
I couldn't find 1-1 Webkit GitHub code so I might not be able to fix it.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Nikolas Zimmermann
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) };
Ahmad Saleem
(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?
Nikolas Zimmermann
(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.
Ahmad Saleem
https://github.com/WebKit/WebKit/pull/6731
EWS
Committed 257032@main (7a2abd482abc): <https://commits.webkit.org/257032@main>
Reviewed commits have been landed. Closing PR #6731 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/102680120>
Said Abou-Hallawa
The specs link is: https://www.w3.org/TR/SVG2/pservers.html#LinearGradients