Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / RenderListItem.cpp
index b3b57a5..8fce613 100644 (file)
@@ -27,6 +27,7 @@
 #include "HTMLNames.h"
 #include "core/dom/ElementTraversal.h"
 #include "core/html/HTMLOListElement.h"
+#include "core/rendering/FastTextAutosizer.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderListMarker.h"
 #include "core/rendering/RenderView.h"
@@ -51,7 +52,7 @@ RenderListItem::RenderListItem(Element* element)
 
 void RenderListItem::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
-    RenderBlock::styleDidChange(diff, oldStyle);
+    RenderBlockFlow::styleDidChange(diff, oldStyle);
 
     if (style()->listStyleType() != NoneListStyle
         || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurred())) {
@@ -316,6 +317,14 @@ void RenderListItem::layout()
 {
     ASSERT(needsLayout());
 
+    // The marker must be autosized before calling updateMarkerLocation.
+    // It cannot be done in the parent's beginLayout because it is not yet in the render tree.
+    if (m_marker) {
+        FastTextAutosizer* textAutosizer = document().fastTextAutosizer();
+        if (textAutosizer)
+            textAutosizer->inflateListItem(this, m_marker);
+    }
+
     LayoutRectRecorder recorder(*this);
     updateMarkerLocation();
     RenderBlockFlow::layout();