Skip to content

Commit

Permalink
Merge r184874 - SVG fragment identifier rendering issue
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=137328

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> 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.
  • Loading branch information
Said Abou-Hallawa authored and carlosgcampos committed Jul 6, 2015
1 parent fcc6a55 commit 9ca3d62
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2015-05-26 Said Abou-Hallawa <sabouhallawa@apple.com>

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-21 Said Abou-Hallawa <sabouhallawa@apple.com>

SVG as image uses very tiny default font-size
Expand Down
@@ -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>
18 changes: 18 additions & 0 deletions LayoutTests/svg/css/svg-resource-fragment-identifier-order.html
@@ -0,0 +1,18 @@
<html>
<head>
<style>
img {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<img src="resources/fragment-identifiers.svg#red">
<img src="resources/fragment-identifiers.svg#red">
<img src="resources/fragment-identifiers.svg#green">
<img src="resources/fragment-identifiers.svg#green">
<img src="resources/fragment-identifiers.svg#blue">
<img src="resources/fragment-identifiers.svg#blue">
</body>
</html>
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2015-05-26 Said Abou-Hallawa <sabouhallawa@apple.com>

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 Csaba Osztrogonác <ossy@webkit.org>

[ARM] Build SVGPathElement.cpp with -O2 due to a GCC bug
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/svg/graphics/SVGImage.cpp
Expand Up @@ -249,6 +249,9 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl

view->resize(containerSize());

if (!m_url.isEmpty())
view->scrollToFragment(m_url);

if (view->needsLayout())
view->layout();

Expand All @@ -259,9 +262,6 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl

stateSaver.restore();

if (!m_url.isEmpty())
view->scrollToFragment(m_url);

if (imageObserver())
imageObserver()->didDraw(this);
}
Expand Down

0 comments on commit 9ca3d62

Please sign in to comment.