Title: [184874] trunk
Revision
184874
Author
[email protected]
Date
2015-05-26 14:24:05 -0700 (Tue, 26 May 2015)

Log Message

SVG fragment identifier rendering issue
https://bugs.webkit.org/show_bug.cgi?id=137328

Patch by Said Abou-Hallawa <[email protected]> on 2015-05-26
Reviewed by Darin Adler.

Source/WebCore:

This is a follow up for http://trac.webkit.org/changeset/164983. In this
changeset, scrolling to the fragment should have been added before the
the paint to guarantee setting the proper display position for the SVG
fragment.

Test: svg/css/svg-resource-fragment-identifier-order.html

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Move view->scrollToFragment() before calling
view->paint().

LayoutTests:

* svg/css/svg-resource-fragment-identifier-order-expected.html: Added.
* svg/css/svg-resource-fragment-identifier-order.html: Added.
Ensure the SVG fragment is drawn correctly when the same SVG image is
referenced multiple times.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184873 => 184874)


--- trunk/LayoutTests/ChangeLog	2015-05-26 21:20:50 UTC (rev 184873)
+++ trunk/LayoutTests/ChangeLog	2015-05-26 21:24:05 UTC (rev 184874)
@@ -1,3 +1,15 @@
+2015-05-26  Said Abou-Hallawa  <[email protected]>
+
+        SVG fragment identifier rendering issue
+        https://bugs.webkit.org/show_bug.cgi?id=137328
+
+        Reviewed by Darin Adler.
+
+        * svg/css/svg-resource-fragment-identifier-order-expected.html: Added.
+        * svg/css/svg-resource-fragment-identifier-order.html: Added.
+        Ensure the SVG fragment is drawn correctly when the same SVG image is
+        referenced multiple times.
+
 2015-05-26  Daniel Bates  <[email protected]>
 
         Update Autofill button icon

Added: trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order-expected.html (0 => 184874)


--- trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order-expected.html	2015-05-26 21:24:05 UTC (rev 184874)
@@ -0,0 +1,19 @@
+<html>
+<head>
+<style>
+  div {
+    width: 100px;
+    height: 100px;
+    display: inline-block;
+  }
+</style>
+</head>
+<body>
+  <div style="background-color: red"></div>
+  <div style="background-color: red"></div>
+  <div style="background-color: green"></div>
+  <div style="background-color: green"></div>
+  <div style="background-color: blue"></div>
+  <div style="background-color: blue"></div>
+</body>
+</html>

Added: trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order.html (0 => 184874)


--- trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/svg-resource-fragment-identifier-order.html	2015-05-26 21:24:05 UTC (rev 184874)
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style>
+  img {
+    width: 100px;
+    height: 100px;
+  }
+</style>
+</head>
+<body>
+  <img src=""
+  <img src=""
+  <img src=""
+  <img src=""
+  <img src=""
+  <img src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (184873 => 184874)


--- trunk/Source/WebCore/ChangeLog	2015-05-26 21:20:50 UTC (rev 184873)
+++ trunk/Source/WebCore/ChangeLog	2015-05-26 21:24:05 UTC (rev 184874)
@@ -1,3 +1,21 @@
+2015-05-26  Said Abou-Hallawa  <[email protected]>
+
+        SVG fragment identifier rendering issue
+        https://bugs.webkit.org/show_bug.cgi?id=137328
+
+        Reviewed by Darin Adler.
+
+        This is a follow up for http://trac.webkit.org/changeset/164983. In this
+        changeset, scrolling to the fragment should have been added before the
+        the paint to guarantee setting the proper display position for the SVG
+        fragment.
+
+        Test: svg/css/svg-resource-fragment-identifier-order.html
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::draw): Move view->scrollToFragment() before calling 
+        view->paint().
+
 2015-05-26  Youenn Fablet  <[email protected]>
 
         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject

Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (184873 => 184874)


--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2015-05-26 21:20:50 UTC (rev 184873)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2015-05-26 21:24:05 UTC (rev 184874)
@@ -249,6 +249,9 @@
 
     view->resize(containerSize());
 
+    if (!m_url.isEmpty())
+        view->scrollToFragment(m_url);
+    
     if (view->needsLayout())
         view->layout();
 
@@ -259,9 +262,6 @@
 
     stateSaver.restore();
 
-    if (!m_url.isEmpty())
-        view->scrollToFragment(m_url);
-
     if (imageObserver())
         imageObserver()->didDraw(this);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to