New issue
Advanced search Search tips

Issue 750506 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug


Participants' hotlists:
Hotlist-1


Sign in to add a comment

XHTML is represented as an XMLDocument

Reported by aa...@spetner.com, Jul 30 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
1. In a file served as application/xhtml+xml, set a property of HTMLDocument.prototype
2. Try to access that property via the document (window.document) object

What is the expected behavior?
The property should be accessible via the document object

What went wrong?
The property is either "undefined" (in the case of a new property) or still retains the old value (in the case of an existing property).

Did this work before? N/A 

Chrome version: 59.0.3071.115  Channel: n/a
OS Version: 10.0
Flash Version: 

I have attached two files, one html and one xhtml. They contain the same code. When opening the HTML file, the console shows "OneTwoThree", whereas when opening the XHTML file, it shows "undefined".

It seems this only occurs with HTMLDocument. Other objects, such as HTMLElement seem unaffected.
 
html.html
233 bytes View Download
xhtml.xhtml
271 bytes View Download
Components: -Blink Blink>Bindings
Components: -Blink>Bindings Blink>HTML
Labels: -OS-Windows OS-All
Status: Untriaged (was: Unconfirmed)
It seems a trivial XHTML document, like this:

data:application/xhtml+xml,<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"></html>

gets an instance of XMLDocument, rather than an instance of HTMLDocument (which by spec is a deprecated alias for Document, but Blink presently implements as a separate interface). If you modify Document.prototype, this works fine.

I don't know what the desired behaviour is here, so bouncing to DOM team for triage.

Comment 3 by tkent@chromium.org, Aug 4 2017

Labels: Hotlist-Interop
Summary: XHTML is represented as an XMLDocument (was: XHTML: HTMLDocument.prototype does not work properly -)
AFAIK, UA should create a Document even for XHTML resources, neither HTMLDocument nor XMLDocument.

Though web authors should use Document instead of HTMLDocument, producing an XMLDocument for an XHTML resource is a bug, I think.

Safari uses XMLDocument, Firefox uses HTMLDocument, Edge uses Document.

Comment 4 by tkent@chromium.org, Aug 4 2017

Status: Available (was: Untriaged)
Project Member

Comment 5 by sheriffbot@chromium.org, Aug 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Pri-2 -Hotlist-Recharge-Cold Pri-3
Status: Available (was: Untriaged)

Sign in to add a comment