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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 1d39ce659c8397fab8cfaae8213e400f299e4443..e08bfc94c474e848fae061541c74c25af19ac00a 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -69,6 +69,7 @@
#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/dom/CSSSelectorWatch.h"
#include "core/dom/FirstLetterPseudoElement.h"
+#include "core/dom/MarkerPseudoElement.h"
#include "core/dom/NodeRenderStyle.h"
#include "core/dom/StyleEngine.h"
#include "core/dom/Text.h"
@@ -719,6 +720,8 @@ PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap
PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element* parent, PseudoId pseudoId)
{
+ if (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && pseudoId == MARKER)
+ return MarkerPseudoElement::create(parent);
if (pseudoId == FIRST_LETTER)
return FirstLetterPseudoElement::create(parent);
return PseudoElement::create(parent, pseudoId);
@@ -730,14 +733,17 @@ PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded
if (!parentRenderer)
return nullptr;
- // The first letter pseudo element has to look up the tree and see if any
- // of the ancestors are first letter.
- if (pseudoId < FIRST_INTERNAL_PSEUDOID && pseudoId != FIRST_LETTER && !parentRenderer->style()->hasPseudoStyle(pseudoId))
+ if (pseudoId < FIRST_INTERNAL_PSEUDOID && pseudoId != FIRST_LETTER && (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && pseudoId != MARKER) && !parentRenderer->style()->hasPseudoStyle(pseudoId))
Julien - ping for review 2014/12/05 19:44:03 Maybe we should start about thinking of doing some
dsinclair 2015/01/23 20:46:36 Done.
return nullptr;
if (pseudoId == BACKDROP && !parent.isInTopLayer())
return nullptr;
+ // FIXME: This should also probably take inline-list-item into account when
+ // we add support.
+ if (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && pseudoId == MARKER && parentRenderer->style()->display() != LIST_ITEM)
+ return nullptr;
+
if (pseudoId == FIRST_LETTER && (parent.isSVGElement() || !FirstLetterPseudoElement::firstLetterTextRenderer(parent)))
return nullptr;
@@ -807,10 +813,15 @@ bool StyleResolver::pseudoStyleForElementInternal(Element& element, const Pseudo
matchUARules(collector);
matchAuthorRules(state.element(), collector, false);
- if (collector.matchedResult().matchedProperties.isEmpty())
+ if (!collector.matchedResult().matchedProperties.isEmpty()) {
+ applyMatchedProperties(state, collector.matchedResult());
+ } else if (pseudoStyleRequest.pseudoId == MARKER && parentStyle->display() == LIST_ITEM) {
+ // FIXME: this goes in the adjuster.
+ // state.style()->setDisplay(INLINE);
+ } else {
return false;
+ }
Julien - ping for review 2014/12/05 19:44:03 This code is just super weirdly structured.
dsinclair 2015/01/23 20:46:36 Code is a work in progress, I though I needed to d
- applyMatchedProperties(state, collector.matchedResult());
applyCallbackSelectors(state);
addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);

Powered by Google App Engine
This is Rietveld 408576698