Changeset 65990 in webkit
- Timestamp:
- Aug 24, 2010 11:57:14 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65989 r65990 1 2010-08-24 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Remove more DTD junk now that the LegacyHTMLDocumentParser is gone 6 https://bugs.webkit.org/show_bug.cgi?id=44588 7 8 Just removing dead code, thus no tests. 9 10 * html/HTMLElement.cpp: 11 (WebCore::HTMLElement::nodeName): 12 * html/HTMLElement.h: 13 1 14 2010-08-24 Adam Barth <abarth@webkit.org> 2 15 -
trunk/WebCore/html/HTMLElement.cpp
r65986 r65990 62 62 String HTMLElement::nodeName() const 63 63 { 64 // FIXME: Would be nice to have an atomicstring lookup based off uppercase chars that does not have to copy65 // the string on a hit in the hash.64 // FIXME: Would be nice to have an atomicstring lookup based off uppercase 65 // chars that does not have to copy the string on a hit in the hash. 66 66 // FIXME: We should have a way to detect XHTML elements and replace the hasPrefix() check with it. 67 67 if (document()->isHTMLDocument() && !tagQName().hasPrefix()) … … 754 754 } 755 755 756 // DTD Stuff757 // This unfortunate function is only needed when checking against the DTD. Other languages (like SVG) won't need this.758 // FIXME: Remove if only used by LegacyHTMLTreeBuilder.759 bool HTMLElement::isRecognizedTagName(const QualifiedName& tagName)760 {761 DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());762 if (tagList.isEmpty()) {763 size_t tagCount = 0;764 WebCore::QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount);765 for (size_t i = 0; i < tagCount; i++) {766 if (*tags[i] == bgsoundTag767 || *tags[i] == commandTag768 || *tags[i] == detailsTag769 || *tags[i] == figcaptionTag770 || *tags[i] == figureTag771 || *tags[i] == summaryTag772 || *tags[i] == trackTag) {773 // Even though we have atoms for these tags, we don't want to774 // treat them as "recognized tags" for the purpose of parsing775 // because that changes how we parse documents.776 continue;777 }778 tagList.add(tags[i]->localName().impl());779 }780 }781 return tagList.contains(tagName.localName().impl());782 }783 784 // The terms inline and block are used here loosely. Don't make the mistake of assuming all inlines or all blocks785 // need to be in these two lists.786 static HashSet<AtomicStringImpl*>* inlineTagList()787 {788 DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());789 if (tagList.isEmpty()) {790 tagList.add(ttTag.localName().impl());791 tagList.add(iTag.localName().impl());792 tagList.add(bTag.localName().impl());793 tagList.add(uTag.localName().impl());794 tagList.add(sTag.localName().impl());795 tagList.add(strikeTag.localName().impl());796 tagList.add(bigTag.localName().impl());797 tagList.add(smallTag.localName().impl());798 tagList.add(emTag.localName().impl());799 tagList.add(strongTag.localName().impl());800 tagList.add(dfnTag.localName().impl());801 tagList.add(codeTag.localName().impl());802 tagList.add(sampTag.localName().impl());803 tagList.add(kbdTag.localName().impl());804 tagList.add(varTag.localName().impl());805 tagList.add(citeTag.localName().impl());806 tagList.add(abbrTag.localName().impl());807 tagList.add(acronymTag.localName().impl());808 tagList.add(aTag.localName().impl());809 tagList.add(canvasTag.localName().impl());810 tagList.add(imgTag.localName().impl());811 tagList.add(appletTag.localName().impl());812 tagList.add(objectTag.localName().impl());813 tagList.add(embedTag.localName().impl());814 tagList.add(fontTag.localName().impl());815 tagList.add(basefontTag.localName().impl());816 tagList.add(brTag.localName().impl());817 tagList.add(scriptTag.localName().impl());818 tagList.add(styleTag.localName().impl());819 tagList.add(linkTag.localName().impl());820 tagList.add(mapTag.localName().impl());821 tagList.add(qTag.localName().impl());822 tagList.add(subTag.localName().impl());823 tagList.add(supTag.localName().impl());824 tagList.add(spanTag.localName().impl());825 tagList.add(bdoTag.localName().impl());826 tagList.add(iframeTag.localName().impl());827 tagList.add(inputTag.localName().impl());828 tagList.add(keygenTag.localName().impl());829 tagList.add(selectTag.localName().impl());830 tagList.add(datagridTag.localName().impl());831 tagList.add(textareaTag.localName().impl());832 tagList.add(labelTag.localName().impl());833 tagList.add(buttonTag.localName().impl());834 tagList.add(datalistTag.localName().impl());835 tagList.add(insTag.localName().impl());836 tagList.add(delTag.localName().impl());837 tagList.add(nobrTag.localName().impl());838 tagList.add(wbrTag.localName().impl());839 #if ENABLE(VIDEO)840 tagList.add(audioTag.localName().impl());841 tagList.add(videoTag.localName().impl());842 #endif843 tagList.add(rpTag.localName().impl());844 tagList.add(rtTag.localName().impl());845 tagList.add(rubyTag.localName().impl());846 tagList.add(progressTag.localName().impl());847 tagList.add(meterTag.localName().impl());848 tagList.add(markTag.localName().impl());849 }850 return &tagList;851 }852 853 static HashSet<AtomicStringImpl*>* blockTagList()854 {855 DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());856 if (tagList.isEmpty()) {857 tagList.add(addressTag.localName().impl());858 tagList.add(articleTag.localName().impl());859 tagList.add(asideTag.localName().impl());860 tagList.add(blockquoteTag.localName().impl());861 tagList.add(centerTag.localName().impl());862 tagList.add(ddTag.localName().impl());863 tagList.add(dirTag.localName().impl());864 tagList.add(divTag.localName().impl());865 tagList.add(dlTag.localName().impl());866 tagList.add(dtTag.localName().impl());867 tagList.add(fieldsetTag.localName().impl());868 tagList.add(footerTag.localName().impl());869 tagList.add(formTag.localName().impl());870 tagList.add(h1Tag.localName().impl());871 tagList.add(h2Tag.localName().impl());872 tagList.add(h3Tag.localName().impl());873 tagList.add(h4Tag.localName().impl());874 tagList.add(h5Tag.localName().impl());875 tagList.add(h6Tag.localName().impl());876 tagList.add(headerTag.localName().impl());877 tagList.add(hgroupTag.localName().impl());878 tagList.add(hrTag.localName().impl());879 tagList.add(isindexTag.localName().impl());880 tagList.add(layerTag.localName().impl());881 tagList.add(liTag.localName().impl());882 tagList.add(listingTag.localName().impl());883 tagList.add(marqueeTag.localName().impl());884 tagList.add(menuTag.localName().impl());885 tagList.add(navTag.localName().impl());886 tagList.add(noembedTag.localName().impl());887 tagList.add(noframesTag.localName().impl());888 tagList.add(nolayerTag.localName().impl());889 tagList.add(noscriptTag.localName().impl());890 tagList.add(olTag.localName().impl());891 tagList.add(pTag.localName().impl());892 tagList.add(plaintextTag.localName().impl());893 tagList.add(preTag.localName().impl());894 tagList.add(sectionTag.localName().impl());895 tagList.add(tableTag.localName().impl());896 tagList.add(ulTag.localName().impl());897 tagList.add(xmpTag.localName().impl());898 }899 return &tagList;900 }901 902 bool HTMLElement::inEitherTagList(const Node* newChild)903 {904 if (newChild->isTextNode())905 return true;906 907 if (newChild->isHTMLElement()) {908 const HTMLElement* child = static_cast<const HTMLElement*>(newChild);909 if (inlineTagList()->contains(child->tagQName().localName().impl())) {910 #if PLATFORM(MAC)911 if (child->tagQName().localName() == styleTag) {912 // Leopard Mail doesn't expect <style> to be in the body of the document, so don't allow it in that case.913 // See <rdar://problem/6621310>914 Settings* settings = newChild->document() ? newChild->document()->settings() : 0;915 if (settings && settings->needsLeopardMailQuirks())916 return false;917 }918 #endif919 return true;920 }921 if (blockTagList()->contains(child->tagQName().localName().impl()))922 return true;923 return !isRecognizedTagName(child->tagQName()); // Accept custom html tags924 }925 926 return false;927 }928 929 bool HTMLElement::inInlineTagList(const Node* newChild)930 {931 if (newChild->isTextNode())932 return true;933 934 if (newChild->isHTMLElement()) {935 const HTMLElement* child = static_cast<const HTMLElement*>(newChild);936 if (inlineTagList()->contains(child->tagQName().localName().impl()))937 return true;938 return !isRecognizedTagName(child->tagQName()); // Accept custom html tags939 }940 941 return false;942 }943 944 bool HTMLElement::inBlockTagList(const Node* newChild)945 {946 if (newChild->isTextNode())947 return true;948 949 if (newChild->isHTMLElement()) {950 const HTMLElement* child = static_cast<const HTMLElement*>(newChild);951 return (blockTagList()->contains(child->tagQName().localName().impl()));952 }953 954 return false;955 }956 957 756 bool HTMLElement::rendererIsNeeded(RenderStyle *style) 958 757 { -
trunk/WebCore/html/HTMLElement.h
r65986 r65990 90 90 virtual void parseMappedAttribute(Attribute*); 91 91 92 static bool inEitherTagList(const Node*);93 static bool inInlineTagList(const Node*);94 static bool inBlockTagList(const Node*);95 static bool isRecognizedTagName(const QualifiedName&);96 97 92 HTMLFormElement* findFormAncestor() const; 98 93 -
trunk/WebCore/html/HTMLObjectElement.cpp
r65917 r65990 263 263 } 264 264 265 // FIXME: This should be removed, all callers are almost certainly wrong. 266 static bool isRecognizedTagName(const QualifiedName& tagName) 267 { 268 DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ()); 269 if (tagList.isEmpty()) { 270 size_t tagCount = 0; 271 QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount); 272 for (size_t i = 0; i < tagCount; i++) { 273 if (*tags[i] == bgsoundTag 274 || *tags[i] == commandTag 275 || *tags[i] == detailsTag 276 || *tags[i] == figcaptionTag 277 || *tags[i] == figureTag 278 || *tags[i] == summaryTag 279 || *tags[i] == trackTag) { 280 // Even though we have atoms for these tags, we don't want to 281 // treat them as "recognized tags" for the purpose of parsing 282 // because that changes how we parse documents. 283 continue; 284 } 285 tagList.add(tags[i]->localName().impl()); 286 } 287 } 288 return tagList.contains(tagName.localName().impl()); 289 } 290 265 291 void HTMLObjectElement::updateDocNamedItem() 266 292 { … … 274 300 if (child->isElementNode()) { 275 301 Element* element = static_cast<Element*>(child); 276 if (HTMLElement::isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag)) 302 // FIXME: Use of isRecognizedTagName is almost certainly wrong here. 303 if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag)) 277 304 isNamedItem = false; 278 305 } else if (child->isTextNode()) {
Note: See TracChangeset
for help on using the changeset viewer.