Title: [277951] trunk
- Revision
- 277951
- Author
- sihui_...@apple.com
- Date
- 2021-05-24 08:26:38 -0700 (Mon, 24 May 2021)
Log Message
REGRESSION(r256715): XSLTProcessor does not parse script when transforming to document
https://bugs.webkit.org/show_bug.cgi?id=226087
Reviewed by Darin Adler.
Source/WebCore:
Allow _javascript_ if context document is null to match old behavior before r256715.
Test: fast/xsl/xslt-transform-script.html
* dom/Document.cpp:
(WebCore::Document::allowsContentJavaScript const):
LayoutTests:
* fast/xsl/xslt-transform-script.html: Added.
* fast/xsl/xslt-transform-script-expected.txt: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (277950 => 277951)
--- trunk/LayoutTests/ChangeLog 2021-05-24 14:56:31 UTC (rev 277950)
+++ trunk/LayoutTests/ChangeLog 2021-05-24 15:26:38 UTC (rev 277951)
@@ -1,3 +1,13 @@
+2021-05-24 Sihui Liu <sihui_...@apple.com>
+
+ REGRESSION(r256715): XSLTProcessor does not parse script when transforming to document
+ https://bugs.webkit.org/show_bug.cgi?id=226087
+
+ Reviewed by Darin Adler.
+
+ * fast/xsl/xslt-transform-script.html: Added.
+ * fast/xsl/xslt-transform-script-expected.txt: Added.
+
2021-05-21 Jonathan Bedard <jbed...@apple.com>
[LayoutTests] Delete unused LayoutTests/http resources
Added: trunk/LayoutTests/fast/xsl/xslt-transform-script-expected.txt (0 => 277951)
--- trunk/LayoutTests/fast/xsl/xslt-transform-script-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/xsl/xslt-transform-script-expected.txt 2021-05-24 15:26:38 UTC (rev 277951)
@@ -0,0 +1 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><a href="" word</a></body></html>
Added: trunk/LayoutTests/fast/xsl/xslt-transform-script.html (0 => 277951)
--- trunk/LayoutTests/fast/xsl/xslt-transform-script.html (rev 0)
+++ trunk/LayoutTests/fast/xsl/xslt-transform-script.html 2021-05-24 15:26:38 UTC (rev 277951)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="result"></div>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><test>test word</test>";
+ var xmlParser = new DOMParser();
+ var parsedXML = xmlParser.parseFromString(xml, "text/xml");
+
+ var xsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
+ <xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"> \
+ <xsl:template match=\"/\"> \
+ <html> \
+ <body> \
+ <a href="" select=\"test\"/></a> \
+ </body> \
+ </html> \
+ </xsl:template> \
+ </xsl:stylesheet>";
+ var xslParser = new DOMParser();
+ var parsedXSL = xslParser.parseFromString(xsl, "text/xml");
+
+ var xslt = new XSLTProcessor();
+ xslt.importStylesheet(parsedXSL);
+
+ var transformedXML = xslt.transformToDocument(parsedXML);
+ var string = new XMLSerializer().serializeToString(transformedXML);
+ var textNode = document.createTextNode(string);
+ document.getElementById('result').appendChild(textNode);
+</script>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (277950 => 277951)
--- trunk/Source/WebCore/ChangeLog 2021-05-24 14:56:31 UTC (rev 277950)
+++ trunk/Source/WebCore/ChangeLog 2021-05-24 15:26:38 UTC (rev 277951)
@@ -1,3 +1,17 @@
+2021-05-24 Sihui Liu <sihui_...@apple.com>
+
+ REGRESSION(r256715): XSLTProcessor does not parse script when transforming to document
+ https://bugs.webkit.org/show_bug.cgi?id=226087
+
+ Reviewed by Darin Adler.
+
+ Allow _javascript_ if context document is null to match old behavior before r256715.
+
+ Test: fast/xsl/xslt-transform-script.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::allowsContentJavaScript const):
+
2021-05-24 Tim Nguyen <n...@apple.com>
Clean up handling of `-webkit-inline-flex`/`-webkit-flex` CSS display values
Modified: trunk/Source/WebCore/dom/Document.cpp (277950 => 277951)
--- trunk/Source/WebCore/dom/Document.cpp 2021-05-24 14:56:31 UTC (rev 277950)
+++ trunk/Source/WebCore/dom/Document.cpp 2021-05-24 15:26:38 UTC (rev 277951)
@@ -7072,7 +7072,7 @@
if (!m_frame || m_frame->document() != this) {
// If this Document is frameless or in the wrong frame, its context document
// must allow for it to run content _javascript_.
- return m_contextDocument && m_contextDocument->allowsContentJavaScript();
+ return !m_contextDocument || m_contextDocument->allowsContentJavaScript();
}
return m_frame->loader().client().allowsContentJavaScriptFromMostRecentNavigation() == AllowsContentJavaScript::Yes;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes