<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.Stylwiadomocie-mail17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=PL link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'>What should the property "HTMLDocument.responseXML”
represent?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'>Chris<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> whatwg-bounces@lists.whatwg.org
[mailto:whatwg-bounces@lists.whatwg.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Weston Ruter<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, October 29, 2008
8:06 PM<br>
<b><span style='font-weight:bold'>To:</span></b> whatwg@whatwg.org<br>
<b><span style='font-weight:bold'>Cc:</span></b> Ian Hickson; Anne van Kesteren<br>
<b><span style='font-weight:bold'>Subject:</span></b> [whatwg] Implement
XMLHttpRequest interface subset on HTMLDocument</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>I realized that the HTTP
response headers exposed in the <a
href="http://www.w3.org/html/wg/html5/#htmldocument">HTMLDocument interface</a>
are limited: referrer, cookie, lastModified, charset, characterSet.<br>
<br>
It would be very useful if a script could get *all* of the response headers,
the raw entity body, and the HTTP status: basically it would be great if the
HTMLDocument interface implemented a subset of of the XMLHttpRequest spec,
namely the parts which have to do with the response (e.g.
getAllResponseHeaders(), getResponseHeader(), status, and others which appear
below). The HTMLDocument interface already has a readyState property which
XMLHttpRequest also has, but the HTMLDocument interface lacks XHR's onreadystatechange
attribute.<br>
<br>
If this subset were implemented on HTMLDocument, then scripts would be able to
determine if the page if a 404 or get any other arbitrary information that is
passed in the response header.<br>
<br>
Here's a proposed extension to the HTMLDocument interface with some comments to
explain the semantics:<br>
<br>
</span></font><font face="Courier New"><span style='font-family:"Courier New"'>interface
HTMLDocument {<br>
...<br>
//another way to get DOMContentLoaded event; the readyState would start
out as LOADING<br>
attribute EventListener onreadystatechange;<br>
<br>
// state<br>
const unsigned short UNSENT = 0;<br>
const unsigned short OPENED = 1;<br>
const unsigned short HEADERS_RECEIVED = 2;<br>
const unsigned short LOADING = 3;<br>
const unsigned short DONE = 4;<br>
readonly attribute unsigned short readyState; //already in HTML 5<br>
<br>
// request<br>
void abort(); //complements window.stop(): stops the contained document
instead of the associated resources<br>
<br>
// response<br>
DOMString getAllResponseHeaders();<br>
DOMString getResponseHeader(in DOMString header);<br>
readonly attribute DOMString responseText; //the non-parsed content of
the document<br>
readonly attribute Document responseXML;<br>
readonly attribute unsigned short status;<br>
readonly attribute DOMString statusText;<br>
}</span></font><o:p></o:p></p>
</div>
</div>
</body>
</html>