DOMParser documents do not inherit origin
Reported by
ise...@gmail.com,
May 28 2016
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
Example URL:
Steps to reproduce the problem:
1. Try document.implementation.createHTMLDocument("").open() // no errors
2. Try (new DOMParser).parseFromString("", "text/html").open() // same-origin error
What is the expected behavior?
Both calls should work without any same-origin errors.
The following statement should evaluate to true:
document.implementation.createHTMLDocument("").origin === (new DOMParser).parseFromString("", "text/html").origin
What went wrong?
DOMParser-instantiated documents do not inherit the parent page's origin.
Does it occur on multiple sites: Yes
Is it a problem with a plugin? No
Did this work before? No
Does this work in other browsers? Yes
Chrome version: 50.0.2661.102 Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
This works correctly in Firefox, Edge, and IE.
,
May 30 2016
Created fiddle to illustrate behaviour: https://jsfiddle.net/mo0qa45e/
,
May 31 2016
Would like to work on this bug. Added an initial patch at https://codereview.chromium.org/2028513002/
,
Jun 1 2016
,
Jun 2 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5bff3790459642ac05e4bfaf61fffec986050302 commit 5bff3790459642ac05e4bfaf61fffec986050302 Author: ramya.v <ramya.v@samsung.com> Date: Thu Jun 02 07:35:50 2016 Set origin for DOMParser documents. BUG= 615597 Review-Url: https://codereview.chromium.org/2028513002 Cr-Commit-Position: refs/heads/master@{#397331} [add] https://crrev.com/5bff3790459642ac05e4bfaf61fffec986050302/third_party/WebKit/LayoutTests/fast/dom/dom-parser-document-origin.html [modify] https://crrev.com/5bff3790459642ac05e4bfaf61fffec986050302/third_party/WebKit/Source/core/xml/DOMParser.cpp
,
Jun 2 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ise...@gmail.com
, May 28 2016Additionally, (new DOMParser).parseFromString("", "text/html").origin === "null" (a string), and not just a null value, which is pretty odd.