Commit bf4dcbab authored by abarth@webkit.org's avatar abarth@webkit.org

2010-08-24 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Delete HTMLElement::checkDTD
        https://bugs.webkit.org/show_bug.cgi?id=44563

        This function existed to service the LegacyHTMLTreeBuilder.  The new
        HTMLTreeBuilder has this logic internalized.  Pulling on this thread
        caused me to remove a legacyParserAddChild and to discover some code
        that shouldn't be calling these parser-specific APIs.

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::parserAddChild):
        (WebCore::ContainerNode::deprecatedParserAddChild):
        * dom/ContainerNode.h:
        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::createDocument):
        * dom/Node.cpp:
        (WebCore::Node::deprecatedParserAddChild):
        * dom/Node.h:
        * dom/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::enterText):
        * dom/XMLDocumentParser.h:
        * dom/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::startElementNs):
        (WebCore::XMLDocumentParser::characters):
        (WebCore::XMLDocumentParser::processingInstruction):
        (WebCore::XMLDocumentParser::cdataBlock):
        (WebCore::XMLDocumentParser::comment):
        (WebCore::XMLDocumentParser::internalSubset):
        * dom/XMLDocumentParserQt.cpp:
        (WebCore::XMLDocumentParser::parse):
        (WebCore::XMLDocumentParser::parseStartElement):
        (WebCore::XMLDocumentParser::parseCharacters):
        (WebCore::XMLDocumentParser::parseProcessingInstruction):
        (WebCore::XMLDocumentParser::parseCdata):
        (WebCore::XMLDocumentParser::parseComment):
        (WebCore::XMLDocumentParser::parseDtd):
        * html/HTMLDataGridElement.cpp:
        * html/HTMLDataGridElement.h:
        * html/HTMLDataGridRowElement.cpp:
        * html/HTMLDataGridRowElement.h:
        * html/HTMLDataListElement.cpp:
        * html/HTMLDataListElement.h:
        * html/HTMLDocument.cpp:
        * html/HTMLDocument.h:
        * html/HTMLElement.cpp:
        * html/HTMLElement.h:
        * html/HTMLFieldSetElement.cpp:
        * html/HTMLFieldSetElement.h:
        * html/HTMLFrameSetElement.cpp:
        * html/HTMLFrameSetElement.h:
        * html/HTMLHeadElement.cpp:
        * html/HTMLHeadElement.h:
        * html/HTMLHeadingElement.cpp:
        * html/HTMLHeadingElement.h:
        * html/HTMLHtmlElement.cpp:
        * html/HTMLHtmlElement.h:
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::HTMLKeygenElement):
        * html/HTMLMapElement.cpp:
        * html/HTMLMapElement.h:
        * html/HTMLMediaElement.cpp:
        * html/HTMLMediaElement.h:
        * html/HTMLNoScriptElement.cpp:
        * html/HTMLNoScriptElement.h:
        * html/HTMLOptGroupElement.cpp:
        * html/HTMLOptGroupElement.h:
        * html/HTMLOptionElement.cpp:
        * html/HTMLOptionElement.h:
        * html/HTMLParagraphElement.cpp:
        * html/HTMLParagraphElement.h:
        * html/HTMLPlugInElement.cpp:
        * html/HTMLPlugInElement.h:
        * html/HTMLScriptElement.h:
        * html/HTMLSelectElement.cpp:
        * html/HTMLSelectElement.h:
        * html/HTMLStyleElement.h:
        * html/HTMLTableColElement.cpp:
        * html/HTMLTableColElement.h:
        * html/HTMLTableElement.cpp:
        * html/HTMLTableElement.h:
        * html/HTMLTableRowElement.cpp:
        * html/HTMLTableRowElement.h:
        * html/HTMLTableSectionElement.cpp:
        * html/HTMLTableSectionElement.h:
        * html/HTMLTextAreaElement.h:
        * html/HTMLTitleElement.h:
        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlElement::attachToParent):
        (WebCore::MediaControlInputElement::attachToParent):
        * rendering/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerElement::attachInnerElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 671ea2ea
