| Differences between
and this patch
- a/Source/WebCore/ChangeLog +62 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-05-17  Chris Dumez  <cdumez@apple.com>
2
3
        Use RenderChildIterator more for traversing a renderer's children
4
        https://bugs.webkit.org/show_bug.cgi?id=157811
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Use RenderChildIterator more for traversing a renderer's children.
9
10
        * inspector/InspectorLayerTreeAgent.cpp:
11
        (WebCore::InspectorLayerTreeAgent::layersForNode):
12
        (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
13
        * inspector/InspectorLayerTreeAgent.h:
14
        * rendering/AutoTableLayout.cpp:
15
        (WebCore::AutoTableLayout::recalcColumn):
16
        * rendering/InlineIterator.h:
17
        (WebCore::isEmptyInline):
18
        * rendering/RenderBlock.cpp:
19
        (WebCore::RenderBlock::addFocusRingRects):
20
        * rendering/RenderBox.cpp:
21
        (WebCore::RenderBox::positionForPoint):
22
        * rendering/RenderElement.cpp:
23
        (WebCore::RenderElement::updateOutlineAutoAncestor):
24
        * rendering/RenderElement.h:
25
        * rendering/RenderFieldset.cpp:
26
        (WebCore::RenderFieldset::findLegend):
27
        * rendering/RenderFieldset.h:
28
        * rendering/RenderInline.cpp:
29
        (WebCore::RenderInline::generateCulledLineBoxRects):
30
        (WebCore::RenderInline::culledInlineFirstLineBox):
31
        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
32
        (WebCore::RenderInline::dirtyLineBoxes):
33
        * rendering/RenderListItem.cpp:
34
        (WebCore::getParentOfFirstLineBox):
35
        * rendering/RenderObject.cpp:
36
        (WebCore::RenderObject::setFlowThreadStateIncludingDescendants):
37
        (WebCore::RenderObject::addAbsoluteRectForLayer):
38
        (WebCore::RenderObject::paintingRootRect):
39
        (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
40
        (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
41
        (WebCore::RenderObject::updateDragState):
42
        * rendering/RenderTable.cpp:
43
        (WebCore::RenderTable::firstColumn):
44
        * rendering/RenderTableCol.cpp:
45
        (WebCore::RenderTableCol::clearPreferredLogicalWidthsDirtyBits):
46
        * rendering/RenderTableSection.cpp:
47
        (WebCore::RenderTableSection::layoutRows):
48
        * rendering/RenderTreeAsText.cpp:
49
        (WebCore::write):
50
        * rendering/svg/RenderSVGText.cpp:
51
        (WebCore::findPreviousAndNextAttributes):
52
        (WebCore::RenderSVGText::subtreeChildWasAdded):
53
        (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
54
        * rendering/svg/SVGRenderSupport.cpp:
55
        (WebCore::updateObjectBoundingBox):
56
        (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
57
        (WebCore::SVGRenderSupport::layoutChildren):
58
        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
59
        (WebCore::SVGTextLayoutAttributesBuilder::collectTextPositioningElements):
60
        * rendering/svg/SVGTextMetricsBuilder.cpp:
61
        (WebCore::SVGTextMetricsBuilder::walkTree):
62
1
2016-05-16  Dean Jackson  <dino@apple.com>
63
2016-05-16  Dean Jackson  <dino@apple.com>
2
64
3
        Tidy unused parameters with build flags in isValidKeywordPropertyAndValue
65
        Tidy unused parameters with build flags in isValidKeywordPropertyAndValue
- a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp -8 / +10 lines
Lines 36-41 a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp_sec1
36
#include "InstrumentingAgents.h"
36
#include "InstrumentingAgents.h"
37
#include "IntRect.h"
37
#include "IntRect.h"
38
#include "PseudoElement.h"
38
#include "PseudoElement.h"
39
#include "RenderChildIterator.h"
39
#include "RenderLayer.h"
40
#include "RenderLayer.h"
40
#include "RenderLayerBacking.h"
41
#include "RenderLayerBacking.h"
41
#include "RenderLayerCompositor.h"
42
#include "RenderLayerCompositor.h"
Lines 105-134 void InspectorLayerTreeAgent::layersForNode(ErrorString& errorString, int nodeId a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp_sec2
105
{
106
{
106
    layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create();
107
    layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create();
107
108
108
    Node* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
109
    auto* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
109
    if (!node) {
110
    if (!node) {
110
        errorString = ASCIILiteral("Provided node id doesn't match any known node");
111
        errorString = ASCIILiteral("Provided node id doesn't match any known node");
111
        return;
112
        return;
112
    }
113
    }
113
114
114
    RenderObject* renderer = node->renderer();
115
    auto* renderer = node->renderer();
115
    if (!renderer) {
116
    if (!renderer) {
116
        errorString = ASCIILiteral("Node for provided node id doesn't have a renderer");
117
        errorString = ASCIILiteral("Node for provided node id doesn't have a renderer");
117
        return;
118
        return;
118
    }
119
    }
119
120
120
    gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
121
    if (is<RenderElement>(*renderer))
122
        gatherLayersUsingRenderObjectHierarchy(errorString, downcast<RenderElement>(*renderer), layers);
121
}
123
}
122
124
123
void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString& errorString, RenderObject* renderer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
125
void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString& errorString, RenderElement& renderer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
124
{
126
{
125
    if (renderer->hasLayer()) {
127
    if (renderer.hasLayer()) {
126
        gatherLayersUsingRenderLayerHierarchy(errorString, downcast<RenderLayerModelObject>(*renderer).layer(), layers);
128
        gatherLayersUsingRenderLayerHierarchy(errorString, downcast<RenderLayerModelObject>(renderer).layer(), layers);
127
        return;
129
        return;
128
    }
130
    }
129
131
130
    for (renderer = renderer->firstChildSlow(); renderer; renderer = renderer->nextSibling())
132
    for (auto& child : childrenOfType<RenderElement>(renderer))
131
        gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
133
        gatherLayersUsingRenderObjectHierarchy(errorString, child, layers);
132
}
134
}
133
135
134
void InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy(ErrorString& errorString, RenderLayer* renderLayer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
136
void InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy(ErrorString& errorString, RenderLayer* renderLayer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
- a/Source/WebCore/inspector/InspectorLayerTreeAgent.h -1 / +1 lines
Lines 66-72 private: a/Source/WebCore/inspector/InspectorLayerTreeAgent.h_sec1
66
    String bind(const RenderLayer*);
66
    String bind(const RenderLayer*);
67
    void unbind(const RenderLayer*);
67
    void unbind(const RenderLayer*);
68
68
69
    void gatherLayersUsingRenderObjectHierarchy(ErrorString&, RenderObject*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
69
    void gatherLayersUsingRenderObjectHierarchy(ErrorString&, RenderElement&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
70
    void gatherLayersUsingRenderLayerHierarchy(ErrorString&, RenderLayer*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
70
    void gatherLayersUsingRenderLayerHierarchy(ErrorString&, RenderLayer*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
71
71
72
    Ref<Inspector::Protocol::LayerTree::Layer> buildObjectForLayer(ErrorString&, RenderLayer*);
72
    Ref<Inspector::Protocol::LayerTree::Layer> buildObjectForLayer(ErrorString&, RenderLayer*);
- a/Source/WebCore/rendering/AutoTableLayout.cpp -5 / +6 lines
Lines 22-27 a/Source/WebCore/rendering/AutoTableLayout.cpp_sec1
22
#include "config.h"
22
#include "config.h"
23
#include "AutoTableLayout.h"
23
#include "AutoTableLayout.h"
24
24
25
#include "RenderChildIterator.h"
25
#include "RenderTable.h"
26
#include "RenderTable.h"
26
#include "RenderTableCell.h"
27
#include "RenderTableCell.h"
27
#include "RenderTableCol.h"
28
#include "RenderTableCol.h"
Lines 48-61 void AutoTableLayout::recalcColumn(unsigned effCol) a/Source/WebCore/rendering/AutoTableLayout.cpp_sec2
48
    RenderTableCell* fixedContributor = nullptr;
49
    RenderTableCell* fixedContributor = nullptr;
49
    RenderTableCell* maxContributor = nullptr;
50
    RenderTableCell* maxContributor = nullptr;
50
51
51
    for (RenderObject* child = m_table->firstChild(); child; child = child->nextSibling()) {
52
    for (auto& child : childrenOfType<RenderObject>(*m_table)) {
52
        if (is<RenderTableCol>(*child)) {
53
        if (is<RenderTableCol>(child)) {
53
            // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits
54
            // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits
54
            // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's
55
            // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's
55
            // ancestors as dirty.
56
            // ancestors as dirty.
56
            downcast<RenderTableCol>(*child).clearPreferredLogicalWidthsDirtyBits();
57
            downcast<RenderTableCol>(child).clearPreferredLogicalWidthsDirtyBits();
57
        } else if (is<RenderTableSection>(*child)) {
58
        } else if (is<RenderTableSection>(child)) {
58
            RenderTableSection& section = downcast<RenderTableSection>(*child);
59
            auto& section = downcast<RenderTableSection>(child);
59
            unsigned numRows = section.numRows();
60
            unsigned numRows = section.numRows();
60
            for (unsigned i = 0; i < numRows; ++i) {
61
            for (unsigned i = 0; i < numRows; ++i) {
61
                RenderTableSection::CellStruct current = section.cellAt(i, effCol);
62
                RenderTableSection::CellStruct current = section.cellAt(i, effCol);
- a/Source/WebCore/rendering/InlineIterator.h -5 / +6 lines
Lines 25-30 a/Source/WebCore/rendering/InlineIterator.h_sec1
25
25
26
#include "BidiRun.h"
26
#include "BidiRun.h"
27
#include "RenderBlockFlow.h"
27
#include "RenderBlockFlow.h"
28
#include "RenderChildIterator.h"
28
#include "RenderInline.h"
29
#include "RenderInline.h"
29
#include "RenderText.h"
30
#include "RenderText.h"
30
#include <wtf/StdLibExtras.h>
31
#include <wtf/StdLibExtras.h>
Lines 209-223 enum EmptyInlineBehavior { a/Source/WebCore/rendering/InlineIterator.h_sec2
209
210
210
static bool isEmptyInline(const RenderInline& renderer)
211
static bool isEmptyInline(const RenderInline& renderer)
211
{
212
{
212
    for (RenderObject* current = renderer.firstChild(); current; current = current->nextSibling()) {
213
    for (auto& current : childrenOfType<RenderObject>(renderer)) {
213
        if (current->isFloatingOrOutOfFlowPositioned())
214
        if (current.isFloatingOrOutOfFlowPositioned())
214
            continue;
215
            continue;
215
        if (is<RenderText>(*current)) {
216
        if (is<RenderText>(current)) {
216
            if (!downcast<RenderText>(*current).isAllCollapsibleWhitespace())
217
            if (!downcast<RenderText>(current).isAllCollapsibleWhitespace())
217
                return false;
218
                return false;
218
            continue;
219
            continue;
219
        }
220
        }
220
        if (!is<RenderInline>(*current) || !isEmptyInline(downcast<RenderInline>(*current)))
221
        if (!is<RenderInline>(current) || !isEmptyInline(downcast<RenderInline>(current)))
221
            return false;
222
            return false;
222
    }
223
    }
223
    return true;
224
    return true;
- a/Source/WebCore/rendering/RenderBlock.cpp -11 / +12 lines
Lines 48-53 a/Source/WebCore/rendering/RenderBlock.cpp_sec1
48
#include "RenderBlockFlow.h"
48
#include "RenderBlockFlow.h"
49
#include "RenderBoxRegionInfo.h"
49
#include "RenderBoxRegionInfo.h"
50
#include "RenderButton.h"
50
#include "RenderButton.h"
51
#include "RenderChildIterator.h"
51
#include "RenderCombineText.h"
52
#include "RenderCombineText.h"
52
#include "RenderDeprecatedFlexibleBox.h"
53
#include "RenderDeprecatedFlexibleBox.h"
53
#include "RenderFlexibleBox.h"
54
#include "RenderFlexibleBox.h"
Lines 3465-3481 void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint a/Source/WebCore/rendering/RenderBlock.cpp_sec2
3465
        if (childrenInline())
3466
        if (childrenInline())
3466
            addFocusRingRectsForInlineChildren(rects, additionalOffset, paintContainer);
3467
            addFocusRingRectsForInlineChildren(rects, additionalOffset, paintContainer);
3467
    
3468
    
3468
        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
3469
        for (auto& box : childrenOfType<RenderBox>(*this)) {
3469
            if (!is<RenderText>(*child) && !is<RenderListMarker>(*child) && is<RenderBox>(*child)) {
3470
            if (is<RenderText>(box) || is<RenderListMarker>(box))
3470
                auto& box = downcast<RenderBox>(*child);
3471
                continue;
3471
                FloatPoint pos;
3472
3472
                // FIXME: This doesn't work correctly with transforms.
3473
            FloatPoint pos;
3473
                if (box.layer())
3474
            // FIXME: This doesn't work correctly with transforms.
3474
                    pos = child->localToContainerPoint(FloatPoint(), paintContainer);
3475
            if (box.layer())
3475
                else
3476
                pos = box.localToContainerPoint(FloatPoint(), paintContainer);
3476
                    pos = FloatPoint(additionalOffset.x() + box.x(), additionalOffset.y() + box.y());
3477
            else
3477
                box.addFocusRingRects(rects, flooredLayoutPoint(pos), paintContainer);
3478
                pos = FloatPoint(additionalOffset.x() + box.x(), additionalOffset.y() + box.y());
3478
            }
3479
            box.addFocusRingRects(rects, flooredLayoutPoint(pos), paintContainer);
3479
        }
3480
        }
3480
    }
3481
    }
3481
3482
- a/Source/WebCore/rendering/RenderBox.cpp -7 / +3 lines
Lines 48-53 a/Source/WebCore/rendering/RenderBox.cpp_sec1
48
#include "Page.h"
48
#include "Page.h"
49
#include "PaintInfo.h"
49
#include "PaintInfo.h"
50
#include "RenderBoxRegionInfo.h"
50
#include "RenderBoxRegionInfo.h"
51
#include "RenderChildIterator.h"
51
#include "RenderDeprecatedFlexibleBox.h"
52
#include "RenderDeprecatedFlexibleBox.h"
52
#include "RenderFlexibleBox.h"
53
#include "RenderFlexibleBox.h"
53
#include "RenderGeometryMap.h"
54
#include "RenderGeometryMap.h"
Lines 4421-4438 VisiblePosition RenderBox::positionForPoint(const LayoutPoint& point, const Rend a/Source/WebCore/rendering/RenderBox.cpp_sec2
4421
    if (isTableRow())
4422
    if (isTableRow())
4422
        adjustedPoint.moveBy(location());
4423
        adjustedPoint.moveBy(location());
4423
4424
4424
    for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject->nextSibling()) {
4425
    for (auto& renderer : childrenOfType<RenderBox>(*this)) {
4425
        if (!is<RenderBox>(*renderObject))
4426
            continue;
4427
4428
        if (is<RenderFlowThread>(*this)) {
4426
        if (is<RenderFlowThread>(*this)) {
4429
            ASSERT(region);
4427
            ASSERT(region);
4430
            if (!downcast<RenderFlowThread>(*this).objectShouldFragmentInFlowRegion(renderObject, region))
4428
            if (!downcast<RenderFlowThread>(*this).objectShouldFragmentInFlowRegion(&renderer, region))
4431
                continue;
4429
                continue;
4432
        }
4430
        }
4433
4431
4434
        auto& renderer = downcast<RenderBox>(*renderObject);
4435
4436
        if ((!renderer.firstChild() && !renderer.isInline() && !is<RenderBlockFlow>(renderer))
4432
        if ((!renderer.firstChild() && !renderer.isInline() && !is<RenderBlockFlow>(renderer))
4437
            || renderer.style().visibility() != VISIBLE)
4433
            || renderer.style().visibility() != VISIBLE)
4438
            continue;
4434
            continue;
- a/Source/WebCore/rendering/RenderElement.cpp -6 / +7 lines
Lines 41-46 a/Source/WebCore/rendering/RenderElement.cpp_sec1
41
#include "Logging.h"
41
#include "Logging.h"
42
#include "PathUtilities.h"
42
#include "PathUtilities.h"
43
#include "RenderBlock.h"
43
#include "RenderBlock.h"
44
#include "RenderChildIterator.h"
44
#include "RenderCounter.h"
45
#include "RenderCounter.h"
45
#include "RenderDeprecatedFlexibleBox.h"
46
#include "RenderDeprecatedFlexibleBox.h"
46
#include "RenderFlexibleBox.h"
47
#include "RenderFlexibleBox.h"
Lines 2151-2168 void RenderElement::issueRepaintForOutlineAuto(float outlineSize) a/Source/WebCore/rendering/RenderElement.cpp_sec2
2151
    repaintRectangle(repaintRect);
2152
    repaintRectangle(repaintRect);
2152
}
2153
}
2153
2154
2154
void RenderElement::updateOutlineAutoAncestor(bool hasOutlineAuto) const
2155
void RenderElement::updateOutlineAutoAncestor(bool hasOutlineAuto)
2155
{
2156
{
2156
    for (auto* child = firstChild(); child; child = child->nextSibling()) {
2157
    for (auto& child : childrenOfType<RenderObject>(*this)) {
2157
        if (hasOutlineAuto == child->hasOutlineAutoAncestor())
2158
        if (hasOutlineAuto == child.hasOutlineAutoAncestor())
2158
            continue;
2159
            continue;
2159
        child->setHasOutlineAutoAncestor(hasOutlineAuto);
2160
        child.setHasOutlineAutoAncestor(hasOutlineAuto);
2160
        bool childHasOutlineAuto = child->outlineStyleForRepaint().outlineStyleIsAuto();
2161
        bool childHasOutlineAuto = child.outlineStyleForRepaint().outlineStyleIsAuto();
2161
        if (childHasOutlineAuto)
2162
        if (childHasOutlineAuto)
2162
            continue;
2163
            continue;
2163
        if (!is<RenderElement>(child))
2164
        if (!is<RenderElement>(child))
2164
            continue;
2165
            continue;
2165
        downcast<RenderElement>(*child).updateOutlineAutoAncestor(hasOutlineAuto);
2166
        downcast<RenderElement>(child).updateOutlineAutoAncestor(hasOutlineAuto);
2166
    }
2167
    }
2167
    if (hasContinuation())
2168
    if (hasContinuation())
2168
        downcast<RenderBoxModelObject>(*this).continuation()->updateOutlineAutoAncestor(hasOutlineAuto);
2169
        downcast<RenderBoxModelObject>(*this).continuation()->updateOutlineAutoAncestor(hasOutlineAuto);
- a/Source/WebCore/rendering/RenderElement.h -1 / +1 lines
Lines 278-284 protected: a/Source/WebCore/rendering/RenderElement.h_sec1
278
278
279
    void paintFocusRing(PaintInfo&, const RenderStyle&, const Vector<LayoutRect>& focusRingRects);
279
    void paintFocusRing(PaintInfo&, const RenderStyle&, const Vector<LayoutRect>& focusRingRects);
280
    void paintOutline(PaintInfo&, const LayoutRect&);
280
    void paintOutline(PaintInfo&, const LayoutRect&);
281
    void updateOutlineAutoAncestor(bool hasOutlineAuto) const;
281
    void updateOutlineAutoAncestor(bool hasOutlineAuto);
282
282
283
private:
283
private:
284
    RenderElement(ContainerNode&, RenderStyle&&, BaseTypeFlags);
284
    RenderElement(ContainerNode&, RenderStyle&&, BaseTypeFlags);
- a/Source/WebCore/rendering/RenderFieldset.cpp -5 / +6 lines
Lines 29-34 a/Source/WebCore/rendering/RenderFieldset.cpp_sec1
29
#include "HTMLFieldSetElement.h"
29
#include "HTMLFieldSetElement.h"
30
#include "HTMLNames.h"
30
#include "HTMLNames.h"
31
#include "PaintInfo.h"
31
#include "PaintInfo.h"
32
#include "RenderChildIterator.h"
32
33
33
namespace WebCore {
34
namespace WebCore {
34
35
Lines 124-137 RenderObject* RenderFieldset::layoutSpecialExcludedChild(bool relayoutChildren) a/Source/WebCore/rendering/RenderFieldset.cpp_sec2
124
    return &legend;
125
    return &legend;
125
}
126
}
126
127
127
RenderBox* RenderFieldset::findLegend(FindLegendOption option) const
128
RenderBox* RenderFieldset::findLegend(FindLegendOption option)
128
{
129
{
129
    for (RenderObject* legend = firstChild(); legend; legend = legend->nextSibling()) {
130
    for (auto& legend : childrenOfType<RenderElement>(*this)) {
130
        if (option == IgnoreFloatingOrOutOfFlow && legend->isFloatingOrOutOfFlowPositioned())
131
        if (option == IgnoreFloatingOrOutOfFlow && legend.isFloatingOrOutOfFlowPositioned())
131
            continue;
132
            continue;
132
        
133
        
133
        if (is<HTMLLegendElement>(legend->node()))
134
        if (is<HTMLLegendElement>(legend.element()))
134
            return downcast<RenderBox>(legend);
135
            return &downcast<RenderBox>(legend);
135
    }
136
    }
136
    return nullptr;
137
    return nullptr;
137
}
138
}
- a/Source/WebCore/rendering/RenderFieldset.h -1 / +1 lines
Lines 36-42 public: a/Source/WebCore/rendering/RenderFieldset.h_sec1
36
    RenderFieldset(HTMLFieldSetElement&, RenderStyle&&);
36
    RenderFieldset(HTMLFieldSetElement&, RenderStyle&&);
37
37
38
    enum FindLegendOption { IgnoreFloatingOrOutOfFlow, IncludeFloatingOrOutOfFlow };
38
    enum FindLegendOption { IgnoreFloatingOrOutOfFlow, IncludeFloatingOrOutOfFlow };
39
    RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow) const;
39
    RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow);
40
40
41
    HTMLFieldSetElement& fieldSetElement() const { return downcast<HTMLFieldSetElement>(nodeForNonAnonymous()); }
41
    HTMLFieldSetElement& fieldSetElement() const { return downcast<HTMLFieldSetElement>(nodeForNonAnonymous()); }
42
42
- a/Source/WebCore/rendering/RenderInline.cpp -42 / +43 lines
Lines 32-37 a/Source/WebCore/rendering/RenderInline.cpp_sec1
32
#include "InlineTextBox.h"
32
#include "InlineTextBox.h"
33
#include "Page.h"
33
#include "Page.h"
34
#include "RenderBlock.h"
34
#include "RenderBlock.h"
35
#include "RenderChildIterator.h"
35
#include "RenderFullScreen.h"
36
#include "RenderFullScreen.h"
36
#include "RenderGeometryMap.h"
37
#include "RenderGeometryMap.h"
37
#include "RenderIterator.h"
38
#include "RenderIterator.h"
Lines 670-683 void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R a/Source/WebCore/rendering/RenderInline.cpp_sec2
670
671
671
    bool isHorizontal = style().isHorizontalWritingMode();
672
    bool isHorizontal = style().isHorizontalWritingMode();
672
673
673
    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
674
    for (auto& current : childrenOfType<RenderObject>(*this)) {
674
        if (current->isFloatingOrOutOfFlowPositioned())
675
        if (current.isFloatingOrOutOfFlowPositioned())
675
            continue;
676
            continue;
676
            
677
677
        // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
678
        // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
678
        // direction (aligned to the root box's baseline).
679
        // direction (aligned to the root box's baseline).
679
        if (is<RenderBox>(*current)) {
680
        if (is<RenderBox>(current)) {
680
            RenderBox& renderBox = downcast<RenderBox>(*current);
681
            auto& renderBox = downcast<RenderBox>(current);
681
            if (renderBox.inlineBoxWrapper()) {
682
            if (renderBox.inlineBoxWrapper()) {
682
                const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root();
683
                const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root();
683
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
684
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
Lines 688-696 void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R a/Source/WebCore/rendering/RenderInline.cpp_sec3
688
                else
689
                else
689
                    context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
690
                    context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
690
            }
691
            }
691
        } else if (is<RenderInline>(*current)) {
692
        } else if (is<RenderInline>(current)) {
692
            // If the child doesn't need line boxes either, then we can recur.
693
            // If the child doesn't need line boxes either, then we can recur.
693
            RenderInline& renderInline = downcast<RenderInline>(*current);
694
            auto& renderInline = downcast<RenderInline>(current);
694
            if (!renderInline.alwaysCreateLineBoxes())
695
            if (!renderInline.alwaysCreateLineBoxes())
695
                renderInline.generateCulledLineBoxRects(context, container);
696
                renderInline.generateCulledLineBoxRects(context, container);
696
            else {
697
            else {
Lines 712-719 void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R a/Source/WebCore/rendering/RenderInline.cpp_sec4
712
                    }
713
                    }
713
                }
714
                }
714
            }
715
            }
715
        } else if (is<RenderText>(*current)) {
716
        } else if (is<RenderText>(current)) {
716
            RenderText& currText = downcast<RenderText>(*current);
717
            auto& currText = downcast<RenderText>(current);
717
            for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
718
            for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
718
                const RootInlineBox& rootBox = childText->root();
719
                const RootInlineBox& rootBox = childText->root();
719
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
720
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
Lines 724-731 void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R a/Source/WebCore/rendering/RenderInline.cpp_sec5
724
                else
725
                else
725
                    context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
726
                    context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
726
            }
727
            }
727
        } else if (is<RenderLineBreak>(*current)) {
728
        } else if (is<RenderLineBreak>(current)) {
728
            if (InlineBox* inlineBox = downcast<RenderLineBreak>(*current).inlineBoxWrapper()) {
729
            if (auto* inlineBox = downcast<RenderLineBreak>(current).inlineBoxWrapper()) {
729
                // FIXME: This could use a helper to share these with text path.
730
                // FIXME: This could use a helper to share these with text path.
730
                const RootInlineBox& rootBox = inlineBox->root();
731
                const RootInlineBox& rootBox = inlineBox->root();
731
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
732
                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
Lines 1033-1058 IntRect RenderInline::linesBoundingBox() const a/Source/WebCore/rendering/RenderInline.cpp_sec6
1033
1034
1034
InlineBox* RenderInline::culledInlineFirstLineBox() const
1035
InlineBox* RenderInline::culledInlineFirstLineBox() const
1035
{
1036
{
1036
    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
1037
    for (auto& current : childrenOfType<RenderObject>(*this)) {
1037
        if (current->isFloatingOrOutOfFlowPositioned())
1038
        if (current.isFloatingOrOutOfFlowPositioned())
1038
            continue;
1039
            continue;
1039
            
1040
1040
        // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
1041
        // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
1041
        // direction (aligned to the root box's baseline).
1042
        // direction (aligned to the root box's baseline).
1042
        if (is<RenderBox>(*current)) {
1043
        if (is<RenderBox>(current)) {
1043
            const auto& renderBox = downcast<RenderBox>(*current);
1044
            auto& renderBox = downcast<RenderBox>(current);
1044
            if (renderBox.inlineBoxWrapper())
1045
            if (renderBox.inlineBoxWrapper())
1045
                return renderBox.inlineBoxWrapper();
1046
                return renderBox.inlineBoxWrapper();
1046
        } else if (is<RenderLineBreak>(*current)) {
1047
        } else if (is<RenderLineBreak>(current)) {
1047
            RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
1048
            auto& renderBR = downcast<RenderLineBreak>(current);
1048
            if (renderBR.inlineBoxWrapper())
1049
            if (renderBR.inlineBoxWrapper())
1049
                return renderBR.inlineBoxWrapper();
1050
                return renderBR.inlineBoxWrapper();
1050
        } else if (is<RenderInline>(*current)) {
1051
        } else if (is<RenderInline>(current)) {
1051
            RenderInline& renderInline = downcast<RenderInline>(*current);
1052
            auto& renderInline = downcast<RenderInline>(current);
1052
            if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
1053
            if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
1053
                return result;
1054
                return result;
1054
        } else if (is<RenderText>(*current)) {
1055
        } else if (is<RenderText>(current)) {
1055
            RenderText& renderText = downcast<RenderText>(*current);
1056
            auto& renderText = downcast<RenderText>(current);
1056
            if (renderText.firstTextBox())
1057
            if (renderText.firstTextBox())
1057
                return renderText.firstTextBox();
1058
                return renderText.firstTextBox();
1058
        }
1059
        }
Lines 1096-1108 LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const a/Source/WebCore/rendering/RenderInline.cpp_sec7
1096
    generateCulledLineBoxRects(context, this);
1097
    generateCulledLineBoxRects(context, this);
1097
    LayoutRect result(enclosingLayoutRect(floatResult));
1098
    LayoutRect result(enclosingLayoutRect(floatResult));
1098
    bool isHorizontal = style().isHorizontalWritingMode();
1099
    bool isHorizontal = style().isHorizontalWritingMode();
1099
    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
1100
    for (auto& current : childrenOfType<RenderObject>(*this)) {
1100
        if (current->isFloatingOrOutOfFlowPositioned())
1101
        if (current.isFloatingOrOutOfFlowPositioned())
1101
            continue;
1102
            continue;
1102
            
1103
1103
        // For overflow we just have to propagate by hand and recompute it all.
1104
        // For overflow we just have to propagate by hand and recompute it all.
1104
        if (is<RenderBox>(*current)) {
1105
        if (is<RenderBox>(current)) {
1105
            RenderBox& renderBox = downcast<RenderBox>(*current);
1106
            auto& renderBox = downcast<RenderBox>(current);
1106
            if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) {
1107
            if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) {
1107
                LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&style());
1108
                LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&style());
1108
                if (isHorizontal) {
1109
                if (isHorizontal) {
Lines 1113-1129 LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const a/Source/WebCore/rendering/RenderInline.cpp_sec8
1113
                    result.uniteIfNonZero(logicalRect.transposedRect());
1114
                    result.uniteIfNonZero(logicalRect.transposedRect());
1114
                }
1115
                }
1115
            }
1116
            }
1116
        } else if (is<RenderInline>(*current)) {
1117
        } else if (is<RenderInline>(current)) {
1117
            // If the child doesn't need line boxes either, then we can recur.
1118
            // If the child doesn't need line boxes either, then we can recur.
1118
            RenderInline& renderInline = downcast<RenderInline>(*current);
1119
            auto& renderInline = downcast<RenderInline>(current);
1119
            if (!renderInline.alwaysCreateLineBoxes())
1120
            if (!renderInline.alwaysCreateLineBoxes())
1120
                result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox());
1121
                result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox());
1121
            else if (!renderInline.hasSelfPaintingLayer())
1122
            else if (!renderInline.hasSelfPaintingLayer())
1122
                result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
1123
                result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
1123
        } else if (is<RenderText>(*current)) {
1124
        } else if (is<RenderText>(current)) {
1124
            // FIXME; Overflow from text boxes is lost. We will need to cache this information in
1125
            // FIXME; Overflow from text boxes is lost. We will need to cache this information in
1125
            // InlineTextBoxes.
1126
            // InlineTextBoxes.
1126
            RenderText& renderText = downcast<RenderText>(*current);
1127
            auto& renderText = downcast<RenderText>(current);
1127
            result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox());
1128
            result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox());
1128
        }
1129
        }
1129
    }
1130
    }
Lines 1458-1481 void RenderInline::dirtyLineBoxes(bool fullLayout) a/Source/WebCore/rendering/RenderInline.cpp_sec9
1458
1459
1459
    if (!alwaysCreateLineBoxes()) {
1460
    if (!alwaysCreateLineBoxes()) {
1460
        // We have to grovel into our children in order to dirty the appropriate lines.
1461
        // We have to grovel into our children in order to dirty the appropriate lines.
1461
        for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
1462
        for (auto& current : childrenOfType<RenderObject>(*this)) {
1462
            if (current->isFloatingOrOutOfFlowPositioned())
1463
            if (current.isFloatingOrOutOfFlowPositioned())
1463
                continue;
1464
                continue;
1464
            if (is<RenderBox>(*current) && !current->needsLayout()) {
1465
            if (is<RenderBox>(current) && !current.needsLayout()) {
1465
                RenderBox& renderBox = downcast<RenderBox>(*current);
1466
                auto& renderBox = downcast<RenderBox>(current);
1466
                if (renderBox.inlineBoxWrapper())
1467
                if (renderBox.inlineBoxWrapper())
1467
                    renderBox.inlineBoxWrapper()->root().markDirty();
1468
                    renderBox.inlineBoxWrapper()->root().markDirty();
1468
            } else if (!current->selfNeedsLayout()) {
1469
            } else if (!current.selfNeedsLayout()) {
1469
                if (is<RenderInline>(*current)) {
1470
                if (is<RenderInline>(current)) {
1470
                    RenderInline& renderInline = downcast<RenderInline>(*current);
1471
                    auto& renderInline = downcast<RenderInline>(current);
1471
                    for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox())
1472
                    for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox())
1472
                        childLine->root().markDirty();
1473
                        childLine->root().markDirty();
1473
                } else if (is<RenderText>(*current)) {
1474
                } else if (is<RenderText>(current)) {
1474
                    RenderText& renderText = downcast<RenderText>(*current);
1475
                    auto& renderText = downcast<RenderText>(current);
1475
                    for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
1476
                    for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
1476
                        childText->root().markDirty();
1477
                        childText->root().markDirty();
1477
                } else if (is<RenderLineBreak>(*current)) {
1478
                } else if (is<RenderLineBreak>(current)) {
1478
                    RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
1479
                    auto& renderBR = downcast<RenderLineBreak>(current);
1479
                    if (renderBR.inlineBoxWrapper())
1480
                    if (renderBR.inlineBoxWrapper())
1480
                        renderBR.inlineBoxWrapper()->root().markDirty();
1481
                        renderBR.inlineBoxWrapper()->root().markDirty();
1481
                }
1482
                }
- a/Source/WebCore/rendering/RenderListItem.cpp -7 / +8 lines
Lines 30-35 a/Source/WebCore/rendering/RenderListItem.cpp_sec1
30
#include "HTMLUListElement.h"
30
#include "HTMLUListElement.h"
31
#include "InlineElementBox.h"
31
#include "InlineElementBox.h"
32
#include "PseudoElement.h"
32
#include "PseudoElement.h"
33
#include "RenderChildIterator.h"
33
#include "RenderInline.h"
34
#include "RenderInline.h"
34
#include "RenderListMarker.h"
35
#include "RenderListMarker.h"
35
#include "RenderMultiColumnFlowThread.h"
36
#include "RenderMultiColumnFlowThread.h"
Lines 227-249 bool RenderListItem::isEmpty() const a/Source/WebCore/rendering/RenderListItem.cpp_sec2
227
static RenderBlock* getParentOfFirstLineBox(RenderBlock& current, RenderObject& marker)
228
static RenderBlock* getParentOfFirstLineBox(RenderBlock& current, RenderObject& marker)
228
{
229
{
229
    bool inQuirksMode = current.document().inQuirksMode();
230
    bool inQuirksMode = current.document().inQuirksMode();
230
    for (RenderObject* child = current.firstChild(); child; child = child->nextSibling()) {
231
    for (auto& child : childrenOfType<RenderObject>(current)) {
231
        if (child == &marker)
232
        if (&child == &marker)
232
            continue;
233
            continue;
233
234
234
        if (child->isInline() && (!is<RenderInline>(*child) || current.generatesLineBoxesForInlineChild(child)))
235
        if (child.isInline() && (!is<RenderInline>(child) || current.generatesLineBoxesForInlineChild(&child)))
235
            return &current;
236
            return &current;
236
237
237
        if (child->isFloating() || child->isOutOfFlowPositioned())
238
        if (child.isFloating() || child.isOutOfFlowPositioned())
238
            continue;
239
            continue;
239
240
240
        if (is<RenderTable>(*child) || !is<RenderBlock>(*child) || (is<RenderBox>(*child) && downcast<RenderBox>(*child).isWritingModeRoot()))
241
        if (is<RenderTable>(child) || !is<RenderBlock>(child) || (is<RenderBox>(child) && downcast<RenderBox>(child).isWritingModeRoot()))
241
            break;
242
            break;
242
243
243
        if (is<RenderListItem>(current) && inQuirksMode && child->node() && isHTMLListElement(*child->node()))
244
        if (is<RenderListItem>(current) && inQuirksMode && child.node() && isHTMLListElement(*child.node()))
244
            break;
245
            break;
245
246
246
        if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast<RenderBlock>(*child), marker))
247
        if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast<RenderBlock>(child), marker))
247
            return lineBox;
248
            return lineBox;
248
    }
249
    }
249
250
- a/Source/WebCore/rendering/RenderObject.cpp -14 / +33 lines
Lines 47-52 a/Source/WebCore/rendering/RenderObject.cpp_sec1
47
#include "MainFrame.h"
47
#include "MainFrame.h"
48
#include "Page.h"
48
#include "Page.h"
49
#include "PseudoElement.h"
49
#include "PseudoElement.h"
50
#include "RenderChildIterator.h"
50
#include "RenderCounter.h"
51
#include "RenderCounter.h"
51
#include "RenderFlowThread.h"
52
#include "RenderFlowThread.h"
52
#include "RenderGeometryMap.h"
53
#include "RenderGeometryMap.h"
Lines 168-179 void RenderObject::setFlowThreadStateIncludingDescendants(FlowThreadState state) a/Source/WebCore/rendering/RenderObject.cpp_sec2
168
{
169
{
169
    setFlowThreadState(state);
170
    setFlowThreadState(state);
170
171
171
    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) {
172
    if (!is<RenderElement>(*this))
173
        return;
174
175
    for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this))) {
172
        // If the child is a fragmentation context it already updated the descendants flag accordingly.
176
        // If the child is a fragmentation context it already updated the descendants flag accordingly.
173
        if (child->isRenderFlowThread())
177
        if (child.isRenderFlowThread())
174
            continue;
178
            continue;
175
        ASSERT(state != child->flowThreadState());
179
        ASSERT(state != child.flowThreadState());
176
        child->setFlowThreadStateIncludingDescendants(state);
180
        child.setFlowThreadStateIncludingDescendants(state);
177
    }
181
    }
178
}
182
}
179
183
Lines 800-807 void RenderObject::addAbsoluteRectForLayer(LayoutRect& result) a/Source/WebCore/rendering/RenderObject.cpp_sec3
800
{
804
{
801
    if (hasLayer())
805
    if (hasLayer())
802
        result.unite(absoluteBoundingBoxRectIgnoringTransforms());
806
        result.unite(absoluteBoundingBoxRectIgnoringTransforms());
803
    for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling())
807
804
        current->addAbsoluteRectForLayer(result);
808
    if (!is<RenderElement>(*this))
809
        return;
810
811
    for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
812
        child.addAbsoluteRectForLayer(result);
805
}
813
}
806
814
807
// FIXME: change this to use the subtreePaint terminology
815
// FIXME: change this to use the subtreePaint terminology
Lines 809-816 LayoutRect RenderObject::paintingRootRect(LayoutRect& topLevelRect) a/Source/WebCore/rendering/RenderObject.cpp_sec4
809
{
817
{
810
    LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms();
818
    LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms();
811
    topLevelRect = result;
819
    topLevelRect = result;
812
    for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling())
820
    if (is<RenderElement>(*this)) {
813
        current->addAbsoluteRectForLayer(result);
821
        for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
822
            child.addAbsoluteRectForLayer(result);
823
    }
814
    return result;
824
    return result;
815
}
825
}
816
826
Lines 1588-1595 void RenderObject::removeFromRenderFlowThreadIncludingDescendants(bool shouldUpd a/Source/WebCore/rendering/RenderObject.cpp_sec5
1588
    if (isRenderFlowThread())
1598
    if (isRenderFlowThread())
1589
        shouldUpdateState = false;
1599
        shouldUpdateState = false;
1590
1600
1591
    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling())
1601
    if (is<RenderElement>(*this)) {
1592
        child->removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
1602
        for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
1603
            child.removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
1604
    }
1593
1605
1594
    // We have to ask for our containing flow thread as it may be above the removed sub-tree.
1606
    // We have to ask for our containing flow thread as it may be above the removed sub-tree.
1595
    RenderFlowThread* flowThreadContainingBlock = this->flowThreadContainingBlock();
1607
    RenderFlowThread* flowThreadContainingBlock = this->flowThreadContainingBlock();
Lines 1627-1634 void RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants(Rende a/Source/WebCore/rendering/RenderObject.cpp_sec6
1627
    if (flowThread)
1639
    if (flowThread)
1628
        flowThread->removeFlowChildInfo(this);
1640
        flowThread->removeFlowChildInfo(this);
1629
1641
1630
    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling())
1642
    if (!is<RenderElement>(*this))
1631
        child->invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
1643
        return;
1644
1645
    for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
1646
        child.invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
1632
}
1647
}
1633
1648
1634
static void collapseAnonymousTableRowsIfNeeded(const RenderObject& rendererToBeDestroyed)
1649
static void collapseAnonymousTableRowsIfNeeded(const RenderObject& rendererToBeDestroyed)
Lines 1723-1730 void RenderObject::updateDragState(bool dragOn) a/Source/WebCore/rendering/RenderObject.cpp_sec7
1723
    setIsDragging(dragOn);
1738
    setIsDragging(dragOn);
1724
    if (valueChanged && node() && (style().affectedByDrag() || (is<Element>(*node()) && downcast<Element>(*node()).childrenAffectedByDrag())))
1739
    if (valueChanged && node() && (style().affectedByDrag() || (is<Element>(*node()) && downcast<Element>(*node()).childrenAffectedByDrag())))
1725
        node()->setNeedsStyleRecalc();
1740
        node()->setNeedsStyleRecalc();
1726
    for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling())
1741
1727
        curr->updateDragState(dragOn);
1742
    if (!is<RenderElement>(*this))
1743
        return;
1744
1745
    for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
1746
        child.updateDragState(dragOn);
1728
}
1747
}
1729
1748
1730
bool RenderObject::isComposited() const
1749
bool RenderObject::isComposited() const
- a/Source/WebCore/rendering/RenderTable.cpp -4 / +5 lines
Lines 35-40 a/Source/WebCore/rendering/RenderTable.cpp_sec1
35
#include "HTMLNames.h"
35
#include "HTMLNames.h"
36
#include "HTMLTableElement.h"
36
#include "HTMLTableElement.h"
37
#include "LayoutRepainter.h"
37
#include "LayoutRepainter.h"
38
#include "RenderChildIterator.h"
38
#include "RenderIterator.h"
39
#include "RenderIterator.h"
39
#include "RenderLayer.h"
40
#include "RenderLayer.h"
40
#include "RenderNamedFlowFragment.h"
41
#include "RenderNamedFlowFragment.h"
Lines 879-890 void RenderTable::appendColumn(unsigned span) a/Source/WebCore/rendering/RenderTable.cpp_sec2
879
880
880
RenderTableCol* RenderTable::firstColumn() const
881
RenderTableCol* RenderTable::firstColumn() const
881
{
882
{
882
    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
883
    for (auto& child : childrenOfType<RenderObject>(*this)) {
883
        if (is<RenderTableCol>(*child))
884
        if (is<RenderTableCol>(child))
884
            return downcast<RenderTableCol>(child);
885
            return &const_cast<RenderTableCol&>(downcast<RenderTableCol>(child));
885
886
886
        // We allow only table-captions before columns or column-groups.
887
        // We allow only table-captions before columns or column-groups.
887
        if (!is<RenderTableCaption>(*child))
888
        if (!is<RenderTableCaption>(child))
888
            return nullptr;
889
            return nullptr;
889
    }
890
    }
890
891
- a/Source/WebCore/rendering/RenderTableCol.cpp -2 / +3 lines
Lines 28-33 a/Source/WebCore/rendering/RenderTableCol.cpp_sec1
28
28
29
#include "HTMLNames.h"
29
#include "HTMLNames.h"
30
#include "HTMLTableColElement.h"
30
#include "HTMLTableColElement.h"
31
#include "RenderChildIterator.h"
31
#include "RenderIterator.h"
32
#include "RenderIterator.h"
32
#include "RenderTable.h"
33
#include "RenderTable.h"
33
#include "RenderTableCaption.h"
34
#include "RenderTableCaption.h"
Lines 131-138 void RenderTableCol::clearPreferredLogicalWidthsDirtyBits() a/Source/WebCore/rendering/RenderTableCol.cpp_sec2
131
{
132
{
132
    setPreferredLogicalWidthsDirty(false);
133
    setPreferredLogicalWidthsDirty(false);
133
134
134
    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
135
    for (auto& child : childrenOfType<RenderObject>(*this))
135
        child->setPreferredLogicalWidthsDirty(false);
136
        child.setPreferredLogicalWidthsDirty(false);
136
}
137
}
137
138
138
RenderTable* RenderTableCol::table() const
139
RenderTable* RenderTableCol::table() const
- a/Source/WebCore/rendering/RenderTableSection.cpp -4 / +5 lines
Lines 29-34 a/Source/WebCore/rendering/RenderTableSection.cpp_sec1
29
#include "HitTestResult.h"
29
#include "HitTestResult.h"
30
#include "HTMLNames.h"
30
#include "HTMLNames.h"
31
#include "PaintInfo.h"
31
#include "PaintInfo.h"
32
#include "RenderChildIterator.h"
32
#include "RenderNamedFlowFragment.h"
33
#include "RenderNamedFlowFragment.h"
33
#include "RenderTableCell.h"
34
#include "RenderTableCell.h"
34
#include "RenderTableCol.h"
35
#include "RenderTableCol.h"
Lines 570-580 void RenderTableSection::layoutRows() a/Source/WebCore/rendering/RenderTableSection.cpp_sec2
570
            bool flexAllChildren = cell->style().logicalHeight().isFixed()
571
            bool flexAllChildren = cell->style().logicalHeight().isFixed()
571
                || (!table()->style().logicalHeight().isAuto() && rHeight != cell->logicalHeight());
572
                || (!table()->style().logicalHeight().isAuto() && rHeight != cell->logicalHeight());
572
573
573
            for (RenderObject* renderer = cell->firstChild(); renderer; renderer = renderer->nextSibling()) {
574
            for (auto& renderer : childrenOfType<RenderObject>(*cell)) {
574
                if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
575
                if (!is<RenderText>(renderer) && renderer.style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer.isReplaced() || (is<RenderBox>(renderer) && downcast<RenderBox>(renderer).scrollsOverflow())) && !is<RenderTextControl>(renderer)))) {
575
                    // Tables with no sections do not flex.
576
                    // Tables with no sections do not flex.
576
                    if (!is<RenderTable>(*renderer) || downcast<RenderTable>(*renderer).hasSections()) {
577
                    if (!is<RenderTable>(renderer) || downcast<RenderTable>(renderer).hasSections()) {
577
                        renderer->setNeedsLayout(MarkOnlyThis);
578
                        renderer.setNeedsLayout(MarkOnlyThis);
578
                        cellChildrenFlex = true;
579
                        cellChildrenFlex = true;
579
                    }
580
                    }
580
                }
581
                }
