Title: [205806] trunk/Source/WebCore
Revision
205806
Author
[email protected]
Date
2016-09-12 02:28:52 -0700 (Mon, 12 Sep 2016)

Log Message

ol.start may return incorrect value for reversed lists when not explicitly set
https://bugs.webkit.org/show_bug.cgi?id=161713

Reviewed by Ryosuke Niwa.

Fix style nit after r205689.

* html/HTMLOListElement.cpp:
(WebCore::HTMLOListElement::itemCount):
(WebCore::HTMLOListElement::itemCountAfterLayout):
* html/HTMLOListElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205805 => 205806)


--- trunk/Source/WebCore/ChangeLog	2016-09-12 09:26:19 UTC (rev 205805)
+++ trunk/Source/WebCore/ChangeLog	2016-09-12 09:28:52 UTC (rev 205806)
@@ -1,5 +1,19 @@
 2016-09-12  Chris Dumez  <[email protected]>
 
+        ol.start may return incorrect value for reversed lists when not explicitly set
+        https://bugs.webkit.org/show_bug.cgi?id=161713
+
+        Reviewed by Ryosuke Niwa.
+
+        Fix style nit after r205689.
+
+        * html/HTMLOListElement.cpp:
+        (WebCore::HTMLOListElement::itemCount):
+        (WebCore::HTMLOListElement::itemCountAfterLayout):
+        * html/HTMLOListElement.h:
+
+2016-09-12  Chris Dumez  <[email protected]>
+
         Start using Document::pageCacheState() instead of Document::inPageCache()
         https://bugs.webkit.org/show_bug.cgi?id=161851
 

Modified: trunk/Source/WebCore/html/HTMLOListElement.cpp (205805 => 205806)


--- trunk/Source/WebCore/html/HTMLOListElement.cpp	2016-09-12 09:26:19 UTC (rev 205805)
+++ trunk/Source/WebCore/html/HTMLOListElement.cpp	2016-09-12 09:28:52 UTC (rev 205806)
@@ -104,16 +104,20 @@
     RenderListItem::updateItemValuesForOrderedList(*this);
 }
 
-unsigned HTMLOListElement::itemCount(ShouldLayout shouldLayout) const
+unsigned HTMLOListElement::itemCount() const
 {
-    if (shouldLayout == ShouldLayout::Yes)
-        document().updateLayoutIgnorePendingStylesheets();
-
     if (m_shouldRecalculateItemCount)
         const_cast<HTMLOListElement*>(this)->recalculateItemCount();
     return m_itemCount;
 }
 
+unsigned HTMLOListElement::itemCountAfterLayout() const
+{
+    document().updateLayoutIgnorePendingStylesheets();
+
+    return itemCount();
+}
+
 void HTMLOListElement::recalculateItemCount()
 {
     m_itemCount = RenderListItem::itemCountForOrderedList(*this);

Modified: trunk/Source/WebCore/html/HTMLOListElement.h (205805 => 205806)


--- trunk/Source/WebCore/html/HTMLOListElement.h	2016-09-12 09:26:19 UTC (rev 205805)
+++ trunk/Source/WebCore/html/HTMLOListElement.h	2016-09-12 09:28:52 UTC (rev 205806)
@@ -35,8 +35,8 @@
     // FIXME: The reason we have this start() function which does not trigger layout is because it is called
     // from rendering code and this is unfortunately one of the few cases where the render tree is mutated
     // while in layout.
-    int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount(ShouldLayout::No) : 1); }
-    int startForBindings() const { return m_start ? m_start.value() : (m_isReversed ? itemCount(ShouldLayout::Yes) : 1); }
+    int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount() : 1); }
+    int startForBindings() const { return m_start ? m_start.value() : (m_isReversed ? itemCountAfterLayout() : 1); }
 
     WEBCORE_EXPORT void setStartForBindings(int);
 
@@ -49,8 +49,8 @@
         
     void updateItemValues();
 
-    enum class ShouldLayout { No, Yes };
-    WEBCORE_EXPORT unsigned itemCount(ShouldLayout) const;
+    WEBCORE_EXPORT unsigned itemCountAfterLayout() const;
+    WEBCORE_EXPORT unsigned itemCount() const;
 
     WEBCORE_EXPORT void recalculateItemCount();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to