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

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

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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: Source/core/rendering/TextAutosizer.cpp
diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp
index f3ebe7f45eb89003dc8e37a9551fbe1aa148e64a..19ef56cff7cc17f8778a4e9bcf84f8fb6c4d72dd 100644
--- a/Source/core/rendering/TextAutosizer.cpp
+++ b/Source/core/rendering/TextAutosizer.cpp
@@ -32,6 +32,7 @@
#include "core/rendering/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(RenderObject* parent, InflateBehavior behavior, flo
// FIXME: Investigate why MarkOnlyThis is sufficient.
if (parent->isRenderInline())
child->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+
} else if (child->isRenderInline()) {
multiplier = inflate(child, behavior, multiplier);
+
} else if (child->isRenderBlock() && behavior == DescendToInnerBlocks
&& !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING)) {
multiplier = inflate(child, behavior, multiplier);
@@ -470,11 +473,20 @@ float TextAutosizer::inflate(RenderObject* 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()) {
+ if (PseudoElement* element = toElement(parent->node())->pseudoElement(MARKER)) {
+ inflateListItem(toRenderListItem(parent), toRenderListMarker(element->renderer()));
+ element->renderer()->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+ }
+ }
+
return multiplier;
}

Powered by Google App Engine
This is Rietveld 408576698