- a/Source/WebCore/rendering/RenderTreeAsText.cpp -3 / +3 lines
Lines 566-575 void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavi a/Source/WebCore/rendering/RenderTreeAsText.cpp_sec1
566
        }
566
        }
567
567
568
    } else {
568
    } else {
569
        for (RenderObject* child = downcast<RenderElement>(o).firstChild(); child; child = child->nextSibling()) {
569
        for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(o))) {
570
            if (child->hasLayer())
570
            if (child.hasLayer())
571
                continue;
571
                continue;
572
            write(ts, *child, indent + 1, behavior);
572
            write(ts, child, indent + 1, behavior);
573
        }
573
        }
574
    }
574
    }
575
575
- a/Source/WebCore/rendering/svg/RenderSVGText.cpp -7 / +7 lines
Lines 118-131 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay a/Source/WebCore/rendering/svg/RenderSVGText.cpp_sec1
118
    }
118
    }
119
}
119
}
120
120
121
static inline bool findPreviousAndNextAttributes(RenderElement* start, RenderSVGInlineText* locateElement, bool& stopAfterNext, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttributes*& next)
121
static inline bool findPreviousAndNextAttributes(RenderElement& start, RenderSVGInlineText* locateElement, bool& stopAfterNext, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttributes*& next)
122
{
122
{
123
    ASSERT(start);
123
    ASSERT(start);
124
    ASSERT(locateElement);
124
    ASSERT(locateElement);
125
    // FIXME: Make this iterative.
125
    // FIXME: Make this iterative.
126
    for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
126
    for (auto& child : childrenOfType<RenderObject>(start)) {
127
        if (is<RenderSVGInlineText>(*child)) {
127
        if (is<RenderSVGInlineText>(child)) {
128
            RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
128
            auto& text = downcast<RenderSVGInlineText>(child);
129
            if (locateElement != &text) {
129
            if (locateElement != &text) {
130
                if (stopAfterNext) {
130
                if (stopAfterNext) {
131
                    next = text.layoutAttributes();
131
                    next = text.layoutAttributes();
Lines 140-146 static inline bool findPreviousAndNextAttributes(RenderElement* start, RenderSVG a/Source/WebCore/rendering/svg/RenderSVGText.cpp_sec2
140
            continue;
140
            continue;
141
        }
141
        }
142
142
143
        if (!is<RenderSVGInline>(*child))
143
        if (!is<RenderSVGInline>(child))
144
            continue;
144
            continue;
145
145
146
        if (findPreviousAndNextAttributes(downcast<RenderElement>(child), locateElement, stopAfterNext, previous, next))
146
        if (findPreviousAndNextAttributes(downcast<RenderElement>(child), locateElement, stopAfterNext, previous, next))
Lines 192-198 void RenderSVGText::subtreeChildWasAdded(RenderObject* child) a/Source/WebCore/rendering/svg/RenderSVGText.cpp_sec3
192
            SVGTextLayoutAttributes* previous = 0;
192
            SVGTextLayoutAttributes* previous = 0;
193
            SVGTextLayoutAttributes* next = 0;
193
            SVGTextLayoutAttributes* next = 0;
194
            ASSERT_UNUSED(child, &attributes->context() == child);
194
            ASSERT_UNUSED(child, &attributes->context() == child);
195
            findPreviousAndNextAttributes(this, &attributes->context(), stopAfterNext, previous, next);
195
            findPreviousAndNextAttributes(*this, &attributes->context(), stopAfterNext, previous, next);
196
196
197
            if (previous)
197
            if (previous)
198
                m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous->context());
198
                m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous->context());
Lines 252-258 void RenderSVGText::subtreeChildWillBeRemoved(RenderObject* child, Vector<SVGTex a/Source/WebCore/rendering/svg/RenderSVGText.cpp_sec4
252
    SVGTextLayoutAttributes* previous = nullptr;
252
    SVGTextLayoutAttributes* previous = nullptr;
253
    SVGTextLayoutAttributes* next = nullptr;
253
    SVGTextLayoutAttributes* next = nullptr;
254
    if (!documentBeingDestroyed())
254
    if (!documentBeingDestroyed())
255
        findPreviousAndNextAttributes(this, &text, stopAfterNext, previous, next);
255
        findPreviousAndNextAttributes(*this, &text, stopAfterNext, previous, next);
256
256
257
    if (previous)
257
    if (previous)
258
        affectedAttributes.append(previous);
258
        affectedAttributes.append(previous);
- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp -35 / +35 lines
Lines 26-31 a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp_sec1
26
#include "SVGRenderSupport.h"
26
#include "SVGRenderSupport.h"
27
27
28
#include "NodeRenderStyle.h"
28
#include "NodeRenderStyle.h"
29
#include "RenderChildIterator.h"
29
#include "RenderElement.h"
30
#include "RenderElement.h"
30
#include "RenderGeometryMap.h"
31
#include "RenderGeometryMap.h"
31
#include "RenderIterator.h"
32
#include "RenderIterator.h"
Lines 131-137 bool SVGRenderSupport::checkForSVGRepaintDuringLayout(const RenderElement& rende a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp_sec2
131
}
132
}
132
133
133
// Update a bounding box taking into account the validity of the other bounding box.
134
// Update a bounding box taking into account the validity of the other bounding box.
134
static inline void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox)
135
static inline void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, const RenderObject* other, FloatRect otherBoundingBox)
135
{
136
{
136
    bool otherValid = is<RenderSVGContainer>(*other) ? downcast<RenderSVGContainer>(*other).isObjectBoundingBoxValid() : true;
137
    bool otherValid = is<RenderSVGContainer>(*other) ? downcast<RenderSVGContainer>(*other).isObjectBoundingBoxValid() : true;
137
    if (!otherValid)
138
    if (!otherValid)
Lines 155-175 void SVGRenderSupport::computeContainerBoundingBoxes(const RenderElement& contai a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp_sec3
155
    // When computing the strokeBoundingBox, we use the repaintRects of the container's children so that the container's stroke includes
156
    // When computing the strokeBoundingBox, we use the repaintRects of the container's children so that the container's stroke includes
156
    // the resources applied to the children (such as clips and filters). This allows filters applied to containers to correctly bound
157
    // the resources applied to the children (such as clips and filters). This allows filters applied to containers to correctly bound
157
    // the children, and also improves inlining of SVG content, as the stroke bound is used in that situation also.
158
    // the children, and also improves inlining of SVG content, as the stroke bound is used in that situation also.
158
    for (RenderObject* current = container.firstChild(); current; current = current->nextSibling()) {
159
    for (auto& current : childrenOfType<RenderObject>(container)) {
159
        if (current->isSVGHiddenContainer())
160
        if (current.isSVGHiddenContainer())
160
            continue;
161
            continue;
161
162
162
        // Don't include elements in the union that do not render.
163
        // Don't include elements in the union that do not render.
163
        if (is<RenderSVGShape>(*current) && downcast<RenderSVGShape>(*current).isRenderingDisabled())
164
        if (is<RenderSVGShape>(current) && downcast<RenderSVGShape>(current).isRenderingDisabled())
164
            continue;
165
            continue;
165
166
166
        const AffineTransform& transform = current->localToParentTransform();
167
        const AffineTransform& transform = current.localToParentTransform();
167
        if (transform.isIdentity()) {
168
        if (transform.isIdentity()) {
168
            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, current->objectBoundingBox());
169
            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &current, current.objectBoundingBox());
169
            strokeBoundingBox.unite(current->repaintRectInLocalCoordinates());
170
            strokeBoundingBox.unite(current.repaintRectInLocalCoordinates());
170
        } else {
171
        } else {
171
            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, transform.mapRect(current->objectBoundingBox()));
172
            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &current, transform.mapRect(current.objectBoundingBox()));
172
            strokeBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoordinates()));
173
            strokeBoundingBox.unite(transform.mapRect(current.repaintRectInLocalCoordinates()));
173
        }
174
        }
174
    }
175
    }
175
176
Lines 247-304 void SVGRenderSupport::layoutChildren(RenderElement& start, bool selfNeedsLayout a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp_sec4
247
    bool needsBoundariesUpdate = start.needsBoundariesUpdate();
248
    bool needsBoundariesUpdate = start.needsBoundariesUpdate();
248
    HashSet<RenderElement*> elementsThatDidNotReceiveLayout;
249
    HashSet<RenderElement*> elementsThatDidNotReceiveLayout;
249
250
250
    for (RenderObject* child = start.firstChild(); child; child = child->nextSibling()) {
251
    for (auto& child : childrenOfType<RenderObject>(start)) {
251
        bool needsLayout = selfNeedsLayout;
252
        bool needsLayout = selfNeedsLayout;
252
        bool childEverHadLayout = child->everHadLayout();
253
        bool childEverHadLayout = child.everHadLayout();
253
254
254
        if (needsBoundariesUpdate && hasSVGShadow) {
255
        if (needsBoundariesUpdate && hasSVGShadow) {
255
            // If we have a shadow, our shadow is baked into our children's cached boundaries,
256
            // If we have a shadow, our shadow is baked into our children's cached boundaries,
256
            // so they need to update.
257
            // so they need to update.
257
            child->setNeedsBoundariesUpdate();
258
            child.setNeedsBoundariesUpdate();
258
            needsLayout = true;
259
            needsLayout = true;
259
        }
260
        }
260
261
261
        if (transformChanged) {
262
        if (transformChanged) {
262
            // If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
263
            // If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
263
            if (is<RenderSVGText>(*child))
264
            if (is<RenderSVGText>(child))
264
                downcast<RenderSVGText>(*child).setNeedsTextMetricsUpdate();
265
                downcast<RenderSVGText>(child).setNeedsTextMetricsUpdate();
265
            needsLayout = true;
266
            needsLayout = true;
266
        }
267
        }
267
268
268
        if (layoutSizeChanged) {
269
        if (layoutSizeChanged && is<SVGElement>(child.node())) {
269
            // When selfNeedsLayout is false and the layout size changed, we have to check whether this child uses relative lengths
270
            // When selfNeedsLayout is false and the layout size changed, we have to check whether this child uses relative lengths
270
            if (SVGElement* element = is<SVGElement>(*child->node()) ? downcast<SVGElement>(child->node()) : nullptr) {
271
            auto& element = downcast<SVGElement>(*child.node());
271
                if (element->hasRelativeLengths()) {
272
            if (element.hasRelativeLengths()) {
272
                    // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
273
                // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
273
                    if (is<RenderSVGShape>(*child))
274
                if (is<RenderSVGShape>(child))
274
                        downcast<RenderSVGShape>(*child).setNeedsShapeUpdate();
275
                    downcast<RenderSVGShape>(child).setNeedsShapeUpdate();
275
                    else if (is<RenderSVGText>(*child)) {
276
                else if (is<RenderSVGText>(child)) {
276
                        RenderSVGText& svgText = downcast<RenderSVGText>(*child);
277
                    auto& svgText = downcast<RenderSVGText>(child);
277
                        svgText.setNeedsTextMetricsUpdate();
278
                    svgText.setNeedsTextMetricsUpdate();
278
                        svgText.setNeedsPositioningValuesUpdate();
279
                    svgText.setNeedsPositioningValuesUpdate();
279
                    }
280
281
                    needsLayout = true;
282
                }
280
                }
281
282
                needsLayout = true;
283
            }
283
            }
284
        }
284
        }
285
285
286
        if (needsLayout)
286
        if (needsLayout)
287
            child->setNeedsLayout(MarkOnlyThis);
287
            child.setNeedsLayout(MarkOnlyThis);
288
288
289
        if (child->needsLayout()) {
289
        if (child.needsLayout()) {
290
            layoutDifferentRootIfNeeded(downcast<RenderElement>(*child));
290
            layoutDifferentRootIfNeeded(downcast<RenderElement>(child));
291
            downcast<RenderElement>(*child).layout();
291
            downcast<RenderElement>(child).layout();
292
            // Renderers are responsible for repainting themselves when changing, except
292
            // Renderers are responsible for repainting themselves when changing, except
293
            // for the initial paint to avoid potential double-painting caused by non-sensical "old" bounds.
293
            // for the initial paint to avoid potential double-painting caused by non-sensical "old" bounds.
294
            // We could handle this in the individual objects, but for now it's easier to have
294
            // We could handle this in the individual objects, but for now it's easier to have
295
            // parent containers call repaint().  (RenderBlock::layout* has similar logic.)
295
            // parent containers call repaint().  (RenderBlock::layout* has similar logic.)
296
            if (!childEverHadLayout)
296
            if (!childEverHadLayout)
297
                child->repaint();
297
                child.repaint();
298
        } else if (layoutSizeChanged && is<RenderElement>(*child))
298
        } else if (layoutSizeChanged && is<RenderElement>(child))
299
            elementsThatDidNotReceiveLayout.add(downcast<RenderElement>(child));
299
            elementsThatDidNotReceiveLayout.add(&downcast<RenderElement>(child));
300
300
301
        ASSERT(!child->needsLayout());
301
        ASSERT(!child.needsLayout());
302
    }
302
    }
303
303
304
    if (!layoutSizeChanged) {
304
    if (!layoutSizeChanged) {
- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp -5 / +6 lines
Lines 20-25 a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp_sec1
20
#include "config.h"
20
#include "config.h"
21
#include "SVGTextLayoutAttributesBuilder.h"
21
#include "SVGTextLayoutAttributesBuilder.h"
22
22
23
#include "RenderChildIterator.h"
23
#include "RenderSVGInline.h"
24
#include "RenderSVGInline.h"
24
#include "RenderSVGInlineText.h"
25
#include "RenderSVGInlineText.h"
25
#include "RenderSVGText.h"
26
#include "RenderSVGText.h"
Lines 98-113 void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(RenderBoxMod a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp_sec2
98
{
99
{
99
    ASSERT(!is<RenderSVGText>(start) || m_textPositions.isEmpty());
100
    ASSERT(!is<RenderSVGText>(start) || m_textPositions.isEmpty());
100
101
101
    for (RenderObject* child = start.firstChild(); child; child = child->nextSibling()) {
102
    for (auto& child : childrenOfType<RenderObject>(start)) {
102
        if (is<RenderSVGInlineText>(*child)) {
103
        if (is<RenderSVGInlineText>(child)) {
103
            processRenderSVGInlineText(downcast<RenderSVGInlineText>(*child), m_textLength, lastCharacterWasSpace);
104
            processRenderSVGInlineText(downcast<RenderSVGInlineText>(child), m_textLength, lastCharacterWasSpace);
104
            continue;
105
            continue;
105
        }
106
        }
106
107
107
        if (!is<RenderSVGInline>(*child))
108
        if (!is<RenderSVGInline>(child))
108
            continue;
109
            continue;
109
110
110
        RenderSVGInline& inlineChild = downcast<RenderSVGInline>(*child);
111
        auto& inlineChild = downcast<RenderSVGInline>(child);
111
        SVGTextPositioningElement* element = SVGTextPositioningElement::elementFromRenderer(inlineChild);
112
        SVGTextPositioningElement* element = SVGTextPositioningElement::elementFromRenderer(inlineChild);
112
113
113
        unsigned atPosition = m_textPositions.size();
114
        unsigned atPosition = m_textPositions.size();
- a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp -5 / +6 lines
Lines 20-25 a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp_sec1
20
#include "config.h"
20
#include "config.h"
21
#include "SVGTextMetricsBuilder.h"
21
#include "SVGTextMetricsBuilder.h"
22
22
23
#include "RenderChildIterator.h"
23
#include "RenderSVGInline.h"
24
#include "RenderSVGInline.h"
24
#include "RenderSVGInlineText.h"
25
#include "RenderSVGInlineText.h"
25
#include "RenderSVGText.h"
26
#include "RenderSVGText.h"
Lines 171-179 void SVGTextMetricsBuilder::measureTextRenderer(RenderSVGInlineText& text, Measu a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp_sec2
171
172
172
void SVGTextMetricsBuilder::walkTree(RenderElement& start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
173
void SVGTextMetricsBuilder::walkTree(RenderElement& start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
173
{
174
{
174
    for (auto* child = start.firstChild(); child; child = child->nextSibling()) {
175
    for (auto& child : childrenOfType<RenderObject>(start)) {
175
        if (is<RenderSVGInlineText>(*child)) {
176
        if (is<RenderSVGInlineText>(child)) {
176
            RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
177
            auto& text = downcast<RenderSVGInlineText>(child);
177
            if (stopAtLeaf && stopAtLeaf != &text) {
178
            if (stopAtLeaf && stopAtLeaf != &text) {
178
                data->processRenderer = false;
179
                data->processRenderer = false;
179
                measureTextRenderer(text, data);
180
                measureTextRenderer(text, data);
Lines 188-197 void SVGTextMetricsBuilder::walkTree(RenderElement& start, RenderSVGInlineText* a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp_sec3
188
            continue;
189
            continue;
189
        }
190
        }
190
191
191
        if (!is<RenderSVGInline>(*child))
192
        if (!is<RenderSVGInline>(child))
192
            continue;
193
            continue;
193
194
194
        walkTree(downcast<RenderSVGInline>(*child), stopAtLeaf, data);
195
        walkTree(downcast<RenderSVGInline>(child), stopAtLeaf, data);
195
    }
196
    }
196
}
197
}
197
198

Return to Bug 157811