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

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

Issue 1233363002: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
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
« no previous file with comments | « Source/core/css/CSSCalculationValue.cpp ('k') | Source/core/css/CSSCrossfadeValue.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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 return getPropertyNameString(computableProperties()[i]); 603 return getPropertyNameString(computableProperties()[i]);
604 } 604 }
605 605
606 bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, c onst CSSValue propertyValue) const 606 bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, c onst CSSValue propertyValue) const
607 { 607 {
608 if (propertyID == CSSPropertyFontSize && propertyValue.isPrimitiveValue() && m_node) { 608 if (propertyID == CSSPropertyFontSize && propertyValue.isPrimitiveValue() && m_node) {
609 m_node->document().updateLayoutIgnorePendingStylesheets(); 609 m_node->document().updateLayoutIgnorePendingStylesheets();
610 const ComputedStyle* style = m_node->ensureComputedStyle(m_pseudoElement Specifier); 610 const ComputedStyle* style = m_node->ensureComputedStyle(m_pseudoElement Specifier);
611 if (style && style->fontDescription().keywordSize()) { 611 if (style && style->fontDescription().keywordSize()) {
612 CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDe scription().keywordSize()); 612 CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDe scription().keywordSize());
613 const CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(propert yValue); 613 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(proper tyValue);
614 if (primitiveValue.isValueID() && primitiveValue.getValueID() == siz eValue) 614 if (primitiveValue.isValueID() && primitiveValue.getValueID() == siz eValue)
615 return true; 615 return true;
616 } 616 }
617 } 617 }
618 NullableCSSValue value = getPropertyCSSValue(propertyID); 618 NullableCSSValue value = getPropertyCSSValue(propertyID);
619 return value && value->equals(propertyValue); 619 return value && value->equals(propertyValue);
620 } 620 }
621 621
622 PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::cop yProperties() const 622 PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::cop yProperties() const
623 { 623 {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only."); 692 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only.");
693 } 693 }
694 694
695 DEFINE_TRACE(CSSComputedStyleDeclaration) 695 DEFINE_TRACE(CSSComputedStyleDeclaration)
696 { 696 {
697 visitor->trace(m_node); 697 visitor->trace(m_node);
698 CSSStyleDeclaration::trace(visitor); 698 CSSStyleDeclaration::trace(visitor);
699 } 699 }
700 700
701 } // namespace blink 701 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSCalculationValue.cpp ('k') | Source/core/css/CSSCrossfadeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698