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

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: 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
« no previous file with comments | « Source/core/rendering/RenderListMarker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderListMarker.cpp
diff --git a/Source/core/rendering/RenderListMarker.cpp b/Source/core/rendering/RenderListMarker.cpp
index d30e6443e0b2c5e6865c63f3facffa333f286e2c..5fff3b3eadd3a1ea32e9421064e2ddfe65a048b8 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
+ // would trigger unnecessary layout.
+ newStyle->setMarginStart(style()->marginStart());
+ newStyle->setMarginEnd(style()->marginRight());
+ }
+ setStyle(newStyle.release());
+}
+
} // namespace blink
« no previous file with comments | « Source/core/rendering/RenderListMarker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698