| 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, 2007, 2009, 2010, 2012 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool Attr::isId() const | 183 bool Attr::isId() const |
| 184 { | 184 { |
| 185 return qualifiedName().matches(document()->idAttributeName()); | 185 return qualifiedName().matches(document()->idAttributeName()); |
| 186 } | 186 } |
| 187 | 187 |
| 188 CSSStyleDeclaration* Attr::style() | 188 CSSStyleDeclaration* Attr::style() |
| 189 { | 189 { |
| 190 // This function only exists to support the Obj-C bindings. | 190 // This function only exists to support the Obj-C bindings. |
| 191 if (!m_element || !m_element->isStyledElement()) | 191 if (!m_element || !m_element->isStyledElement()) |
| 192 return 0; | 192 return 0; |
| 193 m_style = StylePropertySet::create(); | 193 m_style = MutableStylePropertySet::create(); |
| 194 static_cast<StyledElement*>(m_element)->collectStyleForPresentationAttribute
(qualifiedName(), value(), static_cast<MutableStylePropertySet*>(m_style.get()))
; | 194 static_cast<StyledElement*>(m_element)->collectStyleForPresentationAttribute
(qualifiedName(), value(), static_cast<MutableStylePropertySet*>(m_style.get()))
; |
| 195 return m_style->ensureCSSStyleDeclaration(); | 195 return m_style->ensureCSSStyleDeclaration(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 const AtomicString& Attr::value() const | 198 const AtomicString& Attr::value() const |
| 199 { | 199 { |
| 200 if (m_element) | 200 if (m_element) |
| 201 return m_element->getAttribute(qualifiedName()); | 201 return m_element->getAttribute(qualifiedName()); |
| 202 return m_standaloneValue; | 202 return m_standaloneValue; |
| 203 } | 203 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 void Attr::attachToElement(Element* element) | 220 void Attr::attachToElement(Element* element) |
| 221 { | 221 { |
| 222 ASSERT(!m_element); | 222 ASSERT(!m_element); |
| 223 m_element = element; | 223 m_element = element; |
| 224 m_standaloneValue = nullAtom; | 224 m_standaloneValue = nullAtom; |
| 225 } | 225 } |
| 226 | 226 |
| 227 } | 227 } |
| OLD | NEW |