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

Unified Diff: Source/core/layout/TextAutosizer.cpp

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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/layout/LayoutObjectChildList.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/TextAutosizer.cpp
diff --git a/Source/core/layout/TextAutosizer.cpp b/Source/core/layout/TextAutosizer.cpp
index 568da42a402b5e6fa9d1d1c72f169184c082d132..83f60c3b38409f748ac4dcc2eb9081241e180403 100644
--- a/Source/core/layout/TextAutosizer.cpp
+++ b/Source/core/layout/TextAutosizer.cpp
@@ -32,6 +32,7 @@
#include "core/layout/TextAutosizer.h"
#include "core/dom/Document.h"
+#include "core/dom/PseudoElement.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -459,8 +460,10 @@ float TextAutosizer::inflate(LayoutObject* parent, InflateBehavior behavior, flo
// FIXME: Investigate why MarkOnlyThis is sufficient.
if (parent->isLayoutInline())
child->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+
} else if (child->isLayoutInline()) {
multiplier = inflate(child, behavior, multiplier);
+
} else if (child->isLayoutBlock() && behavior == DescendToInnerBlocks
&& !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING)) {
multiplier = inflate(child, behavior, multiplier);
@@ -470,11 +473,21 @@ float TextAutosizer::inflate(LayoutObject* parent, InflateBehavior behavior, flo
if (hasTextChild) {
applyMultiplier(parent, multiplier); // Parent handles line spacing.
+
} else if (!parent->isListItem()) {
// For consistency, a block with no immediate text child should always have a
// multiplier of 1 (except for list items which are handled in inflateListItem).
applyMultiplier(parent, 1);
}
+
+ if (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && parent->isListItem()) {
+ LayoutListItem* item = toLayoutListItem(parent);
+ if (item->marker()) {
+ inflateListItem(item, item->marker());
+ item->marker()->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+ }
+ }
+
return multiplier;
}
« no previous file with comments | « Source/core/layout/LayoutObjectChildList.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698