Changeset 38769 in webkit


Ignore:
Timestamp:
Nov 25, 2008 4:33:56 PM (15 years ago)
Author:
jchaffraix@webkit.org
Message:

2008-11-25 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Eric Seidel.

Bug 22441: Bridge the gap between the generated ElementFactory and HTMLElementFactory
https://bugs.webkit.org/show_bug.cgi?id=22441

Element's other than HTML ones take a QualifiedName in their constructors.
To make HTMLElementFactory closer to the other ElementFactory, we need
to make them take the same arguments.
This patch only makes the 5 first one in HTMLElementFactory abide by that. The others
will go into the next patch.

  • dom/Document.cpp: (WebCore::Document::implicitClose):
  • html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::HTMLBaseElement):
  • html/HTMLBaseElement.h:
  • html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::HTMLBodyElement):
  • html/HTMLBodyElement.h:
  • html/HTMLElementFactory.cpp: (WebCore::htmlConstructor): (WebCore::headConstructor): (WebCore::bodyConstructor): (WebCore::baseConstructor): (WebCore::linkConstructor): (WebCore::metaConstructor):
  • html/HTMLHeadElement.cpp: (WebCore::HTMLHeadElement::HTMLHeadElement):
  • html/HTMLHeadElement.h:
  • html/HTMLHtmlElement.cpp: (WebCore::HTMLHtmlElement::HTMLHtmlElement):
  • html/HTMLHtmlElement.h:
  • html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::HTMLLinkElement):
  • html/HTMLLinkElement.h:
  • html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::HTMLMetaElement):
  • html/HTMLMetaElement.h:
  • html/HTMLParser.cpp: (WebCore::HTMLParser::handleError): (WebCore::HTMLParser::headCreateErrorCheck): (WebCore::HTMLParser::createHead): (WebCore::HTMLParser::finished):
  • html/HTMLViewSourceDocument.cpp: (WebCore::HTMLViewSourceDocument::createContainingTable):
