New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 615597 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

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.
 

Comment 1 by ise...@gmail.com, May 28 2016

Additionally, (new DOMParser).parseFromString("", "text/html").origin === "null" (a string), and not just a null value, which is pretty odd.
Components: -Blink Blink>HTML>Parser
Labels: -OS-Windows OS-All
Status: Available (was: Unconfirmed)
Created fiddle to illustrate behaviour: https://jsfiddle.net/mo0qa45e/

Comment 3 by ramy...@samsung.com, May 31 2016

Owner: ramy...@samsung.com
Status: Assigned (was: Available)
Would like to work on this bug.
Added an initial patch at https://codereview.chromium.org/2028513002/

Comment 4 by tkent@chromium.org, Jun 1 2016

Components: -Blink>HTML>Parser Blink>XML
Labels: Hotlist-Interop
Status: Fixed (was: Assigned)

Sign in to add a comment