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

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

Issue 2759883002: Get markers back while list items have overflow:hidden children (Closed)
Patch Set: add layout test case Created 3 years, 9 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 6c989742027127c6dc1661a27923892756f73f93..0612d3dde724aa6677f2c3e70c59995609e79a29 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -257,6 +257,11 @@ static LayoutObject* getParentOfFirstLineBox(LayoutBlockFlow* curr,
if (currChild == marker)
continue;
+ // Shouldn't add marker into Overflow box, instead, add marker
+ // into listitem
+ if (currChild->hasOverflowClip())
+ break;
+
if (currChild->isInline() &&
(!currChild->isLayoutInline() ||
curr->generatesLineBoxesForInlineChild(currChild)))
@@ -336,6 +341,16 @@ void LayoutListItem::addOverflowFromChildren() {
positionListMarker();
}
+void LayoutListItem::addLogicalHeightFromChild(const LayoutBox& child) {
+ // Outside marker inside an anonymous box with sibling shouldn't effect the
+ // height of listitem, so that marker can be positioned at the left of sibling
+ // not top-left.
+ if (m_marker && !m_marker->isInside() && child.isAnonymous() &&
+ child.isLayoutBlock() && firstChild() == child && child.nextSibling())
+ return;
+ setLogicalHeight(logicalHeight() + logicalHeightForChild(child));
+}
+
void LayoutListItem::positionListMarker() {
if (m_marker && m_marker->parent() && m_marker->parent()->isBox() &&
!m_marker->isInside() && m_marker->inlineBoxWrapper()) {

Powered by Google App Engine
This is Rietveld 408576698