RenderSVGModelObject::checkIntersection triggers layout
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 07:41:39 +0000 (07:41 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 07:41:39 +0000 (07:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178710

Reviewed by Antti Koivisto.

Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.

* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::getElementCTM):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getEnclosureList):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/svg/SVGSVGElement.cpp

index a0ff911..1b8a1c7 100644 (file)
@@ -1,3 +1,17 @@
+2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
+
+        RenderSVGModelObject::checkIntersection triggers layout
+        https://bugs.webkit.org/show_bug.cgi?id=178710
+
+        Reviewed by Antti Koivisto.
+
+        Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
+
+        * rendering/svg/RenderSVGModelObject.cpp:
+        (WebCore::getElementCTM):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::getEnclosureList):
+
 2017-10-24  Nan Wang  <n_wang@apple.com>
 
         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
index e64cafa..caa74ef 100644 (file)
@@ -115,7 +115,6 @@ bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, co
 static void getElementCTM(SVGElement* element, AffineTransform& transform)
 {
     ASSERT(element);
-    element->document().updateLayoutIgnorePendingStylesheets();
 
     SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element);
     ASSERT(stopAtElement);
index 4357037..522821e 100644 (file)
@@ -341,6 +341,7 @@ Ref<NodeList> SVGSVGElement::getIntersectionList(SVGRect& rect, SVGElement* refe
 
 Ref<NodeList> SVGSVGElement::getEnclosureList(SVGRect& rect, SVGElement* referenceElement)
 {
+    document().updateLayoutIgnorePendingStylesheets();
     return collectIntersectionOrEnclosureList(rect, referenceElement, checkEnclosure);
 }