[Webkit-unassigned] [Bug 46150] XMLHttpRequest: send(document) does not throw INVALID_STATE_ERR exception if the document cannot be serialized

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 27 21:19:24 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=46150


Ojan Vafai <ojan at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ojan at chromium.org




--- Comment #4 from Ojan Vafai <ojan at chromium.org>  2010-09-27 21:19:23 PST ---
It turns out the browsers do currently error on some of these cases for XML documents, but not HTML documents. For example, if you create a foo.html file with the following contents, you get an error about a duplicate attribute name (tested Chrome and Firefox):
<div bar='bar' bar='baz'></div>

So, the bug here is specifically in our serialization of XML documents? As it is, no browser passes this test.

I also tested the following:
<script>
function iframeLoad() {
    var client = new XMLHttpRequest()
    client.open("POST", "foo.html", false)
    try {
        client.send(document.querySelector('iframe').contentDocument);
        alert('failed');
    } catch (e) {
        alert('passed, error thrown');
    }
}
</script>
<iframe src="scratch.xhtml" onload="iframeLoad()"></iframe>

And scratch.xhtml is just: <div bar='baz' bar='foo'></div>

If you load scratch.xhtml in Opera, WebKit, Firefox you get an error. If you XHR.send that document though, you don't get an error.

I don't feel strongly about this, but I'm not really sure this is worth changing. Anne, isn't it fine to have all documents use the HTML serialization algorithm?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list