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 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 size_t index = elementData()->attributes().findIndex(localName); | 1319 size_t index = elementData()->attributes().findIndex(localName); |
1320 if (index == kNotFound) { | 1320 if (index == kNotFound) { |
1321 if (UNLIKELY(localName == HTMLNames::styleAttr) && elementData()->m_styl
eAttributeIsDirty && isStyledElement()) | 1321 if (UNLIKELY(localName == HTMLNames::styleAttr) && elementData()->m_styl
eAttributeIsDirty && isStyledElement()) |
1322 removeAllInlineStyleProperties(); | 1322 removeAllInlineStyleProperties(); |
1323 return; | 1323 return; |
1324 } | 1324 } |
1325 | 1325 |
1326 removeAttributeInternal(index, NotInSynchronizationOfLazyAttribute); | 1326 removeAttributeInternal(index, NotInSynchronizationOfLazyAttribute); |
1327 } | 1327 } |
1328 | 1328 |
| 1329 Vector<RefPtr<Attr>> Element::getAttributes() |
| 1330 { |
| 1331 if (!elementData()) |
| 1332 return Vector<RefPtr<Attr>>(); |
| 1333 synchronizeAllAttributes(); |
| 1334 Vector<RefPtr<Attr>> attributes; |
| 1335 for (const Attribute& attribute : elementData()->attributes()) |
| 1336 attributes.append(ensureAttr(attribute.name())); |
| 1337 return attributes; |
| 1338 } |
| 1339 |
1329 PassRefPtr<Attr> Element::getAttributeNode(const AtomicString& localName) | 1340 PassRefPtr<Attr> Element::getAttributeNode(const AtomicString& localName) |
1330 { | 1341 { |
1331 if (!elementData()) | 1342 if (!elementData()) |
1332 return nullptr; | 1343 return nullptr; |
1333 synchronizeAttribute(localName); | 1344 synchronizeAttribute(localName); |
1334 const Attribute* attribute = elementData()->attributes().find(localName); | 1345 const Attribute* attribute = elementData()->attributes().find(localName); |
1335 if (!attribute) | 1346 if (!attribute) |
1336 return nullptr; | 1347 return nullptr; |
1337 return ensureAttr(attribute->name()); | 1348 return ensureAttr(attribute->name()); |
1338 } | 1349 } |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 { | 2103 { |
2093 #if ENABLE(OILPAN) | 2104 #if ENABLE(OILPAN) |
2094 if (hasRareData()) | 2105 if (hasRareData()) |
2095 visitor->trace(elementRareData()); | 2106 visitor->trace(elementRareData()); |
2096 visitor->trace(m_elementData); | 2107 visitor->trace(m_elementData); |
2097 #endif | 2108 #endif |
2098 ContainerNode::trace(visitor); | 2109 ContainerNode::trace(visitor); |
2099 } | 2110 } |
2100 | 2111 |
2101 } // namespace blink | 2112 } // namespace blink |
OLD | NEW |