Changeset 205806 in webkit


Ignore:
Timestamp:
Sep 12, 2016 2:28:52 AM (8 years ago)
Author:
Chris Dumez
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r205805 r205806  
     12016-09-12  Chris Dumez  <cdumez@apple.com>
     2
     3        ol.start may return incorrect value for reversed lists when not explicitly set
     4        https://bugs.webkit.org/show_bug.cgi?id=161713
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fix style nit after r205689.
     9
     10        * html/HTMLOListElement.cpp:
     11        (WebCore::HTMLOListElement::itemCount):
     12        (WebCore::HTMLOListElement::itemCountAfterLayout):
     13        * html/HTMLOListElement.h:
     14
    1152016-09-12  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/html/HTMLOListElement.cpp

    r205689 r205806  
    105105}
    106106
    107 unsigned HTMLOListElement::itemCount(ShouldLayout shouldLayout) const
     107unsigned HTMLOListElement::itemCount() const
    108108{
    109     if (shouldLayout == ShouldLayout::Yes)
    110         document().updateLayoutIgnorePendingStylesheets();
    111 
    112109    if (m_shouldRecalculateItemCount)
    113110        const_cast<HTMLOListElement*>(this)->recalculateItemCount();
    114111    return m_itemCount;
     112}
     113
     114unsigned HTMLOListElement::itemCountAfterLayout() const
     115{
     116    document().updateLayoutIgnorePendingStylesheets();
     117
     118    return itemCount();
    115119}
    116120
  • trunk/Source/WebCore/html/HTMLOListElement.h

    r205689 r205806  
    3636    // from rendering code and this is unfortunately one of the few cases where the render tree is mutated
    3737    // while in layout.
    38     int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount(ShouldLayout::No) : 1); }
    39     int startForBindings() const { return m_start ? m_start.value() : (m_isReversed ? itemCount(ShouldLayout::Yes) : 1); }
     38    int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount() : 1); }
     39    int startForBindings() const { return m_start ? m_start.value() : (m_isReversed ? itemCountAfterLayout() : 1); }
    4040
    4141    WEBCORE_EXPORT void setStartForBindings(int);
     
    5050    void updateItemValues();
    5151
    52     enum class ShouldLayout { No, Yes };
    53     WEBCORE_EXPORT unsigned itemCount(ShouldLayout) const;
     52    WEBCORE_EXPORT unsigned itemCountAfterLayout() const;
     53    WEBCORE_EXPORT unsigned itemCount() const;
    5454
    5555    WEBCORE_EXPORT void recalculateItemCount();
Note: See TracChangeset for help on using the changeset viewer.