[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 11:32:40 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e0cd6d0c7fe02bbcfdff4c4efa2787672b2cfa19
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 28 22:31:36 2010 +0000
2010-07-28 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Update numbered header element closing to match recent spec change
https://bugs.webkit.org/show_bug.cgi?id=43072
* html5lib/runner-expected-html5.txt:
2010-07-28 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Update numbered header element closing to match recent spec change
https://bugs.webkit.org/show_bug.cgi?id=43072
Pretty straightforward transcription of the spec change.
* html/HTMLElementStack.cpp:
(WebCore::HTMLNames::isNumberedHeaderElement):
(WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped):
(WebCore::HTMLElementStack::hasOnlyHTMLElementsInScope):
(WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
* html/HTMLElementStack.h:
* html/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 859f939..91588cb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-28 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update numbered header element closing to match recent spec change
+ https://bugs.webkit.org/show_bug.cgi?id=43072
+
+ * html5lib/runner-expected-html5.txt:
+
2010-07-28 Eric Seidel <eric at webkit.org>
No review. Skipping test to restore peace and justice.
diff --git a/LayoutTests/html5lib/runner-expected-html5.txt b/LayoutTests/html5lib/runner-expected-html5.txt
index 892a563..3a5442b 100644
--- a/LayoutTests/html5lib/runner-expected-html5.txt
+++ b/LayoutTests/html5lib/runner-expected-html5.txt
@@ -161,8 +161,6 @@ resources/tests17.dat: PASS
resources/tests18.dat: PASS
resources/tests19.dat:
-22
-24
63
77
78
@@ -171,49 +169,6 @@ resources/tests19.dat:
101
102
-Test 22 of 102 in resources/tests19.dat failed. Input:
-<!doctype html><h1><div><h3><span></h1>foo
-Got:
-| <!DOCTYPE html>
-| <html>
-| <head>
-| <body>
-| <h1>
-| <div>
-| <h3>
-| <span>
-| "foo"
-Expected:
-| <!DOCTYPE html>
-| <html>
-| <head>
-| <body>
-| <h1>
-| <div>
-| <h3>
-| <span>
-| "foo"
-
-Test 24 of 102 in resources/tests19.dat failed. Input:
-<!doctype html><h3><li>abc</h2>foo
-Got:
-| <!DOCTYPE html>
-| <html>
-| <head>
-| <body>
-| <h3>
-| <li>
-| "abcfoo"
-Expected:
-| <!DOCTYPE html>
-| <html>
-| <head>
-| <body>
-| <h3>
-| <li>
-| "abc"
-| "foo"
-
Test 63 of 102 in resources/tests19.dat failed. Input:
<!doctype html><keygen><frameset>
Got:
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9b9e727..2e5945f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-28 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update numbered header element closing to match recent spec change
+ https://bugs.webkit.org/show_bug.cgi?id=43072
+
+ Pretty straightforward transcription of the spec change.
+
+ * html/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isNumberedHeaderElement):
+ (WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped):
+ (WebCore::HTMLElementStack::hasOnlyHTMLElementsInScope):
+ (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
+ * html/HTMLElementStack.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+
2010-07-28 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp
index 75ae751..531a3b4 100644
--- a/WebCore/html/HTMLElementStack.cpp
+++ b/WebCore/html/HTMLElementStack.cpp
@@ -40,6 +40,16 @@ using namespace HTMLNames;
namespace {
+inline bool isNumberedHeaderElement(Element* element)
+{
+ return element->hasTagName(h1Tag)
+ || element->hasTagName(h2Tag)
+ || element->hasTagName(h3Tag)
+ || element->hasTagName(h4Tag)
+ || element->hasTagName(h5Tag)
+ || element->hasTagName(h6Tag);
+}
+
inline bool isScopeMarker(Element* element)
{
return element->hasTagName(appletTag)
@@ -180,6 +190,13 @@ void HTMLElementStack::popUntilPopped(const AtomicString& tagName)
pop();
}
+void HTMLElementStack::popUntilNumberedHeaderElementPopped()
+{
+ while (!isNumberedHeaderElement(top()))
+ pop();
+ pop();
+}
+
void HTMLElementStack::popUntil(Element* element)
{
while (top() != element)
@@ -367,6 +384,19 @@ bool HTMLElementStack::hasOnlyHTMLElementsInScope() const
return true;
}
+bool HTMLElementStack::hasNumberedHeaderElementInScope() const
+{
+ for (ElementRecord* record = m_top.get(); record; record = record->next()) {
+ Element* element = record->element();
+ if (isNumberedHeaderElement(element))
+ return true;
+ if (isScopeMarker(element))
+ return false;
+ }
+ ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
+ return false;
+}
+
bool HTMLElementStack::inScope(Element* targetElement) const
{
for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) {
diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/HTMLElementStack.h
index 7fc4043..62d031f 100644
--- a/WebCore/html/HTMLElementStack.h
+++ b/WebCore/html/HTMLElementStack.h
@@ -94,6 +94,7 @@ public:
void popUntil(Element*);
void popUntilPopped(const AtomicString& tagName);
void popUntilPopped(Element*);
+ void popUntilNumberedHeaderElementPopped();
void popUntilTableScopeMarker(); // "clear the stack back to a table context" in the spec.
void popUntilTableBodyScopeMarker(); // "clear the stack back to a table body context" in the spec.
void popUntilTableRowScopeMarker(); // "clear the stack back to a table row context" in the spec.
@@ -118,6 +119,7 @@ public:
bool inButtonScope(const QualifiedName&) const;
bool hasOnlyHTMLElementsInScope() const;
+ bool hasNumberedHeaderElementInScope() const;
Element* htmlElement() const;
Element* headElement() const;
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 0a5c859..ec15f9f 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -2008,14 +2008,14 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
return;
}
if (isNumberedHeaderTag(token.name())) {
- if (!m_tree.openElements()->inScope(token.name())) {
+ if (!m_tree.openElements()->hasNumberedHeaderElementInScope()) {
parseError(token);
return;
}
m_tree.generateImpliedEndTags();
if (!m_tree.currentElement()->hasLocalName(token.name()))
parseError(token);
- m_tree.openElements()->popUntilPopped(token.name());
+ m_tree.openElements()->popUntilNumberedHeaderElementPopped();
return;
}
if (token.name() == "sarcasm") {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list