Changeset 157924 in webkit


Ignore:
Timestamp:
Oct 24, 2013, 6:26:06 AM (12 years ago)
Author:
Antti Koivisto
Message:

Element iterator functions should take reference
https://bugs.webkit.org/show_bug.cgi?id=123267

Reviewed by Andreas Kling.

The argument has to be non-null.

Location:
trunk/Source/WebCore
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157920 r157924  
     12013-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
    1102013-10-24  Ryuan Choi  <ryuan.choi@samsung.com>
    211
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r157653 r157924  
    399399    case LegendRole:
    400400        if (Element* element = this->element())
    401             return !ancestorsOfType<HTMLFieldSetElement>(element).first();
     401            return !ancestorsOfType<HTMLFieldSetElement>(*element).first();
    402402    default:
    403403        return true;
     
    425425    if (!node || !node->hasTagName(canvasTag))
    426426        return false;
    427     Element* canvasElement = toElement(node);
     427    Element& canvasElement = toElement(*node);
    428428    // If it has any children that are elements, we'll assume it might be fallback
    429429    // content. If it has no children or its only children are not elements
     
    11421142    }
    11431143
    1144     return ancestorsOfType<HTMLLabelElement>(element).first();
     1144    return ancestorsOfType<HTMLLabelElement>(*element).first();
    11451145}
    11461146
     
    11631163    if (!parent)
    11641164        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) {
    11661167        const AtomicString& siblingAriaRole = sibling->fastGetAttribute(roleAttr);
    11671168        if (equalIgnoringCase(siblingAriaRole, role))
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r157821 r157924  
    27092709        return;
    27102710
    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) {
    27122713        // add an <area> element for this child if it has a link
    27132714        if (!area->isLink())
  • trunk/Source/WebCore/accessibility/AccessibilityTable.cpp

    r157564 r157924  
    125125
    126126    // 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) {
    128129        if (child->hasTagName(colTag) || child->hasTagName(colgroupTag))
    129130            return true;
  • trunk/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm

    r157434 r157924  
    8787        if (renderer->isLegend()) {
    8888            Element* element = this->element();
    89             if (element && ancestorsOfType<HTMLFieldSetElement>(element).first())
     89            if (element && ancestorsOfType<HTMLFieldSetElement>(*element).first())
    9090                return IgnoreObject;
    9191        }
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r156612 r157924  
    140140                    return 0;
    141141
    142                 if (auto firstFontFace = childrenOfType<SVGFontFaceElement>(m_externalSVGFontElement.get()).first()) {
     142                if (auto firstFontFace = childrenOfType<SVGFontFaceElement>(*m_externalSVGFontElement).first()) {
    143143                    if (!m_svgFontFaceElement) {
    144144                        // 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  
    113113}
    114114
    115 void StyleInvalidationAnalysis::invalidateStyle(Document* document)
     115void StyleInvalidationAnalysis::invalidateStyle(Document& document)
    116116{
    117117    ASSERT(!m_dirtiesAllStyle);
  • trunk/Source/WebCore/css/StyleInvalidationAnalysis.h

    r132009 r157924  
    4141
    4242    bool dirtiesAllStyle() const { return m_dirtiesAllStyle; }
    43     void invalidateStyle(Document*);
     43    void invalidateStyle(Document&);
    4444
    4545private:
  • trunk/Source/WebCore/dom/Document.cpp

    r157854 r157924  
    672672    ASSERT(scope);
    673673    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) {
    675676        const AtomicString& accessKey = element->fastGetAttribute(accesskeyAttr);
    676677        if (!accessKey.isEmpty())
     
    792793#endif
    793794
    794     Element* newDocumentElement = elementChildren(this).first();
     795    Element* newDocumentElement = elementChildren(*this).first();
    795796
    796797    if (newDocumentElement == m_documentElement)
     
    15201521    // Update title based on first title element in the head, if one exists.
    15211522    if (HTMLElement* headElement = head()) {
    1522         if (auto firstTitle = childrenOfType<HTMLTitleElement>(headElement).first())
     1523        if (auto firstTitle = childrenOfType<HTMLTitleElement>(*headElement).first())
    15231524            setTitleElement(firstTitle->textWithDirection(), firstTitle);
    15241525    }
     
    22552256    if (!element)
    22562257        return nullptr;
    2257     if (auto frameset = childrenOfType<HTMLFrameSetElement>(element).first())
     2258    if (auto frameset = childrenOfType<HTMLFrameSetElement>(*element).first())
    22582259        return frameset;
    2259     return childrenOfType<HTMLBodyElement>(element).first();
     2260    return childrenOfType<HTMLBodyElement>(*element).first();
    22602261}
    22612262
     
    22882289{
    22892290    if (auto element = documentElement())
    2290         return childrenOfType<HTMLHeadElement>(element).first();
     2291        return childrenOfType<HTMLHeadElement>(*element).first();
    22912292    return nullptr;
    22922293}
     
    26042605        // Base URL change changes any relative visited links.
    26052606        // 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);
    26072608        for (auto anchor = anchorDescendants.begin(), end = anchorDescendants.end(); anchor != end; ++anchor)
    26082609            anchor->invalidateCachedVisitedLinkHash();
     
    26212622    const AtomicString* href = nullptr;
    26222623    const AtomicString* target = nullptr;
    2623     auto baseDescendants = descendantsOfType<HTMLBaseElement>(this);
     2624    auto baseDescendants = descendantsOfType<HTMLBaseElement>(*this);
    26242625    for (auto base = baseDescendants.begin(), end = baseDescendants.end(); base != end && (!href || !target); ++base) {
    26252626        if (!href) {
  • trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp

    r157702 r157924  
    404404    if (invalidationAnalysis.dirtiesAllStyle())
    405405        return;
    406     invalidationAnalysis.invalidateStyle(&m_document);
     406    invalidationAnalysis.invalidateStyle(m_document);
    407407    requiresFullStyleRecalc = false;
    408408}
  • trunk/Source/WebCore/dom/ElementAncestorIterator.h

    r157008 r157924  
    5050class ElementAncestorIteratorAdapter {
    5151public:
    52     explicit ElementAncestorIteratorAdapter(ElementType* descendant);
     52    explicit ElementAncestorIteratorAdapter(ElementType* first);
    5353    ElementAncestorIterator<ElementType> begin();
    5454    ElementAncestorIterator<ElementType> end();
     
    6262class ElementAncestorConstIteratorAdapter {
    6363public:
    64     explicit ElementAncestorConstIteratorAdapter(const ElementType* descendant);
     64    explicit ElementAncestorConstIteratorAdapter(const ElementType* first);
    6565    ElementAncestorConstIterator<ElementType> begin() const;
    6666    ElementAncestorConstIterator<ElementType> end() const;
     
    7575ElementAncestorIteratorAdapter<Element> elementAncestors(Element* descendant);
    7676ElementAncestorConstIteratorAdapter<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);
     77template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element& first);
     78template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const Element& first);
     79template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant);
     80template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant);
    8181
    8282// ElementAncestorIterator
     
    183183
    184184template <typename ElementType>
    185 inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(ElementType* first)
    186 {
     185inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(ElementType& first)
     186{
     187    return ElementAncestorIteratorAdapter<ElementType>(&first);
     188}
     189
     190template <typename ElementType>
     191inline ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const ElementType& first)
     192{
     193    return ElementAncestorConstIteratorAdapter<ElementType>(&first);
     194}
     195
     196template <typename ElementType>
     197inline ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant)
     198{
     199    ElementType* first = findElementAncestorOfType<ElementType>(descendant);
    187200    return ElementAncestorIteratorAdapter<ElementType>(first);
    188201}
    189202
    190203template <typename ElementType>
    191 inline ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const ElementType* first)
    192 {
     204inline ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant)
     205{
     206    const ElementType* first = findElementAncestorOfType<const ElementType>(descendant);
    193207    return ElementAncestorConstIteratorAdapter<ElementType>(first);
    194208}
    195209
    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 
    210210}
    211211
  • trunk/Source/WebCore/dom/ElementChildIterator.h

    r156612 r157924  
    3434class ElementChildIterator : public ElementIterator<ElementType> {
    3535public:
    36     ElementChildIterator(const ContainerNode* root);
    37     ElementChildIterator(const ContainerNode* root, ElementType* current);
     36    ElementChildIterator(const ContainerNode& parent);
     37    ElementChildIterator(const ContainerNode& parent, ElementType* current);
    3838    ElementChildIterator& operator++();
    3939};
     
    4242class ElementChildConstIterator : public ElementConstIterator<ElementType> {
    4343public:
    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);
    4646    ElementChildConstIterator& operator++();
    4747};
     
    5050class ElementChildIteratorAdapter {
    5151public:
    52     ElementChildIteratorAdapter(ContainerNode* root);
     52    ElementChildIteratorAdapter(ContainerNode& parent);
    5353    ElementChildIterator<ElementType> begin();
    5454    ElementChildIterator<ElementType> end();
     
    5757
    5858private:
    59     const ContainerNode* m_root;
     59    ContainerNode& m_parent;
    6060};
    6161
     
    6363class ElementChildConstIteratorAdapter {
    6464public:
    65     ElementChildConstIteratorAdapter(const ContainerNode* root);
     65    ElementChildConstIteratorAdapter(const ContainerNode& parent);
    6666    ElementChildConstIterator<ElementType> begin() const;
    6767    ElementChildConstIterator<ElementType> end() const;
     
    7070
    7171private:
    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
     75ElementChildIteratorAdapter<Element> elementChildren(ContainerNode&);
     76ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode&);
     77template <typename ElementType> ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode&);
     78template <typename ElementType> ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode&);
    7979
    8080// ElementChildIterator
    8181
    8282template <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)
     83inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode& parent)
     84    : ElementIterator<ElementType>(&parent)
     85{
     86}
     87
     88template <typename ElementType>
     89inline ElementChildIterator<ElementType>::ElementChildIterator(const ContainerNode& parent, ElementType* current)
     90    : ElementIterator<ElementType>(&parent, current)
    9191{
    9292}
     
    101101
    102102template <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)
     103inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode& parent)
     104    : ElementConstIterator<ElementType>(&parent)
     105{
     106}
     107
     108template <typename ElementType>
     109inline ElementChildConstIterator<ElementType>::ElementChildConstIterator(const ContainerNode& parent, const ElementType* current)
     110    : ElementConstIterator<ElementType>(&parent, current)
    111111{
    112112}
     
    121121
    122122template <typename ElementType>
    123 inline ElementChildIteratorAdapter<ElementType>::ElementChildIteratorAdapter(ContainerNode* root)
    124     : m_root(root)
     123inline ElementChildIteratorAdapter<ElementType>::ElementChildIteratorAdapter(ContainerNode& parent)
     124    : m_parent(parent)
    125125{
    126126}
     
    129129inline ElementChildIterator<ElementType> ElementChildIteratorAdapter<ElementType>::begin()
    130130{
    131     return ElementChildIterator<ElementType>(m_root, Traversal<ElementType>::firstChild(m_root));
     131    return ElementChildIterator<ElementType>(m_parent, Traversal<ElementType>::firstChild(&m_parent));
    132132}
    133133
     
    135135inline ElementChildIterator<ElementType> ElementChildIteratorAdapter<ElementType>::end()
    136136{
    137     return ElementChildIterator<ElementType>(m_root);
     137    return ElementChildIterator<ElementType>(m_parent);
    138138}
    139139
     
    141141inline ElementType* ElementChildIteratorAdapter<ElementType>::first()
    142142{
    143     return Traversal<ElementType>::firstChild(m_root);
     143    return Traversal<ElementType>::firstChild(&m_parent);
    144144}
    145145
     
    147147inline ElementType* ElementChildIteratorAdapter<ElementType>::last()
    148148{
    149     return Traversal<ElementType>::lastChild(m_root);
     149    return Traversal<ElementType>::lastChild(&m_parent);
    150150}
    151151
     
    153153
    154154template <typename ElementType>
    155 inline ElementChildConstIteratorAdapter<ElementType>::ElementChildConstIteratorAdapter(const ContainerNode* root)
    156     : m_root(root)
     155inline ElementChildConstIteratorAdapter<ElementType>::ElementChildConstIteratorAdapter(const ContainerNode& parent)
     156    : m_parent(parent)
    157157{
    158158}
     
    161161inline ElementChildConstIterator<ElementType> ElementChildConstIteratorAdapter<ElementType>::begin() const
    162162{
    163     return ElementChildConstIterator<ElementType>(m_root, Traversal<ElementType>::firstChild(m_root));
     163    return ElementChildConstIterator<ElementType>(m_parent, Traversal<ElementType>::firstChild(&m_parent));
    164164}
    165165
     
    167167inline ElementChildConstIterator<ElementType> ElementChildConstIteratorAdapter<ElementType>::end() const
    168168{
    169     return ElementChildConstIterator<ElementType>(m_root);
     169    return ElementChildConstIterator<ElementType>(m_parent);
    170170}
    171171
     
    173173inline const ElementType* ElementChildConstIteratorAdapter<ElementType>::first() const
    174174{
    175     return Traversal<ElementType>::firstChild(m_root);
     175    return Traversal<ElementType>::firstChild(&m_parent);
    176176}
    177177
     
    179179inline const ElementType* ElementChildConstIteratorAdapter<ElementType>::last() const
    180180{
    181     return Traversal<ElementType>::lastChild(m_root);
     181    return Traversal<ElementType>::lastChild(&m_parent);
    182182}
    183183
    184184// Standalone functions
    185185
    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);
     186inline ElementChildIteratorAdapter<Element> elementChildren(ContainerNode& parent)
     187{
     188    return ElementChildIteratorAdapter<Element>(parent);
     189}
     190
     191template <typename ElementType>
     192inline ElementChildIteratorAdapter<ElementType> childrenOfType(ContainerNode& parent)
     193{
     194    return ElementChildIteratorAdapter<ElementType>(parent);
     195}
     196
     197inline ElementChildConstIteratorAdapter<Element> elementChildren(const ContainerNode& parent)
     198{
     199    return ElementChildConstIteratorAdapter<Element>(parent);
     200}
     201
     202template <typename ElementType>
     203inline ElementChildConstIteratorAdapter<ElementType> childrenOfType(const ContainerNode& parent)
     204{
     205    return ElementChildConstIteratorAdapter<ElementType>(parent);
    206206}
    207207
  • trunk/Source/WebCore/dom/ElementDescendantIterator.h

    r156612 r157924  
    3434class ElementDescendantIterator : public ElementIterator<ElementType> {
    3535public:
    36     ElementDescendantIterator(const ContainerNode* root);
    37     ElementDescendantIterator(const ContainerNode* root, ElementType* current);
     36    ElementDescendantIterator(const ContainerNode& root);
     37    ElementDescendantIterator(const ContainerNode& root, ElementType* current);
    3838    ElementDescendantIterator& operator++();
    3939};
     
    4242class ElementDescendantConstIterator : public ElementConstIterator<ElementType>  {
    4343public:
    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);
    4646    ElementDescendantConstIterator& operator++();
    4747};
     
    5050class ElementDescendantIteratorAdapter {
    5151public:
    52     ElementDescendantIteratorAdapter(ContainerNode* root);
     52    ElementDescendantIteratorAdapter(ContainerNode& root);
    5353    ElementDescendantIterator<ElementType> begin();
    5454    ElementDescendantIterator<ElementType> end();
     
    5757
    5858private:
    59     ContainerNode* m_root;
     59    ContainerNode& m_root;
    6060};
    6161
     
    6363class ElementDescendantConstIteratorAdapter {
    6464public:
    65     ElementDescendantConstIteratorAdapter(const ContainerNode* root);
     65    ElementDescendantConstIteratorAdapter(const ContainerNode& root);
    6666    ElementDescendantConstIterator<ElementType> begin() const;
    6767    ElementDescendantConstIterator<ElementType> end() const;
     
    7070
    7171private:
    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
     75ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode&);
     76ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode&);
     77template <typename ElementType> ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode&);
     78template <typename ElementType> ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode&);
    7979
    8080// ElementDescendantIterator
    8181
    8282template <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)
     83inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode& root)
     84    : ElementIterator<ElementType>(&root)
     85{
     86}
     87
     88template <typename ElementType>
     89inline ElementDescendantIterator<ElementType>::ElementDescendantIterator(const ContainerNode& root, ElementType* current)
     90    : ElementIterator<ElementType>(&root, current)
    9191{
    9292}
     
    101101
    102102template <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)
     103inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode& root)
     104    : ElementConstIterator<ElementType>(&root)
     105
     106{
     107}
     108
     109template <typename ElementType>
     110inline ElementDescendantConstIterator<ElementType>::ElementDescendantConstIterator(const ContainerNode& root, const ElementType* current)
     111    : ElementConstIterator<ElementType>(&root, current)
    112112{
    113113}
     
    122122
    123123template <typename ElementType>
    124 inline ElementDescendantIteratorAdapter<ElementType>::ElementDescendantIteratorAdapter(ContainerNode* root)
     124inline ElementDescendantIteratorAdapter<ElementType>::ElementDescendantIteratorAdapter(ContainerNode& root)
    125125    : m_root(root)
    126126{
     
    130130inline ElementDescendantIterator<ElementType> ElementDescendantIteratorAdapter<ElementType>::begin()
    131131{
    132     return ElementDescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(m_root));
     132    return ElementDescendantIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(&m_root));
    133133}
    134134
     
    142142inline ElementType* ElementDescendantIteratorAdapter<ElementType>::first()
    143143{
    144     return Traversal<ElementType>::firstWithin(m_root);
     144    return Traversal<ElementType>::firstWithin(&m_root);
    145145}
    146146
     
    148148inline ElementType* ElementDescendantIteratorAdapter<ElementType>::last()
    149149{
    150     return Traversal<ElementType>::lastWithin(m_root);
     150    return Traversal<ElementType>::lastWithin(&m_root);
    151151}
    152152
     
    154154
    155155template <typename ElementType>
    156 inline ElementDescendantConstIteratorAdapter<ElementType>::ElementDescendantConstIteratorAdapter(const ContainerNode* root)
     156inline ElementDescendantConstIteratorAdapter<ElementType>::ElementDescendantConstIteratorAdapter(const ContainerNode& root)
    157157    : m_root(root)
    158158{
     
    162162inline ElementDescendantConstIterator<ElementType> ElementDescendantConstIteratorAdapter<ElementType>::begin() const
    163163{
    164     return ElementDescendantConstIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(m_root));
     164    return ElementDescendantConstIterator<ElementType>(m_root, Traversal<ElementType>::firstWithin(&m_root));
    165165}
    166166
     
    174174inline const ElementType* ElementDescendantConstIteratorAdapter<ElementType>::first() const
    175175{
    176     return Traversal<ElementType>::firstWithin(m_root);
     176    return Traversal<ElementType>::firstWithin(&m_root);
    177177}
    178178
     
    180180inline const ElementType* ElementDescendantConstIteratorAdapter<ElementType>::last() const
    181181{
    182     return Traversal<ElementType>::lastWithin(m_root);
     182    return Traversal<ElementType>::lastWithin(&m_root);
    183183}
    184184
    185185// Standalone functions
    186186
    187 inline ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode* root)
     187inline ElementDescendantIteratorAdapter<Element> elementDescendants(ContainerNode& root)
    188188{
    189189    return ElementDescendantIteratorAdapter<Element>(root);
     
    191191
    192192template <typename ElementType>
    193 inline ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode* root)
     193inline ElementDescendantIteratorAdapter<ElementType> descendantsOfType(ContainerNode& root)
    194194{
    195195    return ElementDescendantIteratorAdapter<ElementType>(root);
    196196}
    197197
    198 inline ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode* root)
     198inline ElementDescendantConstIteratorAdapter<Element> elementDescendants(const ContainerNode& root)
    199199{
    200200    return ElementDescendantConstIteratorAdapter<Element>(root);
     
    202202
    203203template <typename ElementType>
    204 inline ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode* root)
     204inline ElementDescendantConstIteratorAdapter<ElementType> descendantsOfType(const ContainerNode& root)
    205205{
    206206    return ElementDescendantConstIteratorAdapter<ElementType>(root);
  • trunk/Source/WebCore/dom/SelectorQuery.cpp

    r157354 r157924  
    168168static inline void elementsForLocalName(const ContainerNode& rootNode, const AtomicString& localName, typename SelectorQueryTrait::OutputType& output)
    169169{
    170     auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     170    auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    171171    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    172172        if (element->tagQName().localName() == localName) {
     
    181181static inline void anyElement(const ContainerNode& rootNode, typename SelectorQueryTrait::OutputType& output)
    182182{
    183     auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     183    auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    184184    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    185185        SelectorQueryTrait::appendOutputForElement(output, &*element);
     
    210210    } else {
    211211        // Fallback: NamespaceURI is set, selectorLocalName may be starAtom.
    212         auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     212        auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    213213        for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    214214            if (element->namespaceURI() == selectorNamespaceURI && (selectorLocalName == starAtom || element->tagQName().localName() == selectorLocalName)) {
     
    233233
    234234    const AtomicString& className = selectorData.selector->value();
    235     auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     235    auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    236236    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    237237        if (element->hasClass() && element->classNames().contains(className)) {
     
    248248    ASSERT(m_selectors.size() == 1);
    249249
    250     auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     250    auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    251251    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    252252        if (selectorMatches(selectorData, *element, rootNode)) {
     
    262262{
    263263    unsigned selectorCount = m_selectors.size();
    264     auto descendants = elementDescendants(&const_cast<ContainerNode&>(rootNode));
     264    auto descendants = elementDescendants(const_cast<ContainerNode&>(rootNode));
    265265    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    266266        for (unsigned i = 0; i < selectorCount; ++i) {
  • trunk/Source/WebCore/dom/TreeScope.cpp

    r157356 r157924  
    301301        m_labelsByForAttribute = adoptPtr(new DocumentOrderedMap);
    302302
    303         auto labelDescendants = descendantsOfType<HTMLLabelElement>(rootNode());
     303        auto labelDescendants = descendantsOfType<HTMLLabelElement>(*rootNode());
    304304        for (auto label = labelDescendants.begin(), end = labelDescendants.end(); label != end; ++label) {
    305305            const AtomicString& forValue = label->fastGetAttribute(forAttr);
     
    343343    if (Element* element = getElementById(name))
    344344        return element;
    345     auto anchorDescendants = descendantsOfType<HTMLAnchorElement>(rootNode());
     345    auto anchorDescendants = descendantsOfType<HTMLAnchorElement>(*rootNode());
    346346    for (auto anchor = anchorDescendants.begin(), end = anchorDescendants.end(); anchor != end; ++anchor) {
    347347        if (rootNode()->document().inQuirksMode()) {
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r157710 r157924  
    445445
    446446    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) {
    448449        if (isSpanWithoutAttributesOrUnstyledStyleSpan(&*child))
    449450            toRemove.append(&*child);
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r157653 r157924  
    713713    Vector<Element*> toRemove;
    714714
    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();
    717717    while (it != end) {
    718718        if (it->hasTagName(baseTag) || it->hasTagName(linkTag) || it->hasTagName(metaTag) || it->hasTagName(styleTag) || isHTMLTitleElement(*it)) {
  • trunk/Source/WebCore/editing/markup.cpp

    r157058 r157924  
    102102    URL parsedBaseURL(ParsedURLString, baseURL);
    103103
    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) {
    105106        if (!element->hasAttributes())
    106107            continue;
  • trunk/Source/WebCore/html/HTMLAppletElement.cpp

    r157535 r157924  
    149149    }
    150150
    151     auto paramChildren = childrenOfType<HTMLParamElement>(this);
     151    auto paramChildren = childrenOfType<HTMLParamElement>(*this);
    152152    for (auto param = paramChildren.begin(), end = paramChildren.end(); param != end; ++param) {
    153153        if (param->name().isEmpty())
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r157535 r157924  
    748748bool HTMLElement::translate() const
    749749{
    750     auto lineage = lineageOfType<HTMLElement>(this);
     750    auto lineage = lineageOfType<HTMLElement>(*this);
    751751    for (auto element = lineage.begin(), end = lineage.end(); element != end; ++element) {
    752752        TranslateAttributeMode mode = element->translateAttributeMode();
     
    955955        setHasDirAutoFlagRecursively(oldMarkedNode, false);
    956956
    957     auto lineage = lineageOfType<HTMLElement>(this);
     957    auto lineage = lineageOfType<HTMLElement>(*this);
    958958    for (auto elementToAdjust = lineage.begin(), end = lineage.end(); elementToAdjust != end; ++elementToAdjust) {
    959959        if (elementAffectsDirectionality(&*elementToAdjust)) {
  • trunk/Source/WebCore/html/HTMLFieldSetElement.cpp

    r157535 r157924  
    5252void HTMLFieldSetElement::invalidateDisabledStateUnder(Element* base)
    5353{
    54     auto formControlDescendants = descendantsOfType<HTMLFormControlElement>(base);
     54    auto formControlDescendants = descendantsOfType<HTMLFormControlElement>(*base);
    5555    for (auto control = formControlDescendants.begin(), end = formControlDescendants.end(); control != end; ++control)
    5656        control->ancestorDisabledStateWasChanged();
     
    6868    HTMLFormControlElement::childrenChanged(change);
    6969
    70     auto legendChildren = childrenOfType<HTMLLegendElement>(this);
     70    auto legendChildren = childrenOfType<HTMLLegendElement>(*this);
    7171    for (auto legend = legendChildren.begin(), end = legendChildren.end(); legend != end; ++legend)
    7272        invalidateDisabledStateUnder(&*legend);
     
    9191HTMLLegendElement* HTMLFieldSetElement::legend() const
    9292{
    93     return const_cast<HTMLLegendElement*>(descendantsOfType<HTMLLegendElement>(this).first());
     93    return const_cast<HTMLLegendElement*>(descendantsOfType<HTMLLegendElement>(*this).first());
    9494}
    9595
     
    109109    m_associatedElements.clear();
    110110
    111     auto descendants = elementDescendants(const_cast<HTMLFieldSetElement*>(this));
     111    auto descendants = elementDescendants(const_cast<HTMLFieldSetElement&>(*this));
    112112    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    113113        if (element->hasTagName(objectTag))
  • trunk/Source/WebCore/html/HTMLFrameSetElement.cpp

    r157535 r157924  
    166166HTMLFrameSetElement* HTMLFrameSetElement::findContaining(Element* descendant)
    167167{
    168     return ancestorsOfType<HTMLFrameSetElement>(descendant).first();
     168    return ancestorsOfType<HTMLFrameSetElement>(*descendant).first();
    169169}
    170170
  • trunk/Source/WebCore/html/HTMLLabelElement.cpp

    r157375 r157924  
    6868        // per http://dev.w3.org/html5/spec/Overview.html#the-label-element
    6969        // the form element must be "labelable form-associated element".
    70         auto labelableDescendants = descendantsOfType<LabelableElement>(this);
     70        auto labelableDescendants = descendantsOfType<LabelableElement>(*this);
    7171        for (auto labelableElement = labelableDescendants.begin(), end = labelableDescendants.end(); labelableElement != end; ++labelableElement) {
    7272            if (labelableElement->supportLabels())
  • trunk/Source/WebCore/html/HTMLLegendElement.cpp

    r157008 r157924  
    5050{
    5151    // Check if there's a fieldset belonging to this legend.
    52     auto enclosingFieldset = ancestorsOfType<HTMLFieldSetElement>(this).first();
     52    auto enclosingFieldset = ancestorsOfType<HTMLFieldSetElement>(*this).first();
    5353    if (!enclosingFieldset)
    5454        return nullptr;
     
    5656    // Find first form element inside the fieldset that is not a legend element.
    5757    // FIXME: Should we consider tabindex?
    58     return descendantsOfType<HTMLFormControlElement>(enclosingFieldset).first();
     58    return descendantsOfType<HTMLFormControlElement>(*enclosingFieldset).first();
    5959}
    6060
  • trunk/Source/WebCore/html/HTMLMapElement.cpp

    r156981 r157924  
    6363    HTMLAreaElement* defaultArea = 0;
    6464
    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) {
    6667        if (area->isDefault()) {
    6768            if (!defaultArea)
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r157735 r157924  
    559559        return;
    560560
    561     if (descendantsOfType<HTMLTrackElement>(this).first())
     561    if (descendantsOfType<HTMLTrackElement>(*this).first())
    562562        scheduleDelayedAction(ConfigureTextTracks);
    563563#endif
     
    949949        // element child, then let mode be children and let candidate be the first such
    950950        // source element child in tree order.
    951         if (auto firstSource = childrenOfType<HTMLSourceElement>(this).first()) {
     951        if (auto firstSource = childrenOfType<HTMLSourceElement>(*this).first()) {
    952952            mode = children;
    953953            m_nextChildNodeToConsider = firstSource;
     
    14451445    if (track->trackType() == TextTrack::TrackElement) {
    14461446        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) {
    14491449            if (trackElement->track() == track) {
    14501450                if (trackElement->readyState() == HTMLTrackElement::LOADING || trackElement->readyState() == HTMLTrackElement::LOADED)
     
    16781678    m_asyncEventQueue.cancelAllEvents();
    16791679
    1680     auto sourceChildren = childrenOfType<HTMLSourceElement>(this);
     1680    auto sourceChildren = childrenOfType<HTMLSourceElement>(*this);
    16811681    for (auto source = sourceChildren.begin(), end = sourceChildren.end(); source != end; ++source)
    16821682        source->cancelPendingErrorEvent();
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r157342 r157924  
    155155    // Scan the PARAM children and store their name/value pairs.
    156156    // 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);
    158158    for (auto param = paramChildren.begin(), end = paramChildren.end(); param != end; ++param) {
    159159        String name = param->name();
     
    449449        return true;
    450450
    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) {
    452453        if (child->hasTagName(paramTag) && equalIgnoringCase(child->getNameAttribute(), "type")
    453454            && MIMETypeRegistry::isJavaAppletMIMEType(child->getAttribute(valueAttr).string()))
  • trunk/Source/WebCore/loader/PlaceholderDocument.cpp

    r154928 r157924  
    3535    ASSERT(!attached());
    3636
    37     auto children = elementChildren(this);
     37    auto children = elementChildren(*this);
    3838    for (auto child = children.begin(), end = children.end(); child != end; ++child)
    3939        Style::attachRenderTree(*child);
  • trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp

    r157899 r157924  
    162162    auto builder = std::make_unique<SVGFilterBuilder>(previousEffect, SourceAlpha::create(this));
    163163
    164     auto attributesChildren = childrenOfType<SVGFilterPrimitiveStandardAttributes>(filter);
     164    auto attributesChildren = childrenOfType<SVGFilterPrimitiveStandardAttributes>(*filter);
    165165    for (auto it = attributesChildren.begin(), end = attributesChildren.end(); it != end; ++it) {
    166166        SVGFilterPrimitiveStandardAttributes* effectElement = &*it;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp

    r157011 r157924  
    222222
    223223    // Draw all clipPath children into a global mask.
    224     auto children = childrenOfType<SVGElement>(&clipPathElement());
     224    auto children = childrenOfType<SVGElement>(clipPathElement());
    225225    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
    226226        SVGElement& child = *it;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp

    r157899 r157924  
    9696    // Add effects to the builder
    9797    auto builder = std::make_unique<SVGFilterBuilder>(SourceGraphic::create(filter), SourceAlpha::create(filter));
    98     auto children = childrenOfType<SVGFilterPrimitiveStandardAttributes>(&filterElement());
     98    auto children = childrenOfType<SVGFilterPrimitiveStandardAttributes>(filterElement());
    9999    for (auto element = children.begin(), end = children.end(); element != end; ++element) {
    100100        RefPtr<FilterEffect> effect = element->build(builder.get(), filter);
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp

    r157011 r157924  
    120120
    121121    // Draw the content into the ImageBuffer.
    122     auto children = childrenOfType<SVGElement>(&maskElement());
     122    auto children = childrenOfType<SVGElement>(maskElement());
    123123    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
    124124        SVGElement& child = *it;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp

    r157011 r157924  
    273273
    274274    // Draw the content into the ImageBuffer.
    275     auto children = childrenOfType<SVGElement>(attributes.patternContentElement());
     275    auto children = childrenOfType<SVGElement>(*attributes.patternContentElement());
    276276    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
    277277        const SVGElement& child = *it;
  • trunk/Source/WebCore/svg/SVGAltGlyphDefElement.cpp

    r157216 r157924  
    9090    bool foundFirstAltGlyphItem = false;
    9191
    92     auto svgChildren = childrenOfType<SVGElement>(this);
     92    auto svgChildren = childrenOfType<SVGElement>(*this);
    9393    for (auto it = svgChildren.begin(), end = svgChildren.end(); it != end; ++it) {
    9494        const SVGElement& child = *it;
  • trunk/Source/WebCore/svg/SVGAltGlyphItemElement.cpp

    r155815 r157924  
    5151    // there is at least one glyph.
    5252
    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) {
    5455        String referredGlyphName;
    5556        if (glyphRef->hasValidGlyphElement(referredGlyphName))
  • trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp

    r157216 r157924  
    140140    bool foundMPath = false;
    141141
    142     auto mPathChildren = childrenOfType<SVGMPathElement>(this);
     142    auto mPathChildren = childrenOfType<SVGMPathElement>(*this);
    143143    for (auto mPath = mPathChildren.begin(), end = mPathChildren.end(); mPath != end; ++mPath) {
    144144        SVGPathElement* pathElement = mPath->pathElement();
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r157216 r157924  
    511511bool SVGElement::haveLoadedRequiredResources()
    512512{
    513     auto svgChildren = childrenOfType<SVGElement>(this);
     513    auto svgChildren = childrenOfType<SVGElement>(*this);
    514514    for (auto child = svgChildren.begin(), end = svgChildren.end(); child != end; ++child) {
    515515        if (!child->haveLoadedRequiredResources())
     
    926926    // If we aren't an instance in a <use> or the <use> title was not found, then find the first
    927927    // <title> child of this element.
    928     auto firstTitle = descendantsOfType<SVGTitleElement>(this).first();
     928    auto firstTitle = descendantsOfType<SVGTitleElement>(*this).first();
    929929    return firstTitle ? const_cast<SVGTitleElement*>(firstTitle)->innerText() : String();
    930930}
  • trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp

    r155815 r157924  
    9191    ComponentTransferFunction alpha;
    9292
    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) {
    9495        SVGElement* element = &*child;
    9596        if (isSVGFEFuncRElement(element))
  • trunk/Source/WebCore/svg/SVGFELightElement.cpp

    r155815 r157924  
    7272SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)
    7373{
    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) {
    7576        if (isSVGFEDistantLightElement(*child) || isSVGFEPointLightElement(*child) || isSVGFESpotLightElement(*child))
    7677            return static_cast<SVGFELightElement*>(const_cast<SVGElement*>(&*child));
  • trunk/Source/WebCore/svg/SVGFEMergeElement.cpp

    r155815 r157924  
    4848    FilterEffectVector& mergeInputs = effect->inputEffects();
    4949
    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) {
    5152        FilterEffect* mergeEffect = filterBuilder->getEffectById(mergeNode->in1());
    5253        if (!mergeEffect)
  • trunk/Source/WebCore/svg/SVGFontElement.cpp

    r157216 r157924  
    7272const SVGMissingGlyphElement* SVGFontElement::firstMissingGlyphElement() const
    7373{
    74     return childrenOfType<SVGMissingGlyphElement>(this).first();
     74    return childrenOfType<SVGMissingGlyphElement>(*this).first();
    7575}
    7676
     
    119119    const SVGMissingGlyphElement* firstMissingGlyphElement = nullptr;
    120120    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) {
    122123        SVGElement* element = &*child;
    123124        if (isSVGGlyphElement(element)) {
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r157575 r157924  
    229229
    230230    // 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();
    232232
    233233    bool describesParentFont = isSVGFontElement(parentNode());
  • trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp

    r157216 r157924  
    4949{
    5050    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
    51     auto svgChildren = childrenOfType<SVGElement>(this);
     51    auto svgChildren = childrenOfType<SVGElement>(*this);
    5252    for (auto child = svgChildren.begin(), end = svgChildren.end(); child != end; ++child) {
    5353        RefPtr<CSSFontFaceSrcValue> srcValue;
  • trunk/Source/WebCore/svg/SVGGradientElement.cpp

    r157375 r157924  
    142142    Vector<Gradient::ColorStop> stops;
    143143
    144     auto stopChildren = childrenOfType<SVGStopElement>(this);
     144    auto stopChildren = childrenOfType<SVGStopElement>(*this);
    145145    float previousOffset = 0.0f;
    146146
  • trunk/Source/WebCore/svg/SVGSVGElement.cpp

    r157535 r157924  
    338338    Vector<Ref<Element>> elements;
    339339
    340     auto svgDescendants = descendantsOfType<SVGElement>(referenceElement ? referenceElement : this);
     340    auto svgDescendants = descendantsOfType<SVGElement>(*(referenceElement ? referenceElement : this));
    341341    for (auto it = svgDescendants.begin(), end = svgDescendants.end(); it != end; ++it) {
    342342        const SVGElement* svgElement = &*it;
     
    778778    // Fall back to traversing our subtree. Duplicate ids are allowed, the first found will
    779779    // 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) {
    781782        if (element->getIdAttribute() == id)
    782783            return &*element;
  • trunk/Source/WebCore/svg/SVGSwitchElement.cpp

    r157535 r157924  
    5454    // FIXME: This function does not do what the comment below implies it does.
    5555    // 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);
    5757    for (auto element = svgChildren.begin(), end = svgChildren.end(); element != end; ++element) {
    5858        if (!element->isValid())
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r157535 r157924  
    370370static bool subtreeContainsDisallowedElement(SVGElement& start)
    371371{
    372     auto descendants = elementDescendants(&start);
     372    auto descendants = elementDescendants(start);
    373373    for (auto element = descendants.begin(), end = descendants.end(); element != end; ++element) {
    374374        if (isDisallowedElement(*element))
     
    607607    // its correspondingElement that is an SVGRectElement object.
    608608
    609     auto svgChildren = childrenOfType<SVGElement>(target);
     609    auto svgChildren = childrenOfType<SVGElement>(*target);
    610610    for (auto element = svgChildren.begin(), end = svgChildren.end(); element != end; ++element) {
    611611        // Skip any non-svg nodes or any disallowed element.
     
    665665    ASSERT(!subtree.inDocument());
    666666    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();
    669669    while (it != end) {
    670670        if (isDisallowedElement(*it)) {
  • trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp

    r154928 r157924  
    224224    unsigned timingElementCount = 0;
    225225
    226     auto smilDescendants = descendantsOfType<SVGSMILElement>(m_ownerSVGElement);
     226    auto smilDescendants = descendantsOfType<SVGSMILElement>(*m_ownerSVGElement);
    227227    for (auto smilElement = smilDescendants.begin(), end = smilDescendants.end(); smilElement != end; ++smilElement)
    228228        smilElement->setDocumentOrderIndex(timingElementCount++);
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r157909 r157924  
    7676
    7777    // 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())
    7979        return false;
    8080
Note: See TracChangeset for help on using the changeset viewer.