Changeset 14204 in webkit


Ignore:
Timestamp:
May 5, 2006, 7:59:18 AM (19 years ago)
Author:
darin
Message:

LayoutTests:

Reviewed by Darin.

<http://bugzilla.opendarwin.org/show_bug.cgi?id=8563>

Tests that the name, publicID and systemID are all read correctly
and that the doctype object preserves the case of the
components from the source html:

  • fast/doctypes/005-case-preserving.html: Added.
  • fast/doctypes/005-case-preserving-expected.txt: Added.

WebCore:

Reviewed by Darin.

http://bugzilla.opendarwin.org/show_bug.cgi?id=8563

The doctype object in the DOM is now usable by client code
as opposed to always being exposed as nil. Now also ensures that
the 'name' of the component preserves the case of the original html source.
(i.e HtMl -> HtMl not HTML)

  • dom/Document.h: Changes comment by docType() to say it may return 0 for html
  • html/HTMLDocument.cpp: (WebCore::parseDocTypeDeclaration): (WebCore::HTMLDocument::determineParseMode): Preserves the case of the name component (WebCore::HTMLDocument::doctype):removed
  • html/HTMLDocument.h: (WebCore::HTMLDocument::doctype):removed
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r14201 r14204  
     12006-05-05  Matt Gough  <matt@softchaos.com>
     2
     3        Reviewed by Darin.
     4
     5        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8563>
     6
     7        Tests that the name, publicID and systemID are all read correctly
     8        and that the doctype object preserves the case of the
     9        components from the source html:
     10        * fast/doctypes/005-case-preserving.html: Added.
     11        * fast/doctypes/005-case-preserving-expected.txt: Added.
     12
    1132006-05-04  Mitz Pettel  <opendarwin.org@mitzpettel.com>
    214
     
    465477        that Node is autogenerated.
    466478
     479>>>>>>> .r14170
    4674802006-04-25  Justin Garcia  <justin.garcia@apple.com>
    468481
  • trunk/WebCore/ChangeLog

    r14203 r14204  
     12006-05-05  Matt Gough  <matt@softchaos.com>
     2
     3        Reviewed by Darin.
     4
     5        http://bugzilla.opendarwin.org/show_bug.cgi?id=8563
     6
     7        The doctype object in the DOM is now usable by client code
     8        as opposed to always being exposed as nil. Now also ensures that
     9        the 'name' of the component preserves the case of the original html source.
     10        (i.e HtMl -> HtMl not HTML)
     11
     12        * dom/Document.h:
     13        Changes comment by docType() to say it may return 0 for html
     14        * html/HTMLDocument.cpp:
     15        (WebCore::parseDocTypeDeclaration):
     16        (WebCore::HTMLDocument::determineParseMode):
     17        Preserves the case of the name component
     18        (WebCore::HTMLDocument::doctype):removed
     19        * html/HTMLDocument.h:
     20        (WebCore::HTMLDocument::doctype):removed
     21
    1222006-05-05  Rob Buis  <buis@kde.org>
    223
  • trunk/WebCore/dom/Document.h

    r14043 r14204  
    122122    // DOM methods & attributes for Document
    123123
    124     virtual DocumentType* doctype() const; // returns 0 for HTML documents
     124    virtual DocumentType* doctype() const; // May return 0 for HTML documents
    125125    DocumentType* realDocType() const { return m_docType.get(); }
    126126
  • trunk/WebCore/html/HTMLDocument.cpp

    r13821 r14204  
    245245static bool parseDocTypeDeclaration(const DeprecatedString& buffer,
    246246                                    int* resultFlags,
     247                                    DeprecatedString& name,
    247248                                    DeprecatedString& publicID,
    248249                                    DeprecatedString& systemID)
     
    280281        return false;
    281282   
     283    name = buffer.mid(index, 4);
    282284    index = parseDocTypePart(buffer, index+4);
    283285    bool hasPublic = containsString("public", buffer, index);
     
    367369    // the letter.
    368370
    369     DeprecatedString systemID, publicID;
     371    DeprecatedString name, systemID, publicID;
    370372    int resultFlags = 0;
    371     if (parseDocTypeDeclaration(str, &resultFlags, publicID, systemID)) {
     373    if (parseDocTypeDeclaration(str, &resultFlags, name, publicID, systemID)) {
    372374        if (resultFlags & PARSEMODE_HAVE_DOCTYPE)
    373             setDocType(new DocumentType(this, "HTML", publicID, systemID));
     375            setDocType(new DocumentType(this, name, publicID, systemID));
    374376        if (!(resultFlags & PARSEMODE_HAVE_DOCTYPE)) {
    375377            // No doctype found at all.  Default to quirks mode and Html4.
     
    430432}
    431433
    432 DocumentType *HTMLDocument::doctype() const
    433 {
    434     // According to a comment in dom_doc.cpp, doctype is null for HTML documents.
    435     return 0;
    436 }
    437 
    438 }
     434}
  • trunk/WebCore/html/HTMLDocument.h

    r13821 r14204  
    7575    }
    7676
    77     virtual DocumentType* doctype() const;
    78 
    7977    typedef HashMap<StringImpl*, int> NameCountMap;
    8078
Note: See TracChangeset for help on using the changeset viewer.