From dd8bb3de4f353a81954234999f1fea748aee2ea9 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Wed, 11 Aug 2010 14:44:44 +0100 Subject: Merge WebKit at r65072 : Initial merge by git. Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585 --- WebCore/html/HTMLElementStack.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'WebCore/html/HTMLElementStack.cpp') diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp index 531a3b4..194753b 100644 --- a/WebCore/html/HTMLElementStack.cpp +++ b/WebCore/html/HTMLElementStack.cpp @@ -138,6 +138,23 @@ HTMLElementStack::~HTMLElementStack() { } +bool HTMLElementStack::hasOnlyOneElement() const +{ + return !topRecord()->next(); +} + +bool HTMLElementStack::secondElementIsHTMLBodyElement() const +{ + // This is used the fragment case of and in the "in body" + // insertion mode. + // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody + ASSERT(m_htmlElement); + // If we have a body element, it must always be the second element on the + // stack, as we always start with an html element, and any other element + // would cause the implicit creation of a body element. + return !!m_bodyElement; +} + void HTMLElementStack::popHTMLHeadElement() { ASSERT(top() == m_headElement); -- cgit v1.1