Changeset 157924 in webkit
- Timestamp:
- Oct 24, 2013, 6:26:06 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157920 r157924 1 2013-10-24 Antti Koivisto <antti@apple.com> 2 3 Element iterator functions should take reference 4 https://bugs.webkit.org/show_bug.cgi?id=123267 5 6 Reviewed by Andreas Kling. 7 8 The argument has to be non-null. 9 1 10 2013-10-24 Ryuan Choi <ryuan.choi@samsung.com> 2 11 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r157653 r157924 399 399 case LegendRole: 400 400 if (Element* element = this->element()) 401 return !ancestorsOfType<HTMLFieldSetElement>( element).first();401 return !ancestorsOfType<HTMLFieldSetElement>(*element).first(); 402 402 default: 403 403 return true; … … 425 425 if (!node || !node->hasTagName(canvasTag)) 426 426 return false; 427 Element * canvasElement = toElement(node);427 Element& canvasElement = toElement(*node); 428 428 // If it has any children that are elements, we'll assume it might be fallback 429 429 // content. If it has no children or its only children are not elements … … 1142 1142 } 1143 1143 1144 return ancestorsOfType<HTMLLabelElement>( element).first();1144 return ancestorsOfType<HTMLLabelElement>(*element).first(); 1145 1145 } 1146 1146 … … 1163 1163 if (!parent) 1164 1164 return 0; 1165 for (auto sibling = elementChildren(parent).begin(), end = elementChildren(parent).end(); sibling != end; ++sibling) { 1165 auto children = elementChildren(*parent); 1166 for (auto sibling = children.begin(), end = children.end(); sibling != end; ++sibling) { 1166 1167 const AtomicString& siblingAriaRole = sibling->fastGetAttribute(roleAttr); 1167 1168 if (equalIgnoringCase(siblingAriaRole, role)) -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r157821 r157924 2709 2709 return; 2710 2710 2711 for (auto area = descendantsOfType<HTMLAreaElement>(map).begin(), end = descendantsOfType<HTMLAreaElement>(map).end() ; area != end; ++area) { 2711 auto areaDescendants = descendantsOfType<HTMLAreaElement>(*map); 2712 for (auto area = areaDescendants.begin(), end = areaDescendants.end() ; area != end; ++area) { 2712 2713 // add an <area> element for this child if it has a link 2713 2714 if (!area->isLink()) -
trunk/Source/WebCore/accessibility/AccessibilityTable.cpp
r157564 r157924 125 125 126 126 // if there's a colgroup or col element, it's probably a data table. 127 for (auto child = elementChildren(tableElement).begin(), end = elementChildren(tableElement).end(); child != end; ++child) { 127 auto tableChildren = elementChildren(*tableElement); 128 for (auto child = tableChildren.begin(), end = tableChildren.end(); child != end; ++child) { 128 129 if (child->hasTagName(colTag) || child->hasTagName(colgroupTag)) 129 130 return true; -
trunk/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
r157434 r157924 87 87 if (renderer->isLegend()) { 88 88 Element* element = this->element(); 89 if (element && ancestorsOfType<HTMLFieldSetElement>( element).first())89 if (element && ancestorsOfType<HTMLFieldSetElement>(*element).first()) 90 90 return IgnoreObject; 91 91 } -
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
r156612 r157924 140 140 return 0; 141 141 142 if (auto firstFontFace = childrenOfType<SVGFontFaceElement>( m_externalSVGFontElement.get()).first()) {142 if (auto firstFontFace = childrenOfType<SVGFontFaceElement>(*m_externalSVGFontElement).first()) { 143 143 if (!m_svgFontFaceElement) { 144 144 // We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement. -
trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp
r157653 r157924 113 113 } 114 114 115 void StyleInvalidationAnalysis::invalidateStyle(Document *document)115 void StyleInvalidationAnalysis::invalidateStyle(Document& document) 116 116 { 117 117 ASSERT(!m_dirtiesAllStyle); -
trunk/Source/WebCore/css/StyleInvalidationAnalysis.h
r132009 r157924 41 41 42 42 bool dirtiesAllStyle() const { return m_dirtiesAllStyle; } 43 void invalidateStyle(Document *);43 void invalidateStyle(Document&); 44 44 45 45 private: -
trunk/Source/WebCore/dom/Document.cpp
r157854 r157924 672 672 ASSERT(scope); 673 673 ContainerNode* rootNode = scope->rootNode(); 674 for (auto element = elementDescendants(rootNode).begin(), end = elementDescendants(rootNode).end(); element != end; ++element) { 674 auto descendant = elementDescendants(*rootNode); 675 for (auto element = descendant.begin(), end = descendant.end(); element != end; ++element) { 675 676 const AtomicString& accessKey = element->fastGetAttribute(accesskeyAttr); 676 677 if (!accessKey.isEmpty()) … … 792 793 #endif 793 794 794 Element* newDocumentElement = elementChildren( this).first();795 Element* newDocumentElement = elementChildren(*this).first(); 795 796 796 797 if (newDocumentElement == m_documentElement) … … 1520 1521 // Update title based on first title element in the head, if one exists. 1521 1522 if (HTMLElement* headElement = head()) { 1522 if (auto firstTitle = childrenOfType<HTMLTitleElement>( headElement).first())1523 if (auto firstTitle = childrenOfType<HTMLTitleElement>(*headElement).first()) 1523 1524 setTitleElement(firstTitle->textWithDirection(), firstTitle); 1524 1525 } … … 2255 2256 if (!element) 2256 2257 return nullptr; 2257 if (auto frameset = childrenOfType<HTMLFrameSetElement>( element).first())2258 if (auto frameset = childrenOfType<HTMLFrameSetElement>(*element).first()) 2258 2259 return frameset; 2259 return childrenOfType<HTMLBodyElement>( element).first();2260 return childrenOfType<HTMLBodyElement>(*element).first(); 2260 2261 } 2261 2262 … … 2288 2289 { 2289 2290 if (auto element = documentElement()) 2290 return childrenOfType<HTMLHeadElement>( element).first();2291 return childrenOfType<HTMLHeadElement>(*element).first(); 2291 2292 return nullptr; 2292 2293 } … … 2604 2605 // Base URL change changes any relative visited links. 2605 2606 // FIXME: There are other URLs in the tree that would need to be re-evaluated on dynamic base URL change. Style should be invalidated too. 2606 auto anchorDescendants = descendantsOfType<HTMLAnchorElement>( this);2607 auto anchorDescendants = descendantsOfType<HTMLAnchorElement>(*this); 2607 2608 for (auto anchor = anchorDescendants.begin(), end = anchorDescendants.end(); anchor != end; ++anchor) 2608 2609 anchor->invalidateCachedVisitedLinkHash(); … … 2621 2622 const AtomicString* href = nullptr; 2622 2623 const AtomicString* target = nullptr; 2623 auto baseDescendants = descendantsOfType<HTMLBaseElement>( this);2624 auto baseDescendants = descendantsOfType<HTMLBaseElement>(*this); 2624 2625 for (auto base = baseDescendants.begin(), end = baseDescendants.end(); base != end && (!href || !target); ++base) { 2625 2626 if (!href) { -
trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
r157702 r157924 404 404 if (invalidationAnalysis.dirtiesAllStyle()) 405 405 return; 406 invalidationAnalysis.invalidateStyle( &m_document);406 invalidationAnalysis.invalidateStyle(m_document); 407 407 requiresFullStyleRecalc = false; 408 408 } -
trunk/Source/WebCore/dom/ElementAncestorIterator.h
r157008 r157924 50 50 class ElementAncestorIteratorAdapter { 51 51 public: 52 explicit ElementAncestorIteratorAdapter(ElementType* descendant);52 explicit ElementAncestorIteratorAdapter(ElementType* first); 53 53 ElementAncestorIterator<ElementType> begin(); 54 54 ElementAncestorIterator<ElementType> end(); … … 62 62 class ElementAncestorConstIteratorAdapter { 63 63 public: 64 explicit ElementAncestorConstIteratorAdapter(const ElementType* descendant);64 explicit ElementAncestorConstIteratorAdapter(const ElementType* first); 65 65 ElementAncestorConstIterator<ElementType> begin() const; 66 66 ElementAncestorConstIterator<ElementType> end() const; … … 75 75 ElementAncestorIteratorAdapter<Element> elementAncestors(Element* descendant); 76 76 ElementAncestorConstIteratorAdapter<Element> elementAncestors(const Element* descendant); 77 template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element *first);78 template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const Element *first);79 template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element *descendant);80 template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element *descendant);77 template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element& first); 78 template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const Element& first); 79 template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant); 80 template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant); 81 81 82 82 // ElementAncestorIterator … … 183 183 184 184 template <typename ElementType> 185 inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(ElementType* first) 186 { 185 inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(ElementType& first) 186 { 187 return ElementAncestorIteratorAdapter<ElementType>(&first); 188 } 189 190 template <typename ElementType> 191 inline ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const ElementType& first) 192 { 193 return ElementAncestorConstIteratorAdapter<ElementType>(&first); 194 } 195 196 template <typename ElementType> 197 inline ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant) 198 { 199 ElementType* first = findElementAncestorOfType<ElementType>(descendant); 187 200 return ElementAncestorIteratorAdapter<ElementType>(first); 188 201 } 189 202 190 203 template <typename ElementType> 191 inline ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const ElementType* first) 192 { 204 inline ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant) 205 { 206 const ElementType* first = findElementAncestorOfType<const ElementType>(descendant); 193 207 return ElementAncestorConstIteratorAdapter<ElementType>(first); 194 208 } 195 209 196 template <typename ElementType>197 inline ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element* descendant)198 {199 ElementType* first = findElementAncestorOfType<ElementType>(*descendant);200 return ElementAncestorIteratorAdapter<ElementType>(first);201 }202 203 template <typename ElementType>204 inline ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element* descendant)205 {206 const ElementType* first = findElementAncestorOfType<const ElementType>(*descendant);207 return ElementAncestorConstIteratorAdapter<ElementType>(first);208 }209 210 210 } 211 211 -
trunk/Source/WebCore/dom/ElementChildIterator.h
r156612 r157924 34 34 class ElementChildIterator : public ElementIterator<ElementType> { 35 35 public: 36 ElementChildIterator(const ContainerNode * root);37 ElementChildIterator(const ContainerNode * root, ElementType* current);36 ElementChildIterator(const ContainerNode& parent); 37 ElementChildIterator(const ContainerNode& parent, ElementType* current); 38 38 ElementChildIterator& operator++(); 39 39 }; … … 42 42 class ElementChildConstIterator : public ElementConstIterator<ElementType> { 43 43 public: 44 ElementChildConstIterator(const ContainerNode * root);45 ElementChildConstIterator(const ContainerNode * root, const ElementType* current);44 ElementChildConstIterator(const ContainerNode& parent); 45 ElementChildConstIterator(const ContainerNode& parent, const ElementType* current); 46 46 ElementChildConstIterator& operator++(); 47 47 }; … … 50 50 class ElementChildIteratorAdapter { 51 51 public: 52 ElementChildIteratorAdapter(ContainerNode * root);52 ElementChildIteratorAdapter(ContainerNode& parent); 53 53 ElementChildIterator<ElementType> begin(); 54 54 ElementChildIterator<ElementType> end(); … … 57 57 58 58 private: 59 const ContainerNode* m_root;59 ContainerNode& m_parent; 60 60 }; 61 61 … … 63 63 class ElementChildConstIteratorAdapter { 64 64 public: 65 ElementChildConstIteratorAdapter(const ContainerNode * root);65 ElementChildConstIteratorAdapter(const ContainerNode& parent); 66 66 ElementChildConstIterator<ElementType> begin() const; 67 67 ElementChildConstIterator<ElementType> end() const; … … 70 70 71 71 private: 72 const ContainerNode * m_root;73 }; 74 75 ElementChildIteratorAdapter<Element> elementChildren(ContainerNode * root);76 ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode * root);77 template <typename ElementType> ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode * root);78 template <typename ElementType> ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode * root);72 const ContainerNode& m_parent; 73 }; 74 75 ElementChildIteratorAdapter<Element> elementChildren(ContainerNode&); 76 ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode&); 77 template <typename ElementType> ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode&); 78 template <typename ElementType> ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode&); 79 79 80 80 // ElementChildIterator 81 81 82 82 template <typename ElementType> 83 inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode * root)84 : ElementIterator<ElementType>( root)85 { 86 } 87 88 template <typename ElementType> 89 inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode * root, ElementType* current)90 : ElementIterator<ElementType>( root, current)83 inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode& parent) 84 : ElementIterator<ElementType>(&parent) 85 { 86 } 87 88 template <typename ElementType> 89 inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode& parent, ElementType* current) 90 : ElementIterator<ElementType>(&parent, current) 91 91 { 92 92 } … … 101 101 102 102 template <typename ElementType> 103 inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode * root)104 : ElementConstIterator<ElementType>( root)105 { 106 } 107 108 template <typename ElementType> 109 inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode * root, const ElementType* current)110 : ElementConstIterator<ElementType>( root, current)103 inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode& parent) 104 : ElementConstIterator<ElementType>(&parent) 105 { 106 } 107 108 template <typename ElementType> 109 inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode& parent, const ElementType* current) 110 : ElementConstIterator<ElementType>(&parent, current) 111 111 { 112 112 } … … 121 121 122 122 template <typename ElementType> 123 inline ElementChildIteratorAdapter<ElementType>::ElementChildIteratorAdapter(ContainerNode * root)124 : m_ root(root)123 inline ElementChildIteratorAdapter<ElementType>::ElementChildIteratorAdapter(ContainerNode& parent) 124 : m_parent(parent) 125 125 { 126 126 } … … 129 129 inline ElementChildIterator<ElementType> ElementChildIteratorAdapter<ElementType>::begin() 130 130 { 131 return ElementChildIterator<ElementType>(m_ root, Traversal<ElementType>::firstChild(m_root));131 return ElementChildIterator<ElementType>(m_parent, Traversal<ElementType>::firstChild(&m_parent)); 132 132 } 133 133 … … 135 135 inline ElementChildIterator<ElementType> ElementChildIteratorAdapter<ElementType>::end() 136 136 { 137 return ElementChildIterator<ElementType>(m_ root);137 return ElementChildIterator<ElementType>(m_parent); 138 138 } 139 139 … … 141 141 inline ElementType* ElementChildIteratorAdapter<ElementType>::first() 142 142 { 143 return Traversal<ElementType>::firstChild( m_root);143 return Traversal<ElementType>::firstChild(&m_parent); 144 144 } 145 145 … … 147 147 inline ElementType* ElementChildIteratorAdapter<ElementType>::last() 148 148 { 149 return Traversal<ElementType>::lastChild( m_root);149 return Traversal<ElementType>::lastChild(&m_parent); 150 150 } 151 151 … … 153 153 154 154 template <typename ElementType> 155 inline ElementChildConstIteratorAdapter<ElementType>::ElementChildConstIteratorAdapter(const ContainerNode * root)156 : m_ root(root)155 inline ElementChildConstIteratorAdapter<ElementType>::ElementChildConstIteratorAdapter(const ContainerNode& parent) 156 : m_parent(parent) 157 157 { 158 158 } … … 161 161 inline ElementChildConstIterator<ElementType> ElementChildConstIteratorAdapter<ElementType>::begin() const 162 162 { 163 return ElementChildConstIterator<ElementType>(m_ root, Traversal<ElementType>::firstChild(m_root));163 return ElementChildConstIterator<ElementType>(m_parent, Traversal<ElementType>::firstChild(&m_parent)); 164 164 } 165 165 … … 167 167 inline ElementChildConstIterator<ElementType> ElementChildConstIteratorAdapter<ElementType>::end() const 168 168 { 169 return ElementChildConstIterator<ElementType>(m_ root);169 return ElementChildConstIterator<ElementType>(m_parent); 170 170 } 171 171 … … 173 173 inline const ElementType* ElementChildConstIteratorAdapter<ElementType>::first() const 174 174 { 175 return Traversal<ElementType>::firstChild( m_root);175 return Traversal<ElementType>::firstChild(&m_parent); 176 176 } 177 177 … … 179 179 inline const ElementType* ElementChildConstIteratorAdapter<ElementType>::last() const 180 180 { 181 return Traversal<ElementType>::lastChild( m_root);181 return Traversal<ElementType>::lastChild(&m_parent); 182 182 } 183 183 184 184 // Standalone functions 185 185 186 inline ElementChildIteratorAdapter<Element> elementChildren(ContainerNode * root)187 { 188 return ElementChildIteratorAdapter<Element>( root);189 } 190 191 template <typename ElementType> 192 inline ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode * root)193 { 194 return ElementChildIteratorAdapter<ElementType>( root);195 } 196 197 inline ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode * root)198 { 199 return ElementChildConstIteratorAdapter<Element>( root);200 } 201 202 template <typename ElementType> 203 inline ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode * root)204 { 205 return ElementChildConstIteratorAdapter<ElementType>( root);186 inline ElementChildIteratorAdapter<Element> elementChildren(ContainerNode& parent) 187 { 188 return ElementChildIteratorAdapter<Element>(parent); 189 } 190 191 template <typename ElementType> 192 inline ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode& parent) 193 { 194 return ElementChildIteratorAdapter<ElementType>(parent); 195 } 196 197 inline ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode& parent) 198 { 199 return ElementChildConstIteratorAdapter<Element>(parent); 200 } 201 202 template <typename ElementType> 203 inline ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode& parent) 204 { 205 return ElementChildConstIteratorAdapter<ElementType>(parent); 206 206 } 207 207 -
trunk/Source/WebCore/dom/ElementDescendantIterator.h
r156612 r157924 34 34 class ElementDescendantIterator : public ElementIterator<ElementType> { 35 35 public: 36 ElementDescendantIterator(const ContainerNode *root);37 ElementDescendantIterator(const ContainerNode *root, ElementType* current);36 ElementDescendantIterator(const ContainerNode& root); 37 ElementDescendantIterator(const ContainerNode& root, ElementType* current); 38 38 ElementDescendantIterator& operator++(); 39 39 }; … … 42 42 class ElementDescendantConstIterator : public ElementConstIterator<ElementType> { 43 43 public: 44 ElementDescendantConstIterator(const ContainerNode *root);45 ElementDescendantConstIterator(const ContainerNode *root, const ElementType* current);44 ElementDescendantConstIterator(const ContainerNode& root); 45 ElementDescendantConstIterator(const ContainerNode& root, const ElementType* current); 46 46 ElementDescendantConstIterator& operator++(); 47 47 }; … … 50 50 class ElementDescendantIteratorAdapter { 51 51 public: 52 ElementDescendantIteratorAdapter(ContainerNode *root);52 ElementDescendantIteratorAdapter(ContainerNode& root); 53 53 ElementDescendantIterator<ElementType> begin(); 54 54 ElementDescendantIterator<ElementType> end(); … … 57 57 58 58 private: 59 ContainerNode *m_root;59 ContainerNode& m_root; 60 60 }; 61 61 … … 63 63 class ElementDescendantConstIteratorAdapter { 64 64 public: 65 ElementDescendantConstIteratorAdapter(const ContainerNode *root);65 ElementDescendantConstIteratorAdapter(const ContainerNode& root); 66 66 ElementDescendantConstIterator<ElementType> begin() const; 67 67 ElementDescendantConstIterator<ElementType> end() const; … … 70 70 71 71 private: 72 const ContainerNode *m_root;73 }; 74 75 ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode * root);76 ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode * root);77 template <typename ElementType> ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode * root);78 template <typename ElementType> ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode * root);72 const ContainerNode& m_root; 73 }; 74 75 ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode&); 76 ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode&); 77 template <typename ElementType> ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode&); 78 template <typename ElementType> ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode&); 79 79 80 80 // ElementDescendantIterator 81 81 82 82 template <typename ElementType> 83 inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode *root)84 : ElementIterator<ElementType>( root)85 { 86 } 87 88 template <typename ElementType> 89 inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode *root, ElementType* current)90 : ElementIterator<ElementType>( root, current)83 inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode& root) 84 : ElementIterator<ElementType>(&root) 85 { 86 } 87 88 template <typename ElementType> 89 inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode& root, ElementType* current) 90 : ElementIterator<ElementType>(&root, current) 91 91 { 92 92 } … … 101 101 102 102 template <typename ElementType> 103 inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode *root)104 : ElementConstIterator<ElementType>( root)105 106 { 107 } 108 109 template <typename ElementType> 110 inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode *root, const ElementType* current)111 : ElementConstIterator<ElementType>( root, current)103 inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode& root) 104 : ElementConstIterator<ElementType>(&root) 105 106 { 107 } 108 109 template <typename ElementType> 110 inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode& root, const ElementType* current) 111 : ElementConstIterator<ElementType>(&root, current) 112 112 { 113 113 } … … 122 122 123 123 template <typename ElementType> 124 inline ElementDescendantIteratorAdapter<ElementType>::ElementDescendantIteratorAdapter(ContainerNode *root)124 inline ElementDescendantIteratorAdapter<ElementType>::ElementDescendantIteratorAdapter(ContainerNode& root) 125 125 : m_root(root) 126 126 { … … 130 130 inline ElementDescendantIterator<ElementType> ElementDescendantIteratorAdapter<ElementType>::begin() 131 131 { 132 return ElementDescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin( m_root));132 return ElementDescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(&m_root)); 133 133 } 134 134 … … 142 142 inline ElementType* ElementDescendantIteratorAdapter<ElementType>::first() 143 143 { 144 return Traversal<ElementType>::firstWithin( m_root);144 return Traversal<ElementType>::firstWithin(&m_root); 145 145 } 146 146 … … 148 148 inline ElementType* ElementDescendantIteratorAdapter<ElementType>::last() 149 149 { 150 return Traversal<ElementType>::lastWithin( m_root);150 return Traversal<ElementType>::lastWithin(&m_root); 151 151 } 152 152 … … 154 154 155 155 template <typename ElementType> 156 inline ElementDescendantConstIteratorAdapter<ElementType>::ElementDescendantConstIteratorAdapter(const ContainerNode *root)156 inline ElementDescendantConstIteratorAdapter<ElementType>::ElementDescendantConstIteratorAdapter(const ContainerNode& root) 157 157 : m_root(root) 158 158 { … … 162 162 inline ElementDescendantConstIterator<ElementType> ElementDescendantConstIteratorAdapter<ElementType>::begin() const 163 163 { 164 return ElementDescendantConstIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin( m_root));164 return ElementDescendantConstIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(&m_root)); 165 165 } 166 166 … … 174 174 inline const ElementType* ElementDescendantConstIteratorAdapter<ElementType>::first() const 175 175 { 176 return Traversal<ElementType>::firstWithin( m_root);176 return Traversal<ElementType>::firstWithin(&m_root); 177 177 } 178 178 … … 180 180 inline const ElementType* ElementDescendantConstIteratorAdapter<ElementType>::last() const 181 181 { 182 return Traversal<ElementType>::lastWithin( m_root);182 return Traversal<ElementType>::lastWithin(&m_root); 183 183 } 184 184 185 185 // Standalone functions 186 186 187 inline ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode *root)187 inline ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode& root) 188 188 { 189 189 return ElementDescendantIteratorAdapter<Element>(root); … … 191 191 192 192 template <typename ElementType> 193 inline ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode *root)193 inline ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode& root) 194 194 { 195 195 return ElementDescendantIteratorAdapter<ElementType>(root); 196 196 } 197 197 198 inline ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode *root)198 inline ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode& root) 199 199 { 200 200 return ElementDescendantConstIteratorAdapter<Element>(root); … … 202 202 203 203 template <typename ElementType> 204 inline ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode *root)204 inline ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode& root) 205 205 { 206 206 return ElementDescendantConstIteratorAdapter<ElementType>(root); -
trunk/Source/WebCore/dom/SelectorQuery.cpp
r157354 r157924 168 168 static inline void elementsForLocalName(const ContainerNode& rootNode, const AtomicString& localName, typename SelectorQueryTrait::OutputType& output) 169 169 { 170 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));170 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 171 171 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 172 172 if (element->tagQName().localName() == localName) { … … 181 181 static inline void anyElement(const ContainerNode& rootNode, typename SelectorQueryTrait::OutputType& output) 182 182 { 183 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));183 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 184 184 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 185 185 SelectorQueryTrait::appendOutputForElement(output, &*element); … … 210 210 } else { 211 211 // Fallback: NamespaceURI is set, selectorLocalName may be starAtom. 212 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));212 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 213 213 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 214 214 if (element->namespaceURI() == selectorNamespaceURI && (selectorLocalName == starAtom || element->tagQName().localName() == selectorLocalName)) { … … 233 233 234 234 const AtomicString& className = selectorData.selector->value(); 235 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));235 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 236 236 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 237 237 if (element->hasClass() && element->classNames().contains(className)) { … … 248 248 ASSERT(m_selectors.size() == 1); 249 249 250 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));250 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 251 251 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 252 252 if (selectorMatches(selectorData, *element, rootNode)) { … … 262 262 { 263 263 unsigned selectorCount = m_selectors.size(); 264 auto descendants = elementDescendants( &const_cast<ContainerNode&>(rootNode));264 auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode)); 265 265 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 266 266 for (unsigned i = 0; i < selectorCount; ++i) { -
trunk/Source/WebCore/dom/TreeScope.cpp
r157356 r157924 301 301 m_labelsByForAttribute = adoptPtr(new DocumentOrderedMap); 302 302 303 auto labelDescendants = descendantsOfType<HTMLLabelElement>( rootNode());303 auto labelDescendants = descendantsOfType<HTMLLabelElement>(*rootNode()); 304 304 for (auto label = labelDescendants.begin(), end = labelDescendants.end(); label != end; ++label) { 305 305 const AtomicString& forValue = label->fastGetAttribute(forAttr); … … 343 343 if (Element* element = getElementById(name)) 344 344 return element; 345 auto anchorDescendants = descendantsOfType<HTMLAnchorElement>( rootNode());345 auto anchorDescendants = descendantsOfType<HTMLAnchorElement>(*rootNode()); 346 346 for (auto anchor = anchorDescendants.begin(), end = anchorDescendants.end(); anchor != end; ++anchor) { 347 347 if (rootNode()->document().inQuirksMode()) { -
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
r157710 r157924 445 445 446 446 Vector<Element*> toRemove; 447 for (auto child = elementChildren(dummySpanAncestor).begin(), end = elementChildren(dummySpanAncestor).end(); child != end; ++child) { 447 auto children = elementChildren(*dummySpanAncestor); 448 for (auto child = children.begin(), end = children.end(); child != end; ++child) { 448 449 if (isSpanWithoutAttributesOrUnstyledStyleSpan(&*child)) 449 450 toRemove.append(&*child); -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r157653 r157924 713 713 Vector<Element*> toRemove; 714 714 715 auto it = elementDescendants( fragment.fragment()).begin();716 auto end = elementDescendants( fragment.fragment()).end();715 auto it = elementDescendants(*fragment.fragment()).begin(); 716 auto end = elementDescendants(*fragment.fragment()).end(); 717 717 while (it != end) { 718 718 if (it->hasTagName(baseTag) || it->hasTagName(linkTag) || it->hasTagName(metaTag) || it->hasTagName(styleTag) || isHTMLTitleElement(*it)) { -
trunk/Source/WebCore/editing/markup.cpp
r157058 r157924 102 102 URL parsedBaseURL(ParsedURLString, baseURL); 103 103 104 for (auto element = elementDescendants(fragment).begin(), end = elementDescendants(fragment).end(); element != end; ++element) { 104 auto descendants = elementDescendants(*fragment); 105 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 105 106 if (!element->hasAttributes()) 106 107 continue; -
trunk/Source/WebCore/html/HTMLAppletElement.cpp
r157535 r157924 149 149 } 150 150 151 auto paramChildren = childrenOfType<HTMLParamElement>( this);151 auto paramChildren = childrenOfType<HTMLParamElement>(*this); 152 152 for (auto param = paramChildren.begin(), end = paramChildren.end(); param != end; ++param) { 153 153 if (param->name().isEmpty()) -
trunk/Source/WebCore/html/HTMLElement.cpp
r157535 r157924 748 748 bool HTMLElement::translate() const 749 749 { 750 auto lineage = lineageOfType<HTMLElement>( this);750 auto lineage = lineageOfType<HTMLElement>(*this); 751 751 for (auto element = lineage.begin(), end = lineage.end(); element != end; ++element) { 752 752 TranslateAttributeMode mode = element->translateAttributeMode(); … … 955 955 setHasDirAutoFlagRecursively(oldMarkedNode, false); 956 956 957 auto lineage = lineageOfType<HTMLElement>( this);957 auto lineage = lineageOfType<HTMLElement>(*this); 958 958 for (auto elementToAdjust = lineage.begin(), end = lineage.end(); elementToAdjust != end; ++elementToAdjust) { 959 959 if (elementAffectsDirectionality(&*elementToAdjust)) { -
trunk/Source/WebCore/html/HTMLFieldSetElement.cpp
r157535 r157924 52 52 void HTMLFieldSetElement::invalidateDisabledStateUnder(Element* base) 53 53 { 54 auto formControlDescendants = descendantsOfType<HTMLFormControlElement>( base);54 auto formControlDescendants = descendantsOfType<HTMLFormControlElement>(*base); 55 55 for (auto control = formControlDescendants.begin(), end = formControlDescendants.end(); control != end; ++control) 56 56 control->ancestorDisabledStateWasChanged(); … … 68 68 HTMLFormControlElement::childrenChanged(change); 69 69 70 auto legendChildren = childrenOfType<HTMLLegendElement>( this);70 auto legendChildren = childrenOfType<HTMLLegendElement>(*this); 71 71 for (auto legend = legendChildren.begin(), end = legendChildren.end(); legend != end; ++legend) 72 72 invalidateDisabledStateUnder(&*legend); … … 91 91 HTMLLegendElement* HTMLFieldSetElement::legend() const 92 92 { 93 return const_cast<HTMLLegendElement*>(descendantsOfType<HTMLLegendElement>( this).first());93 return const_cast<HTMLLegendElement*>(descendantsOfType<HTMLLegendElement>(*this).first()); 94 94 } 95 95 … … 109 109 m_associatedElements.clear(); 110 110 111 auto descendants = elementDescendants(const_cast<HTMLFieldSetElement *>(this));111 auto descendants = elementDescendants(const_cast<HTMLFieldSetElement&>(*this)); 112 112 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 113 113 if (element->hasTagName(objectTag)) -
trunk/Source/WebCore/html/HTMLFrameSetElement.cpp
r157535 r157924 166 166 HTMLFrameSetElement* HTMLFrameSetElement::findContaining(Element* descendant) 167 167 { 168 return ancestorsOfType<HTMLFrameSetElement>( descendant).first();168 return ancestorsOfType<HTMLFrameSetElement>(*descendant).first(); 169 169 } 170 170 -
trunk/Source/WebCore/html/HTMLLabelElement.cpp
r157375 r157924 68 68 // per http://dev.w3.org/html5/spec/Overview.html#the-label-element 69 69 // the form element must be "labelable form-associated element". 70 auto labelableDescendants = descendantsOfType<LabelableElement>( this);70 auto labelableDescendants = descendantsOfType<LabelableElement>(*this); 71 71 for (auto labelableElement = labelableDescendants.begin(), end = labelableDescendants.end(); labelableElement != end; ++labelableElement) { 72 72 if (labelableElement->supportLabels()) -
trunk/Source/WebCore/html/HTMLLegendElement.cpp
r157008 r157924 50 50 { 51 51 // Check if there's a fieldset belonging to this legend. 52 auto enclosingFieldset = ancestorsOfType<HTMLFieldSetElement>( this).first();52 auto enclosingFieldset = ancestorsOfType<HTMLFieldSetElement>(*this).first(); 53 53 if (!enclosingFieldset) 54 54 return nullptr; … … 56 56 // Find first form element inside the fieldset that is not a legend element. 57 57 // FIXME: Should we consider tabindex? 58 return descendantsOfType<HTMLFormControlElement>( enclosingFieldset).first();58 return descendantsOfType<HTMLFormControlElement>(*enclosingFieldset).first(); 59 59 } 60 60 -
trunk/Source/WebCore/html/HTMLMapElement.cpp
r156981 r157924 63 63 HTMLAreaElement* defaultArea = 0; 64 64 65 for (auto area = descendantsOfType<HTMLAreaElement>(this).begin(), end = descendantsOfType<HTMLAreaElement>(this).end(); area != end; ++area) { 65 auto areaDescendants = descendantsOfType<HTMLAreaElement>(*this); 66 for (auto area = areaDescendants.begin(), end = areaDescendants.end(); area != end; ++area) { 66 67 if (area->isDefault()) { 67 68 if (!defaultArea) -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r157735 r157924 559 559 return; 560 560 561 if (descendantsOfType<HTMLTrackElement>( this).first())561 if (descendantsOfType<HTMLTrackElement>(*this).first()) 562 562 scheduleDelayedAction(ConfigureTextTracks); 563 563 #endif … … 949 949 // element child, then let mode be children and let candidate be the first such 950 950 // source element child in tree order. 951 if (auto firstSource = childrenOfType<HTMLSourceElement>( this).first()) {951 if (auto firstSource = childrenOfType<HTMLSourceElement>(*this).first()) { 952 952 mode = children; 953 953 m_nextChildNodeToConsider = firstSource; … … 1445 1445 if (track->trackType() == TextTrack::TrackElement) { 1446 1446 trackIsLoaded = false; 1447 auto end = childrenOfType<HTMLTrackElement>(this).end();1448 for (auto trackElement = childrenOfType<HTMLTrackElement>(this).begin(); trackElement != end; ++trackElement) {1447 auto trackChildren = childrenOfType<HTMLTrackElement>(*this); 1448 for (auto trackElement = trackChildren.begin(), end = trackChildren.end(); trackElement != end; ++trackElement) { 1449 1449 if (trackElement->track() == track) { 1450 1450 if (trackElement->readyState() == HTMLTrackElement::LOADING || trackElement->readyState() == HTMLTrackElement::LOADED) … … 1678 1678 m_asyncEventQueue.cancelAllEvents(); 1679 1679 1680 auto sourceChildren = childrenOfType<HTMLSourceElement>( this);1680 auto sourceChildren = childrenOfType<HTMLSourceElement>(*this); 1681 1681 for (auto source = sourceChildren.begin(), end = sourceChildren.end(); source != end; ++source) 1682 1682 source->cancelPendingErrorEvent(); -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r157342 r157924 155 155 // Scan the PARAM children and store their name/value pairs. 156 156 // Get the URL and type from the params if we don't already have them. 157 auto paramChildren = childrenOfType<HTMLParamElement>( this);157 auto paramChildren = childrenOfType<HTMLParamElement>(*this); 158 158 for (auto param = paramChildren.begin(), end = paramChildren.end(); param != end; ++param) { 159 159 String name = param->name(); … … 449 449 return true; 450 450 451 for (auto child = elementChildren(this).begin(), end = elementChildren(this).end(); child != end; ++child) { 451 auto children = elementChildren(*this); 452 for (auto child = children.begin(), end = children.end(); child != end; ++child) { 452 453 if (child->hasTagName(paramTag) && equalIgnoringCase(child->getNameAttribute(), "type") 453 454 && MIMETypeRegistry::isJavaAppletMIMEType(child->getAttribute(valueAttr).string())) -
trunk/Source/WebCore/loader/PlaceholderDocument.cpp
r154928 r157924 35 35 ASSERT(!attached()); 36 36 37 auto children = elementChildren( this);37 auto children = elementChildren(*this); 38 38 for (auto child = children.begin(), end = children.end(); child != end; ++child) 39 39 Style::attachRenderTree(*child); -
trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp
r157899 r157924 162 162 auto builder = std::make_unique<SVGFilterBuilder>(previousEffect, SourceAlpha::create(this)); 163 163 164 auto attributesChildren = childrenOfType<SVGFilterPrimitiveStandardAttributes>( filter);164 auto attributesChildren = childrenOfType<SVGFilterPrimitiveStandardAttributes>(*filter); 165 165 for (auto it = attributesChildren.begin(), end = attributesChildren.end(); it != end; ++it) { 166 166 SVGFilterPrimitiveStandardAttributes* effectElement = &*it; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
r157011 r157924 222 222 223 223 // Draw all clipPath children into a global mask. 224 auto children = childrenOfType<SVGElement>( &clipPathElement());224 auto children = childrenOfType<SVGElement>(clipPathElement()); 225 225 for (auto it = children.begin(), end = children.end(); it != end; ++it) { 226 226 SVGElement& child = *it; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
r157899 r157924 96 96 // Add effects to the builder 97 97 auto builder = std::make_unique<SVGFilterBuilder>(SourceGraphic::create(filter), SourceAlpha::create(filter)); 98 auto children = childrenOfType<SVGFilterPrimitiveStandardAttributes>( &filterElement());98 auto children = childrenOfType<SVGFilterPrimitiveStandardAttributes>(filterElement()); 99 99 for (auto element = children.begin(), end = children.end(); element != end; ++element) { 100 100 RefPtr<FilterEffect> effect = element->build(builder.get(), filter); -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
r157011 r157924 120 120 121 121 // Draw the content into the ImageBuffer. 122 auto children = childrenOfType<SVGElement>( &maskElement());122 auto children = childrenOfType<SVGElement>(maskElement()); 123 123 for (auto it = children.begin(), end = children.end(); it != end; ++it) { 124 124 SVGElement& child = *it; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r157011 r157924 273 273 274 274 // Draw the content into the ImageBuffer. 275 auto children = childrenOfType<SVGElement>( attributes.patternContentElement());275 auto children = childrenOfType<SVGElement>(*attributes.patternContentElement()); 276 276 for (auto it = children.begin(), end = children.end(); it != end; ++it) { 277 277 const SVGElement& child = *it; -
trunk/Source/WebCore/svg/SVGAltGlyphDefElement.cpp
r157216 r157924 90 90 bool foundFirstAltGlyphItem = false; 91 91 92 auto svgChildren = childrenOfType<SVGElement>( this);92 auto svgChildren = childrenOfType<SVGElement>(*this); 93 93 for (auto it = svgChildren.begin(), end = svgChildren.end(); it != end; ++it) { 94 94 const SVGElement& child = *it; -
trunk/Source/WebCore/svg/SVGAltGlyphItemElement.cpp
r155815 r157924 51 51 // there is at least one glyph. 52 52 53 for (auto glyphRef = childrenOfType<SVGGlyphRefElement>(this).begin(), end = childrenOfType<SVGGlyphRefElement>(this).end(); glyphRef != end; ++glyphRef) { 53 auto glyphChildren = childrenOfType<SVGGlyphRefElement>(*this); 54 for (auto glyphRef = glyphChildren.begin(), end = glyphChildren.end(); glyphRef != end; ++glyphRef) { 54 55 String referredGlyphName; 55 56 if (glyphRef->hasValidGlyphElement(referredGlyphName)) -
trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp
r157216 r157924 140 140 bool foundMPath = false; 141 141 142 auto mPathChildren = childrenOfType<SVGMPathElement>( this);142 auto mPathChildren = childrenOfType<SVGMPathElement>(*this); 143 143 for (auto mPath = mPathChildren.begin(), end = mPathChildren.end(); mPath != end; ++mPath) { 144 144 SVGPathElement* pathElement = mPath->pathElement(); -
trunk/Source/WebCore/svg/SVGElement.cpp
r157216 r157924 511 511 bool SVGElement::haveLoadedRequiredResources() 512 512 { 513 auto svgChildren = childrenOfType<SVGElement>( this);513 auto svgChildren = childrenOfType<SVGElement>(*this); 514 514 for (auto child = svgChildren.begin(), end = svgChildren.end(); child != end; ++child) { 515 515 if (!child->haveLoadedRequiredResources()) … … 926 926 // If we aren't an instance in a <use> or the <use> title was not found, then find the first 927 927 // <title> child of this element. 928 auto firstTitle = descendantsOfType<SVGTitleElement>( this).first();928 auto firstTitle = descendantsOfType<SVGTitleElement>(*this).first(); 929 929 return firstTitle ? const_cast<SVGTitleElement*>(firstTitle)->innerText() : String(); 930 930 } -
trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp
r155815 r157924 91 91 ComponentTransferFunction alpha; 92 92 93 for (auto child = childrenOfType<SVGElement>(this).begin(), end = childrenOfType<SVGElement>(this).end(); child != end; ++child) { 93 auto children = childrenOfType<SVGElement>(*this); 94 for (auto child = children.begin(), end = children.end(); child != end; ++child) { 94 95 SVGElement* element = &*child; 95 96 if (isSVGFEFuncRElement(element)) -
trunk/Source/WebCore/svg/SVGFELightElement.cpp
r155815 r157924 72 72 SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement) 73 73 { 74 for (auto child = childrenOfType<SVGElement>(svgElement).begin(), end = childrenOfType<SVGElement>(svgElement).end(); child != end; ++child) { 74 auto children = childrenOfType<SVGElement>(*svgElement); 75 for (auto child = children.begin(), end = children.end(); child != end; ++child) { 75 76 if (isSVGFEDistantLightElement(*child) || isSVGFEPointLightElement(*child) || isSVGFESpotLightElement(*child)) 76 77 return static_cast<SVGFELightElement*>(const_cast<SVGElement*>(&*child)); -
trunk/Source/WebCore/svg/SVGFEMergeElement.cpp
r155815 r157924 48 48 FilterEffectVector& mergeInputs = effect->inputEffects(); 49 49 50 for (auto mergeNode = childrenOfType<SVGFEMergeNodeElement>(this).begin(), end = childrenOfType<SVGFEMergeNodeElement>(this).end(); mergeNode != end; ++mergeNode) { 50 auto children = childrenOfType<SVGFEMergeNodeElement>(*this); 51 for (auto mergeNode = children.begin(), end = children.end(); mergeNode != end; ++mergeNode) { 51 52 FilterEffect* mergeEffect = filterBuilder->getEffectById(mergeNode->in1()); 52 53 if (!mergeEffect) -
trunk/Source/WebCore/svg/SVGFontElement.cpp
r157216 r157924 72 72 const SVGMissingGlyphElement* SVGFontElement::firstMissingGlyphElement() const 73 73 { 74 return childrenOfType<SVGMissingGlyphElement>( this).first();74 return childrenOfType<SVGMissingGlyphElement>(*this).first(); 75 75 } 76 76 … … 119 119 const SVGMissingGlyphElement* firstMissingGlyphElement = nullptr; 120 120 Vector<String> ligatures; 121 for (auto child = childrenOfType<SVGElement>(this).begin(), end = childrenOfType<SVGElement>(this).end(); child != end; ++child) { 121 auto children = childrenOfType<SVGElement>(*this); 122 for (auto child = children.begin(), end = children.end(); child != end; ++child) { 122 123 SVGElement* element = &*child; 123 124 if (isSVGGlyphElement(element)) { -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r157575 r157924 229 229 230 230 // we currently ignore all but the first src element, alternatively we could concat them 231 auto srcElement = childrenOfType<SVGFontFaceSrcElement>( this).first();231 auto srcElement = childrenOfType<SVGFontFaceSrcElement>(*this).first(); 232 232 233 233 bool describesParentFont = isSVGFontElement(parentNode()); -
trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp
r157216 r157924 49 49 { 50 50 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 51 auto svgChildren = childrenOfType<SVGElement>( this);51 auto svgChildren = childrenOfType<SVGElement>(*this); 52 52 for (auto child = svgChildren.begin(), end = svgChildren.end(); child != end; ++child) { 53 53 RefPtr<CSSFontFaceSrcValue> srcValue; -
trunk/Source/WebCore/svg/SVGGradientElement.cpp
r157375 r157924 142 142 Vector<Gradient::ColorStop> stops; 143 143 144 auto stopChildren = childrenOfType<SVGStopElement>( this);144 auto stopChildren = childrenOfType<SVGStopElement>(*this); 145 145 float previousOffset = 0.0f; 146 146 -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r157535 r157924 338 338 Vector<Ref<Element>> elements; 339 339 340 auto svgDescendants = descendantsOfType<SVGElement>( referenceElement ? referenceElement : this);340 auto svgDescendants = descendantsOfType<SVGElement>(*(referenceElement ? referenceElement : this)); 341 341 for (auto it = svgDescendants.begin(), end = svgDescendants.end(); it != end; ++it) { 342 342 const SVGElement* svgElement = &*it; … … 778 778 // Fall back to traversing our subtree. Duplicate ids are allowed, the first found will 779 779 // be returned. 780 for (auto element = elementDescendants(this).begin(), end = elementDescendants(this).end(); element != end; ++element) { 780 auto descendants = elementDescendants(*this); 781 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 781 782 if (element->getIdAttribute() == id) 782 783 return &*element; -
trunk/Source/WebCore/svg/SVGSwitchElement.cpp
r157535 r157924 54 54 // FIXME: This function does not do what the comment below implies it does. 55 55 // It will create a renderer for any valid SVG element children, not just the first one. 56 auto svgChildren = childrenOfType<SVGElement>( this);56 auto svgChildren = childrenOfType<SVGElement>(*this); 57 57 for (auto element = svgChildren.begin(), end = svgChildren.end(); element != end; ++element) { 58 58 if (!element->isValid()) -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r157535 r157924 370 370 static bool subtreeContainsDisallowedElement(SVGElement& start) 371 371 { 372 auto descendants = elementDescendants( &start);372 auto descendants = elementDescendants(start); 373 373 for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) { 374 374 if (isDisallowedElement(*element)) … … 607 607 // its correspondingElement that is an SVGRectElement object. 608 608 609 auto svgChildren = childrenOfType<SVGElement>( target);609 auto svgChildren = childrenOfType<SVGElement>(*target); 610 610 for (auto element = svgChildren.begin(), end = svgChildren.end(); element != end; ++element) { 611 611 // Skip any non-svg nodes or any disallowed element. … … 665 665 ASSERT(!subtree.inDocument()); 666 666 Vector<Element*> toRemove; 667 auto it = elementDescendants( &subtree).begin();668 auto end = elementDescendants( &subtree).end();667 auto it = elementDescendants(subtree).begin(); 668 auto end = elementDescendants(subtree).end(); 669 669 while (it != end) { 670 670 if (isDisallowedElement(*it)) { -
trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp
r154928 r157924 224 224 unsigned timingElementCount = 0; 225 225 226 auto smilDescendants = descendantsOfType<SVGSMILElement>( m_ownerSVGElement);226 auto smilDescendants = descendantsOfType<SVGSMILElement>(*m_ownerSVGElement); 227 227 for (auto smilElement = smilDescendants.begin(), end = smilDescendants.end(); smilElement != end; ++smilElement) 228 228 smilElement->setDocumentOrderIndex(timingElementCount++); -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r157909 r157924 76 76 77 77 // Don't allow foreignObject elements since they can leak information with arbitrary HTML (like spellcheck or control theme). 78 if (descendantsOfType<SVGForeignObjectElement>( rootElement).first())78 if (descendantsOfType<SVGForeignObjectElement>(*rootElement).first()) 79 79 return false; 80 80
Note:
See TracChangeset
for help on using the changeset viewer.