Bug 120502

Summary: Avoid reparsing an XSLT stylesheet after the first failure
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: XMLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, darin, rwlbuis, sam
Priority: P2 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Ryosuke Niwa 2013-08-29 18:06:14 PDT
Merge https://chromium.googlesource.com/chromium/blink/+/1debd636044712388392671a3202ec2e6ad08f17
or come up with a better fix.

I can reproduce the crash on ToT WebKit.

Certain libxslt versions appear to leave the doc in an invalid state when parsing fails. We should cache this result and avoid re-parsing.

(The test cannot be converted to text-only due to its invalid stylesheet).
Comment 1 Alexey Proskuryakov 2013-08-30 11:34:48 PDT
> (The test cannot be converted to text-only due to its invalid stylesheet).

This is likely untrue. Should be possible to do that with a subframe or separate window.
Comment 2 Ahmad Saleem 2022-06-03 02:16:15 PDT
I think this has been fixed by adding Blink changes though bit differently.

I looked for "m_compilationFailed" within XSLStyleSheet.h and XSLStyleSheetLibxslt.cpp within Webkit Github mirror as below and it is present.



XSLStyleSheet.h  - https://github.com/WebKit/WebKit/blob/0393f2f7c7a1e97a7a4c63441b50703cc11d493f/Source/WebCore/xml/XSLStyleSheet.h

XSLStyleSheetLibxslt.cpp - https://github.com/WebKit/WebKit/blob/0393f2f7c7a1e97a7a4c63441b50703cc11d493f/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp

Unless if there is anything else or I looked incorrectly, I think this was fixed. Thanks!
Comment 3 Alexey Proskuryakov 2022-06-03 12:05:06 PDT
The test doesn't crash Safari any more, so all must be good.