Bug 191934

Summary: Updating href on linearGradient and radialGradient doesn't update its rendering
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: SVGAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, ews-watchlist, graouts, koivisto, rniwa, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=191930
Attachments:
Description Flags
Reduction
none
Patch
none
Archive of layout-test-results from ews101 for mac-sierra
none
Archive of layout-test-results from ews107 for mac-sierra-wk2
none
Archive of layout-test-results from ews204 for win-future
none
Patch
none
Patch none

Description Ryosuke Niwa 2018-11-23 17:54:09 PST
Updating href content attribute on SVG radialGradient element doesn't update its rendering.
Comment 1 Ryosuke Niwa 2018-11-23 17:54:47 PST
Created attachment 355543 [details]
Reduction
Comment 2 Ryosuke Niwa 2018-11-23 18:53:33 PST
linearGradient has the same issue.
Comment 3 Simon Fraser (smfr) 2018-11-27 20:04:27 PST
A couple of issues here, by the look of it.

First, a radial gradient with r="0" doesn't seem to render a solid color, so even if the attribute changing worked, you'd see nothing.

Second, I think SVGGradientElement::svgAttributeChanged() needs to be like:

 void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
 {
-    if (isKnownAttribute(attrName)) {
+    if (isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (RenderObject* object = renderer())
             object->setNeedsLayout();
Comment 4 Simon Fraser (smfr) 2018-11-27 20:09:11 PST
For the zero radius thing, it seems that CGContextDrawRadialGradient() doesn't fill with the end color even though we pass kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation.
Comment 5 Said Abou-Hallawa 2018-11-28 11:28:58 PST
Created attachment 355897 [details]
Patch
Comment 6 EWS Watchlist 2018-11-28 12:10:54 PST
Comment on attachment 355897 [details]
Patch

Attachment 355897 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/10185500

New failing tests:
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.svg
svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.svg
Comment 7 EWS Watchlist 2018-11-28 12:10:56 PST
Created attachment 355902 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 8 EWS Watchlist 2018-11-28 12:43:20 PST
Comment on attachment 355897 [details]
Patch

Attachment 355897 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/10185729

New failing tests:
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.svg
Comment 9 EWS Watchlist 2018-11-28 12:43:22 PST
Created attachment 355906 [details]
Archive of layout-test-results from ews107 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 10 EWS Watchlist 2018-11-28 13:08:40 PST
Comment on attachment 355897 [details]
Patch

Attachment 355897 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/10185869

New failing tests:
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.svg
svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.svg
Comment 11 EWS Watchlist 2018-11-28 13:08:51 PST
Created attachment 355909 [details]
Archive of layout-test-results from ews204 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews204  Port: win-future  Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Comment 12 Said Abou-Hallawa 2018-11-28 13:12:53 PST
Created attachment 355910 [details]
Patch
Comment 13 Said Abou-Hallawa 2018-11-28 13:13:38 PST
(In reply to Said Abou-Hallawa from comment #12)
> Created attachment 355910 [details]
> Patch

I forgot waitUntilDone()/notifyDone() in the tests.
Comment 14 Ryosuke Niwa 2018-11-28 13:19:05 PST
Comment on attachment 355910 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=355910&action=review

> LayoutTests/ChangeLog:9
> +        * svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop-expected.svg: Added.
> +        * svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.svg: Added.

Could you add a test case for a shadow tree as I've done in https://trac.webkit.org/changeset/238524 ?
Comment 15 Said Abou-Hallawa 2018-11-28 14:51:31 PST
Created attachment 355921 [details]
Patch
Comment 16 WebKit Commit Bot 2018-11-28 17:30:03 PST
Comment on attachment 355921 [details]
Patch

Clearing flags on attachment: 355921

Committed r238651: <https://trac.webkit.org/changeset/238651>
Comment 17 WebKit Commit Bot 2018-11-28 17:30:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 18 Radar WebKit Bug Importer 2018-11-28 17:32:03 PST
<rdar://problem/46328013>