Changeset 38714 in webkit
- Timestamp:
- Nov 24, 2008 11:29:39 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r38713 r38714 1 2008-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 1 85 2008-11-24 Brent Fulgham <bfulgham@gmail.com> 2 86 -
trunk/WebCore/dom/Document.cpp
r38661 r38714 524 524 525 525 if (m_isXHTML) 526 return HTMLElementFactory::createHTMLElement( name, this, 0, false);526 return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, name, xhtmlNamespaceURI), this, 0, false); 527 527 528 528 return createElement(QualifiedName(nullAtom, name, nullAtom), false, ec); … … 749 749 // FIXME: Use registered namespaces and look up in a hash to find the right factory. 750 750 if (qName.namespaceURI() == xhtmlNamespaceURI) 751 e = HTMLElementFactory::createHTMLElement(qName .localName(), this, 0, createdByParser);751 e = HTMLElementFactory::createHTMLElement(qName, this, 0, createdByParser); 752 752 #if ENABLE(SVG) 753 753 else if (qName.namespaceURI() == SVGNames::svgNamespaceURI) -
trunk/WebCore/html/HTMLDocument.cpp
r38327 r38714 305 305 } 306 306 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); 308 308 } 309 309 -
trunk/WebCore/html/HTMLElement.cpp
r38418 r38714 99 99 PassRefPtr<Node> HTMLElement::cloneNode(bool deep) 100 100 { 101 RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement(tagQName() .localName(), document(), 0, false);101 RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement(tagQName(), document(), 0, false); 102 102 if (!clone) 103 103 return 0; -
trunk/WebCore/html/HTMLElementFactory.cpp
r36616 r38714 90 90 using namespace HTMLNames; 91 91 92 typedef PassRefPtr<HTMLElement> (*ConstructorFunc)(const AtomicString& tagName, Document*, HTMLFormElement*, bool createdByParser);92 typedef PassRefPtr<HTMLElement> (*ConstructorFunc)(const QualifiedName& tagName, Document*, HTMLFormElement*, bool createdByParser); 93 93 typedef HashMap<AtomicStringImpl*, ConstructorFunc> FunctionMap; 94 94 static FunctionMap* gFunctionMap; 95 95 96 static PassRefPtr<HTMLElement> htmlConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)96 static PassRefPtr<HTMLElement> htmlConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 97 97 { 98 98 return new HTMLHtmlElement(doc); 99 99 } 100 100 101 static PassRefPtr<HTMLElement> headConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)101 static PassRefPtr<HTMLElement> headConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 102 102 { 103 103 return new HTMLHeadElement(doc); 104 104 } 105 105 106 static PassRefPtr<HTMLElement> bodyConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)106 static PassRefPtr<HTMLElement> bodyConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 107 107 { 108 108 return new HTMLBodyElement(doc); 109 109 } 110 110 111 static PassRefPtr<HTMLElement> baseConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)111 static PassRefPtr<HTMLElement> baseConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 112 112 { 113 113 return new HTMLBaseElement(doc); 114 114 } 115 115 116 static PassRefPtr<HTMLElement> linkConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)116 static PassRefPtr<HTMLElement> linkConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 117 117 { 118 118 RefPtr<HTMLLinkElement> link = new HTMLLinkElement(doc); … … 121 121 } 122 122 123 static PassRefPtr<HTMLElement> metaConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)123 static PassRefPtr<HTMLElement> metaConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 124 124 { 125 125 return new HTMLMetaElement(doc); 126 126 } 127 127 128 static PassRefPtr<HTMLElement> styleConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)128 static PassRefPtr<HTMLElement> styleConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 129 129 { 130 130 RefPtr<HTMLStyleElement> style = new HTMLStyleElement(doc); … … 133 133 } 134 134 135 static PassRefPtr<HTMLElement> titleConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)135 static PassRefPtr<HTMLElement> titleConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 136 136 { 137 137 return new HTMLTitleElement(doc); 138 138 } 139 139 140 static PassRefPtr<HTMLElement> frameConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)140 static PassRefPtr<HTMLElement> frameConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 141 141 { 142 142 RefPtr<HTMLFrameElement> frame = new HTMLFrameElement(doc); … … 145 145 } 146 146 147 static PassRefPtr<HTMLElement> framesetConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)147 static PassRefPtr<HTMLElement> framesetConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 148 148 { 149 149 return new HTMLFrameSetElement(doc); 150 150 } 151 151 152 static PassRefPtr<HTMLElement> iframeConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)152 static PassRefPtr<HTMLElement> iframeConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 153 153 { 154 154 RefPtr<HTMLIFrameElement> iFrame = new HTMLIFrameElement(doc); … … 157 157 } 158 158 159 static PassRefPtr<HTMLElement> formConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)159 static PassRefPtr<HTMLElement> formConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 160 160 { 161 161 return new HTMLFormElement(doc); 162 162 } 163 163 164 static PassRefPtr<HTMLElement> buttonConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)164 static PassRefPtr<HTMLElement> buttonConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 165 165 { 166 166 return new HTMLButtonElement(doc, form); 167 167 } 168 168 169 static PassRefPtr<HTMLElement> inputConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)169 static PassRefPtr<HTMLElement> inputConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 170 170 { 171 171 return new HTMLInputElement(doc, form); 172 172 } 173 173 174 static PassRefPtr<HTMLElement> isindexConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)174 static PassRefPtr<HTMLElement> isindexConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 175 175 { 176 176 return new HTMLIsIndexElement(doc, form); 177 177 } 178 178 179 static PassRefPtr<HTMLElement> fieldsetConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)179 static PassRefPtr<HTMLElement> fieldsetConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 180 180 { 181 181 return new HTMLFieldSetElement(doc, form); 182 182 } 183 183 184 static PassRefPtr<HTMLElement> keygenConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)184 static PassRefPtr<HTMLElement> keygenConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 185 185 { 186 186 return new HTMLKeygenElement(doc, form); 187 187 } 188 188 189 static PassRefPtr<HTMLElement> labelConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)189 static PassRefPtr<HTMLElement> labelConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 190 190 { 191 191 return new HTMLLabelElement(doc); 192 192 } 193 193 194 static PassRefPtr<HTMLElement> legendConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)194 static PassRefPtr<HTMLElement> legendConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 195 195 { 196 196 return new HTMLLegendElement(doc, form); 197 197 } 198 198 199 static PassRefPtr<HTMLElement> optgroupConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)199 static PassRefPtr<HTMLElement> optgroupConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 200 200 { 201 201 return new HTMLOptGroupElement(doc, form); 202 202 } 203 203 204 static PassRefPtr<HTMLElement> optionConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)204 static PassRefPtr<HTMLElement> optionConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 205 205 { 206 206 return new HTMLOptionElement(doc, form); 207 207 } 208 208 209 static PassRefPtr<HTMLElement> selectConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)209 static PassRefPtr<HTMLElement> selectConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 210 210 { 211 211 return new HTMLSelectElement(doc, form); 212 212 } 213 213 214 static PassRefPtr<HTMLElement> textareaConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)214 static PassRefPtr<HTMLElement> textareaConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 215 215 { 216 216 return new HTMLTextAreaElement(doc, form); 217 217 } 218 218 219 static PassRefPtr<HTMLElement> dlConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)219 static PassRefPtr<HTMLElement> dlConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 220 220 { 221 221 return new HTMLDListElement(doc); 222 222 } 223 223 224 static PassRefPtr<HTMLElement> ulConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)224 static PassRefPtr<HTMLElement> ulConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 225 225 { 226 226 return new HTMLUListElement(doc); 227 227 } 228 228 229 static PassRefPtr<HTMLElement> olConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)229 static PassRefPtr<HTMLElement> olConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 230 230 { 231 231 return new HTMLOListElement(doc); 232 232 } 233 233 234 static PassRefPtr<HTMLElement> dirConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)234 static PassRefPtr<HTMLElement> dirConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 235 235 { 236 236 return new HTMLDirectoryElement(doc); 237 237 } 238 238 239 static PassRefPtr<HTMLElement> menuConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)239 static PassRefPtr<HTMLElement> menuConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 240 240 { 241 241 return new HTMLMenuElement(doc); 242 242 } 243 243 244 static PassRefPtr<HTMLElement> liConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)244 static PassRefPtr<HTMLElement> liConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 245 245 { 246 246 return new HTMLLIElement(doc); 247 247 } 248 248 249 static PassRefPtr<HTMLElement> blockquoteConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)249 static PassRefPtr<HTMLElement> blockquoteConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 250 250 { 251 251 return new HTMLBlockquoteElement(doc); 252 252 } 253 253 254 static PassRefPtr<HTMLElement> divConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)254 static PassRefPtr<HTMLElement> divConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 255 255 { 256 256 return new HTMLDivElement(doc); 257 257 } 258 258 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)259 static PassRefPtr<HTMLElement> headingConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 260 { 261 return new HTMLHeadingElement(tagName, doc); 262 } 263 264 static PassRefPtr<HTMLElement> hrConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 265 265 { 266 266 return new HTMLHRElement(doc); 267 267 } 268 268 269 static PassRefPtr<HTMLElement> paragraphConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)269 static PassRefPtr<HTMLElement> paragraphConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 270 270 { 271 271 return new HTMLParagraphElement(doc); 272 272 } 273 273 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)274 static PassRefPtr<HTMLElement> preConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 275 { 276 return new HTMLPreElement(tagName, doc); 277 } 278 279 static PassRefPtr<HTMLElement> basefontConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 280 280 { 281 281 return new HTMLBaseFontElement(doc); 282 282 } 283 283 284 static PassRefPtr<HTMLElement> fontConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)284 static PassRefPtr<HTMLElement> fontConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 285 285 { 286 286 return new HTMLFontElement(doc); 287 287 } 288 288 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)289 static PassRefPtr<HTMLElement> modConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 290 { 291 return new HTMLModElement(tagName, doc); 292 } 293 294 static PassRefPtr<HTMLElement> anchorConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 295 295 { 296 296 return new HTMLAnchorElement(doc); 297 297 } 298 298 299 static PassRefPtr<HTMLElement> imageConstructor(const AtomicString&, Document* doc, HTMLFormElement* form, bool)299 static PassRefPtr<HTMLElement> imageConstructor(const QualifiedName&, Document* doc, HTMLFormElement* form, bool) 300 300 { 301 301 return new HTMLImageElement(doc, form); 302 302 } 303 303 304 static PassRefPtr<HTMLElement> mapConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)304 static PassRefPtr<HTMLElement> mapConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 305 305 { 306 306 return new HTMLMapElement(doc); 307 307 } 308 308 309 static PassRefPtr<HTMLElement> areaConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)309 static PassRefPtr<HTMLElement> areaConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 310 310 { 311 311 return new HTMLAreaElement(doc); 312 312 } 313 313 314 static PassRefPtr<HTMLElement> canvasConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)314 static PassRefPtr<HTMLElement> canvasConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 315 315 { 316 316 return new HTMLCanvasElement(doc); 317 317 } 318 318 319 static PassRefPtr<HTMLElement> appletConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)319 static PassRefPtr<HTMLElement> appletConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 320 320 { 321 321 return new HTMLAppletElement(doc); 322 322 } 323 323 324 static PassRefPtr<HTMLElement> embedConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)324 static PassRefPtr<HTMLElement> embedConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 325 325 { 326 326 return new HTMLEmbedElement(doc); 327 327 } 328 328 329 static PassRefPtr<HTMLElement> objectConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)329 static PassRefPtr<HTMLElement> objectConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 330 330 { 331 331 RefPtr<HTMLObjectElement> object = new HTMLObjectElement(doc, createdByParser); … … 333 333 } 334 334 335 static PassRefPtr<HTMLElement> paramConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)335 static PassRefPtr<HTMLElement> paramConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 336 336 { 337 337 return new HTMLParamElement(doc); 338 338 } 339 339 340 static PassRefPtr<HTMLElement> scriptConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool createdByParser)340 static PassRefPtr<HTMLElement> scriptConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser) 341 341 { 342 342 RefPtr<HTMLScriptElement> script = new HTMLScriptElement(doc); … … 345 345 } 346 346 347 static PassRefPtr<HTMLElement> tableConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)347 static PassRefPtr<HTMLElement> tableConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 348 348 { 349 349 return new HTMLTableElement(doc); 350 350 } 351 351 352 static PassRefPtr<HTMLElement> tableCaptionConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)352 static PassRefPtr<HTMLElement> tableCaptionConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 353 353 { 354 354 return new HTMLTableCaptionElement(doc); 355 355 } 356 356 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)357 static PassRefPtr<HTMLElement> tableColConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 358 { 359 return new HTMLTableColElement(tagName, doc); 360 } 361 362 static PassRefPtr<HTMLElement> tableRowConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 363 363 { 364 364 return new HTMLTableRowElement(doc); 365 365 } 366 366 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)367 static PassRefPtr<HTMLElement> tableCellConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 368 { 369 return new HTMLTableCellElement(tagName, doc); 370 } 371 372 static PassRefPtr<HTMLElement> tableSectionConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 373 { 374 return new HTMLTableSectionElement(tagName, doc); 375 } 376 377 static PassRefPtr<HTMLElement> brConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 378 378 { 379 379 return new HTMLBRElement(doc); 380 380 } 381 381 382 static PassRefPtr<HTMLElement> quoteConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)382 static PassRefPtr<HTMLElement> quoteConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 383 383 { 384 384 return new HTMLQuoteElement(doc); 385 385 } 386 386 387 static PassRefPtr<HTMLElement> marqueeConstructor(const AtomicString&, Document* doc, HTMLFormElement*, bool)387 static PassRefPtr<HTMLElement> marqueeConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool) 388 388 { 389 389 return new HTMLMarqueeElement(doc); … … 391 391 392 392 #if ENABLE(VIDEO) 393 static PassRefPtr<HTMLElement> audioConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)393 static PassRefPtr<HTMLElement> audioConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 394 394 { 395 395 if (!MediaPlayer::isAvailable()) 396 return new HTMLElement( QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);396 return new HTMLElement(tagName, doc); 397 397 return new HTMLAudioElement(doc); 398 398 } 399 399 400 static PassRefPtr<HTMLElement> videoConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)400 static PassRefPtr<HTMLElement> videoConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 401 401 { 402 402 if (!MediaPlayer::isAvailable()) 403 return new HTMLElement( QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);403 return new HTMLElement(tagName, doc); 404 404 return new HTMLVideoElement(doc); 405 405 } 406 406 407 static PassRefPtr<HTMLElement> sourceConstructor(const AtomicString& tagName, Document* doc, HTMLFormElement*, bool)407 static PassRefPtr<HTMLElement> sourceConstructor(const QualifiedName& tagName, Document* doc, HTMLFormElement*, bool) 408 408 { 409 409 if (!MediaPlayer::isAvailable()) 410 return new HTMLElement( QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);410 return new HTMLElement(tagName, doc); 411 411 return new HTMLSourceElement(doc); 412 412 } … … 501 501 } 502 502 503 PassRefPtr<HTMLElement> HTMLElementFactory::createHTMLElement(const AtomicString& tagName, Document* doc, HTMLFormElement* form, bool createdByParser)503 PassRefPtr<HTMLElement> HTMLElementFactory::createHTMLElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* form, bool createdByParser) 504 504 { 505 505 if (!doc) … … 508 508 if (!gFunctionMap) 509 509 createFunctionMap(); 510 511 ConstructorFunc func = gFunctionMap->get(tagName. impl());510 511 ConstructorFunc func = gFunctionMap->get(tagName.localName().impl()); 512 512 if (func) 513 513 return func(tagName, doc, form, createdByParser); 514 514 515 515 // 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 40 40 public: 41 41 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); 43 43 }; 44 44 -
trunk/WebCore/html/HTMLParser.cpp
r38418 r38714 897 897 proceed = (this->*errorCheckFunc)(t, result); 898 898 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()); 900 900 return result.release(); 901 901 }
Note: See TracChangeset
for help on using the changeset viewer.