Changeset 79944 in webkit


Ignore:
Timestamp:
Feb 28, 2011 4:54:55 PM (13 years ago)
Author:
tonyg@chromium.org
Message:

2011-02-28 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Follow HTML5 spec for document.open() a little more closely
https://bugs.webkit.org/show_bug.cgi?id=55392

  • fast/parser/double-write-from-closed-iframe-expected.txt: Added.
  • fast/parser/double-write-from-closed-iframe.html: Added. Prior to this patch, the second write of 'PASS' could fail indeterminately.
  • fast/parser/script-tests/double-write-from-closed-iframe.js: Added.
  • fast/regex/script-tests/cross-frame-callable.js: Necessary to close late writes.

2011-02-28 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Follow HTML5 spec for document.open() a little more closely
https://bugs.webkit.org/show_bug.cgi?id=55392

See: 3.5.1.4 at http://www.whatwg.org/specs/web-apps/current-work/#dom-document-open.

The second return check matches the spec. The first return check (isExecutingScript())
was left in place because without it, fast/tokenizer/write-external-script-open.html
would fail. It also possible there is a spec bug because FF4 crashes on that test and
IE9 prints "FAILURE." The isLoadingMainResource() check was removed because the main
resource is always loading while parser->isParsing().

Test: fast/parser/double-write-from-closed-iframe.html

  • dom/Document.cpp: (WebCore::Document::open):
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79941 r79944  
     12011-02-28  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Follow HTML5 spec for document.open() a little more closely
     6        https://bugs.webkit.org/show_bug.cgi?id=55392
     7
     8        * fast/parser/double-write-from-closed-iframe-expected.txt: Added.
     9        * fast/parser/double-write-from-closed-iframe.html: Added. Prior to this patch, the second write of 'PASS' could fail indeterminately.
     10        * fast/parser/script-tests/double-write-from-closed-iframe.js: Added.
     11        * fast/regex/script-tests/cross-frame-callable.js: Necessary to close late writes.
     12
    1132011-02-28  James Robinson  <jamesr@chromium.org>
    214
  • trunk/LayoutTests/fast/regex/script-tests/cross-frame-callable.js

    r76180 r79944  
    99document.body.appendChild(iframe);
    1010iframe.contentDocument.write('<script>top.doTest(/a/)</script>');
     11iframe.contentDocument.close();
    1112document.write('DONE');
    1213
  • trunk/Source/WebCore/ChangeLog

    r79942 r79944  
     12011-02-28  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Follow HTML5 spec for document.open() a little more closely
     6        https://bugs.webkit.org/show_bug.cgi?id=55392
     7
     8        See: 3.5.1.4 at http://www.whatwg.org/specs/web-apps/current-work/#dom-document-open.
     9
     10        The second return check matches the spec. The first return check (isExecutingScript())
     11        was left in place because without it, fast/tokenizer/write-external-script-open.html
     12        would fail. It also possible there is a spec bug because FF4 crashes on that test and
     13        IE9 prints "FAILURE." The isLoadingMainResource() check was removed because the main
     14        resource is always loading while parser->isParsing().
     15
     16        Test: fast/parser/double-write-from-closed-iframe.html
     17
     18        * dom/Document.cpp:
     19        (WebCore::Document::open):
     20
    1212011-02-28  Avi Drissman  <avi@google.com>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r79861 r79944  
    18931893
    18941894    if (m_frame) {
    1895         ScriptableDocumentParser* parser = scriptableDocumentParser();
    1896         if (m_frame->loader()->isLoadingMainResource() || (parser && parser->isParsing() && parser->isExecutingScript()))
    1897             return;
     1895        if (ScriptableDocumentParser* parser = scriptableDocumentParser()) {
     1896            if (parser->isParsing()) {
     1897                // FIXME: HTML5 doesn't tell us to check this, it might not be correct.
     1898                if (parser->isExecutingScript())
     1899                    return;
     1900
     1901                if (!parser->wasCreatedByScript() && parser->hasInsertionPoint())
     1902                    return;
     1903            }
     1904        }
    18981905
    18991906        if (m_frame->loader()->state() == FrameStateProvisional)
Note: See TracChangeset for help on using the changeset viewer.