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

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

Issue 15746004: Rename/tweak some StylePropertySet/CSSStyleDeclaration copying functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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/css/StylePropertySet.h ('k') | Source/core/css/StyleRule.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 * (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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 for (unsigned i = 0; i < size; ++i) { 489 for (unsigned i = 0; i < size; ++i) {
490 PropertyReference property = propertyAt(i); 490 PropertyReference property = propertyAt(i);
491 if (style->cssPropertyMatches(property.id(), property.value())) 491 if (style->cssPropertyMatches(property.id(), property.value()))
492 propertiesToRemove.append(property.id()); 492 propertiesToRemove.append(property.id());
493 } 493 }
494 // FIXME: This should use mass removal. 494 // FIXME: This should use mass removal.
495 for (unsigned i = 0; i < propertiesToRemove.size(); ++i) 495 for (unsigned i = 0; i < propertiesToRemove.size(); ++i)
496 removeProperty(propertiesToRemove[i]); 496 removeProperty(propertiesToRemove[i]);
497 } 497 }
498 498
499 PassRefPtr<StylePropertySet> StylePropertySet::copy() const 499 PassRefPtr<MutableStylePropertySet> StylePropertySet::mutableCopy() const
500 { 500 {
501 return adoptRef(new MutableStylePropertySet(*this)); 501 return adoptRef(new MutableStylePropertySet(*this));
502 } 502 }
503 503
504 PassRefPtr<StylePropertySet> StylePropertySet::copyPropertiesInSet(const Vector< CSSPropertyID>& properties) const 504 PassRefPtr<MutableStylePropertySet> StylePropertySet::copyPropertiesInSet(const Vector<CSSPropertyID>& properties) const
505 { 505 {
506 Vector<CSSProperty, 256> list; 506 Vector<CSSProperty, 256> list;
507 list.reserveInitialCapacity(properties.size()); 507 list.reserveInitialCapacity(properties.size());
508 for (unsigned i = 0; i < properties.size(); ++i) { 508 for (unsigned i = 0; i < properties.size(); ++i) {
509 RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]); 509 RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]);
510 if (value) 510 if (value)
511 list.append(CSSProperty(properties[i], value.release(), false)); 511 list.append(CSSProperty(properties[i], value.release(), false));
512 } 512 }
513 return StylePropertySet::create(list.data(), list.size()); 513 return static_pointer_cast<MutableStylePropertySet>(StylePropertySet::create (list.data(), list.size()));
514 } 514 }
515 515
516 PropertySetCSSStyleDeclaration* StylePropertySet::cssStyleDeclaration() 516 PropertySetCSSStyleDeclaration* StylePropertySet::cssStyleDeclaration()
517 { 517 {
518 if (!m_ownsCSSOMWrapper) 518 if (!m_ownsCSSOMWrapper)
519 return 0; 519 return 0;
520 ASSERT(isMutable()); 520 ASSERT(isMutable());
521 return propertySetCSSOMWrapperMap().get(this); 521 return propertySetCSSOMWrapperMap().get(this);
522 } 522 }
523 523
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 result.appendLiteral(": "); 609 result.appendLiteral(": ");
610 result.append(propertyValue()->cssText()); 610 result.append(propertyValue()->cssText());
611 if (isImportant()) 611 if (isImportant())
612 result.appendLiteral(" !important"); 612 result.appendLiteral(" !important");
613 result.append(';'); 613 result.append(';');
614 return result.toString(); 614 return result.toString();
615 } 615 }
616 616
617 617
618 } // namespace WebCore 618 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySet.h ('k') | Source/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698