OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |