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

Side by Side Diff: Source/core/dom/StyledElement.cpp

Issue 16339006: Make sure to use CSSValueID and CSSPropertyID rather than integers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/StyledElement.h ('k') | Source/core/editing/EditingStyle.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2008, 2010 Apple 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 Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void StyledElement::inlineStyleChanged() 222 void StyledElement::inlineStyleChanged()
223 { 223 {
224 setNeedsStyleRecalc(InlineStyleChange); 224 setNeedsStyleRecalc(InlineStyleChange);
225 ASSERT(elementData()); 225 ASSERT(elementData());
226 elementData()->m_styleAttributeIsDirty = true; 226 elementData()->m_styleAttributeIsDirty = true;
227 InspectorInstrumentation::didInvalidateStyleAttr(document(), this); 227 InspectorInstrumentation::didInvalidateStyleAttr(document(), this);
228 } 228 }
229 229
230 bool StyledElement::setInlineStyleProperty(CSSPropertyID propertyID, int identif ier, bool important) 230 bool StyledElement::setInlineStyleProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important)
231 { 231 {
232 ensureMutableInlineStyle()->setProperty(propertyID, cssValuePool().createIde ntifierValue(identifier), important); 232 ensureMutableInlineStyle()->setProperty(propertyID, cssValuePool().createIde ntifierValue(identifier), important);
233 inlineStyleChanged(); 233 inlineStyleChanged();
234 return true;
235 }
236
237 bool StyledElement::setInlineStyleProperty(CSSPropertyID propertyID, CSSProperty ID identifier, bool important)
238 {
239 ensureMutableInlineStyle()->setProperty(propertyID, cssValuePool().createIde ntifierValue(identifier), important);
240 inlineStyleChanged();
234 return true; 241 return true;
235 } 242 }
236 243
237 bool StyledElement::setInlineStyleProperty(CSSPropertyID propertyID, double valu e, CSSPrimitiveValue::UnitTypes unit, bool important) 244 bool StyledElement::setInlineStyleProperty(CSSPropertyID propertyID, double valu e, CSSPrimitiveValue::UnitTypes unit, bool important)
238 { 245 {
239 ensureMutableInlineStyle()->setProperty(propertyID, cssValuePool().createVal ue(value, unit), important); 246 ensureMutableInlineStyle()->setProperty(propertyID, cssValuePool().createVal ue(value, unit), important);
240 inlineStyleChanged(); 247 inlineStyleChanged();
241 return true; 248 return true;
242 } 249 }
243 250
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 366
360 static const int presentationAttributeCacheMaximumSize = 4096; 367 static const int presentationAttributeCacheMaximumSize = 4096;
361 if (presentationAttributeCache().size() > presentationAttributeCacheMaximumS ize) { 368 if (presentationAttributeCache().size() > presentationAttributeCacheMaximumS ize) {
362 // Start building from scratch if the cache ever gets big. 369 // Start building from scratch if the cache ever gets big.
363 presentationAttributeCache().clear(); 370 presentationAttributeCache().clear();
364 presentationAttributeCache().set(cacheHash, newEntry.release()); 371 presentationAttributeCache().set(cacheHash, newEntry.release());
365 } else 372 } else
366 cacheIterator->value = newEntry.release(); 373 cacheIterator->value = newEntry.release();
367 } 374 }
368 375
369 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, int identifier) 376 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, CSSValueID identifier)
370 { 377 {
371 style->setProperty(propertyID, cssValuePool().createIdentifierValue(identifi er)); 378 style->setProperty(propertyID, cssValuePool().createIdentifierValue(identifi er));
372 } 379 }
373 380
374 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, double value, CSSPrimitiveValue::UnitTypes unit) 381 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, double value, CSSPrimitiveValue::UnitTypes unit)
375 { 382 {
376 style->setProperty(propertyID, cssValuePool().createValue(value, unit)); 383 style->setProperty(propertyID, cssValuePool().createValue(value, unit));
377 } 384 }
378 385
379 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, const String& value) 386 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, const String& value)
380 { 387 {
381 style->setProperty(propertyID, value, false, document()->elementSheet()->con tents()); 388 style->setProperty(propertyID, value, false, document()->elementSheet()->con tents());
382 } 389 }
383 390
384 } 391 }
OLDNEW
« no previous file with comments | « Source/core/dom/StyledElement.h ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698