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

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

Issue 1411823002: Lists: Minor code style revisions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@472084_fix_overflow_hidden
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
index 91cdd4640f7d4384502f53e8a3d76fd7281b8f5b..9937326da0ccb31ec82381c154f72a75ba68d939 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
@@ -36,7 +36,7 @@
namespace blink {
-const int cMarkerPadding = 7;
+const int cMarkerPaddingPx = 7;
enum SequenceType { NumericSequence, AlphabeticSequence };
@@ -1034,10 +1034,13 @@ LayoutRect LayoutListMarker::localSelectionRect() const
if (!box)
return LayoutRect(LayoutPoint(), size());
RootInlineBox& root = inlineBoxWrapper()->root();
- LayoutUnit newLogicalTop = root.block().style()->isFlippedBlocksWritingMode() ? inlineBoxWrapper()->logicalBottom() - root.selectionBottom() : root.selectionTop() - inlineBoxWrapper()->logicalTop();
- if (root.block().style()->isHorizontalWritingMode())
- return LayoutRect(0, newLogicalTop, size().width(), root.selectionHeight());
- return LayoutRect(newLogicalTop, 0, root.selectionHeight(), size().height());
+ const ComputedStyle* blockStyle = root.block().style();
+ LayoutUnit newLogicalTop = blockStyle->isFlippedBlocksWritingMode()
+ ? inlineBoxWrapper()->logicalBottom() - root.selectionBottom()
+ : root.selectionTop() - inlineBoxWrapper()->logicalTop();
+ return blockStyle->isHorizontalWritingMode()
+ ? LayoutRect(0, newLogicalTop, size().width(), root.selectionHeight())
+ : LayoutRect(newLogicalTop, 0, root.selectionHeight(), size().height());
}
void LayoutListMarker::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
@@ -1179,7 +1182,7 @@ void LayoutListMarker::updateMargins()
if (isInside()) {
if (isImage()) {
- marginEnd = cMarkerPadding;
+ marginEnd = cMarkerPaddingPx;
} else {
switch (listStyleCategory()) {
case ListStyleCategory::Symbol:
@@ -1193,14 +1196,14 @@ void LayoutListMarker::updateMargins()
} else {
if (style()->isLeftToRightDirection()) {
if (isImage()) {
- marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
+ marginStart = -minPreferredLogicalWidth() - cMarkerPaddingPx;
} else {
int offset = fontMetrics.ascent() * 2 / 3;
switch (listStyleCategory()) {
case ListStyleCategory::None:
break;
case ListStyleCategory::Symbol:
- marginStart = -offset - cMarkerPadding - 1;
+ marginStart = -offset - cMarkerPaddingPx - 1;
break;
default:
marginStart = m_text.isEmpty() ? LayoutUnit() : -minPreferredLogicalWidth();
@@ -1209,14 +1212,14 @@ void LayoutListMarker::updateMargins()
marginEnd = -marginStart - minPreferredLogicalWidth();
} else {
if (isImage()) {
- marginEnd = cMarkerPadding;
+ marginEnd = cMarkerPaddingPx;
} else {
int offset = fontMetrics.ascent() * 2 / 3;
switch (listStyleCategory()) {
case ListStyleCategory::None:
break;
case ListStyleCategory::Symbol:
- marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
+ marginEnd = offset + cMarkerPaddingPx + 1 - minPreferredLogicalWidth();
break;
default:
marginEnd = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698