Crash at WebCore::SVGUseElement::expandSymbolElementsInShadowTree
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 17:06:11 +0000 (17:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 17:06:11 +0000 (17:06 +0000)
commitafb535c4b43c4353bc1e82b5169332a68843b7b6
tree291e4a8fe44a42af00c274b0ee438fae6784f9ef
parent65788ff24bb61f09da3f3a46fc828dde2614f87f
Crash at WebCore::SVGUseElement::expandSymbolElementsInShadowTree
https://bugs.webkit.org/show_bug.cgi?id=77639

Patch by Stephen Chenney <schenney@chromium.org> on 2012-02-17
Reviewed by Nikolas Zimmermann.

Source/WebCore:

Fix a SVG crash in Release builds, although it still crashes in Debug builds.
The crash occurred when an SVG use element attempted to reference a style element while the file
contained an error causing the error banner to display. The fix is to prevent SVGUseElement
from recalculating style during tree building and return immediately when style is recalculated and
the tree is building.

Test: svg/custom/use-referencing-style-crash.svg

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::willRecalcStyle): Return false if the tree is being built.
(WebCore::SVGUseElement::didRecalcStyle): Check and return if the tree
is being built and we are not yet ready for style update.

LayoutTests:

Fix a SVG crash in Release builds, although it still crashes in Debug builds.
This test is to verify no crash in Release builds, while expectations/Skipped
are added for Debug builds. Bug 77764 tracks the Debug fix.

* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
* svg/custom/use-referencing-style-crash-expected.txt: Added.
* svg/custom/use-referencing-style-crash.svg: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/svg/custom/use-referencing-style-crash-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-referencing-style-crash.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGUseElement.cpp