Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1252)

Unified Diff: Source/core/rendering/RenderListMarker.cpp

Issue 644073002: Avoid layout when list color changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address mstensho's comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderListMarker.cpp
diff --git a/Source/core/rendering/RenderListMarker.cpp b/Source/core/rendering/RenderListMarker.cpp
index d30e6443e0b2c5e6865c63f3facffa333f286e2c..6b156ffa622fc2928d5ac4f33dfedd97e6cae25c 100644
--- a/Source/core/rendering/RenderListMarker.cpp
+++ b/Source/core/rendering/RenderListMarker.cpp
@@ -1633,4 +1633,19 @@ LayoutRect RenderListMarker::selectionRectForPaintInvalidation(const RenderLayer
return rect;
}
+void RenderListMarker::listItemStyleDidChange()
+{
+ RefPtr<RenderStyle> newStyle = RenderStyle::create();
+ // The marker always inherits from the list item, regardless of where it might end
+ // up (e.g., in some deeply nested line box). See CSS3 spec.
+ newStyle->inheritFrom(m_listItem->style());
+ if (style()) {
+ // Reuse the current margins otherwise resetting the margins to initial values
mstensho (USE GERRIT) 2014/10/14 19:51:39 Could you add something in front of "otherwise"? E
Xianzhu 2014/10/14 20:38:42 Done.
+ // would trigger unnecessary layout.
+ newStyle->setMarginStart(style()->marginStart());
+ newStyle->setMarginEnd(style()->marginRight());
+ }
+ setStyle(newStyle.release());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698