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

Side by Side Diff: Source/core/css/RuleFeature.cpp

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 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 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 void RuleFeatureSet::updateInvalidationSetsForContentAttribute(const RuleData& r uleData) 298 void RuleFeatureSet::updateInvalidationSetsForContentAttribute(const RuleData& r uleData)
299 { 299 {
300 const StylePropertySet& propertySet = ruleData.rule()->properties(); 300 const StylePropertySet& propertySet = ruleData.rule()->properties();
301 301
302 int propertyIndex = propertySet.findPropertyIndex(CSSPropertyContent); 302 int propertyIndex = propertySet.findPropertyIndex(CSSPropertyContent);
303 303
304 if (propertyIndex == -1) 304 if (propertyIndex == -1)
305 return; 305 return;
306 306
307 StylePropertySet::PropertyReference contentProperty = propertySet.propertyAt (propertyIndex); 307 StylePropertySet::PropertyReference contentProperty = propertySet.propertyAt (propertyIndex);
308 CSSValue* contentValue = contentProperty.value(); 308 CSSValue contentValue = contentProperty.value();
309 309
310 if (!contentValue->isValueList()) 310 if (!contentValue.isValueList())
311 return; 311 return;
312 312
313 for (auto& item : toCSSValueList(*contentValue)) { 313 for (auto& item : toCSSValueList(contentValue)) {
314 if (!item->isPrimitiveValue()) 314 if (!item.isPrimitiveValue())
315 continue; 315 continue;
316 CSSPrimitiveValue* primitiveItem = toCSSPrimitiveValue(item.get()); 316 CSSPrimitiveValue& primitiveItem = toCSSPrimitiveValue(item);
317 if (!primitiveItem->isAttr()) 317 if (!primitiveItem.isAttr())
318 continue; 318 continue;
319 ensureAttributeInvalidationSet(AtomicString(primitiveItem->getStringValu e())); 319 ensureAttributeInvalidationSet(AtomicString(primitiveItem.getStringValue ()));
320 } 320 }
321 } 321 }
322 322
323 std::pair<const CSSSelector*, RuleFeatureSet::UseFeaturesType> 323 std::pair<const CSSSelector*, RuleFeatureSet::UseFeaturesType>
324 RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelector& selector, Inva lidationSetFeatures& features, bool negated) 324 RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelector& selector, Inva lidationSetFeatures& features, bool negated)
325 { 325 {
326 bool foundFeatures = false; 326 bool foundFeatures = false;
327 for (const CSSSelector* current = &selector; current; current = current->tag History()) { 327 for (const CSSSelector* current = &selector; current; current = current->tag History()) {
328 if (!negated) 328 if (!negated)
329 foundFeatures |= extractInvalidationSetFeature(*current, features); 329 foundFeatures |= extractInvalidationSetFeature(*current, features);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 visitor->trace(siblingRules); 583 visitor->trace(siblingRules);
584 visitor->trace(uncommonAttributeRules); 584 visitor->trace(uncommonAttributeRules);
585 visitor->trace(m_classInvalidationSets); 585 visitor->trace(m_classInvalidationSets);
586 visitor->trace(m_attributeInvalidationSets); 586 visitor->trace(m_attributeInvalidationSets);
587 visitor->trace(m_idInvalidationSets); 587 visitor->trace(m_idInvalidationSets);
588 visitor->trace(m_pseudoInvalidationSets); 588 visitor->trace(m_pseudoInvalidationSets);
589 #endif 589 #endif
590 } 590 }
591 591
592 } // namespace blink 592 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | Source/core/css/StylePropertySerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698