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

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

Issue 2219543003: Elements using @apply shouldn't use the MatchedPropertiesCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 // When hitting matched properties' cache, only inherited properties wil l be 1424 // When hitting matched properties' cache, only inherited properties wil l be
1425 // applied. 1425 // applied.
1426 if (inheritedOnly && !CSSPropertyMetadata::isInheritedProperty(propertyI d)) 1426 if (inheritedOnly && !CSSPropertyMetadata::isInheritedProperty(propertyI d))
1427 continue; 1427 continue;
1428 1428
1429 StyleBuilder::applyProperty(propertyId, state, allValue); 1429 StyleBuilder::applyProperty(propertyId, state, allValue);
1430 } 1430 }
1431 } 1431 }
1432 1432
1433 template <CSSPropertyPriority priority> 1433 template <CSSPropertyPriority priority>
1434 void StyleResolver::applyPropertiesForApplyAtRule(StyleResolverState& state, con st CSSValue& value, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhitelistType) 1434 void StyleResolver::applyPropertiesForApplyAtRule(StyleResolverState& state, con st CSSValue& value, bool isImportant, PropertyWhitelistType propertyWhitelistTyp e)
1435 { 1435 {
1436 if (!state.style()->hasVariableReferenceFromNonInheritedProperty())
1437 state.style()->setHasVariableReferenceFromNonInheritedProperty();
meade_UTC10 2016/08/08 06:53:56 Do you get much from checking this before setting?
Timothy Loh 2016/08/08 07:03:12 Mmm yeah I'll remove the check
1436 if (!state.style()->variables()) 1438 if (!state.style()->variables())
1437 return; 1439 return;
1438 const String& name = toCSSCustomIdentValue(value).value(); 1440 const String& name = toCSSCustomIdentValue(value).value();
1439 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name); 1441 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name);
1442 bool inheritedOnly = false;
1440 if (propertySet) 1443 if (propertySet)
1441 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType); 1444 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType);
1442 } 1445 }
1443 1446
1444 template <CSSPropertyPriority priority> 1447 template <CSSPropertyPriority priority>
1445 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType) 1448 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType)
1446 { 1449 {
1447 unsigned propertyCount = properties->propertyCount(); 1450 unsigned propertyCount = properties->propertyCount();
1448 for (unsigned i = 0; i < propertyCount; ++i) { 1451 for (unsigned i = 0; i < propertyCount; ++i) {
1449 StylePropertySet::PropertyReference current = properties->propertyAt(i); 1452 StylePropertySet::PropertyReference current = properties->propertyAt(i);
1450 CSSPropertyID property = current.id(); 1453 CSSPropertyID property = current.id();
1451 1454
1452 if (property == CSSPropertyApplyAtRule) { 1455 if (property == CSSPropertyApplyAtRule) {
1453 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, inheritedOnly, propertyWhitelistType); 1456 DCHECK(!inheritedOnly);
1457 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, propertyWhitelistType);
1454 continue; 1458 continue;
1455 } 1459 }
1456 1460
1457 if (isImportant != current.isImportant()) 1461 if (isImportant != current.isImportant())
1458 continue; 1462 continue;
1459 1463
1460 if (property == CSSPropertyAll) { 1464 if (property == CSSPropertyAll) {
1461 applyAllProperty<priority>(state, current.value(), inheritedOnly, pr opertyWhitelistType); 1465 applyAllProperty<priority>(state, current.value(), inheritedOnly, pr opertyWhitelistType);
1462 continue; 1466 continue;
1463 } 1467 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 visitor->trace(m_siblingRuleSet); 1747 visitor->trace(m_siblingRuleSet);
1744 visitor->trace(m_uncommonAttributeRuleSet); 1748 visitor->trace(m_uncommonAttributeRuleSet);
1745 visitor->trace(m_watchedSelectorsRules); 1749 visitor->trace(m_watchedSelectorsRules);
1746 visitor->trace(m_treeBoundaryCrossingScopes); 1750 visitor->trace(m_treeBoundaryCrossingScopes);
1747 visitor->trace(m_styleSharingLists); 1751 visitor->trace(m_styleSharingLists);
1748 visitor->trace(m_pendingStyleSheets); 1752 visitor->trace(m_pendingStyleSheets);
1749 visitor->trace(m_document); 1753 visitor->trace(m_document);
1750 } 1754 }
1751 1755
1752 } // namespace blink 1756 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698