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

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

Issue 20672003: Avoid reaching for StyleResolver::m_features from StyleBuilder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index a1ca151d02c3987efb0f4345a18ea7b833e04b16..c69b5cd9b197003460c4b21b6917630924518559 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -531,6 +531,11 @@ static inline void resetDirectionAndWritingModeOnDocument(Document* document)
document->setWritingModeSetOnDocumentElement(false);
}
+static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAttrValues, RuleFeatureSet& features)
+{
+ for (size_t i = 0; i < contentAttrValues.size(); ++i)
+ features.attrsInRules.add(contentAttrValues[i].impl());
+}
PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior,
RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling)
@@ -607,6 +612,8 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
matchAllRules(state, collector, m_matchAuthorAndUserStyles, matchingBehavior != MatchAllRulesExcludingSMIL);
applyMatchedProperties(state, collector.matchedResult());
+
+ addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
}
{
StyleAdjuster adjuster(state.cachedUAStyle(), m_document->inQuirksMode());
@@ -802,6 +809,8 @@ PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const P
state.style()->setStyleType(pseudoStyleRequest.pseudoId);
applyMatchedProperties(state, collector.matchedResult());
+
+ addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
}
{
StyleAdjuster adjuster(state.cachedUAStyle(), m_document->inQuirksMode());
@@ -853,6 +862,8 @@ PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex)
applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
+ addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
+
// Start loading resources referenced by this style.
m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources());
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698