2010-08-24 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Delete HTMLElement::checkDTD
https://bugs.webkit.org/show_bug.cgi?id=44563
This function existed to service the LegacyHTMLTreeBuilder. The new
HTMLTreeBuilder has this logic internalized. Pulling on this thread
caused me to remove a legacyParserAddChild and to discover some code
that shouldn't be calling these parser-specific APIs.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserAddChild):
(WebCore::ContainerNode::deprecatedParserAddChild):
* dom/ContainerNode.h:
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* dom/Node.cpp:
(WebCore::Node::deprecatedParserAddChild):
* dom/Node.h:
* dom/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::enterText):
* dom/XMLDocumentParser.h:
* dom/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::characters):
(WebCore::XMLDocumentParser::processingInstruction):
(WebCore::XMLDocumentParser::cdataBlock):
(WebCore::XMLDocumentParser::comment):
(WebCore::XMLDocumentParser::internalSubset):
* dom/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::parse):
(WebCore::XMLDocumentParser::parseStartElement):
(WebCore::XMLDocumentParser::parseCharacters):
(WebCore::XMLDocumentParser::parseProcessingInstruction):
(WebCore::XMLDocumentParser::parseCdata):
(WebCore::XMLDocumentParser::parseComment):
(WebCore::XMLDocumentParser::parseDtd):
* html/HTMLDataGridElement.cpp:
* html/HTMLDataGridElement.h:
* html/HTMLDataGridRowElement.cpp:
* html/HTMLDataGridRowElement.h:
* html/HTMLDataListElement.cpp:
* html/HTMLDataListElement.h:
* html/HTMLDocument.cpp:
* html/HTMLDocument.h:
* html/HTMLElement.cpp:
* html/HTMLElement.h:
* html/HTMLFieldSetElement.cpp:
* html/HTMLFieldSetElement.h:
* html/HTMLFrameSetElement.cpp:
* html/HTMLFrameSetElement.h:
* html/HTMLHeadElement.cpp:
* html/HTMLHeadElement.h:
* html/HTMLHeadingElement.cpp:
* html/HTMLHeadingElement.h:
* html/HTMLHtmlElement.cpp:
* html/HTMLHtmlElement.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement):
* html/HTMLMapElement.cpp:
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
* html/HTMLMediaElement.h:
* html/HTMLNoScriptElement.cpp:
* html/HTMLNoScriptElement.h:
* html/HTMLOptGroupElement.cpp:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
* html/HTMLOptionElement.h:
* html/HTMLParagraphElement.cpp:
* html/HTMLParagraphElement.h:
* html/HTMLPlugInElement.cpp:
* html/HTMLPlugInElement.h:
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* html/HTMLStyleElement.h:
* html/HTMLTableColElement.cpp:
* html/HTMLTableColElement.h:
* html/HTMLTableElement.cpp:
* html/HTMLTableElement.h:
* html/HTMLTableRowElement.cpp:
* html/HTMLTableRowElement.h:
* html/HTMLTableSectionElement.cpp:
* html/HTMLTableSectionElement.h:
* html/HTMLTextAreaElement.h:
* html/HTMLTitleElement.h:
* rendering/MediaControlElements.cpp:
(WebCore::MediaControlElement::attachToParent):
(WebCore::MediaControlInputElement::attachToParent):
* rendering/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::attachInnerElement):
2010-08-24 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
......@@ -588,7 +588,7 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
return true;
}
void ContainerNode::addChildCommon(Node* newChild)
void ContainerNode::parserAddChild(PassRefPtr<Node> newChild)
{
ASSERT(newChild);
ASSERT(!newChild->parent()); // Use appendChild if you need to handle reparenting (and want DOM mutation events).
......@@ -596,7 +596,7 @@ void ContainerNode::addChildCommon(Node* newChild)
forbidEventDispatch();
Node* last = m_lastChild;
// FIXME: This method should take a PassRefPtr.
appendChildToContainer<Node, ContainerNode>(newChild, this);
appendChildToContainer<Node, ContainerNode>(newChild.get(), this);
allowEventDispatch();
// FIXME: Why doesn't this use notifyChildInserted(newChild) instead?
......@@ -606,25 +606,9 @@ void ContainerNode::addChildCommon(Node* newChild)
childrenChanged(true, last, 0, 1);
}
void ContainerNode::parserAddChild(PassRefPtr<Node> newChild)
{
ASSERT(newChild);
addChildCommon(newChild.get());
}
ContainerNode* ContainerNode::legacyParserAddChild(PassRefPtr<Node> newChild)
void ContainerNode::deprecatedParserAddChild(PassRefPtr<Node> node)
{
ASSERT(newChild);
// Check for consistency with DTD, but only when parsing HTML.
if (document()->isHTMLDocument() && !childAllowed(newChild.get()))
return 0;
addChildCommon(newChild.get());
if (newChild->isElementNode())
return static_cast<ContainerNode*>(newChild.get());
return this;
parserAddChild(node);
}
void ContainerNode::suspendPostAttachCallbacks()
......
......@@ -51,7 +51,6 @@ public:
// These methods are only used during parsing.
// They don't send DOM mutation events or handle reparenting.
// However, arbitrary code may be run by beforeload handlers.
virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>);
void parserAddChild(PassRefPtr<Node>);
void parserRemoveChild(Node*);
void parserInsertBefore(PassRefPtr<Node> newChild, Node* refChild);
......@@ -100,8 +99,12 @@ protected:
void setLastChild(Node* child) { m_lastChild = child; }
private:
// FIXME: This should take a PassRefPtr.
void addChildCommon(Node*);
// Never call this function directly. If you're trying to call this
// function, your code is either wrong or you're supposed to call
// parserAddChild. Please do not call parserAddChild unless you are the
// parser!
virtual void deprecatedParserAddChild(PassRefPtr<Node>);
void removeBetween(Node* previousChild, Node* nextChild, Node* oldChild);
void insertBeforeCommon(Node* nextChild, Node* oldChild);
......
......@@ -258,9 +258,9 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR
// FIXME: Shouldn't this call appendChild instead?
if (doctype)
doc->legacyParserAddChild(doctype);
doc->parserAddChild(doctype);
if (documentElement)
doc->legacyParserAddChild(documentElement.release());
doc->parserAddChild(documentElement.release());
return doc.release();
}
......
......@@ -641,9 +641,8 @@ const AtomicString& Node::virtualNamespaceURI() const
return nullAtom;
}
ContainerNode* Node::legacyParserAddChild(PassRefPtr<Node>)
void Node::deprecatedParserAddChild(PassRefPtr<Node>)
{
return 0;
}
bool Node::isContentEditable() const
......@@ -1225,11 +1224,6 @@ bool Node::contains(const Node* node) const
return this == node || node->isDescendantOf(this);
}
bool Node::childAllowed(Node* newChild)
{
return childTypeAllowed(newChild->nodeType());
}
void Node::attach()
{
ASSERT(!attached());
......
......@@ -258,11 +258,9 @@ public:
Element* rootEditableElement() const;
bool inSameContainingBlockFlowElement(Node*);
// Used by the parser. Checks against the DTD, unlike DOM operations like appendChild().
// Also does not dispatch DOM mutation events.
// Returns the appropriate container node for future insertions as you parse, or 0 for failure.
virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>);
// FIXME: All callers of this function are almost certainly wrong!
virtual void deprecatedParserAddChild(PassRefPtr<Node>);
// Called by the parser when this element's close tag is reached,
// signaling that all child tags have been parsed and added.
......@@ -423,11 +421,9 @@ public:
bool isDescendantOf(const Node*) const;
bool contains(const Node*) const;
// These two methods are mutually exclusive. The former is used to do strict error-checking
// when adding children via the public DOM API (e.g., appendChild()). The latter is called only when parsing,
// to sanity-check against the DTD for error recovery.
// This method is used to do strict error-checking when adding children via
// the public DOM API (e.g., appendChild()).
void checkAddChild(Node* newChild, ExceptionCode&); // Error-checking when adding via the DOM API
virtual bool childAllowed(Node* newChild); // Error-checking during parsing that checks the DTD
void checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode&);
virtual bool canReplaceChild(Node* newChild, Node* oldChild);
......
......@@ -170,16 +170,14 @@ void XMLDocumentParser::handleError(ErrorType type, const char* m, int lineNumbe
stopParsing();
}
bool XMLDocumentParser::enterText()
void XMLDocumentParser::enterText()
{
#if !USE(QXMLSTREAM)
ASSERT(m_bufferedText.size() == 0);
#endif
RefPtr<Node> newNode = Text::create(document(), "");
if (!m_currentNode->legacyParserAddChild(newNode.get()))
return false;
m_currentNode->deprecatedParserAddChild(newNode.get());
pushCurrentNode(newNode.get());
return true;
}
#if !USE(QXMLSTREAM)
......
......@@ -166,7 +166,7 @@ public:
void insertErrorMessageBlock();
bool enterText();
void enterText();
void exitText();
void doWrite(const String&);
......
......@@ -808,10 +808,7 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
if (scriptElement)
m_scriptStartLine = lineNumber();
if (!m_currentNode->legacyParserAddChild(newElement.get())) {
stopParsing();
return;
}
m_currentNode->deprecatedParserAddChild(newElement.get());
pushCurrentNode(newElement.get());
if (m_view && !newElement->attached())
......@@ -915,8 +912,9 @@ void XMLDocumentParser::characters(const xmlChar* s, int len)
return;
}
if (m_currentNode->isTextNode() || enterText())
m_bufferedText.append(s, len);
if (!m_currentNode->isTextNode())
enterText();
m_bufferedText.append(s, len);
}
void XMLDocumentParser::error(ErrorType type, const char* message, va_list args)
......@@ -964,8 +962,7 @@ void XMLDocumentParser::processingInstruction(const xmlChar* target, const xmlCh
pi->setCreatedByParser(true);
if (!m_currentNode->legacyParserAddChild(pi.get()))
return;
m_currentNode->deprecatedParserAddChild(pi.get());
if (m_view && !pi->attached())
pi->attach();
......@@ -991,8 +988,7 @@ void XMLDocumentParser::cdataBlock(const xmlChar* s, int len)
exitText();
RefPtr<Node> newNode = CDATASection::create(document(), toString(s, len));
if (!m_currentNode->legacyParserAddChild(newNode.get()))
return;
m_currentNode->deprecatedParserAddChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
}
......@@ -1010,7 +1006,7 @@ void XMLDocumentParser::comment(const xmlChar* s)
exitText();
RefPtr<Node> newNode = Comment::create(document(), toString(s));
m_currentNode->legacyParserAddChild(newNode.get());
m_currentNode->deprecatedParserAddChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
}
......@@ -1074,7 +1070,7 @@ void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* exter
}
#endif
document()->legacyParserAddChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID)));
document()->parserAddChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID)));
}
}
......
......@@ -410,12 +410,12 @@ void XMLDocumentParser::parse()
) {
QString entity = m_stream.name().toString();
UChar c = decodeNamedEntity(entity.toUtf8().constData());
if (m_currentNode->isTextNode() || enterText()) {
ExceptionCode ec = 0;
String str(&c, 1);
//qDebug()<<" ------- adding entity "<<str;
static_cast<Text*>(m_currentNode)->appendData(str, ec);
}
if (!m_currentNode->isTextNode())
enterText();
ExceptionCode ec = 0;
String str(&c, 1);
// qDebug()<<" ------- adding entity "<<str;
static_cast<Text*>(m_currentNode)->appendData(str, ec);
}
}
break;
......@@ -518,10 +518,7 @@ void XMLDocumentParser::parseStartElement()
if (scriptElement)
m_scriptStartLine = lineNumber();
if (!m_currentNode->legacyParserAddChild(newElement.get())) {
stopParsing();
return;
}
m_currentNode->parserAddChild(newElement.get());
pushCurrentNode(newElement.get());
if (m_view && !newElement->attached())
......@@ -599,10 +596,10 @@ void XMLDocumentParser::parseEndElement()
void XMLDocumentParser::parseCharacters()
{
if (m_currentNode->isTextNode() || enterText()) {
ExceptionCode ec = 0;
static_cast<Text*>(m_currentNode)->appendData(m_stream.text(), ec);
}
if (!m_currentNode->isTextNode())
enterText();
ExceptionCode ec = 0;
static_cast<Text*>(m_currentNode)->appendData(m_stream.text(), ec);
}
void XMLDocumentParser::parseProcessingInstruction()
......@@ -619,8 +616,7 @@ void XMLDocumentParser::parseProcessingInstruction()
pi->setCreatedByParser(true);
if (!m_currentNode->legacyParserAddChild(pi.get()))
return;
m_currentNode->parserAddChild(pi.get());
if (m_view && !pi->attached())
pi->attach();
......@@ -638,8 +634,8 @@ void XMLDocumentParser::parseCdata()
exitText();
RefPtr<Node> newNode = CDATASection::create(document(), m_stream.text());
if (!m_currentNode->legacyParserAddChild(newNode.get()))
return;
m_currentNode->parserAddChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
}
......@@ -649,7 +645,8 @@ void XMLDocumentParser::parseComment()
exitText();
RefPtr<Node> newNode = Comment::create(document(), m_stream.text());
m_currentNode->legacyParserAddChild(newNode.get());
m_currentNode->parserAddChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
}
......@@ -708,7 +705,7 @@ void XMLDocumentParser::parseDtd()
handleError(fatal, "Invalid DTD Public ID", lineNumber(), columnNumber());
#endif
if (!m_parsingFragment)
document()->legacyParserAddChild(DocumentType::create(document(), name, publicId, systemId));
document()->parserAddChild(DocumentType::create(document(), name, publicId, systemId));
}
}
......
......@@ -55,13 +55,6 @@ HTMLDataGridElement::~HTMLDataGridElement()
m_columns->clearDataGrid();
}
bool HTMLDataGridElement::checkDTD(const Node* newChild)
{
if (newChild->isTextNode())
return static_cast<const Text*>(newChild)->containsOnlyWhitespace();
return newChild->hasTagName(dcolTag) || newChild->hasTagName(drowTag);
}
RenderObject* HTMLDataGridElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderDataGrid(this);
......
......@@ -56,8 +56,6 @@ public:
private:
HTMLDataGridElement(const QualifiedName&, Document*);
virtual bool checkDTD(const Node*);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
RefPtr<DataGridDataSource> m_dataSource;
......
......@@ -45,13 +45,6 @@ PassRefPtr<HTMLDataGridRowElement> HTMLDataGridRowElement::create(const Qualifie
return adoptRef(new HTMLDataGridRowElement(name, document));
}
bool HTMLDataGridRowElement::checkDTD(const Node* newChild)
{
if (newChild->isTextNode())
return static_cast<const Text*>(newChild)->containsOnlyWhitespace();
return newChild->hasTagName(drowTag) || newChild->hasTagName(dcellTag);
}
bool HTMLDataGridRowElement::selected() const
{
return hasAttribute(selectedAttr);
......
......@@ -47,8 +47,6 @@ public:
private:
HTMLDataGridRowElement(const QualifiedName&, Document*);
virtual bool checkDTD(const Node*);
};
} // namespace WebCore
......
......@@ -47,11 +47,6 @@ PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(const QualifiedName&
return adoptRef(new HTMLDataListElement(tagName, document));
}
bool HTMLDataListElement::checkDTD(const Node* newChild)
{
return newChild->hasTagName(HTMLNames::optionTag) || HTMLElement::inInlineTagList(newChild);
}
PassRefPtr<HTMLCollection> HTMLDataListElement::options()
{
return HTMLCollection::create(this, DataListOptions);
......
......@@ -47,8 +47,6 @@ public:
private:
HTMLDataListElement(const QualifiedName&, Document*);
virtual bool checkDTD(const Node*);
};
} // namespace WebCore
......
......@@ -296,11 +296,6 @@ PassRefPtr<DocumentParser> HTMLDocument::createParser()
// not part of the DOM
// --------------------------------------------------------------------------
bool HTMLDocument::childAllowed(Node *newChild)
{
return newChild->hasTagName(htmlTag) || newChild->isCommentNode() || (newChild->nodeType() == DOCUMENT_TYPE_NODE && !doctype());
}
PassRefPtr<Element> HTMLDocument::createElement(const AtomicString& name, ExceptionCode& ec)
{
if (!isValidName(name)) {
......
......@@ -83,8 +83,6 @@ protected:
HTMLDocument(Frame*, const KURL&);
private:
virtual bool childAllowed(Node*);
virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);
virtual bool isFrameSet() const;
......
......@@ -753,34 +753,9 @@ PassRefPtr<HTMLCollection> HTMLElement::children()
return HTMLCollection::create(this, NodeChildren);
}
// DOM Section 1.1.1
bool HTMLElement::childAllowed(Node *newChild)
{
if (!Element::childAllowed(newChild))
return false;
// For XML documents, we are non-validating and do not check against a DTD, even for HTML elements.
if (!document()->isHTMLDocument())
return true;
// Future-proof for XML content inside HTML documents (we may allow this some day).
if (newChild->isElementNode() && !newChild->isHTMLElement())
return true;
// Elements with forbidden tag status can never have children
if (endTagRequirement() == TagStatusForbidden)
return false;
// Comment nodes are always allowed.
if (newChild->isCommentNode())
return true;
// Now call checkDTD.
return checkDTD(newChild);
}
// 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, ());
......@@ -979,13 +954,6 @@ bool HTMLElement::inBlockTagList(const Node* newChild)
return false;
}
bool HTMLElement::checkDTD(const Node* newChild)
{
if (hasLocalName(addressTag) && newChild->hasTagName(pTag))
return true;
return inEitherTagList(newChild);
}
bool HTMLElement::rendererIsNeeded(RenderStyle *style)
{
#if !ENABLE(XHTMLMP)
......
......@@ -89,11 +89,6 @@ protected:
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
virtual void parseMappedAttribute(Attribute*);
virtual bool childAllowed(Node* newChild); // Error-checking during parsing that checks the DTD
// Helper function to check the DTD for a given child node.
virtual bool checkDTD(const Node*);
static bool inEitherTagList(const Node*);
static bool inInlineTagList(const Node*);
static bool inBlockTagList(const Node*);
......
......@@ -44,11 +44,6 @@ PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(const QualifiedName&
return adoptRef(new HTMLFieldSetElement(tagName, document, form));
}
bool HTMLFieldSetElement::checkDTD(const Node* newChild)
{
return newChild->hasTagName(legendTag) || HTMLElement::checkDTD(newChild);
}
bool HTMLFieldSetElement::supportsFocus() const
{
return HTMLElement::supportsFocus();
......
......@@ -35,8 +35,6 @@ public:
private:
HTMLFieldSetElement(const QualifiedName&, Document*, HTMLFormElement*);
virtual bool checkDTD(const Node* newChild);
virtual bool supportsFocus() const;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual const AtomicString& formControlType() const;
......
......@@ -59,15 +59,6 @@ PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(const QualifiedName&
return adoptRef(new HTMLFrameSetElement(tagName, document));
}
bool HTMLFrameSetElement::checkDTD(const Node* newChild)
{
// FIXME: Old code had adjacent double returns and seemed to want to do something with NOFRAMES (but didn't).
// What is the correct behavior?
if (newChild->isTextNode())
return static_cast<const Text*>(newChild)->containsOnlyWhitespace();
return newChild->hasTagName(framesetTag) || newChild->hasTagName(frameTag);
}
bool HTMLFrameSetElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
if (attrName == bordercolorAttr) {
......
......@@ -68,7 +68,6 @@ private:
HTMLFrameSetElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual bool checkDTD(const Node* newChild);
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
virtual void parseMappedAttribute(Attribute*);
......
......@@ -47,21 +47,4 @@ PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(const QualifiedName& tagName
return adoptRef(new HTMLHeadElement(tagName, document));
}
bool HTMLHeadElement::childAllowed(Node* newChild)