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

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

Issue 2044023005: Make PropertyReference value() return a const CSSValue& (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_remove_style_property_set_mutable_overload
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 { 136 {
137 return propertySet().propertyCount(); 137 return propertySet().propertyCount();
138 } 138 }
139 139
140 String AbstractPropertySetCSSStyleDeclaration::item(unsigned i) const 140 String AbstractPropertySetCSSStyleDeclaration::item(unsigned i) const
141 { 141 {
142 if (i >= propertySet().propertyCount()) 142 if (i >= propertySet().propertyCount())
143 return ""; 143 return "";
144 StylePropertySet::PropertyReference property = propertySet().propertyAt(i); 144 StylePropertySet::PropertyReference property = propertySet().propertyAt(i);
145 if (RuntimeEnabledFeatures::cssVariablesEnabled() && property.id() == CSSPro pertyVariable) 145 if (RuntimeEnabledFeatures::cssVariablesEnabled() && property.id() == CSSPro pertyVariable)
146 return toCSSCustomPropertyDeclaration(property.value())->name(); 146 return toCSSCustomPropertyDeclaration(property.value()).name();
147 if (property.id() == CSSPropertyApplyAtRule) 147 if (property.id() == CSSPropertyApplyAtRule)
148 return "@apply"; 148 return "@apply";
149 return getPropertyName(property.id()); 149 return getPropertyName(property.id());
150 } 150 }
151 151
152 String AbstractPropertySetCSSStyleDeclaration::cssText() const 152 String AbstractPropertySetCSSStyleDeclaration::cssText() const
153 { 153 {
154 return propertySet().asText(); 154 return propertySet().asText();
155 } 155 }
156 156
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 297
298 StyleSheetContents* AbstractPropertySetCSSStyleDeclaration::contextStyleSheet() const 298 StyleSheetContents* AbstractPropertySetCSSStyleDeclaration::contextStyleSheet() const
299 { 299 {
300 CSSStyleSheet* cssStyleSheet = parentStyleSheet(); 300 CSSStyleSheet* cssStyleSheet = parentStyleSheet();
301 return cssStyleSheet ? cssStyleSheet->contents() : nullptr; 301 return cssStyleSheet ? cssStyleSheet->contents() : nullptr;
302 } 302 }
303 303
304 bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID pr opertyID, const CSSValue* propertyValue) const 304 bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID pr opertyID, const CSSValue* propertyValue) const
305 { 305 {
306 return propertySet().propertyMatches(propertyID, propertyValue); 306 return propertySet().propertyMatches(propertyID, *propertyValue);
307 } 307 }
308 308
309 DEFINE_TRACE(AbstractPropertySetCSSStyleDeclaration) 309 DEFINE_TRACE(AbstractPropertySetCSSStyleDeclaration)
310 { 310 {
311 CSSStyleDeclaration::trace(visitor); 311 CSSStyleDeclaration::trace(visitor);
312 } 312 }
313 313
314 StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertyS et& propertySetArg, CSSRule* parentRule) 314 StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertyS et& propertySetArg, CSSRule* parentRule)
315 : PropertySetCSSStyleDeclaration(propertySetArg) 315 : PropertySetCSSStyleDeclaration(propertySetArg)
316 , m_parentRule(parentRule) 316 , m_parentRule(parentRule)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return m_parentElement ? &m_parentElement->document().elementSheet() : nullp tr; 374 return m_parentElement ? &m_parentElement->document().elementSheet() : nullp tr;
375 } 375 }
376 376
377 DEFINE_TRACE(InlineCSSStyleDeclaration) 377 DEFINE_TRACE(InlineCSSStyleDeclaration)
378 { 378 {
379 visitor->trace(m_parentElement); 379 visitor->trace(m_parentElement);
380 AbstractPropertySetCSSStyleDeclaration::trace(visitor); 380 AbstractPropertySetCSSStyleDeclaration::trace(visitor);
381 } 381 }
382 382
383 } // namespace blink 383 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp ('k') | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698