Bug 191934 - Updating href on linearGradient and radialGradient doesn't update its rendering
Summary: Updating href on linearGradient and radialGradient doesn't update its rendering
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-23 17:54 PST by Ryosuke Niwa
Modified: 2018-11-28 17:32 PST (History)
10 users (show)

See Also:


Attachments
Reduction (784 bytes, text/html)
2018-11-23 17:54 PST, Ryosuke Niwa
no flags Details
Patch (5.30 KB, patch)
2018-11-28 11:28 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-sierra (2.66 MB, application/zip)
2018-11-28 12:10 PST, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.19 MB, application/zip)
2018-11-28 12:43 PST, Build Bot
no flags Details
Archive of layout-test-results from ews204 for win-future (12.83 MB, application/zip)
2018-11-28 13:08 PST, Build Bot
no flags Details
Patch (5.60 KB, patch)
2018-11-28 13:12 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (12.20 KB, patch)
2018-11-28 14:51 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 Build Bot 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 Build Bot 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 Build Bot 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 Build Bot 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 Build Bot 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 Build Bot 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>