[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
eric at webkit.org
eric at webkit.org
Wed Dec 22 12:32:57 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ef17f4bcd9c2dbf6533790534bc32fd1a56830f7
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 25 06:57:14 2010 +0000
2010-08-24 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
Remove more DTD junk now that the LegacyHTMLDocumentParser is gone
https://bugs.webkit.org/show_bug.cgi?id=44588
Just removing dead code, thus no tests.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::nodeName):
* html/HTMLElement.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0bbc5ea..7296a6f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-24 Eric Seidel <eric at webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove more DTD junk now that the LegacyHTMLDocumentParser is gone
+ https://bugs.webkit.org/show_bug.cgi?id=44588
+
+ Just removing dead code, thus no tests.
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::nodeName):
+ * html/HTMLElement.h:
+
2010-08-24 Adam Barth <abarth at webkit.org>
Qt build fix.
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index e055a3e..be6bddc 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -61,8 +61,8 @@ PassRefPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Docume
String HTMLElement::nodeName() const
{
- // FIXME: Would be nice to have an atomicstring lookup based off uppercase chars that does not have to copy
- // the string on a hit in the hash.
+ // FIXME: Would be nice to have an atomicstring lookup based off uppercase
+ // chars that does not have to copy the string on a hit in the hash.
// FIXME: We should have a way to detect XHTML elements and replace the hasPrefix() check with it.
if (document()->isHTMLDocument() && !tagQName().hasPrefix())
return tagQName().localNameUpper();
@@ -753,207 +753,6 @@ PassRefPtr<HTMLCollection> HTMLElement::children()
return HTMLCollection::create(this, NodeChildren);
}
-// DTD Stuff
-// This unfortunate function is only needed when checking against the DTD. Other languages (like SVG) won't need this.
-// FIXME: Remove if only used by LegacyHTMLTreeBuilder.
-bool HTMLElement::isRecognizedTagName(const QualifiedName& tagName)
-{
- DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());
- if (tagList.isEmpty()) {
- size_t tagCount = 0;
- WebCore::QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount);
- for (size_t i = 0; i < tagCount; i++) {
- if (*tags[i] == bgsoundTag
- || *tags[i] == commandTag
- || *tags[i] == detailsTag
- || *tags[i] == figcaptionTag
- || *tags[i] == figureTag
- || *tags[i] == summaryTag
- || *tags[i] == trackTag) {
- // Even though we have atoms for these tags, we don't want to
- // treat them as "recognized tags" for the purpose of parsing
- // because that changes how we parse documents.
- continue;
- }
- tagList.add(tags[i]->localName().impl());
- }
- }
- return tagList.contains(tagName.localName().impl());
-}
-
-// The terms inline and block are used here loosely. Don't make the mistake of assuming all inlines or all blocks
-// need to be in these two lists.
-static HashSet<AtomicStringImpl*>* inlineTagList()
-{
- DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());
- if (tagList.isEmpty()) {
- tagList.add(ttTag.localName().impl());
- tagList.add(iTag.localName().impl());
- tagList.add(bTag.localName().impl());
- tagList.add(uTag.localName().impl());
- tagList.add(sTag.localName().impl());
- tagList.add(strikeTag.localName().impl());
- tagList.add(bigTag.localName().impl());
- tagList.add(smallTag.localName().impl());
- tagList.add(emTag.localName().impl());
- tagList.add(strongTag.localName().impl());
- tagList.add(dfnTag.localName().impl());
- tagList.add(codeTag.localName().impl());
- tagList.add(sampTag.localName().impl());
- tagList.add(kbdTag.localName().impl());
- tagList.add(varTag.localName().impl());
- tagList.add(citeTag.localName().impl());
- tagList.add(abbrTag.localName().impl());
- tagList.add(acronymTag.localName().impl());
- tagList.add(aTag.localName().impl());
- tagList.add(canvasTag.localName().impl());
- tagList.add(imgTag.localName().impl());
- tagList.add(appletTag.localName().impl());
- tagList.add(objectTag.localName().impl());
- tagList.add(embedTag.localName().impl());
- tagList.add(fontTag.localName().impl());
- tagList.add(basefontTag.localName().impl());
- tagList.add(brTag.localName().impl());
- tagList.add(scriptTag.localName().impl());
- tagList.add(styleTag.localName().impl());
- tagList.add(linkTag.localName().impl());
- tagList.add(mapTag.localName().impl());
- tagList.add(qTag.localName().impl());
- tagList.add(subTag.localName().impl());
- tagList.add(supTag.localName().impl());
- tagList.add(spanTag.localName().impl());
- tagList.add(bdoTag.localName().impl());
- tagList.add(iframeTag.localName().impl());
- tagList.add(inputTag.localName().impl());
- tagList.add(keygenTag.localName().impl());
- tagList.add(selectTag.localName().impl());
- tagList.add(datagridTag.localName().impl());
- tagList.add(textareaTag.localName().impl());
- tagList.add(labelTag.localName().impl());
- tagList.add(buttonTag.localName().impl());
- tagList.add(datalistTag.localName().impl());
- tagList.add(insTag.localName().impl());
- tagList.add(delTag.localName().impl());
- tagList.add(nobrTag.localName().impl());
- tagList.add(wbrTag.localName().impl());
-#if ENABLE(VIDEO)
- tagList.add(audioTag.localName().impl());
- tagList.add(videoTag.localName().impl());
-#endif
- tagList.add(rpTag.localName().impl());
- tagList.add(rtTag.localName().impl());
- tagList.add(rubyTag.localName().impl());
- tagList.add(progressTag.localName().impl());
- tagList.add(meterTag.localName().impl());
- tagList.add(markTag.localName().impl());
- }
- return &tagList;
-}
-
-static HashSet<AtomicStringImpl*>* blockTagList()
-{
- DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());
- if (tagList.isEmpty()) {
- tagList.add(addressTag.localName().impl());
- tagList.add(articleTag.localName().impl());
- tagList.add(asideTag.localName().impl());
- tagList.add(blockquoteTag.localName().impl());
- tagList.add(centerTag.localName().impl());
- tagList.add(ddTag.localName().impl());
- tagList.add(dirTag.localName().impl());
- tagList.add(divTag.localName().impl());
- tagList.add(dlTag.localName().impl());
- tagList.add(dtTag.localName().impl());
- tagList.add(fieldsetTag.localName().impl());
- tagList.add(footerTag.localName().impl());
- tagList.add(formTag.localName().impl());
- tagList.add(h1Tag.localName().impl());
- tagList.add(h2Tag.localName().impl());
- tagList.add(h3Tag.localName().impl());
- tagList.add(h4Tag.localName().impl());
- tagList.add(h5Tag.localName().impl());
- tagList.add(h6Tag.localName().impl());
- tagList.add(headerTag.localName().impl());
- tagList.add(hgroupTag.localName().impl());
- tagList.add(hrTag.localName().impl());
- tagList.add(isindexTag.localName().impl());
- tagList.add(layerTag.localName().impl());
- tagList.add(liTag.localName().impl());
- tagList.add(listingTag.localName().impl());
- tagList.add(marqueeTag.localName().impl());
- tagList.add(menuTag.localName().impl());
- tagList.add(navTag.localName().impl());
- tagList.add(noembedTag.localName().impl());
- tagList.add(noframesTag.localName().impl());
- tagList.add(nolayerTag.localName().impl());
- tagList.add(noscriptTag.localName().impl());
- tagList.add(olTag.localName().impl());
- tagList.add(pTag.localName().impl());
- tagList.add(plaintextTag.localName().impl());
- tagList.add(preTag.localName().impl());
- tagList.add(sectionTag.localName().impl());
- tagList.add(tableTag.localName().impl());
- tagList.add(ulTag.localName().impl());
- tagList.add(xmpTag.localName().impl());
- }
- return &tagList;
-}
-
-bool HTMLElement::inEitherTagList(const Node* newChild)
-{
- if (newChild->isTextNode())
- return true;
-
- if (newChild->isHTMLElement()) {
- const HTMLElement* child = static_cast<const HTMLElement*>(newChild);
- if (inlineTagList()->contains(child->tagQName().localName().impl())) {
-#if PLATFORM(MAC)
- if (child->tagQName().localName() == styleTag) {
- // Leopard Mail doesn't expect <style> to be in the body of the document, so don't allow it in that case.
- // See <rdar://problem/6621310>
- Settings* settings = newChild->document() ? newChild->document()->settings() : 0;
- if (settings && settings->needsLeopardMailQuirks())
- return false;
- }
-#endif
- return true;
- }
- if (blockTagList()->contains(child->tagQName().localName().impl()))
- return true;
- return !isRecognizedTagName(child->tagQName()); // Accept custom html tags
- }
-
- return false;
-}
-
-bool HTMLElement::inInlineTagList(const Node* newChild)
-{
- if (newChild->isTextNode())
- return true;
-
- if (newChild->isHTMLElement()) {
- const HTMLElement* child = static_cast<const HTMLElement*>(newChild);
- if (inlineTagList()->contains(child->tagQName().localName().impl()))
- return true;
- return !isRecognizedTagName(child->tagQName()); // Accept custom html tags
- }
-
- return false;
-}
-
-bool HTMLElement::inBlockTagList(const Node* newChild)
-{
- if (newChild->isTextNode())
- return true;
-
- if (newChild->isHTMLElement()) {
- const HTMLElement* child = static_cast<const HTMLElement*>(newChild);
- return (blockTagList()->contains(child->tagQName().localName().impl()));
- }
-
- return false;
-}
-
bool HTMLElement::rendererIsNeeded(RenderStyle *style)
{
#if !ENABLE(XHTMLMP)
diff --git a/WebCore/html/HTMLElement.h b/WebCore/html/HTMLElement.h
index e1b56a0..5f08d38 100644
--- a/WebCore/html/HTMLElement.h
+++ b/WebCore/html/HTMLElement.h
@@ -89,11 +89,6 @@ protected:
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
virtual void parseMappedAttribute(Attribute*);
- static bool inEitherTagList(const Node*);
- static bool inInlineTagList(const Node*);
- static bool inBlockTagList(const Node*);
- static bool isRecognizedTagName(const QualifiedName&);
-
HTMLFormElement* findFormAncestor() const;
private:
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 25e15bc..de1ed91 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -262,6 +262,32 @@ void HTMLObjectElement::renderFallbackContent()
attach();
}
+// FIXME: This should be removed, all callers are almost certainly wrong.
+static bool isRecognizedTagName(const QualifiedName& tagName)
+{
+ DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());
+ if (tagList.isEmpty()) {
+ size_t tagCount = 0;
+ QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount);
+ for (size_t i = 0; i < tagCount; i++) {
+ if (*tags[i] == bgsoundTag
+ || *tags[i] == commandTag
+ || *tags[i] == detailsTag
+ || *tags[i] == figcaptionTag
+ || *tags[i] == figureTag
+ || *tags[i] == summaryTag
+ || *tags[i] == trackTag) {
+ // Even though we have atoms for these tags, we don't want to
+ // treat them as "recognized tags" for the purpose of parsing
+ // because that changes how we parse documents.
+ continue;
+ }
+ tagList.add(tags[i]->localName().impl());
+ }
+ }
+ return tagList.contains(tagName.localName().impl());
+}
+
void HTMLObjectElement::updateDocNamedItem()
{
// The rule is "<object> elements with no children other than
@@ -273,7 +299,8 @@ void HTMLObjectElement::updateDocNamedItem()
while (child && isNamedItem) {
if (child->isElementNode()) {
Element* element = static_cast<Element*>(child);
- if (HTMLElement::isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
+ // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
+ if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
isNamedItem = false;
} else if (child->isTextNode()) {
if (!static_cast<Text*>(child)->containsOnlyWhitespace())
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list