[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 01:05:28 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 97bbdadca7df1ec80c569a1c198df600182c0169
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 14 10:39:10 2010 +0000

    2010-01-14  Eric Seidel  <eric at webkit.org>
    
            No review, rolling out r53248.
            http://trac.webkit.org/changeset/53248
            https://bugs.webkit.org/show_bug.cgi?id=32641
    
            Caused 2 tests to crash on various bots:
            fast/dom/HTMLSelectElement/listbox-select-reset.html and
            fast/forms/listbox-typeahead-scroll.html
    
            * fast/forms/HTMLOptionElement_selected-expected.txt:
            * fast/forms/HTMLOptionElement_selected.html:
            * fast/forms/HTMLOptionElement_selected2-expected.txt: Removed.
            * fast/forms/HTMLOptionElement_selected2.html: Removed.
            * fast/forms/HTMLOptionElement_selected3-expected.txt: Removed.
            * fast/forms/HTMLOptionElement_selected3.html: Removed.
            * fast/forms/add-remove-option-modification-event-expected.txt:
    2010-01-14  Eric Seidel  <eric at webkit.org>
    
            No review, rolling out r53248.
            http://trac.webkit.org/changeset/53248
            https://bugs.webkit.org/show_bug.cgi?id=32641
    
            Caused 2 tests to crash on various bots:
            fast/dom/HTMLSelectElement/listbox-select-reset.html and
            fast/forms/listbox-typeahead-scroll.html
    
            * dom/SelectElement.cpp:
            (WebCore::SelectElement::recalcStyle):
            (WebCore::SelectElement::setRecalcListItems):
            (WebCore::SelectElement::recalcListItems):
            (WebCore::SelectElement::restoreFormControlState):
            (WebCore::SelectElement::reset):
            (WebCore::SelectElement::typeAheadFind):
            * dom/SelectElement.h:
            * html/HTMLOptionElement.cpp:
            (WebCore::HTMLOptionElement::selected):
            (WebCore::HTMLOptionElement::insertedIntoTree):
            * html/HTMLSelectElement.cpp:
            (WebCore::HTMLSelectElement::recalcStyle):
            * html/HTMLSelectElement.h:
            * wml/WMLSelectElement.cpp:
            (WebCore::WMLSelectElement::recalcStyle):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53252 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9813ab5..eba6cfc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-14  Eric Seidel  <eric at webkit.org>
+
+        No review, rolling out r53248.
+        http://trac.webkit.org/changeset/53248
+        https://bugs.webkit.org/show_bug.cgi?id=32641
+
+        Caused 2 tests to crash on various bots:
+        fast/dom/HTMLSelectElement/listbox-select-reset.html and
+        fast/forms/listbox-typeahead-scroll.html
+
+        * fast/forms/HTMLOptionElement_selected-expected.txt:
+        * fast/forms/HTMLOptionElement_selected.html:
+        * fast/forms/HTMLOptionElement_selected2-expected.txt: Removed.
+        * fast/forms/HTMLOptionElement_selected2.html: Removed.
+        * fast/forms/HTMLOptionElement_selected3-expected.txt: Removed.
+        * fast/forms/HTMLOptionElement_selected3.html: Removed.
+        * fast/forms/add-remove-option-modification-event-expected.txt:
+
 2010-01-14  Ben Murdoch  <benm at google.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected-expected.txt b/LayoutTests/fast/forms/HTMLOptionElement_selected-expected.txt
index 98b9087..7097cfe 100644
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected-expected.txt
+++ b/LayoutTests/fast/forms/HTMLOptionElement_selected-expected.txt
@@ -1,6 +1,5 @@
 The test below queries the selected property of the option. In both cases it should be selected, just as the result is when the select is visible. Bug 15088
 
 true
-0
 true
 
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected.html b/LayoutTests/fast/forms/HTMLOptionElement_selected.html
index 1c2d5f8..181bb59 100644
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected.html
+++ b/LayoutTests/fast/forms/HTMLOptionElement_selected.html
@@ -10,7 +10,7 @@
             var console = document.getElementById('console');
             var theOption = document.getElementById('theOption');
             console.innerHTML += theOption.selected + "<br>";
-            console.innerHTML += theOption.parentNode.selectedIndex + "<br>";
+            theOption.parentNode.selectedIndex;
             console.innerHTML += theOption.selected + "<br>";
         }
         </script>
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected2-expected.txt b/LayoutTests/fast/forms/HTMLOptionElement_selected2-expected.txt
deleted file mode 100644
index 1172b7a..0000000
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected2-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-This test checks that the selected property of an option is initialized correctly. https://bugs.webkit.org/show_bug.cgi?id=32641
-
-Before querying selectedIndex, [theOption].selected = true
-
-[theSelect].selectedIndex = 0
-
-After querying selectedIndex, [theOption].selected = true
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected2.html b/LayoutTests/fast/forms/HTMLOptionElement_selected2.html
deleted file mode 100644
index 876e51c..0000000
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected2.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <body>
-    <p>This test checks that the selected property of an option is initialized correctly. https://bugs.webkit.org/show_bug.cgi?id=32641</p>
-    <p>Before querying selectedIndex, [theOption].selected = <span id="logOne"></span></p>
-    <p>[theSelect].selectedIndex = <span id="logTwo"></span></p>
-    <p>After querying selectedIndex, [theOption].selected = <span id="logThree"></span></p>
-    <select id="theSelect" style="display:none">
-      <option id="theOption">lalala</option>
-    </select>
-    <script>
-      if (window.layoutTestController)
-        layoutTestController.dumpAsText();
-      var o = document.getElementById('theOption');
-      document.getElementById('logOne').textContent = o.selected;
-      document.getElementById('logTwo').textContent = document.getElementById('theSelect').selectedIndex;
-      document.getElementById('logThree').textContent = o.selected;
-    </script>
- </body>
-</html>
-
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected3-expected.txt b/LayoutTests/fast/forms/HTMLOptionElement_selected3-expected.txt
deleted file mode 100644
index eb9c128..0000000
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected3-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-This test checks that the selected property of an option is initialized correctly even prior to the </select> being parsed. https://bugs.webkit.org/show_bug.cgi?id=32641
-
-Before querying selectedIndex, [theOption].selected = true
-
-[theSelect].selectedIndex = 0
-
-After querying selectedIndex, [theOption].selected = true
diff --git a/LayoutTests/fast/forms/HTMLOptionElement_selected3.html b/LayoutTests/fast/forms/HTMLOptionElement_selected3.html
deleted file mode 100644
index 2520abe..0000000
--- a/LayoutTests/fast/forms/HTMLOptionElement_selected3.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <body>
-    <p>This test checks that the selected property of an option is initialized correctly even prior to the &lt;/select&gt; being parsed. https://bugs.webkit.org/show_bug.cgi?id=32641</p>
-    <p>Before querying selectedIndex, [theOption].selected = <span id="logOne"></span></p>
-    <p>[theSelect].selectedIndex = <span id="logTwo"></span></p>
-    <p>After querying selectedIndex, [theOption].selected = <span id="logThree"></span></p>
-    <select id="theSelect" style="display:none">
-      <option id="theOption">lalala</option>
-    <script>
-      if (window.layoutTestController)
-        layoutTestController.dumpAsText();
-      var o = document.getElementById('theOption');
-      document.getElementById('logOne').textContent = o.selected;
-      document.getElementById('logTwo').textContent = document.getElementById('theSelect').selectedIndex;
-      document.getElementById('logThree').textContent = o.selected;
-    </script>
-    </select>
- </body>
-</html>
-
diff --git a/LayoutTests/fast/forms/add-remove-option-modification-event-expected.txt b/LayoutTests/fast/forms/add-remove-option-modification-event-expected.txt
index 5e1d761..818c47c 100644
--- a/LayoutTests/fast/forms/add-remove-option-modification-event-expected.txt
+++ b/LayoutTests/fast/forms/add-remove-option-modification-event-expected.txt
@@ -2,6 +2,9 @@ Test that SELECT is in correct state when handling a DOM modification event for
 
   
 
