Changeset 38714 in webkit


Ignore:
Timestamp:
Nov 24, 2008 11:29:39 AM (15 years ago)
Author:
jchaffraix@webkit.org
Message:

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

Reviewed by Darin Adler.

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

  • Make HTMLElementFactory::createHTMLElement take a QualifiedName instead of an AtomicString.
  • Updated the elements' constructors and the callers to reflect the previous change.
  • dom/Document.cpp: (WebCore::Document::createElement):
  • html/HTMLDocument.cpp: (WebCore::HTMLDocument::createElement):
  • html/HTMLElement.cpp: (WebCore::HTMLElement::cloneNode):
  • html/HTMLElementFactory.cpp: (WebCore::htmlConstructor): (WebCore::headConstructor): (WebCore::bodyConstructor): (WebCore::baseConstructor): (WebCore::linkConstructor): (WebCore::metaConstructor): (WebCore::styleConstructor): (WebCore::titleConstructor): (WebCore::frameConstructor): (WebCore::framesetConstructor): (WebCore::iframeConstructor): (WebCore::formConstructor): (WebCore::buttonConstructor): (WebCore::inputConstructor): (WebCore::isindexConstructor): (WebCore::fieldsetConstructor): (WebCore::keygenConstructor): (WebCore::labelConstructor): (WebCore::legendConstructor): (WebCore::optgroupConstructor): (WebCore::optionConstructor): (WebCore::selectConstructor): (WebCore::textareaConstructor): (WebCore::dlConstructor): (WebCore::ulConstructor): (WebCore::olConstructor): (WebCore::dirConstructor): (WebCore::menuConstructor): (WebCore::liConstructor): (WebCore::blockquoteConstructor): (WebCore::divConstructor): (WebCore::headingConstructor): (WebCore::hrConstructor): (WebCore::paragraphConstructor): (WebCore::preConstructor): (WebCore::basefontConstructor): (WebCore::fontConstructor): (WebCore::modConstructor): (WebCore::anchorConstructor): (WebCore::imageConstructor): (WebCore::mapConstructor): (WebCore::areaConstructor): (WebCore::canvasConstructor): (WebCore::appletConstructor): (WebCore::embedConstructor): (WebCore::objectConstructor): (WebCore::paramConstructor): (WebCore::scriptConstructor): (WebCore::tableConstructor): (WebCore::tableCaptionConstructor): (WebCore::tableColConstructor): (WebCore::tableRowConstructor): (WebCore::tableCellConstructor): (WebCore::tableSectionConstructor): (WebCore::brConstructor): (WebCore::quoteConstructor): (WebCore::marqueeConstructor): (WebCore::audioConstructor): (WebCore::videoConstructor): (WebCore::sourceConstructor): (WebCore::HTMLElementFactory::createHTMLElement):
  • html/HTMLElementFactory.h:
  • html/HTMLParser.cpp: (WebCore::HTMLParser::getNode):
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38713 r38714  
     12008-11-19  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin Adler.
     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        - Make HTMLElementFactory::createHTMLElement take a QualifiedName instead of
     9        an AtomicString.
     10
     11        - Updated the elements' constructors and the callers to reflect the previous change.
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::createElement):
     15        * html/HTMLDocument.cpp:
     16        (WebCore::HTMLDocument::createElement):
     17        * html/HTMLElement.cpp:
     18        (WebCore::HTMLElement::cloneNode):
     19        * html/HTMLElementFactory.cpp:
     20        (WebCore::htmlConstructor):
     21        (WebCore::headConstructor):
     22        (WebCore::bodyConstructor):
     23        (WebCore::baseConstructor):
     24        (WebCore::linkConstructor):
     25        (WebCore::metaConstructor):
     26        (WebCore::styleConstructor):
     27        (WebCore::titleConstructor):
     28        (WebCore::frameConstructor):
     29        (WebCore::framesetConstructor):
     30        (WebCore::iframeConstructor):
     31        (WebCore::formConstructor):
     32        (WebCore::buttonConstructor):
     33        (WebCore::inputConstructor):
     34        (WebCore::isindexConstructor):
     35        (WebCore::fieldsetConstructor):
     36        (WebCore::keygenConstructor):
     37        (WebCore::labelConstructor):
     38        (WebCore::legendConstructor):
     39        (WebCore::optgroupConstructor):
     40        (WebCore::optionConstructor):
     41        (WebCore::selectConstructor):
     42        (WebCore::textareaConstructor):
     43        (WebCore::dlConstructor):
     44        (WebCore::ulConstructor):
     45        (WebCore::olConstructor):
     46        (WebCore::dirConstructor):
     47        (WebCore::menuConstructor):
     48        (WebCore::liConstructor):
     49        (WebCore::blockquoteConstructor):
     50        (WebCore::divConstructor):
     51        (WebCore::headingConstructor):
     52        (WebCore::hrConstructor):
     53        (WebCore::paragraphConstructor):
     54        (WebCore::preConstructor):
     55        (WebCore::basefontConstructor):
     56        (WebCore::fontConstructor):
     57        (WebCore::modConstructor):
     58        (WebCore::anchorConstructor):
     59        (WebCore::imageConstructor):
     60        (WebCore::mapConstructor):
     61        (WebCore::areaConstructor):
     62        (WebCore::canvasConstructor):
     63        (WebCore::appletConstructor):
     64        (WebCore::embedConstructor):
     65        (WebCore::objectConstructor):
     66        (WebCore::paramConstructor):
     67        (WebCore::scriptConstructor):
     68        (WebCore::tableConstructor):
     69        (WebCore::tableCaptionConstructor):
     70        (WebCore::tableColConstructor):
     71        (WebCore::tableRowConstructor):
     72        (WebCore::tableCellConstructor):
     73        (WebCore::tableSectionConstructor):
     74        (WebCore::brConstructor):
     75        (WebCore::quoteConstructor):
     76        (WebCore::marqueeConstructor):
     77        (WebCore::audioConstructor):
     78        (WebCore::videoConstructor):
     79        (WebCore::sourceConstructor):
     80        (WebCore::HTMLElementFactory::createHTMLElement):
     81        * html/HTMLElementFactory.h:
     82        * html/HTMLParser.cpp:
     83        (WebCore::HTMLParser::getNode):
     84
    1852008-11-24  Brent Fulgham  <bfulgham@gmail.com>
    286
  • trunk/WebCore/dom/Document.cpp

    r38661 r38714  
    524524
    525525    if (m_isXHTML)
    526         return HTMLElementFactory::createHTMLElement(name, this, 0, false);
     526        return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, name, xhtmlNamespaceURI), this, 0, false);
    527527
    528528    return createElement(QualifiedName(nullAtom, name, nullAtom), false, ec);
     
    749749    // FIXME: Use registered namespaces and look up in a hash to find the right factory.
    750750    if (qName.namespaceURI() == xhtmlNamespaceURI)
    751         e = HTMLElementFactory::createHTMLElement(qName.localName(), this, 0, createdByParser);
     751        e = HTMLElementFactory::createHTMLElement(qName, this, 0, createdByParser);
    752752#if ENABLE(SVG)
    753753    else if (qName.namespaceURI() == SVGNames::svgNamespaceURI)
  • trunk/WebCore/html/HTMLDocument.cpp

    r38327 r38714  
    305305    }
    306306    AtomicString lowerName = name.string().impl()->isLower() ? name : AtomicString(name.string().lower());
    307     return HTMLElementFactory::createHTMLElement(lowerName, this, 0, false);
     307    return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, lowerName, xhtmlNamespaceURI), this, 0, false);
    308308}
    309309
  • trunk/WebCore/html/HTMLElement.cpp

    r38418 r38714  
    9999PassRefPtr<Node> HTMLElement::cloneNode(bool deep)
    100100{
    101     RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement(tagQName().localName(), document(), 0, false);
     101    RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement(tagQName(), document(), 0, false);
    102102    if (!clone)
    103103        return 0;
  • trunk/WebCore/html/HTMLElementFactory.cpp

    r36616 r38714  
    9090using namespace HTMLNames;
    9191
    92 typedef PassRefPtr<HTMLElement> (*ConstructorFunc)(const AtomicString& tagName, Document*, HTMLFormElement*, bool createdByParser);
     92typedef PassRefPtr<HTMLElement> (*ConstructorFunc)(const QualifiedName& tagName, Document*, HTMLFormElement*, bool createdByParser);
    9393typedef HashMap<AtomicStringImpl*, ConstructorFunc> FunctionMap;
    9494static FunctionMap* gFunctionMap;
    9595
    96 static PassRefPtr<HTMLElement> htmlConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     96static PassRefPtr<HTMLElement> htmlConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    9797{
    9898    return new HTMLHtmlElement(doc);
    9999}
    100100
    101 static PassRefPtr<HTMLElement> headConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     101static PassRefPtr<HTMLElement> headConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    102102{
    103103    return new HTMLHeadElement(doc);
    104104}
    105105
    106 static PassRefPtr<HTMLElement> bodyConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     106static PassRefPtr<HTMLElement> bodyConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    107107{
    108108    return new HTMLBodyElement(doc);
    109109}
    110110
    111 static PassRefPtr<HTMLElement> baseConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     111static PassRefPtr<HTMLElement> baseConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    112112{
    113113    return new HTMLBaseElement(doc);
    114114}
    115115
    116 static PassRefPtr<HTMLElement> linkConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     116static PassRefPtr<HTMLElement> linkConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    117117{
    118118    RefPtr<HTMLLinkElement> link = new HTMLLinkElement(doc);
     
    121121}
    122122
    123 static PassRefPtr<HTMLElement> metaConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     123static PassRefPtr<HTMLElement> metaConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    124124{
    125125    return new HTMLMetaElement(doc);
    126126}
    127127
    128 static PassRefPtr<HTMLElement> styleConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     128static PassRefPtr<HTMLElement> styleConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    129129{
    130130    RefPtr<HTMLStyleElement> style = new HTMLStyleElement(doc);
     
    133133}
    134134
    135 static PassRefPtr<HTMLElement> titleConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     135static PassRefPtr<HTMLElement> titleConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    136136{
    137137    return new HTMLTitleElement(doc);
    138138}
    139139
    140 static PassRefPtr<HTMLElement> frameConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     140static PassRefPtr<HTMLElement> frameConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    141141{
    142142    RefPtr<HTMLFrameElement> frame = new HTMLFrameElement(doc);
     
    145145}
    146146
    147 static PassRefPtr<HTMLElement> framesetConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     147static PassRefPtr<HTMLElement> framesetConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    148148{
    149149    return new HTMLFrameSetElement(doc);
    150150}
    151151
    152 static PassRefPtr<HTMLElement> iframeConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     152static PassRefPtr<HTMLElement> iframeConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    153153{
    154154    RefPtr<HTMLIFrameElement> iFrame = new HTMLIFrameElement(doc);
     
    157157}
    158158
    159 static PassRefPtr<HTMLElement> formConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     159static PassRefPtr<HTMLElement> formConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    160160{
    161161    return new HTMLFormElement(doc);
    162162}
    163163
    164 static PassRefPtr<HTMLElement> buttonConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     164static PassRefPtr<HTMLElement> buttonConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    165165{
    166166    return new HTMLButtonElement(doc, form);
    167167}
    168168
    169 static PassRefPtr<HTMLElement> inputConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     169static PassRefPtr<HTMLElement> inputConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    170170{
    171171    return new HTMLInputElement(doc, form);
    172172}
    173173
    174 static PassRefPtr<HTMLElement> isindexConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     174static PassRefPtr<HTMLElement> isindexConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    175175{
    176176    return new HTMLIsIndexElement(doc, form);
    177177}
    178178
    179 static PassRefPtr<HTMLElement> fieldsetConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     179static PassRefPtr<HTMLElement> fieldsetConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    180180{
    181181    return new HTMLFieldSetElement(doc, form);
    182182}
    183183
    184 static PassRefPtr<HTMLElement> keygenConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     184static PassRefPtr<HTMLElement> keygenConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    185185{
    186186    return new HTMLKeygenElement(doc, form);
    187187}
    188188
    189 static PassRefPtr<HTMLElement> labelConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     189static PassRefPtr<HTMLElement> labelConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    190190{
    191191    return new HTMLLabelElement(doc);
    192192}
    193193
    194 static PassRefPtr<HTMLElement> legendConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     194static PassRefPtr<HTMLElement> legendConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    195195{
    196196    return new HTMLLegendElement(doc, form);
    197197}
    198198
    199 static PassRefPtr<HTMLElement> optgroupConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     199static PassRefPtr<HTMLElement> optgroupConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    200200{
    201201    return new HTMLOptGroupElement(doc, form);
    202202}
    203203
    204 static PassRefPtr<HTMLElement> optionConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     204static PassRefPtr<HTMLElement> optionConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    205205{
    206206    return new HTMLOptionElement(doc, form);
    207207}
    208208
    209 static PassRefPtr<HTMLElement> selectConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     209static PassRefPtr<HTMLElement> selectConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    210210{
    211211    return new HTMLSelectElement(doc, form);
    212212}
    213213
    214 static PassRefPtr<HTMLElement> textareaConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     214static PassRefPtr<HTMLElement> textareaConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    215215{
    216216    return new HTMLTextAreaElement(doc, form);
    217217}
    218218
    219 static PassRefPtr<HTMLElement> dlConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     219static PassRefPtr<HTMLElement> dlConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    220220{
    221221    return new HTMLDListElement(doc);
    222222}
    223223
    224 static PassRefPtr<HTMLElement> ulConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     224static PassRefPtr<HTMLElement> ulConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    225225{
    226226    return new HTMLUListElement(doc);
    227227}
    228228
    229 static PassRefPtr<HTMLElement> olConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     229static PassRefPtr<HTMLElement> olConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    230230{
    231231    return new HTMLOListElement(doc);
    232232}
    233233
    234 static PassRefPtr<HTMLElement> dirConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     234static PassRefPtr<HTMLElement> dirConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    235235{
    236236    return new HTMLDirectoryElement(doc);
    237237}
    238238
    239 static PassRefPtr<HTMLElement> menuConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     239static PassRefPtr<HTMLElement> menuConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    240240{
    241241    return new HTMLMenuElement(doc);
    242242}
    243243
    244 static PassRefPtr<HTMLElement> liConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     244static PassRefPtr<HTMLElement> liConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    245245{
    246246    return new HTMLLIElement(doc);
    247247}
    248248
    249 static PassRefPtr<HTMLElement> blockquoteConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     249static PassRefPtr<HTMLElement> blockquoteConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    250250{
    251251    return new HTMLBlockquoteElement(doc);
    252252}
    253253
    254 static PassRefPtr<HTMLElement> divConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     254static PassRefPtr<HTMLElement> divConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    255255{
    256256    return new HTMLDivElement(doc);
    257257}
    258258
    259 static PassRefPtr<HTMLElement> headingConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    260 {
    261     return new HTMLHeadingElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    262 }
    263 
    264 static PassRefPtr<HTMLElement> hrConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     259static PassRefPtr<HTMLElement> headingConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     260{
     261    return new HTMLHeadingElement(tagName, doc);
     262}
     263
     264static PassRefPtr<HTMLElement> hrConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    265265{
    266266    return new HTMLHRElement(doc);
    267267}
    268268
    269 static PassRefPtr<HTMLElement> paragraphConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     269static PassRefPtr<HTMLElement> paragraphConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    270270{
    271271    return new HTMLParagraphElement(doc);
    272272}
    273273
    274 static PassRefPtr<HTMLElement> preConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    275 {
    276     return new HTMLPreElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    277 }
    278 
    279 static PassRefPtr<HTMLElement> basefontConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     274static PassRefPtr<HTMLElement> preConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     275{
     276    return new HTMLPreElement(tagName, doc);
     277}
     278
     279static PassRefPtr<HTMLElement> basefontConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    280280{
    281281    return new HTMLBaseFontElement(doc);
    282282}
    283283
    284 static PassRefPtr<HTMLElement> fontConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     284static PassRefPtr<HTMLElement> fontConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    285285{
    286286    return new HTMLFontElement(doc);
    287287}
    288288
    289 static PassRefPtr<HTMLElement> modConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    290 {
    291     return new HTMLModElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    292 }
    293 
    294 static PassRefPtr<HTMLElement> anchorConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     289static PassRefPtr<HTMLElement> modConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     290{
     291    return new HTMLModElement(tagName, doc);
     292}
     293
     294static PassRefPtr<HTMLElement> anchorConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    295295{
    296296    return new HTMLAnchorElement(doc);
    297297}
    298298
    299 static PassRefPtr<HTMLElement> imageConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)
     299static PassRefPtr<HTMLElement> imageConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool)
    300300{
    301301    return new HTMLImageElement(doc, form);
    302302}
    303303
    304 static PassRefPtr<HTMLElement> mapConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     304static PassRefPtr<HTMLElement> mapConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    305305{
    306306    return new HTMLMapElement(doc);
    307307}
    308308
    309 static PassRefPtr<HTMLElement> areaConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     309static PassRefPtr<HTMLElement> areaConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    310310{
    311311    return new HTMLAreaElement(doc);
    312312}
    313313
    314 static PassRefPtr<HTMLElement> canvasConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     314static PassRefPtr<HTMLElement> canvasConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    315315{
    316316    return new HTMLCanvasElement(doc);
    317317}
    318318
    319 static PassRefPtr<HTMLElement> appletConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     319static PassRefPtr<HTMLElement> appletConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    320320{
    321321    return new HTMLAppletElement(doc);
    322322}
    323323
    324 static PassRefPtr<HTMLElement> embedConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     324static PassRefPtr<HTMLElement> embedConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    325325{
    326326    return new HTMLEmbedElement(doc);
    327327}
    328328
    329 static PassRefPtr<HTMLElement> objectConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     329static PassRefPtr<HTMLElement> objectConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    330330{
    331331    RefPtr<HTMLObjectElement> object = new HTMLObjectElement(doc, createdByParser);
     
    333333}
    334334
    335 static PassRefPtr<HTMLElement> paramConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     335static PassRefPtr<HTMLElement> paramConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    336336{
    337337    return new HTMLParamElement(doc);
    338338}
    339339
    340 static PassRefPtr<HTMLElement> scriptConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)
     340static PassRefPtr<HTMLElement> scriptConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    341341{
    342342    RefPtr<HTMLScriptElement> script = new HTMLScriptElement(doc);
     
    345345}
    346346
    347 static PassRefPtr<HTMLElement> tableConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     347static PassRefPtr<HTMLElement> tableConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    348348{
    349349    return new HTMLTableElement(doc);
    350350}
    351351
    352 static PassRefPtr<HTMLElement> tableCaptionConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     352static PassRefPtr<HTMLElement> tableCaptionConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    353353{
    354354    return new HTMLTableCaptionElement(doc);
    355355}
    356356
    357 static PassRefPtr<HTMLElement> tableColConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    358 {
    359     return new HTMLTableColElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    360 }
    361 
    362 static PassRefPtr<HTMLElement> tableRowConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     357static PassRefPtr<HTMLElement> tableColConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     358{
     359    return new HTMLTableColElement(tagName, doc);
     360}
     361
     362static PassRefPtr<HTMLElement> tableRowConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    363363{
    364364    return new HTMLTableRowElement(doc);
    365365}
    366366
    367 static PassRefPtr<HTMLElement> tableCellConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    368 {
    369     return new HTMLTableCellElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    370 }
    371 
    372 static PassRefPtr<HTMLElement> tableSectionConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
    373 {
    374     return new HTMLTableSectionElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    375 }
    376 
    377 static PassRefPtr<HTMLElement> brConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     367static PassRefPtr<HTMLElement> tableCellConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     368{
     369    return new HTMLTableCellElement(tagName, doc);
     370}
     371
     372static PassRefPtr<HTMLElement> tableSectionConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
     373{
     374    return new HTMLTableSectionElement(tagName, doc);
     375}
     376
     377static PassRefPtr<HTMLElement> brConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    378378{
    379379    return new HTMLBRElement(doc);
    380380}
    381381
    382 static PassRefPtr<HTMLElement> quoteConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     382static PassRefPtr<HTMLElement> quoteConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    383383{
    384384    return new HTMLQuoteElement(doc);
    385385}
    386386
    387 static PassRefPtr<HTMLElement> marqueeConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)
     387static PassRefPtr<HTMLElement> marqueeConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool)
    388388{
    389389    return new HTMLMarqueeElement(doc);
     
    391391
    392392#if ENABLE(VIDEO)
    393 static PassRefPtr<HTMLElement> audioConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
     393static PassRefPtr<HTMLElement> audioConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
    394394{
    395395    if (!MediaPlayer::isAvailable())
    396         return new HTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
     396        return new HTMLElement(tagName, doc);
    397397    return new HTMLAudioElement(doc);
    398398}
    399399
    400 static PassRefPtr<HTMLElement> videoConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
     400static PassRefPtr<HTMLElement> videoConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
    401401{
    402402    if (!MediaPlayer::isAvailable())
    403         return new HTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
     403        return new HTMLElement(tagName, doc);
    404404    return new HTMLVideoElement(doc);
    405405}
    406406
    407 static PassRefPtr<HTMLElement> sourceConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)
     407static PassRefPtr<HTMLElement> sourceConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool)
    408408{
    409409    if (!MediaPlayer::isAvailable())
    410         return new HTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
     410        return new HTMLElement(tagName, doc);
    411411    return new HTMLSourceElement(doc);
    412412}
     
    501501}
    502502
    503 PassRefPtr<HTMLElement> HTMLElementFactory::createHTMLElement(const AtomicString& tagName, Document* doc, HTMLFormElement* form, bool createdByParser)
     503PassRefPtr<HTMLElement> HTMLElementFactory::createHTMLElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* form, bool createdByParser)
    504504{
    505505    if (!doc)
     
    508508    if (!gFunctionMap)
    509509        createFunctionMap();
    510    
    511     ConstructorFunc func = gFunctionMap->get(tagName.impl());
     510
     511    ConstructorFunc func = gFunctionMap->get(tagName.localName().impl());
    512512    if (func)
    513513        return func(tagName, doc, form, createdByParser);
    514  
     514
    515515    // elements with no special representation in the DOM
    516     return new HTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
    517 }
    518 
    519 }
    520 
     516    return new HTMLElement(tagName, doc);
     517}
     518
     519}
     520
  • trunk/WebCore/html/HTMLElementFactory.h

    r25754 r38714  
    4040public:
    4141    PassRefPtr<Element> createElement(const QualifiedName&, Document*, bool createdByParser = true);
    42     static PassRefPtr<HTMLElement> createHTMLElement(const AtomicString& tagName, Document*, HTMLFormElement* = 0, bool createdByParser = true);
     42    static PassRefPtr<HTMLElement> createHTMLElement(const QualifiedName& tagName, Document*, HTMLFormElement* = 0, bool createdByParser = true);
    4343};
    4444
  • trunk/WebCore/html/HTMLParser.cpp

    r38418 r38714  
    897897        proceed = (this->*errorCheckFunc)(t, result);
    898898    if (proceed)
    899         result = HTMLElementFactory::createHTMLElement(t->tagName, document, m_currentFormElement.get());
     899        result = HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, t->tagName, xhtmlNamespaceURI), document, m_currentFormElement.get());
    900900    return result.release();
    901901}
Note: See TracChangeset for help on using the changeset viewer.