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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutListItem.cpp

Issue 1403643002: Rework list marker spacing for better web compatibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@472084_use_list_item_painter
Patch Set: Fix compile error with default switch case. Created 5 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: third_party/WebKit/Source/core/layout/LayoutListItem.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
index bcf21d089a3ceef02eafba879f55619e5675c56e..fc73d5a54cd898bcc8eb27d31b33ca5800f9e5fa 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -54,8 +54,9 @@ void LayoutListItem::styleDidChange(StyleDifference diff, const ComputedStyle* o
{
LayoutBlockFlow::styleDidChange(diff, oldStyle);
+ StyleImage* currentImage = style()->listStyleImage();
if (style()->listStyleType() != NoneListStyle
- || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurred())) {
+ || (currentImage && !currentImage->errorOccurred())) {
wkorman 2015/10/14 01:55:30 codereview UI isn't showing your comment in-line h
if (!m_marker)
m_marker = LayoutListMarker::createAnonymous(this);
m_marker->listItemStyleDidChange();
@@ -66,11 +67,11 @@ void LayoutListItem::styleDidChange(StyleDifference diff, const ComputedStyle* o
}
StyleImage* oldImage = oldStyle ? oldStyle->listStyleImage() : nullptr;
- if (oldImage != style()->listStyleImage()) {
+ if (oldImage != currentImage) {
if (oldImage)
oldImage->removeClient(this);
- if (style()->listStyleImage())
- style()->listStyleImage()->addClient(this);
+ if (currentImage)
+ currentImage->addClient(this);
}
}
@@ -219,7 +220,7 @@ inline int LayoutListItem::calcValue() const
return m_explicitValue;
Node* list = enclosingList(this);
- HTMLOListElement* oListElement = isHTMLOListElement(list) ? toHTMLOListElement(list) : 0;
+ HTMLOListElement* oListElement = isHTMLOListElement(list) ? toHTMLOListElement(list) : nullptr;
int valueStep = 1;
if (oListElement && oListElement->isReversed())
valueStep = -1;

Powered by Google App Engine
This is Rietveld 408576698