[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:24:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c7b199df9c23cb87a482ba35164e034bcd9f7da3
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 22 01:00:46 2010 +0000

    2010-07-21  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            HTMLTreeBuilder needs to update to match new spec behavior for <button>
            https://bugs.webkit.org/show_bug.cgi?id=42233
    
            The spec has some typos in this area, but this is my best guess for
            what Ian means.  I've filed bugs against the spec for each typo.
    
            * html/HTMLElementStack.cpp:
            (WebCore::HTMLNames::isScopeMarker):
            (WebCore::HTMLNames::isButtonScopeMarker):
            (WebCore::HTMLElementStack::inButtonScope):
            * html/HTMLElementStack.h:
            * html/HTMLTreeBuilder.cpp:
            (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
            (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
            (WebCore::HTMLTreeBuilder::processStartTagForInBody):
            (WebCore::HTMLTreeBuilder::processEndTagForInBody):
            * html/HTMLTreeBuilder.h:
    2010-07-21  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            HTMLTreeBuilder needs to update to match new spec behavior for <button>
            https://bugs.webkit.org/show_bug.cgi?id=42233
    
            Test progression.  There's one regression mixed in here.  I'll
            investigate in the next patch.
    
            * html5lib/runner-expected-html5.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63868 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1cdd81c..77e83b2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-21  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        HTMLTreeBuilder needs to update to match new spec behavior for <button>
+        https://bugs.webkit.org/show_bug.cgi?id=42233
+
+        Test progression.  There's one regression mixed in here.  I'll
+        investigate in the next patch.
+
+        * html5lib/runner-expected-html5.txt:
+
 2010-07-21  Justin Schuh  <jschuh at chromium.org>
 
         Unreviewed. Build fix.
diff --git a/LayoutTests/html5lib/runner-expected-html5.txt b/LayoutTests/html5lib/runner-expected-html5.txt
index d9eb5f2..f010234 100644
--- a/LayoutTests/html5lib/runner-expected-html5.txt
+++ b/LayoutTests/html5lib/runner-expected-html5.txt
@@ -10,44 +10,8 @@ CONSOLE MESSAGE: line 1: SyntaxError: Parse error
 CONSOLE MESSAGE: line 2: PASS
 CONSOLE MESSAGE: line 2: FOO<span>BAR</span>BAZ
 Content-Type: text/plain
-resources/tests1.dat:
-24
-98
-
-Test 24 of 114 in resources/tests1.dat failed. Input:
-<b><button>foo</b>bar
-Got:
-| <html>
-|   <head>
-|   <body>
-|     <b>
-|       <button>
-|         "foobar"
-Expected:
-| <html>
-|   <head>
-|   <body>
-|     <b>
-|     <button>
-|       <b>
-|         "foo"
-|       "bar"
+resources/tests1.dat: PASS
 
-Test 98 of 114 in resources/tests1.dat failed. Input:
-<b><button></b></button></b>
-Got:
-| <html>
-|   <head>
-|   <body>
-|     <b>
-|       <button>
-Expected:
-| <html>
-|   <head>
-|   <body>
-|     <b>
-|     <button>
-|       <b>
 resources/tests2.dat: PASS
 
 resources/tests3.dat: PASS
@@ -467,48 +431,29 @@ Expected:
 |       <article>
 |     "a"
 resources/tests20.dat:
-20
-21
+16
 24
 25
 
-Test 20 of 25 in resources/tests20.dat failed. Input:
-<!doctype html><address><button></address>a
+Test 16 of 25 in resources/tests20.dat failed. Input:
+<!doctype html><p><button><table>
 Got:
 | <!DOCTYPE html>
 | <html>
 |   <head>
 |   <body>
-|     <address>
-|       <button>
-|         "a"
-Expected:
-| <!DOCTYPE html>
-| <html>
-|   <head>
-|   <body>
-|     <address>
-|       <button>
-|     "a"
-
-Test 21 of 25 in resources/tests20.dat failed. Input:
-<!doctype html><address><button></address>a
-Got:
-| <!DOCTYPE html>
-| <html>
-|   <head>
-|   <body>
-|     <address>
+|     <p>
 |       <button>
-|         "a"
+|         <p>
+|         <table>
 Expected:
 | <!DOCTYPE html>
 | <html>
 |   <head>
 |   <body>
-|     <address>
+|     <p>
 |       <button>
-|     "a"
+|         <table>
 
 Test 24 of 25 in resources/tests20.dat failed. Input:
 <!doctype html><p><figcaption>
@@ -888,30 +833,8 @@ resources/entities02.dat: PASS
 resources/comments01.dat: PASS
 
 resources/adoption01.dat:
-3
 12
 
-Test 3 of 12 in resources/adoption01.dat failed. Input:
-<a>1<button>2</a>3</button>
-Got:
-| <html>
-|   <head>
-|   <body>
-|     <a>
-|       "1"
-|       <button>
-|         "23"
-Expected:
-| <html>
-|   <head>
-|   <body>
-|     <a>
-|       "1"
-|     <button>
-|       <a>
-|         "2"
-|       "3"
-
 Test 12 of 12 in resources/adoption01.dat failed. Input:
 <table>A<td>B</td>C</table>
 Got:
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3aa7b8c..86a2118 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-21  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        HTMLTreeBuilder needs to update to match new spec behavior for <button>
+        https://bugs.webkit.org/show_bug.cgi?id=42233
+
+        The spec has some typos in this area, but this is my best guess for
+        what Ian means.  I've filed bugs against the spec for each typo.
+
+        * html/HTMLElementStack.cpp:
+        (WebCore::HTMLNames::isScopeMarker):
+        (WebCore::HTMLNames::isButtonScopeMarker):
+        (WebCore::HTMLElementStack::inButtonScope):
+        * html/HTMLElementStack.h:
+        * html/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
+        (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
+        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+        (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+        * html/HTMLTreeBuilder.h:
+
 2010-07-21  Justin Schuh  <jschuh at chromium.org>
 
         Reviewed by Oliver Hunt.
diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp
index 5c325e5..f3e78f5 100644
--- a/WebCore/html/HTMLElementStack.cpp
+++ b/WebCore/html/HTMLElementStack.cpp
@@ -43,7 +43,6 @@ namespace {
 inline bool isScopeMarker(Element* element)
 {
     return element->hasTagName(appletTag)
-        || element->hasTagName(buttonTag)
         || element->hasTagName(captionTag)
 #if ENABLE(SVG_FOREIGN_OBJECT)
         || element->hasTagName(SVGNames::foreignObjectTag)
@@ -83,6 +82,12 @@ inline bool isTableRowScopeMarker(Element* element)
         || element->hasTagName(htmlTag);
 }
 
+inline bool isButtonScopeMarker(Element* element)
+{
+    return isScopeMarker(element)
+        || element->hasTagName(buttonTag);
+}
+
 }
 
 HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<Element> element, PassOwnPtr<ElementRecord> next)
@@ -414,6 +419,17 @@ bool HTMLElementStack::inTableScope(const QualifiedName& tagName) const
     return inTableScope(tagName.localName());
 }
 
+bool HTMLElementStack::inButtonScope(const AtomicString& targetTag) const
+{
+    return inScopeCommon<isButtonScopeMarker>(m_top.get(), targetTag);
+}
+
+bool HTMLElementStack::inButtonScope(const QualifiedName& tagName) const
+{
+    // FIXME: Is localName() right for non-html elements?
+    return inButtonScope(tagName.localName());
+}
+
 Element* HTMLElementStack::htmlElement() const
 {
     ASSERT(m_htmlElement);
diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/HTMLElementStack.h
index 830faf0..5969c80 100644
--- a/WebCore/html/HTMLElementStack.h
+++ b/WebCore/html/HTMLElementStack.h
@@ -107,6 +107,8 @@ public:
     bool inListItemScope(const QualifiedName&) const;
     bool inTableScope(const AtomicString& tagName) const;
     bool inTableScope(const QualifiedName&) const;
+    bool inButtonScope(const AtomicString& tagName) const;
+    bool inButtonScope(const QualifiedName&) const;
 
     bool hasOnlyHTMLElementsInScope() const;
 
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 93da3f7..13b6f5c 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -183,7 +183,6 @@ bool isSpecialTag(const AtomicString& tagName)
 bool isScopingTag(const AtomicString& tagName)
 {
     return tagName == appletTag
-        || tagName == buttonTag
         || tagName == captionTag
         || tagName == SVGNames::foreignObjectTag
         || tagName == htmlTag
@@ -572,9 +571,9 @@ void HTMLTreeBuilder::processFakeCharacters(const String& characters)
     processCharacterBuffer(buffer);
 }
 
-void HTMLTreeBuilder::processFakePEndTagIfPInScope()
+void HTMLTreeBuilder::processFakePEndTagIfPInButtonScope()
 {
-    if (!m_tree.openElements()->inScope(pTag.localName()))
+    if (!m_tree.openElements()->inButtonScope(pTag.localName()))
         return;
     AtomicHTMLToken endP(HTMLToken::EndTag, pTag.localName());
     processEndTag(endP);
@@ -654,7 +653,7 @@ void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken& token)
             break;
         nodeRecord = nodeRecord->next();
     }
-    processFakePEndTagIfPInScope();
+    processFakePEndTagIfPInButtonScope();
     m_tree.insertHTMLElement(token);
 }
 
@@ -820,12 +819,12 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
         || token.name() == pTag
         || token.name() == sectionTag
         || token.name() == ulTag) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.insertHTMLElement(token);
         return;
     }
     if (isNumberedHeaderTag(token.name())) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         if (isNumberedHeaderTag(m_tree.currentElement()->localName())) {
             parseError(token);
             m_tree.openElements()->pop();
@@ -834,7 +833,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
         return;
     }
     if (token.name() == preTag || token.name() == listingTag) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.insertHTMLElement(token);
         m_tokenizer->skipLeadingNewLineForListing();
         m_framesetOk = false;