-Passed
+Failed
+     Expected: true
+     Actual: false
+
 Passed
 Passed
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 37e89e9..fc3f30f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-01-14  Eric Seidel  <eric at webkit.org>
+
+        No review, rolling out r53248.
+        http://trac.webkit.org/changeset/53248
+        https://bugs.webkit.org/show_bug.cgi?id=32641
+
+        Caused 2 tests to crash on various bots:
+        fast/dom/HTMLSelectElement/listbox-select-reset.html and
+        fast/forms/listbox-typeahead-scroll.html
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::recalcStyle):
+        (WebCore::SelectElement::setRecalcListItems):
+        (WebCore::SelectElement::recalcListItems):
+        (WebCore::SelectElement::restoreFormControlState):
+        (WebCore::SelectElement::reset):
+        (WebCore::SelectElement::typeAheadFind):
+        * dom/SelectElement.h:
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::selected):
+        (WebCore::HTMLOptionElement::insertedIntoTree):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::recalcStyle):
+        * html/HTMLSelectElement.h:
+        * wml/WMLSelectElement.cpp:
+        (WebCore::WMLSelectElement::recalcStyle):
+
 2010-01-14  Ben Murdoch  <benm at google.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index d0cc59e..4f7712d 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -222,21 +222,28 @@ void SelectElement::scrollToSelection(SelectElementData& data, Element* element)
         toRenderListBox(renderer)->selectionChanged();
 }
 
