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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 1190303003: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CL for perf tryjob on mac Created 5 years, 6 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 666
667 loadPendingResources(state); 667 loadPendingResources(state);
668 668
669 didAccess(); 669 didAccess();
670 670
671 return state.takeStyle(); 671 return state.takeStyle();
672 } 672 }
673 673
674 // This function is used by the WebAnimations JavaScript API method animate(). 674 // This function is used by the WebAnimations JavaScript API method animate().
675 // FIXME: Remove this when animate() switches away from resolution-dependent par sing. 675 // FIXME: Remove this when animate() switches away from resolution-dependent par sing.
676 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, C SSValue* value) 676 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, N ullableCSSValue value)
677 { 677 {
678 StyleResolverState state(element.document(), &element); 678 StyleResolverState state(element.document(), &element);
679 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle: :create()); 679 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle: :create());
680 return createAnimatableValueSnapshot(state, property, value); 680 return createAnimatableValueSnapshot(state, property, value);
681 } 681 }
682 682
683 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(StyleResolverState& state, CSSPropertyID property, CSSValue* value) 683 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(StyleResolverState& state, CSSPropertyID property, NullableCSSValue value)
684 { 684 {
685 if (value) { 685 if (value) {
686 StyleBuilder::applyProperty(property, state, value); 686 StyleBuilder::applyProperty(property, state, *value);
687 state.fontBuilder().createFont(state.document().styleEngine().fontSelect or(), state.mutableStyleRef()); 687 state.fontBuilder().createFont(state.document().styleEngine().fontSelect or(), state.mutableStyleRef());
688 } 688 }
689 return CSSAnimatableValueFactory::create(property, *state.style()); 689 return CSSAnimatableValueFactory::create(property, *state.style());
690 } 690 }
691 691
692 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element * parent, PseudoId pseudoId) 692 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element * parent, PseudoId pseudoId)
693 { 693 {
694 if (pseudoId == FIRST_LETTER) 694 if (pseudoId == FIRST_LETTER)
695 return FirstLetterPseudoElement::create(parent); 695 return FirstLetterPseudoElement::create(parent);
696 return PseudoElement::create(parent, pseudoId); 696 return PseudoElement::create(parent, pseudoId);
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 || !settings->textTrackTextColor().isEmpty() 1180 || !settings->textTrackTextColor().isEmpty()
1181 || !settings->textTrackTextShadow().isEmpty() 1181 || !settings->textTrackTextShadow().isEmpty()
1182 || !settings->textTrackTextSize().isEmpty()) 1182 || !settings->textTrackTextSize().isEmpty())
1183 return true; 1183 return true;
1184 return false; 1184 return false;
1185 } 1185 }
1186 1186
1187 // This method expands the 'all' shorthand property to longhand properties 1187 // This method expands the 'all' shorthand property to longhand properties
1188 // and applies the expanded longhand properties. 1188 // and applies the expanded longhand properties.
1189 template <CSSPropertyPriority priority> 1189 template <CSSPropertyPriority priority>
1190 void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allVal ue, bool inheritedOnly) 1190 void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue allValu e, bool inheritedOnly)
1191 { 1191 {
1192 unsigned startCSSProperty = CSSPropertyPriorityData<priority>::first(); 1192 unsigned startCSSProperty = CSSPropertyPriorityData<priority>::first();
1193 unsigned endCSSProperty = CSSPropertyPriorityData<priority>::last(); 1193 unsigned endCSSProperty = CSSPropertyPriorityData<priority>::last();
1194 1194
1195 for (unsigned i = startCSSProperty; i <= endCSSProperty; ++i) { 1195 for (unsigned i = startCSSProperty; i <= endCSSProperty; ++i) {
1196 CSSPropertyID propertyId = static_cast<CSSPropertyID>(i); 1196 CSSPropertyID propertyId = static_cast<CSSPropertyID>(i);
1197 1197
1198 // StyleBuilder does not allow any expanded shorthands. 1198 // StyleBuilder does not allow any expanded shorthands.
1199 if (isShorthandProperty(propertyId)) 1199 if (isShorthandProperty(propertyId))
1200 continue; 1200 continue;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 if (propertyWhitelistType == PropertyWhitelistCue && (!isValidCueStylePr operty(property) || shouldIgnoreTextTrackAuthorStyle(document()))) 1235 if (propertyWhitelistType == PropertyWhitelistCue && (!isValidCueStylePr operty(property) || shouldIgnoreTextTrackAuthorStyle(document())))
1236 continue; 1236 continue;
1237 1237
1238 if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFir stLetterStyleProperty(property)) 1238 if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFir stLetterStyleProperty(property))
1239 continue; 1239 continue;
1240 1240
1241 if (inheritedOnly && !current.isInherited()) { 1241 if (inheritedOnly && !current.isInherited()) {
1242 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties 1242 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties
1243 // as they might override the value inherited here. For this reason we don't allow declarations with 1243 // as they might override the value inherited here. For this reason we don't allow declarations with
1244 // explicitly inherited properties to be cached. 1244 // explicitly inherited properties to be cached.
1245 ASSERT(!current.value()->isInheritedValue()); 1245 ASSERT(!current.value().isInheritedValue());
1246 continue; 1246 continue;
1247 } 1247 }
1248 1248
1249 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) 1249 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property))
1250 continue; 1250 continue;
1251 1251
1252 StyleBuilder::applyProperty(current.id(), state, current.value()); 1252 StyleBuilder::applyProperty(current.id(), state, current.value());
1253 } 1253 }
1254 } 1254 }
1255 1255
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 CSSPropertyLineHeight, 1429 CSSPropertyLineHeight,
1430 }; 1430 };
1431 1431
1432 // TODO(timloh): This is weird, the style is being used as its own parent 1432 // TODO(timloh): This is weird, the style is being used as its own parent
1433 StyleResolverState state(document(), document().documentElement(), style); 1433 StyleResolverState state(document(), document().documentElement(), style);
1434 state.setStyle(style); 1434 state.setStyle(style);
1435 1435
1436 for (CSSPropertyID property : properties) { 1436 for (CSSPropertyID property : properties) {
1437 if (property == CSSPropertyLineHeight) 1437 if (property == CSSPropertyLineHeight)
1438 updateFont(state); 1438 updateFont(state);
1439 StyleBuilder::applyProperty(property, state, propertySet.getPropertyCSSV alue(property).get()); 1439 StyleBuilder::applyProperty(property, state, *propertySet.getPropertyCSS Value(property));
1440 } 1440 }
1441 } 1441 }
1442 1442
1443 void StyleResolver::addMediaQueryResults(const MediaQueryResultList& list) 1443 void StyleResolver::addMediaQueryResults(const MediaQueryResultList& list)
1444 { 1444 {
1445 for (size_t i = 0; i < list.size(); ++i) 1445 for (size_t i = 0; i < list.size(); ++i)
1446 m_viewportDependentMediaQueryResults.append(list[i]); 1446 m_viewportDependentMediaQueryResults.append(list[i]);
1447 } 1447 }
1448 1448
1449 bool StyleResolver::mediaQueryAffectedByViewportChange() const 1449 bool StyleResolver::mediaQueryAffectedByViewportChange() const
(...skipping 18 matching lines...) Expand all
1468 visitor->trace(m_watchedSelectorsRules); 1468 visitor->trace(m_watchedSelectorsRules);
1469 visitor->trace(m_treeBoundaryCrossingRules); 1469 visitor->trace(m_treeBoundaryCrossingRules);
1470 visitor->trace(m_styleResourceLoader); 1470 visitor->trace(m_styleResourceLoader);
1471 visitor->trace(m_styleSharingLists); 1471 visitor->trace(m_styleSharingLists);
1472 visitor->trace(m_pendingStyleSheets); 1472 visitor->trace(m_pendingStyleSheets);
1473 visitor->trace(m_document); 1473 visitor->trace(m_document);
1474 #endif 1474 #endif
1475 } 1475 }
1476 1476
1477 } // namespace blink 1477 } // namespace blink
OLDNEW
« 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