diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/dom/StyledElement.h | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/dom/StyledElement.h')
-rw-r--r-- | WebCore/dom/StyledElement.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/WebCore/dom/StyledElement.h b/WebCore/dom/StyledElement.h index e7766b2..f22a5e8 100644 --- a/WebCore/dom/StyledElement.h +++ b/WebCore/dom/StyledElement.h @@ -3,7 +3,7 @@ * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2001 Peter Kelly (pmk@post.com) * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -53,9 +53,12 @@ public: void addCSSColor(MappedAttribute* attr, int id, const String &c); void createMappedDecl(MappedAttribute* attr); - static CSSMappedAttributeDeclaration* getMappedAttributeDecl(MappedAttributeEntry type, Attribute* attr); - static void setMappedAttributeDecl(MappedAttributeEntry type, Attribute* attr, CSSMappedAttributeDeclaration* decl); - static void removeMappedAttributeDecl(MappedAttributeEntry type, const QualifiedName& attrName, const AtomicString& attrValue); + static CSSMappedAttributeDeclaration* getMappedAttributeDecl(MappedAttributeEntry type, const QualifiedName& name, const AtomicString& value); + static void setMappedAttributeDecl(MappedAttributeEntry, const QualifiedName& name, const AtomicString& value, CSSMappedAttributeDeclaration*); + static void removeMappedAttributeDecl(MappedAttributeEntry type, const QualifiedName& name, const AtomicString& value); + + static CSSMappedAttributeDeclaration* getMappedAttributeDecl(MappedAttributeEntry, Attribute*); + static void setMappedAttributeDecl(MappedAttributeEntry, Attribute*, CSSMappedAttributeDeclaration*); CSSMutableStyleDeclaration* inlineStyleDecl() const { return m_inlineStyleDecl.get(); } virtual bool canHaveAdditionalAttributeStyleDecls() const { return false; } @@ -65,18 +68,24 @@ public: void createInlineStyleDecl(); void destroyInlineStyleDecl(); void invalidateStyleAttribute(); - virtual void updateStyleAttributeIfNeeded() const; + virtual void updateStyleAttribute() const; - virtual const ClassNames* getClassNames() const; - virtual void attributeChanged(Attribute* attr, bool preserveDecls = false); - virtual void parseMappedAttribute(MappedAttribute* attr); + const ClassNames& classNames() const { ASSERT(hasClass()); ASSERT(mappedAttributes()); return mappedAttributes()->classNames(); } + + virtual void attributeChanged(Attribute*, bool preserveDecls = false); + virtual void parseMappedAttribute(MappedAttribute*); virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const; virtual void createAttributeMap() const; - virtual Attribute* createAttribute(const QualifiedName& name, StringImpl* value); + virtual PassRefPtr<Attribute> createAttribute(const QualifiedName&, const AtomicString& value); virtual void copyNonAttributeProperties(const Element*); protected: + // classAttributeChanged() exists to share code between + // parseMappedAttribute (called via setAttribute()) and + // svgAttributeChanged (called when element.className.baseValue is set) + void classAttributeChanged(const AtomicString& newClassString); + RefPtr<CSSMutableStyleDeclaration> m_inlineStyleDecl; }; |