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

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: remove check 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 state.style()->setHasVariableReferenceFromNonInheritedProperty();
1436 if (!state.style()->variables()) 1437 if (!state.style()->variables())
1437 return; 1438 return;
1438 const String& name = toCSSCustomIdentValue(value).value(); 1439 const String& name = toCSSCustomIdentValue(value).value();
1439 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name); 1440 const StylePropertySet* propertySet = state.customPropertySetForApplyAtRule( name);
1441 bool inheritedOnly = false;
1440 if (propertySet) 1442 if (propertySet)
1441 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType); 1443 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly , propertyWhitelistType);
1442 } 1444 }
1443 1445
1444 template <CSSPropertyPriority priority> 1446 template <CSSPropertyPriority priority>
1445 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType) 1447 void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper tySet* properties, bool isImportant, bool inheritedOnly, PropertyWhitelistType p ropertyWhitelistType)
1446 { 1448 {
1447 unsigned propertyCount = properties->propertyCount(); 1449 unsigned propertyCount = properties->propertyCount();
1448 for (unsigned i = 0; i < propertyCount; ++i) { 1450 for (unsigned i = 0; i < propertyCount; ++i) {
1449 StylePropertySet::PropertyReference current = properties->propertyAt(i); 1451 StylePropertySet::PropertyReference current = properties->propertyAt(i);
1450 CSSPropertyID property = current.id(); 1452 CSSPropertyID property = current.id();
1451 1453
1452 if (property == CSSPropertyApplyAtRule) { 1454 if (property == CSSPropertyApplyAtRule) {
1453 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, inheritedOnly, propertyWhitelistType); 1455 DCHECK(!inheritedOnly);
1456 applyPropertiesForApplyAtRule<priority>(state, current.value(), isIm portant, propertyWhitelistType);
1454 continue; 1457 continue;
1455 } 1458 }
1456 1459
1457 if (isImportant != current.isImportant()) 1460 if (isImportant != current.isImportant())
1458 continue; 1461 continue;
1459 1462
1460 if (property == CSSPropertyAll) { 1463 if (property == CSSPropertyAll) {
1461 applyAllProperty<priority>(state, current.value(), inheritedOnly, pr opertyWhitelistType); 1464 applyAllProperty<priority>(state, current.value(), inheritedOnly, pr opertyWhitelistType);
1462 continue; 1465 continue;
1463 } 1466 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 visitor->trace(m_siblingRuleSet); 1746 visitor->trace(m_siblingRuleSet);
1744 visitor->trace(m_uncommonAttributeRuleSet); 1747 visitor->trace(m_uncommonAttributeRuleSet);
1745 visitor->trace(m_watchedSelectorsRules); 1748 visitor->trace(m_watchedSelectorsRules);
1746 visitor->trace(m_treeBoundaryCrossingScopes); 1749 visitor->trace(m_treeBoundaryCrossingScopes);
1747 visitor->trace(m_styleSharingLists); 1750 visitor->trace(m_styleSharingLists);
1748 visitor->trace(m_pendingStyleSheets); 1751 visitor->trace(m_pendingStyleSheets);
1749 visitor->trace(m_document); 1752 visitor->trace(m_document);
1750 } 1753 }
1751 1754
1752 } // namespace blink 1755 } // 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