@@ -845,7 +844,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
             parseError(token);
             return;
         }
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.insertHTMLFormElement(token);
         return;
     }
@@ -858,7 +857,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
         return;
     }
     if (token.name() == plaintextTag) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.insertHTMLElement(token);
         m_tokenizer->setState(HTMLTokenizer::PLAINTEXTState);
         return;
@@ -947,7 +946,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
         return;
     }
     if (token.name() == hrTag) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.insertSelfClosingHTMLElement(token);
         m_framesetOk = false;
         return;
@@ -966,7 +965,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
         return;
     }
     if (token.name() == xmpTag) {
-        processFakePEndTagIfPInScope();
+        processFakePEndTagIfPInButtonScope();
         m_tree.reconstructTheActiveFormattingElements();
         m_framesetOk = false;
         processGenericRawTextStartTag(token);
@@ -1973,7 +1972,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
         m_tree.openElements()->remove(node.get());
     }
     if (token.name() == pTag) {
-        if (!m_tree.openElements()->inScope(token.name())) {
+        if (!m_tree.openElements()->inButtonScope(token.name())) {
             parseError(token);
             processFakeStartTag(pTag);
             ASSERT(m_tree.openElements()->inScope(token.name()));
diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h
index 0f87cb0..735c9f3 100644
--- a/WebCore/html/HTMLTreeBuilder.h
+++ b/WebCore/html/HTMLTreeBuilder.h
@@ -140,7 +140,7 @@ private:
     void processFakeStartTag(const QualifiedName&, PassRefPtr<NamedNodeMap> attributes = 0);
     void processFakeEndTag(const QualifiedName&);
     void processFakeCharacters(const String&);
-    void processFakePEndTagIfPInScope();
+    void processFakePEndTagIfPInButtonScope();
 
     void processGenericRCDATAStartTag(AtomicHTMLToken&);
     void processGenericRawTextStartTag(AtomicHTMLToken&);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list