Title: [280300] trunk
- Revision
- 280300
- Author
- [email protected]
- Date
- 2021-07-26 11:42:22 -0700 (Mon, 26 Jul 2021)
Log Message
XML documents end up with a unique origin in WebKit only
https://bugs.webkit.org/show_bug.cgi?id=228254
Reviewed by Darin Adler.
Source/WebCore:
XML documents end up with a unique origin in WebKit only. They have a regular origin in Blink and Firefox.
This patch is aligning our behavior with other browsers.
Test: http/tests/misc/xml-document-origin.html
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
LayoutTests:
Add layout test coverage.
* http/tests/misc/xml-document-origin-expected.txt: Added.
* http/tests/misc/xml-document-origin.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (280299 => 280300)
--- trunk/LayoutTests/ChangeLog 2021-07-26 17:53:42 UTC (rev 280299)
+++ trunk/LayoutTests/ChangeLog 2021-07-26 18:42:22 UTC (rev 280300)
@@ -1,3 +1,15 @@
+2021-07-26 Chris Dumez <[email protected]>
+
+ XML documents end up with a unique origin in WebKit only
+ https://bugs.webkit.org/show_bug.cgi?id=228254
+
+ Reviewed by Darin Adler.
+
+ Add layout test coverage.
+
+ * http/tests/misc/xml-document-origin-expected.txt: Added.
+ * http/tests/misc/xml-document-origin.html: Added.
+
2021-07-26 Jer Noble <[email protected]>
[iOS] All home screen web apps resume when any home screen web app is foregrounded
Added: trunk/LayoutTests/http/tests/misc/xml-document-origin-expected.txt (0 => 280300)
--- trunk/LayoutTests/http/tests/misc/xml-document-origin-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/misc/xml-document-origin-expected.txt 2021-07-26 18:42:22 UTC (rev 280300)
@@ -0,0 +1,10 @@
+Tests that XML documents do not end up with a unique origin.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS win.origin is self.origin
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/misc/xml-document-origin.html (0 => 280300)
--- trunk/LayoutTests/http/tests/misc/xml-document-origin.html (rev 0)
+++ trunk/LayoutTests/http/tests/misc/xml-document-origin.html 2021-07-26 18:42:22 UTC (rev 280300)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description("Tests that XML documents do not end up with a unique origin.");
+jsTestIsAsync = true;
+
+if (window.testRunner)
+ testRunner.setCanOpenWindows();
+
+function finishTest()
+{
+ clearTimeout(timeoutHandle);
+ clearInterval(id);
+ finishJSTest();
+}
+
+_onload_ = () => {
+ win = open("/resources/dummy.xml");
+ id = setInterval(() => {
+ try {
+ if (win.location.href == "about:blank")
+ return;
+ } catch(e) {
+ testFailed("Exception thrown when trying to access the popup's URL: " + e);
+ finishTest();
+ return;
+ }
+
+ shouldBe("win.origin", "self.origin");
+ finishTest();
+ }, 10);
+ timeoutHandle = setTimeout(() => {
+ testFailed("The location of the popup stayed 'about:blank'");
+ finishTest();
+ }, 5000);
+};
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (280299 => 280300)
--- trunk/Source/WebCore/ChangeLog 2021-07-26 17:53:42 UTC (rev 280299)
+++ trunk/Source/WebCore/ChangeLog 2021-07-26 18:42:22 UTC (rev 280300)
@@ -1,3 +1,18 @@
+2021-07-26 Chris Dumez <[email protected]>
+
+ XML documents end up with a unique origin in WebKit only
+ https://bugs.webkit.org/show_bug.cgi?id=228254
+
+ Reviewed by Darin Adler.
+
+ XML documents end up with a unique origin in WebKit only. They have a regular origin in Blink and Firefox.
+ This patch is aligning our behavior with other browsers.
+
+ Test: http/tests/misc/xml-document-origin.html
+
+ * xml/XMLTreeViewer.cpp:
+ (WebCore::XMLTreeViewer::transformDocumentToTreeView):
+
2021-07-26 Jer Noble <[email protected]>
[iOS] All home screen web apps resume when any home screen web app is foregrounded
Modified: trunk/Source/WebCore/xml/XMLTreeViewer.cpp (280299 => 280300)
--- trunk/Source/WebCore/xml/XMLTreeViewer.cpp 2021-07-26 17:53:42 UTC (rev 280299)
+++ trunk/Source/WebCore/xml/XMLTreeViewer.cpp 2021-07-26 18:42:22 UTC (rev 280300)
@@ -53,8 +53,6 @@
void XMLTreeViewer::transformDocumentToTreeView()
{
- m_document.setSecurityOriginPolicy(SecurityOriginPolicy::create(SecurityOrigin::createUnique()));
-
String scriptString = StringImpl::createWithoutCopying(XMLViewer_js, sizeof(XMLViewer_js));
m_document.frame()->script().evaluateIgnoringException(ScriptSourceCode(scriptString));
m_document.frame()->script().evaluateIgnoringException(ScriptSourceCode(AtomString("prepareWebKitXMLViewer('This XML file does not appear to have any style information associated with it. The document tree is shown below.');")));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes