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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 #include "wtf/HashFunctions.h" | 123 #include "wtf/HashFunctions.h" |
124 #include "wtf/text/CString.h" | 124 #include "wtf/text/CString.h" |
125 #include "wtf/text/StringBuilder.h" | 125 #include "wtf/text/StringBuilder.h" |
126 #include "wtf/text/TextPosition.h" | 126 #include "wtf/text/TextPosition.h" |
127 | 127 |
128 namespace blink { | 128 namespace blink { |
129 | 129 |
130 using namespace HTMLNames; | 130 using namespace HTMLNames; |
131 using namespace XMLNames; | 131 using namespace XMLNames; |
132 | 132 |
133 typedef WillBeHeapVector<RefPtrWillBeMember<Attr> > AttrNodeList; | 133 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList; |
134 | 134 |
135 static Attr* findAttrNodeInList(const AttrNodeList& attrNodeList, const Qualifie
dName& name) | 135 static Attr* findAttrNodeInList(const AttrNodeList& attrNodeList, const Qualifie
dName& name) |
136 { | 136 { |
137 for (const auto& attr : attrNodeList) { | 137 for (const auto& attr : attrNodeList) { |
138 if (attr->qualifiedName() == name) | 138 if (attr->qualifiedName() == name) |
139 return attr.get(); | 139 return attr.get(); |
140 } | 140 } |
141 return nullptr; | 141 return nullptr; |
142 } | 142 } |
143 | 143 |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 | 1896 |
1897 strncpy(buffer, result.toString().utf8().data(), length - 1); | 1897 strncpy(buffer, result.toString().utf8().data(), length - 1); |
1898 } | 1898 } |
1899 #endif | 1899 #endif |
1900 | 1900 |
1901 WillBeHeapVector<RefPtrWillBeMember<Attr>>* Element::attrNodeList() | 1901 WillBeHeapVector<RefPtrWillBeMember<Attr>>* Element::attrNodeList() |
1902 { | 1902 { |
1903 return hasRareData() ? elementRareData()->attrNodeList() : nullptr; | 1903 return hasRareData() ? elementRareData()->attrNodeList() : nullptr; |
1904 } | 1904 } |
1905 | 1905 |
1906 WillBeHeapVector<RefPtrWillBeMember<Attr> >& Element::ensureAttrNodeList() | 1906 WillBeHeapVector<RefPtrWillBeMember<Attr>>& Element::ensureAttrNodeList() |
1907 { | 1907 { |
1908 setHasSyntheticAttrChildNodes(true); | 1908 setHasSyntheticAttrChildNodes(true); |
1909 return ensureElementRareData().ensureAttrNodeList(); | 1909 return ensureElementRareData().ensureAttrNodeList(); |
1910 } | 1910 } |
1911 | 1911 |
1912 void Element::removeAttrNodeList() | 1912 void Element::removeAttrNodeList() |
1913 { | 1913 { |
1914 ASSERT(hasSyntheticAttrChildNodes()); | 1914 ASSERT(hasSyntheticAttrChildNodes()); |
1915 if (hasRareData()) | 1915 if (hasRareData()) |
1916 elementRareData()->removeAttrNodeList(); | 1916 elementRareData()->removeAttrNodeList(); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 void Element::cancelFocusAppearanceUpdate() | 2580 void Element::cancelFocusAppearanceUpdate() |
2581 { | 2581 { |
2582 if (document().focusedElement() == this) | 2582 if (document().focusedElement() == this) |
2583 document().cancelFocusAppearanceUpdate(); | 2583 document().cancelFocusAppearanceUpdate(); |
2584 } | 2584 } |
2585 | 2585 |
2586 void Element::normalizeAttributes() | 2586 void Element::normalizeAttributes() |
2587 { | 2587 { |
2588 if (!hasAttributes()) | 2588 if (!hasAttributes()) |
2589 return; | 2589 return; |
2590 WillBeHeapVector<RefPtrWillBeMember<Attr> >* attrNodes = attrNodeList(); | 2590 WillBeHeapVector<RefPtrWillBeMember<Attr>>* attrNodes = attrNodeList(); |
2591 if (!attrNodes) | 2591 if (!attrNodes) |
2592 return; | 2592 return; |
2593 // Copy the Attr Vector because Node::normalize() can fire synchronous JS | 2593 // Copy the Attr Vector because Node::normalize() can fire synchronous JS |
2594 // events (e.g. DOMSubtreeModified) and a JS listener could add / remove | 2594 // events (e.g. DOMSubtreeModified) and a JS listener could add / remove |
2595 // attributes while we are iterating. | 2595 // attributes while we are iterating. |
2596 WillBeHeapVector<RefPtrWillBeMember<Attr> > attrNodesCopy(*attrNodes); | 2596 WillBeHeapVector<RefPtrWillBeMember<Attr>> attrNodesCopy(*attrNodes); |
2597 for (size_t i = 0; i < attrNodesCopy.size(); ++i) | 2597 for (size_t i = 0; i < attrNodesCopy.size(); ++i) |
2598 attrNodesCopy[i]->normalize(); | 2598 attrNodesCopy[i]->normalize(); |
2599 } | 2599 } |
2600 | 2600 |
2601 void Element::updatePseudoElement(PseudoId pseudoId, StyleRecalcChange change) | 2601 void Element::updatePseudoElement(PseudoId pseudoId, StyleRecalcChange change) |
2602 { | 2602 { |
2603 ASSERT(!needsStyleRecalc()); | 2603 ASSERT(!needsStyleRecalc()); |
2604 PseudoElement* element = pseudoElement(pseudoId); | 2604 PseudoElement* element = pseudoElement(pseudoId); |
2605 | 2605 |
2606 if (element && (change == UpdatePseudoElements || element->shouldCallRecalcS
tyle(change))) { | 2606 if (element && (change == UpdatePseudoElements || element->shouldCallRecalcS
tyle(change))) { |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3374 { | 3374 { |
3375 #if ENABLE(OILPAN) | 3375 #if ENABLE(OILPAN) |
3376 if (hasRareData()) | 3376 if (hasRareData()) |
3377 visitor->trace(elementRareData()); | 3377 visitor->trace(elementRareData()); |
3378 visitor->trace(m_elementData); | 3378 visitor->trace(m_elementData); |
3379 #endif | 3379 #endif |
3380 ContainerNode::trace(visitor); | 3380 ContainerNode::trace(visitor); |
3381 } | 3381 } |
3382 | 3382 |
3383 } // namespace blink | 3383 } // namespace blink |
OLD | NEW |