Avoid reparsing an XSLT stylesheet after the first failure.
authorjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Sep 2015 05:54:53 +0000 (05:54 +0000)
committerjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Sep 2015 05:54:53 +0000 (05:54 +0000)
commitacf49713b8c1e637276642ec40c6d75fa54a12d2
treeb0981fe384403f3c16da8e7f6866016643388cea
parentddde825e9406b3416158f6e3898ac5cba4c1e3d1
Avoid reparsing an XSLT stylesheet after the first failure.
https://bugs.webkit.org/show_bug.cgi?id=149188
<rdar://problem/22709912>

Reviewed by Dave Hyatt.

Patch by Jiewen Tan, jiewen_tan@apple.com.

Source/WebCore:

Test: svg/custom/invalid-xslt-crash.svg

* xml/XSLStyleSheet.h:
Add a new member variable m_compilationFailed that tracks whether
compilation has failed. Default value is false.

* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::compileStyleSheet):
Return early if the compilation has failed before. After compiling the
style sheet, if we failed, set m_compilationFailed to true.

LayoutTests:

* svg/custom/invalid-xslt-crash-expected.txt: Added.
* svg/custom/invalid-xslt-crash.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/custom/invalid-xslt-crash-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/invalid-xslt-crash.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/xml/XSLStyleSheet.h
Source/WebCore/xml/XSLStyleSheetLibxslt.cpp