Changeset 154682 in webkit
- Timestamp:
- Aug 27, 2013, 7:39:46 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r154681 r154682 1 2013-08-27 Antti Koivisto <antti@apple.com> 2 3 Remove branch from DescendantIteratorAdapter::begin() when invoking for ContainerNode 4 https://bugs.webkit.org/show_bug.cgi?id=120358 5 6 Reviewed by Andreas Kling. 7 8 * dom/ContainerNode.h: 9 10 Delete isContainerNode() so it can't be called if there is static knowledge that the object is a ContainerNode. 11 12 * dom/DescendantIterator.h: 13 (WebCore::::DescendantIterator): 14 15 Make DescendantIterator use Node* as root instead of ContainerNode*. It is only used for equality comparison. 16 17 (WebCore::::begin): 18 19 Remove branch. Rely on ElementTraversal specialization for ContainerNodes. 20 1 21 2013-08-27 Joseph Pecoraro <pecoraro@apple.com> 2 22 -
TabularUnified trunk/Source/WebCore/dom/ContainerNode.h ¶
r154371 r154682 148 148 bool getLowerRightCorner(FloatPoint&) const; 149 149 150 bool isContainerNode() const WTF_DELETED_FUNCTION; 151 150 152 Node* m_firstChild; 151 153 Node* m_lastChild; -
TabularUnified trunk/Source/WebCore/dom/DescendantIterator.h ¶
r154581 r154682 38 38 class DescendantIterator { 39 39 public: 40 DescendantIterator(const ContainerNode* root);41 DescendantIterator(const ContainerNode* root, ElementType* current);40 DescendantIterator(const Node* root); 41 DescendantIterator(const Node* root, ElementType* current); 42 42 DescendantIterator& operator++(); 43 43 ElementType& operator*() { return *m_current; } … … 46 46 47 47 private: 48 const ContainerNode* m_root;48 const Node* m_root; 49 49 ElementType* m_current; 50 50 #ifndef NDEBUG … … 71 71 72 72 template <typename ElementType> 73 inline DescendantIterator<ElementType>::DescendantIterator(const ContainerNode* root)73 inline DescendantIterator<ElementType>::DescendantIterator(const Node* root) 74 74 : m_root(root) 75 75 , m_current(nullptr) … … 81 81 82 82 template <typename ElementType> 83 inline DescendantIterator<ElementType>::DescendantIterator(const ContainerNode* root, ElementType* current)83 inline DescendantIterator<ElementType>::DescendantIterator(const Node* root, ElementType* current) 84 84 : m_root(root) 85 85 , m_current(current) … … 116 116 inline DescendantIterator<ElementType> DescendantIteratorAdapter<ElementType, ContainerType>::begin() 117 117 { 118 if (!m_root->isContainerNode()) 119 return DescendantIterator<ElementType>(m_root); 120 return DescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(static_cast<ContainerNode*>(m_root))); 118 return DescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(m_root)); 121 119 } 122 120
Note:
See TracChangeset
for help on using the changeset viewer.