-void SelectElement::setOptionsChangedOnRenderer(SelectElementData& data, Element* element)
+void SelectElement::recalcStyle(SelectElementData& data, Element* element)
 {
-    if (RenderObject* renderer = element->renderer()) {
+    RenderObject* renderer = element->renderer();
+    if (element->childNeedsStyleRecalc() && renderer) {
         if (data.usesMenuList())
             toRenderMenuList(renderer)->setOptionsChanged(true);
         else
             toRenderListBox(renderer)->setOptionsChanged(true);
-    }
+    } else if (data.shouldRecalcListItems())
+        recalcListItems(data, element);
 }
 
 void SelectElement::setRecalcListItems(SelectElementData& data, Element* element)
 {
     data.setShouldRecalcListItems(true);
     data.setActiveSelectionAnchorIndex(-1); // Manual selection anchor is reset when manipulating the select programmatically.
-    setOptionsChangedOnRenderer(data, element);
+    if (RenderObject* renderer = element->renderer()) {
+        if (data.usesMenuList())
+            toRenderMenuList(renderer)->setOptionsChanged(true);
+        else
+            toRenderListBox(renderer)->setOptionsChanged(true);
+    }
     element->setNeedsStyleRecalc();
 }
 
@@ -245,8 +252,6 @@ void SelectElement::recalcListItems(SelectElementData& data, const Element* elem
     Vector<Element*>& listItems = data.rawListItems();
     listItems.clear();
 
-    data.setShouldRecalcListItems(false);
-
     OptionElement* foundSelected = 0;
     for (Node* currentNode = element->firstChild(); currentNode;) {
         if (!currentNode->isElementNode()) {
@@ -292,6 +297,8 @@ void SelectElement::recalcListItems(SelectElementData& data, const Element* elem
         // <select>'s subtree at this point.
         currentNode = currentNode->traverseNextSibling(element);
     }
+
+    data.setShouldRecalcListItems(false);
 }
 
 int SelectElement::selectedIndex(const SelectElementData& data, const Element* element)
@@ -440,7 +447,7 @@ void SelectElement::restoreFormControlState(SelectElementData& data, Element* el
             optionElement->setSelectedState(state[i] == 'X');
     }
 
-    setOptionsChangedOnRenderer(data, element);
+    element->setNeedsStyleRecalc();
 }
 
 void SelectElement::parseMultipleAttribute(SelectElementData& data, Element* element, MappedAttribute* attribute)
@@ -514,7 +521,7 @@ void SelectElement::reset(SelectElementData& data, Element* element)
     if (!selectedOption && firstOption && data.usesMenuList())
         firstOption->setSelectedState(true);
 
-    setOptionsChangedOnRenderer(data, element);
+    element->setNeedsStyleRecalc();
 }
     
 #if !ARROW_KEYS_POP_MENU
@@ -888,8 +895,7 @@ void SelectElement::typeAheadFind(SelectElementData& data, Element* element, Key
             setSelectedIndex(data, element, listToOptionIndex(data, element, index));
             if (!data.usesMenuList())
                 listBoxOnChange(data, element);
-
-            setOptionsChangedOnRenderer(data, element);
+            element->setNeedsStyleRecalc();
             return;
         }
     }
diff --git a/WebCore/dom/SelectElement.h b/WebCore/dom/SelectElement.h
index 6891c22..4cc76a0 100644
--- a/WebCore/dom/SelectElement.h
+++ b/WebCore/dom/SelectElement.h
@@ -75,6 +75,7 @@ protected:
     static void listBoxOnChange(SelectElementData&, Element*);
     static void menuListOnChange(SelectElementData&, Element*);
     static void scrollToSelection(SelectElementData&, Element*);
