This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20288 - Type argument to Document.open needs to allow "replace" as an alias for "text/html"
Summary: Type argument to Document.open needs to allow "replace" as an alias for "text...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-07 08:20 UTC by contributor
Modified: 2013-03-05 01:07 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-12-07 08:20:41 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
Multipage: http://www.whatwg.org/C#opening-the-input-stream
Complete: http://www.whatwg.org/c#opening-the-input-stream

Comment:
Type argument to Document.open needs to allow "replace"

Posted from: 173.48.81.109 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20121203 Firefox/20.0
Comment 1 Boris Zbarsky 2012-12-07 08:25:29 UTC
The behavior of different UAs for the "type" argument of Document.open is as follows:

IE and WebKit: Values other than "text/plain" (after truncating at ';'?) are
   treated as HTML.
Opera: Values other than "text/html" are treated as text
Gecko: "text/html" and literal (case-sensitive) "replace" are treated as HTML,
   the rest as text.  When we tried doing what Opera does we ran into compat
   issues back when.  See https://bugzilla.mozilla.org/show_bug.cgi?id=313217
Comment 2 Ian 'Hixie' Hickson 2012-12-31 05:18:00 UTC
Do you have to act as if the fourth argument is also set to "replace" in this situation? (i.e. is it just that the type argument is optional?) Or does it not replace in this situation?
Comment 3 Boris Zbarsky 2012-12-31 06:56:05 UTC
> Do you have to act as if the fourth argument is also set to "replace" in this
> situation?

No.  Not replacing was not a problem in the cases we dealt with.  We just treat "replace" as an alias for "text/html" in the third argument and the fourth argument behaves as normal (i.e. not replacing if it wasn't passed).
Comment 4 contributor 2013-03-05 01:07:23 UTC
Checked in as WHATWG revision r7729.
Check-in comment: document.open() legacy hack for compat
http://html5.org/tools/web-apps-tracker?from=7728&to=7729