[ macOS ] svg/custom/textPath-change-id-pattern.svg is flakey failing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2020 04:28:40 +0000 (04:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2020 04:28:40 +0000 (04:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208532

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-03-25
Reviewed by Darin Adler.

Source/WebCore:

In this layout test, the id of a <path> element changes. This <path> is
referenced by a <textPath> element which is a child of a <pattern> element.
The <pattern> element is used to fill a <rect> element.

This patch ensures all clients (<rect>) of the resource ancestor (<pattern>)
of any sub-resource (<textPath>) is marked for repaint when the id of a
sub-sub-resource (<path>) changes.

* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientsForRepaint):
* rendering/svg/RenderSVGResourceContainer.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::buildPendingResourcesIfNeeded):
(WebCore::SVGElement::invalidateInstances):
Unrelated change. This is a leftover from r179807 which was converting a
"do { } while();" statement to "while() { }" statement.

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259031 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
Source/WebCore/rendering/svg/RenderSVGResourceContainer.h
Source/WebCore/svg/SVGElement.cpp

index 3ca2b0a..6347c8f 100644 (file)
@@ -1,3 +1,12 @@
+2020-03-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        [ macOS ] svg/custom/textPath-change-id-pattern.svg is flakey failing
+        https://bugs.webkit.org/show_bug.cgi?id=208532
+
+        Reviewed by Darin Adler.
+
+        * platform/mac-wk1/TestExpectations:
+
 2020-03-25  Jack Lee  <shihchieh_lee@apple.com>
 
         Nullptr crash in WebCore::Node::isDescendantOf when inserting list
index c7ec688..ab5ddd3 100644 (file)
@@ -943,8 +943,6 @@ webkit.org/b/209479 [ Debug ] webgl/2.0.0/conformance2/rendering/blitframebuffer
 
 webkit.org/b/209480 [ Debug ] webgl/2.0.0/conformance/attribs/gl-vertexattribpointer.html [ Pass Timeout ]
 
-webkit.org/b/208532 svg/custom/textPath-change-id-pattern.svg [ Pass Failure ]
-
 webkit.org/b/208825 [ Debug ] inspector/script-profiler/event-type-Microtask.html [ Pass Failure ]
 
 webkit.org/b/208890 imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor.htm [ Pass Failure ]
index f9055d1..2f12096 100644 (file)
@@ -1,3 +1,27 @@
+2020-03-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        [ macOS ] svg/custom/textPath-change-id-pattern.svg is flakey failing
+        https://bugs.webkit.org/show_bug.cgi?id=208532
+
+        Reviewed by Darin Adler.
+
+        In this layout test, the id of a <path> element changes. This <path> is
+        referenced by a <textPath> element which is a child of a <pattern> element.
+        The <pattern> element is used to fill a <rect> element.
+
+        This patch ensures all clients (<rect>) of the resource ancestor (<pattern>)
+        of any sub-resource (<textPath>) is marked for repaint when the id of a
+        sub-sub-resource (<path>) changes.
+
+        * rendering/svg/RenderSVGResourceContainer.cpp:
+        (WebCore::RenderSVGResourceContainer::markAllClientsForRepaint):
+        * rendering/svg/RenderSVGResourceContainer.h:
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::buildPendingResourcesIfNeeded):
+        (WebCore::SVGElement::invalidateInstances):
+        Unrelated change. This is a leftover from r179807 which was converting a
+        "do { } while();" statement to "while() { }" statement.
+
 2020-03-25  Jack Lee  <shihchieh_lee@apple.com>
 
         Nullptr crash in WebCore::Node::isDescendantOf when inserting list
index 39fa73f..2db0551 100644 (file)
@@ -90,6 +90,11 @@ void RenderSVGResourceContainer::idChanged()
     registerResource();
 }
 
+void RenderSVGResourceContainer::markAllClientsForRepaint()
+{
+    markAllClientsForInvalidation(RepaintInvalidation);
+}
+
 void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode mode)
 {
     // FIXME: Style invalidation should either be a pre-layout task or this function
index 894b57d..eb4209d 100644 (file)
@@ -42,6 +42,7 @@ public:
     static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform);
 
     void idChanged();
+    void markAllClientsForRepaint();
     void addClientRenderLayer(RenderLayer*);
     void removeClientRenderLayer(RenderLayer*);
 
index b66a632..554be8a 100644 (file)
@@ -34,6 +34,7 @@
 #include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
+#include "RenderAncestorIterator.h"
 #include "RenderSVGResourceFilter.h"
 #include "RenderSVGResourceMasker.h"
 #include "SVGDocumentExtensions.h"
@@ -867,6 +868,10 @@ void SVGElement::buildPendingResourcesIfNeeded()
         ASSERT(clientElement->hasPendingResources());
         if (clientElement->hasPendingResources()) {
             clientElement->buildPendingResource();
+            if (auto renderer = clientElement->renderer()) {
+                for (auto& ancestor : ancestorsOfType<RenderSVGResourceContainer>(*renderer))
+                    ancestor.markAllClientsForRepaint();
+            }
             extensions.clearHasPendingResourcesIfPossible(*clientElement);
         }
     }
@@ -946,7 +951,7 @@ void SVGElement::invalidateInstances()
         if (auto useElement = instance->correspondingUseElement())
             useElement->invalidateShadowTree();
         instance->setCorrespondingElement(nullptr);
-    } while (!instances.isEmpty());
+    }
 }
 
 }