Changeset 41932 in webkit


Ignore:
Timestamp:
Mar 23, 2009 7:06:51 PM (15 years ago)
Author:
eric@webkit.org
Message:

Reviewed by David Hyatt.

document.write() should be able to make a document strict mode
https://bugs.webkit.org/show_bug.cgi?id=24336

Remove an implicit write of "<html>" on the first document.write call
this was added as part of a KDE import http://trac.webkit.org/changeset/798
with no layout test or explanation. I can't think of any reason why
an implicit <html> write is necessary (or correct), so I'm removing it and
adding a test for the correct behavior. The parser will add any necessary
HTMLHTMLElements during the write() anyway.

Our behavior is now tested by fast/dom/Document/document-write-doctype
and matches IE, FF fails this new test. Mozilla bug filed:
https://bugzilla.mozilla.org/show_bug.cgi?id=483908

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r41928 r41932  
     12009-03-17  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        document.write() should be able to make a document strict mode
     6        https://bugs.webkit.org/show_bug.cgi?id=24336
     7
     8        Our behavior is now tested by fast/dom/Document/document-write-doctype
     9        and matches IE, FF fails this new test.  Mozilla bug filed:
     10        https://bugzilla.mozilla.org/show_bug.cgi?id=483908
     11
     12        * fast/dom/Document/document-write-doctype-expected.txt: Added.
     13        * fast/dom/Document/document-write-doctype.html: Added.
     14        * fast/dom/Document/resources/document-write-doctype.js: Added.
     15
    1162009-03-23  Darin Adler  <darin@apple.com>
    217
  • trunk/WebCore/ChangeLog

    r41930 r41932  
     12009-03-17  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        document.write() should be able to make a document strict mode
     6        https://bugs.webkit.org/show_bug.cgi?id=24336
     7
     8        Remove an implicit write of "<html>" on the first document.write call
     9        this was added as part of a KDE import http://trac.webkit.org/changeset/798
     10        with no layout test or explanation.  I can't think of any reason why
     11        an implicit <html> write is necessary (or correct), so I'm removing it and
     12        adding a test for the correct behavior.  The parser will add any necessary
     13        HTMLHTMLElements during the write() anyway.
     14
     15        Our behavior is now tested by fast/dom/Document/document-write-doctype
     16        and matches IE, FF fails this new test.  Mozilla bug filed:
     17        https://bugzilla.mozilla.org/show_bug.cgi?id=483908
     18
     19        * dom/Document.cpp:
     20        (WebCore::Document::write):
     21
    1222009-03-23  Sam Weinig  <sam@webkit.org>
    223
  • trunk/WebCore/dom/Document.cpp

    r41925 r41932  
    16971697#endif
    16981698
    1699     if (!m_tokenizer) {
     1699    if (!m_tokenizer)
    17001700        open(ownerDocument);
    1701         ASSERT(m_tokenizer);
    1702         if (!m_tokenizer)
    1703             return;
    1704         UChar documentPrefix[] = { '<', 'h', 't', 'm', 'l', '>' };
    1705         m_tokenizer->write(SegmentedString(documentPrefix, sizeof(documentPrefix) / sizeof(documentPrefix[0])), false);
    1706     }
    1707 
     1701
     1702    ASSERT(m_tokenizer);
    17081703    m_tokenizer->write(text, false);
    17091704
Note: See TracChangeset for help on using the changeset viewer.