[Webkit-unassigned] [Bug 32115] New: document.cookie accessors should raise INVALID_STATE_ERR if there is no browsing context

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 3 05:24:53 PST 2009


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

           Summary: document.cookie accessors should raise
                    INVALID_STATE_ERR if there is no browsing context
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: patrik.j.persson at ericsson.com
                CC: darin at apple.com


(In reply to comment #51 in bug 21288)
> 
> > +    // FIXME: The HTML5 DOM spec states that this attribute can raise an
> > +    // INVALID_STATE_ERR exception on getting if the Document has no
> > +    // browsing context.
> 
> Loose end for after this lands: Test case showing the problem? Bug report for
> the problem?

This was originally located in Document.idl, and moved into
Document.cpp during the work with #21288. I'm posting this to
highlight the issue, but I don't have a strong opinion on how to
resolve it.

http://www.w3.org/TR/html5/dom.html#dom-document-cookie says (slightly
edited):

On getting/setting, if the document is not associated with a browsing
context then the user agent must raise an INVALID_STATE_ERR exception.

I made some quick browser tests using (an instrumented version of)
this code:

    var dom =
document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html',
null);

    dom.cookie = 'invalid';
    cookiecopy = dom.cookie;

These tests show:

* Firefox 3.5.5 (Windows) raises no exception, and actually seems to
  allow both setting and getting the cookie attribute.

* Safari 4.0.4 (Mac OS X) raises no exception, but prevents the
  attribute from being modified and/or read. (Reading it back gives an
  empty string.) WebKit r51596 behaves the same way.

* IE8 does not have a document.implementation.createDocument method.

-- 
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