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

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

Issue 2553793003: Establish a list marker's offset before floats have been added to its line (Closed)
Patch Set: bug 548616 Created 4 years 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 | « third_party/WebKit/Source/core/layout/LayoutListMarker.h ('k') | 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 806cda731dc5b44a357ac400ce827d63b1162abc..5b56ad214f204ff6a8e212eb6cde084e31f8d3ae 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
@@ -43,7 +43,7 @@ const int cMarkerPaddingPx = 7;
const int cUAMarkerMarginEm = 1;
LayoutListMarker::LayoutListMarker(LayoutListItem* item)
- : LayoutBox(nullptr), m_listItem(item) {
+ : LayoutBox(nullptr), m_listItem(item), m_lineOffset() {
setInline(true);
setIsAtomicInlineLevel(true);
}
@@ -139,6 +139,17 @@ void LayoutListMarker::layout() {
ASSERT(needsLayout());
LayoutAnalyzer::Scope analyzer(*this);
+ LayoutUnit blockOffset;
+ for (LayoutBox* o = parentBox(); o != listItem(); o = o->parentBox()) {
eae 2016/12/07 21:30:45 Is parentBox guaranteed to be non-null? If not we
+ blockOffset += o->logicalTop();
+ }
+ if (listItem()->style()->isLeftToRightDirection()) {
+ m_lineOffset = listItem()->logicalLeftOffsetForLine(
+ blockOffset, DoNotIndentText, LayoutUnit());
+ } else {
+ m_lineOffset = listItem()->logicalRightOffsetForLine(
+ blockOffset, DoNotIndentText, LayoutUnit());
+ }
if (isImage()) {
updateMarginsAndContent();
LayoutSize imageSize(imageBulletSize());
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutListMarker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698