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

Issue 683827 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment

Deprecate and remove Document.{xmlEncoding, xmlStandalone, xmlVersion}

Project Member Reported by cvrebert@google.com, Jan 23 2017

Issue description

Chrome Version: 55.0.2883.95
OS: macOS 10.12.2

What steps will reproduce the problem?
(1) Open http://w3c-test.org/dom/historical.html in Chrome
(2) Observe the test results

What is the expected result?
All the tests should pass.

What happens instead?
Some tests fail. Specifically:
Fail	Historical DOM features must be removed: xmlEncoding
	assert_equals: expected (undefined) undefined but got (object) null
Fail	Historical DOM features must be removed: xmlStandalone
	assert_equals: expected (undefined) undefined but got (boolean) false
Fail	Historical DOM features must be removed: xmlVersion
	assert_equals: expected (undefined) undefined but got (object) null

Further details:
Per https://dom.spec.whatwg.org/#dom-document-xmlencoding ,
the Document.xmlEncoding, Document.xmlStandalone, and Document.xmlVersion
properties are historical and should not be supported.
 
Components: -Blink>DOM Blink>XML
Labels: Hotlist-Interop Hotlist-GoodFirstBug
Owner: dominicc@chromium.org
Status: Assigned (was: Untriaged)
Summary: Deprecate and remove Document.{xmlEncoding, xmlStandalone, xmlVersion} (was: Document.{xmlEncoding, xmlStandalone, xmlVersion} should not be supported)
xmlEncoding: https://www.chromestatus.com/metrics/feature/timeline/popularity/115
xmlStandalone: https://www.chromestatus.com/metrics/feature/timeline/popularity/116
xmlVersion: https://www.chromestatus.com/metrics/feature/timeline/popularity/117

It would probably be web compatible to remove these. On the other hand, they are just string properties, so I'm not sure there's a tremendous benefit to removing them.

Comment 2 by tkent@chromium.org, Jan 25 2017

Labels: Needs-BlinkIntent
Blocking: 674593
I assume that these are all actually still in all implementations, so I think what we should probably revive this in the spec instead. (The linked issue 674593 is to standardize or remove non-spec'd things, with no a priori preference either way.)

Comment 5 by cvrebert@google.com, Feb 12 2017

Firefox does not appear to implement any of these 3 properties.

Chrome, Safari, and Edge do implement them.
Although Edge returns empty strings for xmlEncoding and xmlVersion, whereas Chrome+Safari return null for those.
Cc: rbyers@chromium.org foolip@chromium.org
My preference would be to remove these:
- It would reduce cognitive load, for example when developers write document. in DevTools console, etc.
- They're not useful, it's a useless constant value.
- It's probably web compatible to remove them because they return different falsy values, removing them would also be falsy (undefined), and FF doesn't have them anyway.
- It would make the product marginally smaller.

On the other hand, this may not meet the bar for Blink removals these days because compatibility doesn't immediately get better by removing them, and there's no security benefit to removing them.

Rick, Foolip, WDYT?

It would be interesting if Edge gave them string values for a reason.

Comment 7 by foolip@chromium.org, Feb 15 2017

Ff other vendors are also still interested in eventual removal and if somebody does the necessary httparchive research to figure out what the impact of this would be, then removal could still be the best outcome. There mere fact that these are ancient APIs and supported everywhere should raise the bar for removal somewhat, but not rule it out entirely.

These attributes return null/false in HTML documents, but for example document.implementation.createDocument(null,'').xmlVersion is "1.0". The main risk is probably with these properties being used as a kind of "is this XHTML" check, but checking httparchive would reveal that.
Yes, good point--it's 1.0 in non-blink::HTMLDocument instances.

Rough cut:

SELECT SUM(xmlversion), SUM(xmlencoding), SUM(xmlstandalone), SUM(all)
FROM (
  SELECT
    body CONTAINS '.xmlVersion' AS xmlversion,
    body CONTAINS '.xmlEncoding' AS xmlencoding,
    body CONTAINS '.xmlStandalone' AS xmlstandalone,
    1 AS all
  FROM [httparchive:har.2016_05_15_chrome_requests_bodies]
)

xmlVersion = 0.06%
xmlEncoding = 0.005%
xmlStandalone = 0.002%

Comment 9 by cvrebert@google.com, Feb 15 2017

Ah. Ironically, https://www.w3.org/TR/xhtml1/ is apparently not considered X(HT)ML, so my testing was flawed.
https://www.w3.org/2000/07/8378/schemas/xhtml1-sample.xml would be a proper testcase.
I looked at 90% of the xmlVersion instances and yes, they're basically type tests for XMLDocument.

There's a smattering (~500) false positives of things called xmlVersion.
Did you find a case where it looks like the breakage would be bad, like where taking the wrong branch would cause us to try to call methods that don't exist or something similar?
Hard to say, I just looked at snippets of the surrounding 50 characters. Some of them are minimized helper functions so it would need more digging to see what's calling them.
Filling out my form from https://docs.google.com/document/d/1LSuLWJDP02rlC9bOlidL6DzBV5kSkV5bW5Pled8HGC8/edit?usp=sharing:

Tests: https://jsbin.com/xaquni/edit?html,output
Implemented in: Blink, EdgeHTML, WebKit (not Gecko)
Standard: https://dom.spec.whatwg.org/#interface-document

xmlEncoding was once in Gecko but was removed in 2011:
https://bugzilla.mozilla.org/show_bug.cgi?id=687426

The other two properties I couldn't find Bugzilla bugs for.

The "algorithm" in my doc would suggest httparchive analysis at this point, due to the generic risk that Blink+EdgeHTML+WebKit APIs may be used for UA sniffing and cause trouble if added to Gecko. But that's actually not a concern here because there are ancient APIs, not something originally introduced by WebKit.

Because Ms2ger went through the trouble+risk of removing xmlEncoding from Gecko, I think we should try to follow rather than standardizing again. So, next step here would be to look for things that would break in httparchive and then just try it.
Cc: dominicc@chromium.org
Owner: ----
Status: Available (was: Assigned)
Bulk disowning per sshruthi's email about bug triage best practices.
Owner: jstenback@chromium.org
Status: Assigned (was: Available)

Sign in to add a comment