Location:
trunk/WebCore
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38768 r38769  
     12008-11-25  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Bug 22441: Bridge the gap between the generated ElementFactory and HTMLElementFactory
     6        https://bugs.webkit.org/show_bug.cgi?id=22441
     7
     8        Element's other than HTML ones take a QualifiedName in their constructors.
     9        To make HTMLElementFactory closer to the other ElementFactory, we need
     10        to make them take the same arguments.
     11        This patch only makes the 5 first one in HTMLElementFactory abide by that. The others
     12        will go into the next patch.
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::implicitClose):
     16        * html/HTMLBaseElement.cpp:
     17        (WebCore::HTMLBaseElement::HTMLBaseElement):
     18        * html/HTMLBaseElement.h:
     19        * html/HTMLBodyElement.cpp:
     20        (WebCore::HTMLBodyElement::HTMLBodyElement):
     21        * html/HTMLBodyElement.h:
     22        * html/HTMLElementFactory.cpp:
     23        (WebCore::htmlConstructor):
     24        (WebCore::headConstructor):
     25        (WebCore::bodyConstructor):
     26        (WebCore::baseConstructor):
     27        (WebCore::linkConstructor):
     28        (WebCore::metaConstructor):
     29        * html/HTMLHeadElement.cpp:
     30        (WebCore::HTMLHeadElement::HTMLHeadElement):
     31        * html/HTMLHeadElement.h:
     32        * html/HTMLHtmlElement.cpp:
     33        (WebCore::HTMLHtmlElement::HTMLHtmlElement):
     34        * html/HTMLHtmlElement.h:
     35        * html/HTMLLinkElement.cpp:
     36        (WebCore::HTMLLinkElement::HTMLLinkElement):
     37        * html/HTMLLinkElement.h:
     38        * html/HTMLMetaElement.cpp:
     39        (WebCore::HTMLMetaElement::HTMLMetaElement):
     40        * html/HTMLMetaElement.h:
     41        * html/HTMLParser.cpp:
     42        (WebCore::HTMLParser::handleError):
     43        (WebCore::HTMLParser::headCreateErrorCheck):
     44        (WebCore::HTMLParser::createHead):
     45        (WebCore::HTMLParser::finished):
     46        * html/HTMLViewSourceDocument.cpp:
     47        (WebCore::HTMLViewSourceDocument::createContainingTable):
     48
    1492008-11-25  Chris Marrin  <cmarrin@apple.com>
    250
  • trunk/WebCore/dom/Document.cpp

    r38714 r38769  
    15391539        if (Node* documentElement = this->documentElement()) {
    15401540            ExceptionCode ec = 0;
    1541             documentElement->appendChild(new HTMLBodyElement(this), ec);
     1541            documentElement->appendChild(new HTMLBodyElement(bodyTag, this), ec);
    15421542            ASSERT(!ec);
    15431543        }
  • trunk/WebCore/html/HTMLBaseElement.cpp

    r34583 r38769  
    3535using namespace HTMLNames;
    3636
    37 HTMLBaseElement::HTMLBaseElement(Document* doc)
    38     : HTMLElement(baseTag, doc)
     37HTMLBaseElement::HTMLBaseElement(const QualifiedName& qName, Document* doc)
     38    : HTMLElement(qName, doc)
    3939{
    4040}
  • trunk/WebCore/html/HTMLBaseElement.h

    r25754 r38769  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
     
    3230{
    3331public:
    34     HTMLBaseElement(Document*);
     32    HTMLBaseElement(const QualifiedName&, Document*);
    3533    ~HTMLBaseElement();
    3634
  • trunk/WebCore/html/HTMLBodyElement.cpp

    r38094 r38769  
    4141using namespace HTMLNames;
    4242
    43 HTMLBodyElement::HTMLBodyElement(Document* doc)
    44     : HTMLElement(bodyTag, doc)
     43HTMLBodyElement::HTMLBodyElement(const QualifiedName& qName, Document* doc)
     44    : HTMLElement(qName, doc)
    4545{
    4646}
  • trunk/WebCore/html/HTMLBodyElement.h

    r31357 r38769  
    3434{
    3535public:
    36     HTMLBodyElement(Document*);
     36    HTMLBodyElement(const QualifiedName&, Document*);
    3737    ~HTMLBodyElement();
    3838
  • trunk/WebCore/html/HTMLElementFactory.cpp

    r38714 r38769  
    9696static PassRefPtr<HTMLElement> htmlConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    9797{
    98     return new HTMLHtmlElement(doc);
     98    return new HTMLHtmlElement(htmlTag, doc);
    9999}
    100100
    101101static PassRefPtr<HTMLElement> headConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    102102{
    103     return new HTMLHeadElement(doc);
     103    return new HTMLHeadElement(headTag, doc);
    104104}
    105105
    106106static PassRefPtr<HTMLElement> bodyConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    107107{
    108     return new HTMLBodyElement(doc);
     108    return new HTMLBodyElement(bodyTag, doc);
    109109}
    110110
    111111static PassRefPtr<HTMLElement> baseConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    112112{
    113     return new HTMLBaseElement(doc);
     113    return new HTMLBaseElement(baseTag, doc);
    114114}
    115115
    116116static PassRefPtr<HTMLElement> linkConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    117117{
    118     RefPtr<HTMLLinkElement> link = new HTMLLinkElement(doc);
     118    RefPtr<HTMLLinkElement> link = new HTMLLinkElement(linkTag, doc);
    119119    link->setCreatedByParser(createdByParser);
    120120    return link.release();
     
    123123static PassRefPtr<HTMLElement> metaConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    124124{
    125     return new HTMLMetaElement(doc);
     125    return new HTMLMetaElement(metaTag, doc);
    126126}
    127127
  • trunk/WebCore/html/HTMLHeadElement.cpp

    r25754 r38769  
    3333using namespace HTMLNames;
    3434
    35 HTMLHeadElement::HTMLHeadElement(Document* doc)
    36     : HTMLElement(headTag, doc)
     35HTMLHeadElement::HTMLHeadElement(const QualifiedName& qName, Document* doc)
     36    : HTMLElement(qName, doc)
    3737{
    3838}
  • trunk/WebCore/html/HTMLHeadElement.h

    r25754 r38769  
    3434{
    3535public:
    36     HTMLHeadElement(Document*);
     36    HTMLHeadElement(const QualifiedName&, Document*);
    3737    ~HTMLHeadElement();
    3838
  • trunk/WebCore/html/HTMLHtmlElement.cpp

    r32364 r38769  
    11/**
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
     
    3432using namespace HTMLNames;
    3533
    36 HTMLHtmlElement::HTMLHtmlElement(Document* doc)
    37     : HTMLElement(htmlTag, doc)
     34HTMLHtmlElement::HTMLHtmlElement(const QualifiedName& qName, Document* doc)
     35    : HTMLElement(qName, doc)
    3836{
    3937}
  • trunk/WebCore/html/HTMLHtmlElement.h

    r32351 r38769  
    3434{
    3535public:
    36     HTMLHtmlElement(Document*);
     36    HTMLHtmlElement(const QualifiedName&, Document*);
    3737    ~HTMLHtmlElement();
    3838
  • trunk/WebCore/html/HTMLLinkElement.cpp

    r36650 r38769  
    4343using namespace HTMLNames;
    4444
    45 HTMLLinkElement::HTMLLinkElement(Document *doc)
    46     : HTMLElement(linkTag, doc)
     45HTMLLinkElement::HTMLLinkElement(const QualifiedName& qName, Document *doc)
     46    : HTMLElement(qName, doc)
    4747    , m_cachedSheet(0)
    4848    , m_disabledState(0)
  • trunk/WebCore/html/HTMLLinkElement.h

    r36650 r38769  
    3636class HTMLLinkElement : public HTMLElement, public CachedResourceClient {
    3737public:
    38     HTMLLinkElement(Document*);
     38    HTMLLinkElement(const QualifiedName&, Document*);
    3939    ~HTMLLinkElement();
    4040
  • trunk/WebCore/html/HTMLMetaElement.cpp

    r25754 r38769  
    3232using namespace HTMLNames;
    3333
    34 HTMLMetaElement::HTMLMetaElement(Document* doc)
    35     : HTMLElement(metaTag, doc)
     34HTMLMetaElement::HTMLMetaElement(const QualifiedName& qName, Document* doc)
     35    : HTMLElement(qName, doc)
    3636{
    3737}
  • trunk/WebCore/html/HTMLMetaElement.h

    r25754 r38769  
    3232{
    3333public:
    34     HTMLMetaElement(Document*);
     34    HTMLMetaElement(const QualifiedName&, Document*);
    3535    ~HTMLMetaElement();
    3636
  • trunk/WebCore/html/HTMLParser.cpp

    r38714 r38769  
    489489                elt->hasLocalName(baseTag))) {
    490490                if (!head) {
    491                     head = new HTMLHeadElement(document);
     491                    head = new HTMLHeadElement(headTag, document);
    492492                    e = head;
    493493                    insertNode(e);
     
    501501                }
    502502                if (!haveFrameSet) {
    503                     e = new HTMLBodyElement(document);
     503                    e = new HTMLBodyElement(bodyTag, document);
    504504                    startBody();
    505505                    insertNode(e);
     
    515515                if (!haveFrameSet) {
    516516                    popBlock(currentTagName);
    517                     e = new HTMLBodyElement(document);
     517                    e = new HTMLBodyElement(bodyTag, document);
    518518                    startBody();
    519519                    insertNode(e);
     
    639639
    640640        if (!document->documentElement()) {
    641             e = new HTMLHtmlElement(document);
     641            e = new HTMLHtmlElement(htmlTag, document);
    642642            insertNode(e);
    643643            handled = true;
     
    671671{
    672672    if (!head || current->localName() == htmlTag) {
    673         head = new HTMLHeadElement(document);
     673        head = new HTMLHeadElement(headTag, document);
    674674        result = head;
    675675    } else
     
    14901490        return;
    14911491
    1492     head = new HTMLHeadElement(document);
     1492    head = new HTMLHeadElement(headTag, document);
    14931493    HTMLElement* body = document->body();
    14941494    ExceptionCode ec = 0;
     
    15461546    // In the case of a completely empty document, here's the place to create the HTML element.
    15471547    if (current && current->isDocumentNode() && !document->documentElement())
    1548         insertNode(new HTMLHtmlElement(document));
     1548        insertNode(new HTMLHtmlElement(htmlTag, document));
    15491549
    15501550    // This ensures that "current" is not left pointing to a node when the document is destroyed.
  • trunk/WebCore/html/HTMLViewSourceDocument.cpp

    r37846 r38769  
    6262void HTMLViewSourceDocument::createContainingTable()
    6363{
    64     RefPtr<Element> html = new HTMLHtmlElement(this);
     64    RefPtr<Element> html = new HTMLHtmlElement(htmlTag, this);
    6565    addChild(html);
    6666    html->attach();
    67     RefPtr<Element> body = new HTMLBodyElement(this);
     67    RefPtr<Element> body = new HTMLBodyElement(bodyTag, this);
    6868    html->addChild(body);
    6969    body->attach();
Note: See TracChangeset for help on using the changeset viewer.