+    static void recalcStyle(SelectElementData&, Element*);
     static void setRecalcListItems(SelectElementData&, Element*);
     static void recalcListItems(SelectElementData&, const Element*, bool updateSelectedStates = true);
     static int selectedIndex(const SelectElementData&, const Element*);
@@ -99,7 +100,6 @@ protected:
 private:
     static void menuListDefaultEventHandler(SelectElementData&, Element*, Event*, HTMLFormElement*);
     static void listBoxDefaultEventHandler(SelectElementData&, Element*, Event*, HTMLFormElement*);
-    static void setOptionsChangedOnRenderer(SelectElementData&, Element*);
 };
 
 // HTML/WMLSelectElement hold this struct as member variable
diff --git a/WebCore/html/HTMLOptionElement.cpp b/WebCore/html/HTMLOptionElement.cpp
index 3263393..316b192 100644
--- a/WebCore/html/HTMLOptionElement.cpp
+++ b/WebCore/html/HTMLOptionElement.cpp
@@ -137,8 +137,6 @@ void HTMLOptionElement::setValue(const String& value)
 
 bool HTMLOptionElement::selected() const
 {
-    if (HTMLSelectElement* select = ownerSelectElement())
-        select->recalcListItemsIfNeeded();
     return m_data.selected();
 }
 
@@ -222,8 +220,7 @@ void HTMLOptionElement::insertedIntoTree(bool deep)
 {
     if (HTMLSelectElement* select = ownerSelectElement()) {
         select->setRecalcListItems();
-        // Avoid our selected() getter since it will recalculate list items incorrectly for us.
-        if (m_data.selected())
+        if (selected())
             select->setSelectedIndex(index(), false);
         select->scrollToSelection();
     }
diff --git a/WebCore/html/HTMLSelectElement.cpp b/WebCore/html/HTMLSelectElement.cpp
index 5f5c855..2409f31 100644
--- a/WebCore/html/HTMLSelectElement.cpp
+++ b/WebCore/html/HTMLSelectElement.cpp
@@ -4,7 +4,6 @@
  *           (C) 2001 Dirk Mueller (mueller at kde.org)
  * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov (ap at nypop.com)
- * Copyright (C) 2010 Google Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -60,6 +59,7 @@ bool HTMLSelectElement::checkDTD(const Node* newChild)
 
 void HTMLSelectElement::recalcStyle(StyleChange change)
 {
+    SelectElement::recalcStyle(m_data, this);
     HTMLFormControlElementWithState::recalcStyle(change);
 }
 
@@ -261,12 +261,6 @@ void HTMLSelectElement::recalcListItems(bool updateSelectedStates) const
     SelectElement::recalcListItems(const_cast<SelectElementData&>(m_data), this, updateSelectedStates);
 }
 
-void HTMLSelectElement::recalcListItemsIfNeeded()
-{
-    if (m_data.shouldRecalcListItems())
-        recalcListItems();
-}
-
 void HTMLSelectElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     setRecalcListItems();
diff --git a/WebCore/html/HTMLSelectElement.h b/WebCore/html/HTMLSelectElement.h
index d772e4d..8f575d2 100644
--- a/WebCore/html/HTMLSelectElement.h
+++ b/WebCore/html/HTMLSelectElement.h
@@ -3,7 +3,6 @@
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
  *           (C) 2000 Dirk Mueller (mueller at kde.org)
  * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -59,7 +58,6 @@ public:
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     void setRecalcListItems();
-    void recalcListItemsIfNeeded();
 
     virtual const Vector<Element*>& listItems() const { return m_data.listItems(this); }
 
diff --git a/WebCore/wml/WMLSelectElement.cpp b/WebCore/wml/WMLSelectElement.cpp
index e6041f4..03ca05a 100644
--- a/WebCore/wml/WMLSelectElement.cpp
+++ b/WebCore/wml/WMLSelectElement.cpp
@@ -83,6 +83,7 @@ void WMLSelectElement::selectAll()
 
 void WMLSelectElement::recalcStyle(StyleChange change)
 {
+    SelectElement::recalcStyle(m_data, this);
     WMLFormControlElement::recalcStyle(change);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list