Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Vector-effect updates require a re-layout
https://bugs.webkit.org/show_bug.cgi?id=127553

Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2014-02-07
Reviewed by Andreas Kling.

As noted in the stale SVGRenderStyle::diff() comment, now that layout() observes vector-effect
we need to trigger a re-layout on attribute changes.

Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152570&view=revision

Source/WebCore:

Tests: svg/custom/non-scaling-stroke-update-expected.svg
       svg/custom/non-scaling-stroke-update.svg

* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):

LayoutTests:

* svg/custom/non-scaling-stroke-update-expected.svg: Added.
* svg/custom/non-scaling-stroke-update.svg: Added.

Canonical link: https://commits.webkit.org/146390@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Peter Molnar authored and webkit-commit-queue committed Feb 7, 2014
1 parent 6f498a5 commit 09d8f30
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 4 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
2014-02-07 Peter Molnar <pmolnar.u-szeged@partner.samsung.com>

Vector-effect updates require a re-layout
https://bugs.webkit.org/show_bug.cgi?id=127553

Reviewed by Andreas Kling.

As noted in the stale SVGRenderStyle::diff() comment, now that layout() observes vector-effect
we need to trigger a re-layout on attribute changes.

Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152570&view=revision

* svg/custom/non-scaling-stroke-update-expected.svg: Added.
* svg/custom/non-scaling-stroke-update.svg: Added.

2014-02-07 ChangSeok Oh <changseok.oh@collabora.com>

Unreviewed GTK port gardening
Expand Down
5 changes: 5 additions & 0 deletions LayoutTests/svg/custom/non-scaling-stroke-update-expected.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions LayoutTests/svg/custom/non-scaling-stroke-update.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2014-02-07 Peter Molnar <pmolnar.u-szeged@partner.samsung.com>

Vector-effect updates require a re-layout
https://bugs.webkit.org/show_bug.cgi?id=127553

Reviewed by Andreas Kling.

As noted in the stale SVGRenderStyle::diff() comment, now that layout() observes vector-effect
we need to trigger a re-layout on attribute changes.

Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152570&view=revision

Tests: svg/custom/non-scaling-stroke-update-expected.svg
svg/custom/non-scaling-stroke-update.svg

* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):

2014-02-07 Laszlo Vidacs <lvidacs.u-szeged@partner.samsung.com>

Renaming isTableElement() to isRenderedTable() as per the FIXME comment
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/rendering/style/SVGRenderStyle.cpp
Expand Up @@ -202,6 +202,10 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
return StyleDifferenceRepaint;
}

// vector-effect changes require a re-layout.
if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
return StyleDifferenceLayout;

// NOTE: All comparisions below may only return StyleDifferenceRepaint

// Painting related properties only need repaints.
Expand Down Expand Up @@ -230,10 +234,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
|| svg_inherited_flags._colorInterpolationFilters != other->svg_inherited_flags._colorInterpolationFilters)
return StyleDifferenceRepaint;

// FIXME: vector-effect is not taken into account in the layout-phase. Once this is fixed, we should relayout here.
if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
return StyleDifferenceRepaint;

if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_flags.f.bufferedRendering)
return StyleDifferenceRepaint;

Expand Down

0 comments on commit 09d8f30

Please sign in to comment.