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

Side by Side Diff: Source/core/dom/StyledElement.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/dom/Element.cpp ('k') | Source/core/editing/ApplyStyleCommand.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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 { 145 {
146 return ensureMutableInlineStyle()->ensureInlineCSSStyleDeclaration(this); 146 return ensureMutableInlineStyle()->ensureInlineCSSStyleDeclaration(this);
147 } 147 }
148 148
149 MutableStylePropertySet* StyledElement::ensureMutableInlineStyle() 149 MutableStylePropertySet* StyledElement::ensureMutableInlineStyle()
150 { 150 {
151 RefPtr<StylePropertySet>& inlineStyle = ensureUniqueElementData()->m_inlineS tyle; 151 RefPtr<StylePropertySet>& inlineStyle = ensureUniqueElementData()->m_inlineS tyle;
152 if (!inlineStyle) 152 if (!inlineStyle)
153 inlineStyle = StylePropertySet::create(strictToCSSParserMode(isHTMLEleme nt() && !document()->inQuirksMode())); 153 inlineStyle = StylePropertySet::create(strictToCSSParserMode(isHTMLEleme nt() && !document()->inQuirksMode()));
154 else if (!inlineStyle->isMutable()) 154 else if (!inlineStyle->isMutable())
155 inlineStyle = inlineStyle->copy(); 155 inlineStyle = inlineStyle->mutableCopy();
156 ASSERT(inlineStyle->isMutable()); 156 ASSERT(inlineStyle->isMutable());
157 return static_cast<MutableStylePropertySet*>(inlineStyle.get()); 157 return static_cast<MutableStylePropertySet*>(inlineStyle.get());
158 } 158 }
159 159
160 void StyledElement::attributeChanged(const QualifiedName& name, const AtomicStri ng& newValue, AttributeModificationReason reason) 160 void StyledElement::attributeChanged(const QualifiedName& name, const AtomicStri ng& newValue, AttributeModificationReason reason)
161 { 161 {
162 if (name == styleAttr) 162 if (name == styleAttr)
163 styleAttributeChanged(newValue, reason); 163 styleAttributeChanged(newValue, reason);
164 else if (isPresentationAttribute(name)) { 164 else if (isPresentationAttribute(name)) {
165 elementData()->m_presentationAttributeStyleIsDirty = true; 165 elementData()->m_presentationAttributeStyleIsDirty = true;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 { 372 {
373 style->setProperty(propertyID, cssValuePool().createValue(value, unit)); 373 style->setProperty(propertyID, cssValuePool().createValue(value, unit));
374 } 374 }
375 375
376 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, const String& value) 376 void StyledElement::addPropertyToPresentationAttributeStyle(MutableStyleProperty Set* style, CSSPropertyID propertyID, const String& value)
377 { 377 {
378 style->setProperty(propertyID, value, false, document()->elementSheet()->con tents()); 378 style->setProperty(propertyID, value, false, document()->elementSheet()->con tents());
379 } 379 }
380 380
381 } 381 }
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698