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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 for (i = 0; i < length; ++i) { | 165 for (i = 0; i < length; ++i) { |
166 if (isNotHTMLSpace(characters[i])) | 166 if (isNotHTMLSpace(characters[i])) |
167 break; | 167 break; |
168 } | 168 } |
169 bool hasClass = i < length; | 169 bool hasClass = i < length; |
170 if (hasClass) { | 170 if (hasClass) { |
171 const bool shouldFoldCase = document()->inQuirksMode(); | 171 const bool shouldFoldCase = document()->inQuirksMode(); |
172 ensureAttributeData()->setClass(newClassString, shouldFoldCase); | 172 ensureAttributeData()->setClass(newClassString, shouldFoldCase); |
173 if (DOMTokenList* classList = optionalClassList()) | 173 if (DOMTokenList* classList = optionalClassList()) |
174 static_cast<ClassList*>(classList)->reset(newClassString); | 174 static_cast<ClassList*>(classList)->reset(newClassString); |
175 } else | 175 } else if (attributeData()) |
176 attributeData()->clearClass(); | 176 attributeData()->clearClass(); |
177 setNeedsStyleRecalc(); | 177 setNeedsStyleRecalc(); |
178 } | 178 } |
179 | 179 |
180 void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, Sh
ouldReparseStyleAttribute shouldReparse) | 180 void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, Sh
ouldReparseStyleAttribute shouldReparse) |
181 { | 181 { |
182 if (shouldReparse) { | 182 if (shouldReparse) { |
183 WTF::OrdinalNumber startLineNumber = WTF::OrdinalNumber::beforeFirst(); | 183 WTF::OrdinalNumber startLineNumber = WTF::OrdinalNumber::beforeFirst(); |
184 if (document() && document()->scriptableDocumentParser() && !document()-
>isInDocumentWrite()) | 184 if (document() && document()->scriptableDocumentParser() && !document()-
>isInDocumentWrite()) |
185 startLineNumber = document()->scriptableDocumentParser()->lineNumber
(); | 185 startLineNumber = document()->scriptableDocumentParser()->lineNumber
(); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 { | 346 { |
347 style->setProperty(propertyID, cssValuePool().createValue(value, unit)); | 347 style->setProperty(propertyID, cssValuePool().createValue(value, unit)); |
348 } | 348 } |
349 | 349 |
350 void StyledElement::addPropertyToAttributeStyle(StylePropertySet* style, CSSProp
ertyID propertyID, const String& value) | 350 void StyledElement::addPropertyToAttributeStyle(StylePropertySet* style, CSSProp
ertyID propertyID, const String& value) |
351 { | 351 { |
352 style->setProperty(propertyID, value, false, document()->elementSheet()->con
tents()); | 352 style->setProperty(propertyID, value, false, document()->elementSheet()->con
tents()); |
353 } | 353 } |
354 | 354 |
355 } | 355 } |
OLD | NEW |