| Differences between
and this patch
- a/Source/WebCore/ChangeLog +79 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2021-05-18  Chris Lord  <clord@igalia.com>
2
3
        [WPE] Spatial navigation tests fail with async overflow scrolling enabled
4
        https://bugs.webkit.org/show_bug.cgi?id=225922
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Separate RenderObject::absoluteClippedOverflowRect into separate
9
        versions for repainting and for spatial navigation. Using the latter
10
        fixes spatial navigation tests when async overflow scrolling is enabled.
11
12
        No new tests, covered by existing tests.
13
14
        * accessibility/AccessibilityRenderObject.cpp:
15
        (WebCore::AccessibilityRenderObject::isOffScreen const):
16
        * dom/DocumentMarkerController.cpp:
17
        (WebCore::DocumentMarkerController::renderedRectsForMarkers):
18
        * page/SpatialNavigation.cpp:
19
        (WebCore::hasOffscreenRect):
20
        * rendering/RenderBox.cpp:
21
        (WebCore::RenderBox::clippedOverflowRect const):
22
        * rendering/RenderBox.h:
23
        * rendering/RenderElement.cpp:
24
        (WebCore::RenderElement::mayCauseRepaintInsideViewport const):
25
        (WebCore::RenderElement::isVisibleInDocumentRect const):
26
        * rendering/RenderInline.cpp:
27
        (WebCore::RenderInline::clippedOverflowRect const):
28
        * rendering/RenderInline.h:
29
        * rendering/RenderLineBreak.h:
30
        * rendering/RenderObject.cpp:
31
        (WebCore::RenderObject::pixelSnappedAbsoluteClippedOverflowRect const):
32
        (WebCore::RenderObject::clippedOverflowRect const):
33
        (WebCore::RenderObject::computeRect const):
34
        (WebCore::absoluteRectsForRangeInText):
35
        * rendering/RenderObject.h:
36
        (WebCore::RenderObject::absoluteClippedOverflowRectForRepaint const):
37
        (WebCore::RenderObject::absoluteClippedOverflowRectForSpatialNavigation const):
38
        (WebCore::RenderObject::clippedOverflowRectForRepaint const):
39
        (WebCore::RenderObject::outlineBoundsForRepaint const):
40
        (WebCore::RenderObject::computeAbsoluteRepaintRect const):
41
        (WebCore::RenderObject::computeRectForRepaint const):
42
        (WebCore::RenderObject::visibleRectContextForSpatialNavigation):
43
        * rendering/RenderReplaced.cpp:
44
        (WebCore::RenderReplaced::clippedOverflowRect const):
45
        * rendering/RenderReplaced.h:
46
        * rendering/RenderTableCell.cpp:
47
        (WebCore::RenderTableCell::clippedOverflowRect const):
48
        * rendering/RenderTableCell.h:
49
        * rendering/RenderTableCol.cpp:
50
        (WebCore::RenderTableCol::clippedOverflowRect const):
51
        * rendering/RenderTableCol.h:
52
        * rendering/RenderTableRow.cpp:
53
        (WebCore::RenderTableRow::layout):
54
        (WebCore::RenderTableRow::clippedOverflowRect const):
55
        * rendering/RenderTableRow.h:
56
        * rendering/RenderText.cpp:
57
        (WebCore::RenderText::clippedOverflowRect const):
58
        * rendering/RenderText.h:
59
        * rendering/RenderView.cpp:
60
        (WebCore::RenderView::updateVisibleViewportRect):
61
        * rendering/svg/RenderSVGForeignObject.cpp:
62
        (WebCore::RenderSVGForeignObject::clippedOverflowRect const):
63
        * rendering/svg/RenderSVGForeignObject.h:
64
        * rendering/svg/RenderSVGGradientStop.h:
65
        * rendering/svg/RenderSVGHiddenContainer.h:
66
        * rendering/svg/RenderSVGInline.cpp:
67
        (WebCore::RenderSVGInline::clippedOverflowRect const):
68
        * rendering/svg/RenderSVGInline.h:
69
        * rendering/svg/RenderSVGModelObject.cpp:
70
        (WebCore::RenderSVGModelObject::clippedOverflowRect const):
71
        * rendering/svg/RenderSVGModelObject.h:
72
        * rendering/svg/RenderSVGRoot.cpp:
73
        (WebCore::RenderSVGRoot::clippedOverflowRect const):
74
        * rendering/svg/RenderSVGRoot.h:
75
        * rendering/svg/RenderSVGText.cpp:
76
        (WebCore::RenderSVGText::clippedOverflowRect const):
77
        * rendering/svg/RenderSVGText.h:
78
        * rendering/svg/SVGRenderTreeAsText.cpp:
79
1
2021-05-10  Philippe Normand  <pnormand@igalia.com>
80
2021-05-10  Philippe Normand  <pnormand@igalia.com>
2
81
3
        [GStreamer] fast/mediastream/MediaStream-video-element-video-tracks-disabled.html fails
82
        [GStreamer] fast/mediastream/MediaStream-video-element-video-tracks-disabled.html fails
- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp -1 / +1 lines
Lines 550-556 bool AccessibilityRenderObject::isOffScreen() const a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp_sec1
550
    if (!m_renderer)
550
    if (!m_renderer)
551
        return true;
551
        return true;
552
552
553
    IntRect contentRect = snappedIntRect(m_renderer->absoluteClippedOverflowRect());
553
    IntRect contentRect = snappedIntRect(m_renderer->absoluteClippedOverflowRectForSpatialNavigation());
554
    // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
554
    // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
555
    IntRect viewRect = m_renderer->view().frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
555
    IntRect viewRect = m_renderer->view().frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
556
    viewRect.intersect(contentRect);
556
    viewRect.intersect(contentRect);
- a/Source/WebCore/dom/DocumentMarkerController.cpp -1 / +1 lines
Lines 197-203 Vector<FloatRect> DocumentMarkerController::renderedRectsForMarkers(DocumentMark a/Source/WebCore/dom/DocumentMarkerController.cpp_sec1
197
        auto renderer = nodeMarkers.key->renderer();
197
        auto renderer = nodeMarkers.key->renderer();
198
        FloatRect overflowClipRect;
198
        FloatRect overflowClipRect;
199
        if (renderer)
199
        if (renderer)
200
            overflowClipRect = renderer->absoluteClippedOverflowRect();
200
            overflowClipRect = renderer->absoluteClippedOverflowRectForRepaint();
201
        for (auto& marker : *nodeMarkers.value) {
201
        for (auto& marker : *nodeMarkers.value) {
202
            if (marker.type() != type)
202
            if (marker.type() != type)
203
                continue;
203
                continue;
- a/Source/WebCore/page/SpatialNavigation.cpp -1 / +1 lines
Lines 325-331 bool hasOffscreenRect(Node* node, FocusDirection direction) a/Source/WebCore/page/SpatialNavigation.cpp_sec1
325
    if (!render)
325
    if (!render)
326
        return true;
326
        return true;
327
327
328
    LayoutRect rect(render->absoluteClippedOverflowRect());
328
    LayoutRect rect(render->absoluteClippedOverflowRectForSpatialNavigation());
329
    if (rect.isEmpty())
329
    if (rect.isEmpty())
330
        return true;
330
        return true;
331
331
- a/Source/WebCore/rendering/RenderBox.cpp -2 / +2 lines
Lines 2304-2310 void RenderBox::deleteLineBoxWrapper() a/Source/WebCore/rendering/RenderBox.cpp_sec1
2304
    m_inlineBoxWrapper = nullptr;
2304
    m_inlineBoxWrapper = nullptr;
2305
}
2305
}
2306
2306
2307
LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
2307
LayoutRect RenderBox::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
2308
{
2308
{
2309
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
2309
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
2310
        return LayoutRect();
2310
        return LayoutRect();
Lines 2312-2318 LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject a/Source/WebCore/rendering/RenderBox.cpp_sec2
2312
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
2312
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
2313
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
2313
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
2314
    r.move(view().frameView().layoutContext().layoutDelta());
2314
    r.move(view().frameView().layoutContext().layoutDelta());
2315
    return computeRectForRepaint(r, repaintContainer);
2315
    return computeRect(r, repaintContainer, context);
2316
}
2316
}
2317
2317
2318
LayoutRect RenderBox::computeVisibleRectUsingPaintOffset(const LayoutRect& rect) const
2318
LayoutRect RenderBox::computeVisibleRectUsingPaintOffset(const LayoutRect& rect) const
- a/Source/WebCore/rendering/RenderBox.h -1 / +1 lines
Lines 389-395 public: a/Source/WebCore/rendering/RenderBox.h_sec1
389
    void setInlineBoxWrapper(InlineElementBox*);
389
    void setInlineBoxWrapper(InlineElementBox*);
390
    void deleteLineBoxWrapper();
390
    void deleteLineBoxWrapper();
391
391
392
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
392
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
393
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const
393
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const
394
override;
394
override;
395
    void repaintDuringLayoutIfMoved(const LayoutRect&);
395
    void repaintDuringLayoutIfMoved(const LayoutRect&);
- a/Source/WebCore/rendering/RenderElement.cpp -2 / +2 lines
Lines 1344-1350 bool RenderElement::mayCauseRepaintInsideViewport(const IntRect* optionalViewpor a/Source/WebCore/rendering/RenderElement.cpp_sec1
1344
1344
1345
    // Compute viewport rect if it was not provided.
1345
    // Compute viewport rect if it was not provided.
1346
    const IntRect& visibleRect = optionalViewportRect ? *optionalViewportRect : frameView.windowToContents(frameView.windowClipRect());
1346
    const IntRect& visibleRect = optionalViewportRect ? *optionalViewportRect : frameView.windowToContents(frameView.windowClipRect());
1347
    return visibleRect.intersects(enclosingIntRect(absoluteClippedOverflowRect()));
1347
    return visibleRect.intersects(enclosingIntRect(absoluteClippedOverflowRectForRepaint()));
1348
}
1348
}
1349
1349
1350
bool RenderElement::isVisibleIgnoringGeometry() const
1350
bool RenderElement::isVisibleIgnoringGeometry() const
Lines 1377-1383 bool RenderElement::isVisibleInDocumentRect(const IntRect& documentRect) const a/Source/WebCore/rendering/RenderElement.cpp_sec2
1377
        backgroundIsPaintedByRoot = !rootRenderer.hasBackground();
1377
        backgroundIsPaintedByRoot = !rootRenderer.hasBackground();
1378
    }
1378
    }
1379
1379
1380
    LayoutRect backgroundPaintingRect = backgroundIsPaintedByRoot ? view().backgroundRect() : absoluteClippedOverflowRect();
1380
    LayoutRect backgroundPaintingRect = backgroundIsPaintedByRoot ? view().backgroundRect() : absoluteClippedOverflowRectForRepaint();
1381
    if (!documentRect.intersects(enclosingIntRect(backgroundPaintingRect)))
1381
    if (!documentRect.intersects(enclosingIntRect(backgroundPaintingRect)))
1382
        return false;
1382
        return false;
1383
1383
- a/Source/WebCore/rendering/RenderInline.cpp -3 / +3 lines
Lines 849-855 LayoutRect RenderInline::linesVisualOverflowBoundingBoxInFragment(const RenderFr a/Source/WebCore/rendering/RenderInline.cpp_sec1
849
    return rect;
849
    return rect;
850
}
850
}
851
851
852
LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
852
LayoutRect RenderInline::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
853
{
853
{
854
    // Only first-letter renderers are allowed in here during layout. They mutate the tree triggering repaints.
854
    // Only first-letter renderers are allowed in here during layout. They mutate the tree triggering repaints.
855
    ASSERT(!view().frameView().layoutContext().isPaintOffsetCacheEnabled() || style().styleType() == PseudoId::FirstLetter || hasSelfPaintingLayer());
855
    ASSERT(!view().frameView().layoutContext().isPaintOffsetCacheEnabled() || style().styleType() == PseudoId::FirstLetter || hasSelfPaintingLayer());
Lines 892-900 LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObj a/Source/WebCore/rendering/RenderInline.cpp_sec2
892
        return repaintRect;
892
        return repaintRect;
893
893
894
    if (containingBlock->hasOverflowClip())
894
    if (containingBlock->hasOverflowClip())
895
        containingBlock->applyCachedClipAndScrollPosition(repaintRect, repaintContainer, visibleRectContextForRepaint());
895
        containingBlock->applyCachedClipAndScrollPosition(repaintRect, repaintContainer, context);
896
896
897
    repaintRect = containingBlock->computeRectForRepaint(repaintRect, repaintContainer);
897
    repaintRect = containingBlock->computeRect(repaintRect, repaintContainer, context);
898
898
899
    if (outlineSize) {
899
    if (outlineSize) {
900
        for (auto& child : childrenOfType<RenderElement>(*this))
900
        for (auto& child : childrenOfType<RenderElement>(*this))
- a/Source/WebCore/rendering/RenderInline.h -1 / +1 lines
Lines 126-132 private: a/Source/WebCore/rendering/RenderInline.h_sec1
126
    LayoutUnit offsetWidth() const final { return linesBoundingBox().width(); }
126
    LayoutUnit offsetWidth() const final { return linesBoundingBox().width(); }
127
    LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); }
127
    LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); }
128
128
129
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
129
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
130
    LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const final;
130
    LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const final;
131
131
132
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
132
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
- a/Source/WebCore/rendering/RenderLineBreak.h -1 / +1 lines
Lines 81-87 private: a/Source/WebCore/rendering/RenderLineBreak.h_sec1
81
    LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); }
81
    LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); }
82
    LayoutRect borderBoundingBox() const final { return LayoutRect(LayoutPoint(), linesBoundingBox().size()); }
82
    LayoutRect borderBoundingBox() const final { return LayoutRect(LayoutPoint(), linesBoundingBox().size()); }
83
    LayoutRect frameRectForStickyPositioning() const final { ASSERT_NOT_REACHED(); return LayoutRect(); }
83
    LayoutRect frameRectForStickyPositioning() const final { ASSERT_NOT_REACHED(); return LayoutRect(); }
84
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const final { return LayoutRect(); }
84
    LayoutRect clippedOverflowRect(const RenderLayerModelObject*, VisibleRectContext) const final { return LayoutRect(); }
85
85
86
    void updateFromStyle() final;
86
    void updateFromStyle() final;
87
    bool requiresLayer() const final { return false; }
87
    bool requiresLayer() const final { return false; }
- a/Source/WebCore/rendering/RenderObject.cpp -5 / +5 lines
Lines 968-974 void RenderObject::repaintSlowRepaintObject() const a/Source/WebCore/rendering/RenderObject.cpp_sec1
968
968
969
IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
969
IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
970
{
970
{
971
    return snappedIntRect(absoluteClippedOverflowRect());
971
    return snappedIntRect(absoluteClippedOverflowRectForRepaint());
972
}
972
}
973
    
973
    
974
LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
974
LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
Lines 978-992 LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* a/Source/WebCore/rendering/RenderObject.cpp_sec2
978
    return r;
978
    return r;
979
}
979
}
980
980
981
LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObject*) const
981
LayoutRect RenderObject::clippedOverflowRect(const RenderLayerModelObject*, VisibleRectContext) const
982
{
982
{
983
    ASSERT_NOT_REACHED();
983
    ASSERT_NOT_REACHED();
984
    return LayoutRect();
984
    return LayoutRect();
985
}
985
}
986
986
987
LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer) const
987
LayoutRect RenderObject::computeRect(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
988
{
988
{
989
    return *computeVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint());
989
    return *computeVisibleRectInContainer(rect, repaintContainer, context);
990
}
990
}
991
991
992
FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const RenderLayerModelObject* repaintContainer) const
992
FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const RenderLayerModelObject* repaintContainer) const
Lines 1974-1980 static Vector<FloatRect> absoluteRectsForRangeInText(const SimpleRange& range, T a/Source/WebCore/rendering/RenderObject.cpp_sec3
1974
    auto textQuads = renderer->absoluteQuadsForRange(offsetRange.start, offsetRange.end, behavior.contains(RenderObject::BoundingRectBehavior::UseSelectionHeight), behavior.contains(RenderObject::BoundingRectBehavior::IgnoreEmptyTextSelections));
1974
    auto textQuads = renderer->absoluteQuadsForRange(offsetRange.start, offsetRange.end, behavior.contains(RenderObject::BoundingRectBehavior::UseSelectionHeight), behavior.contains(RenderObject::BoundingRectBehavior::IgnoreEmptyTextSelections));
1975
1975
1976
    if (behavior.contains(RenderObject::BoundingRectBehavior::RespectClipping)) {
1976
    if (behavior.contains(RenderObject::BoundingRectBehavior::RespectClipping)) {
1977
        auto absoluteClippedOverflowRect = renderer->absoluteClippedOverflowRect();
1977
        auto absoluteClippedOverflowRect = renderer->absoluteClippedOverflowRectForRepaint();
1978
        Vector<FloatRect> clippedRects;
1978
        Vector<FloatRect> clippedRects;
1979
        clippedRects.reserveInitialCapacity(textQuads.size());
1979
        clippedRects.reserveInitialCapacity(textQuads.size());
1980
        for (auto& quad : textQuads) {
1980
        for (auto& quad : textQuads) {
- a/Source/WebCore/rendering/RenderObject.h -21 / +29 lines
Lines 605-629 public: a/Source/WebCore/rendering/RenderObject.h_sec1
605
    // Repaint a slow repaint object, which, at this time, means we are repainting an object with background-attachment:fixed.
605
    // Repaint a slow repaint object, which, at this time, means we are repainting an object with background-attachment:fixed.
606
    void repaintSlowRepaintObject() const;
606
    void repaintSlowRepaintObject() const;
607
607
608
    // Returns the rect that should be repainted whenever this object changes.  The rect is in the view's
609
    // coordinate space.  This method deals with outlines and overflow.
610
    LayoutRect absoluteClippedOverflowRect() const { return clippedOverflowRectForRepaint(nullptr); }
611
    WEBCORE_EXPORT IntRect pixelSnappedAbsoluteClippedOverflowRect() const;
612
    virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const;
613
    virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const;
614
    virtual LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* /*repaintContainer*/, const RenderGeometryMap* = nullptr) const { return LayoutRect(); }
615
616
    // Given a rect in the object's coordinate space, compute a rect suitable for repainting
617
    // that rect in view coordinates.
618
    LayoutRect computeAbsoluteRepaintRect(const LayoutRect& rect) const { return computeRectForRepaint(rect, nullptr); }
619
    // Given a rect in the object's coordinate space, compute a rect suitable for repainting
620
    // that rect in the coordinate space of repaintContainer.
621
    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer) const;
622
    FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer) const;
623
624
    // Given a rect in the object's coordinate space, compute the location in container space where this rect is visible,
625
    // when clipping and scrolling as specified by the context. When using edge-inclusive intersection, return WTF::nullopt
626
    // rather than an empty rect if the rect is completely clipped out in container space.
627
    enum class VisibleRectContextOption {
608
    enum class VisibleRectContextOption {
628
        UseEdgeInclusiveIntersection = 1 << 0,
609
        UseEdgeInclusiveIntersection = 1 << 0,
629
        ApplyCompositedClips = 1 << 1,
610
        ApplyCompositedClips = 1 << 1,
Lines 642-647 public: a/Source/WebCore/rendering/RenderObject.h_sec2
642
        bool descendantNeedsEnclosingIntRect { false };
623
        bool descendantNeedsEnclosingIntRect { false };
643
        OptionSet<VisibleRectContextOption> options;
624
        OptionSet<VisibleRectContextOption> options;
644
    };
625
    };
626
627
    // Returns the rect that should be repainted whenever this object changes. The rect is in the view's
628
    // coordinate space. This method deals with outlines and overflow.
629
    LayoutRect absoluteClippedOverflowRectForRepaint() const { return clippedOverflowRect(nullptr, visibleRectContextForRepaint()); }
630
    LayoutRect absoluteClippedOverflowRectForSpatialNavigation() const { return clippedOverflowRect(nullptr, visibleRectContextForSpatialNavigation()); }
631
    WEBCORE_EXPORT IntRect pixelSnappedAbsoluteClippedOverflowRect() const;
632
    virtual LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
633
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const { return clippedOverflowRect(repaintContainer, visibleRectContextForRepaint()); }
634
    virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const;
635
    virtual LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* /*repaintContainer*/, const RenderGeometryMap* = nullptr) const { return LayoutRect(); }
636
637
    // Given a rect in the object's coordinate space, compute a rect suitable for repainting
638
    // that rect in view coordinates.
639
    LayoutRect computeAbsoluteRepaintRect(const LayoutRect& rect) const { return computeRect(rect, nullptr, visibleRectContextForRepaint()); }
640
    // Given a rect in the object's coordinate space, compute a rect  in the coordinate space
641
    // of repaintContainer suitable for the given VisibleRectContext.
642
    LayoutRect computeRect(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
643
    LayoutRect computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer) const { return computeRect(rect, repaintContainer, visibleRectContextForRepaint()); }
644
    FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer) const;
645
646
    // Given a rect in the object's coordinate space, compute the location in container space where this rect is visible,
647
    // when clipping and scrolling as specified by the context. When using edge-inclusive intersection, return WTF::nullopt
648
    // rather than an empty rect if the rect is completely clipped out in container space.
645
    virtual Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
649
    virtual Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
646
    virtual Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
650
    virtual Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const;
647
651
Lines 754-762 protected: a/Source/WebCore/rendering/RenderObject.h_sec3
754
758
755
    static FragmentedFlowState computedFragmentedFlowState(const RenderObject&);
759
    static FragmentedFlowState computedFragmentedFlowState(const RenderObject&);
756
760
757
    static bool shouldApplyCompositedContainerScrollsForRepaint();
758
759
    static VisibleRectContext visibleRectContextForRepaint();
761
    static VisibleRectContext visibleRectContextForRepaint();
762
    static VisibleRectContext visibleRectContextForSpatialNavigation();
760
763
761
    bool isSetNeedsLayoutForbidden() const;
764
    bool isSetNeedsLayoutForbidden() const;
762
765
Lines 1135-1140 inline auto RenderObject::visibleRectContextForRepaint() -> VisibleRectContext a/Source/WebCore/rendering/RenderObject.h_sec4
1135
    return { false, false, { VisibleRectContextOption::ApplyContainerClip, VisibleRectContextOption::ApplyCompositedContainerScrolls } };
1138
    return { false, false, { VisibleRectContextOption::ApplyContainerClip, VisibleRectContextOption::ApplyCompositedContainerScrolls } };
1136
}
1139
}
1137
1140
1141
inline auto RenderObject::visibleRectContextForSpatialNavigation() -> VisibleRectContext
1142
{
1143
    return { false, false, { VisibleRectContextOption::ApplyContainerClip, VisibleRectContextOption::ApplyCompositedContainerScrolls, VisibleRectContextOption::ApplyCompositedClips } };
1144
}
1145
1138
inline bool RenderObject::isSetNeedsLayoutForbidden() const
1146
inline bool RenderObject::isSetNeedsLayoutForbidden() const
1139
{
1147
{
1140
#if ASSERT_ENABLED
1148
#if ASSERT_ENABLED
- a/Source/WebCore/rendering/RenderReplaced.cpp -2 / +2 lines
Lines 786-792 bool RenderReplaced::isHighlighted(HighlightState state, const HighlightData& ra a/Source/WebCore/rendering/RenderReplaced.cpp_sec1
786
    return false;
786
    return false;
787
}
787
}
788
788
789
LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
789
LayoutRect RenderReplaced::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
790
{
790
{
791
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
791
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
792
        return LayoutRect();
792
        return LayoutRect();
Lines 797-803 LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelO a/Source/WebCore/rendering/RenderReplaced.cpp_sec2
797
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
797
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
798
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
798
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
799
    r.move(view().frameView().layoutContext().layoutDelta());
799
    r.move(view().frameView().layoutContext().layoutDelta());
800
    return computeRectForRepaint(r, repaintContainer);
800
    return computeRect(r, repaintContainer, context);
801
}
801
}
802
802
803
bool RenderReplaced::isContentLikelyVisibleInViewport()
803
bool RenderReplaced::isContentLikelyVisibleInViewport()
- a/Source/WebCore/rendering/RenderReplaced.h -1 / +1 lines
Lines 89-95 private: a/Source/WebCore/rendering/RenderReplaced.h_sec1
89
    void computePreferredLogicalWidths() final;
89
    void computePreferredLogicalWidths() final;
90
    virtual void paintReplaced(PaintInfo&, const LayoutPoint&) { }
90
    virtual void paintReplaced(PaintInfo&, const LayoutPoint&) { }
91
91
92
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
92
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
93
93
94
    VisiblePosition positionForPoint(const LayoutPoint&, const RenderFragmentContainer*) final;
94
    VisiblePosition positionForPoint(const LayoutPoint&, const RenderFragmentContainer*) final;
95
    
95
    
- a/Source/WebCore/rendering/RenderTableCell.cpp -3 / +3 lines
Lines 347-360 LayoutSize RenderTableCell::offsetFromContainer(RenderElement& container, const a/Source/WebCore/rendering/RenderTableCell.cpp_sec1
347
    return offset;
347
    return offset;
348
}
348
}
349
349
350
LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
350
LayoutRect RenderTableCell::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
351
{
351
{
352
    // If the table grid is dirty, we cannot get reliable information about adjoining cells,
352
    // If the table grid is dirty, we cannot get reliable information about adjoining cells,
353
    // so we ignore outside borders. This should not be a problem because it means that
353
    // so we ignore outside borders. This should not be a problem because it means that
354
    // the table is going to recalculate the grid, relayout and repaint its current rect, which
354
    // the table is going to recalculate the grid, relayout and repaint its current rect, which
355
    // includes any outside borders of this cell.
355
    // includes any outside borders of this cell.
356
    if (!table()->collapseBorders() || table()->needsSectionRecalc())
356
    if (!table()->collapseBorders() || table()->needsSectionRecalc())
357
        return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer);
357
        return RenderBlockFlow::clippedOverflowRect(repaintContainer, context);
358
358
359
    bool rtl = !styleForCellFlow().isLeftToRightDirection();
359
    bool rtl = !styleForCellFlow().isLeftToRightDirection();
360
    LayoutUnit outlineSize { style().outlineSize() };
360
    LayoutUnit outlineSize { style().outlineSize() };
Lines 392-398 LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel a/Source/WebCore/rendering/RenderTableCell.cpp_sec2
392
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
392
    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
393
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
393
    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
394
    r.move(view().frameView().layoutContext().layoutDelta());
394
    r.move(view().frameView().layoutContext().layoutDelta());
395
    return computeRectForRepaint(r, repaintContainer);
395
    return computeRect(r, repaintContainer, context);
396
}
396
}
397
397
398
Optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
398
Optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
- a/Source/WebCore/rendering/RenderTableCell.h -1 / +1 lines
Lines 129-135 public: a/Source/WebCore/rendering/RenderTableCell.h_sec1
129
    bool isFirstOrLastCellInRow() const { return !table()->cellAfter(this) || !table()->cellBefore(this); }
129
    bool isFirstOrLastCellInRow() const { return !table()->cellAfter(this) || !table()->cellBefore(this); }
130
#endif
130
#endif
131
    
131
    
132
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
132
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
133
133
134
    void invalidateHasEmptyCollapsedBorders();
134
    void invalidateHasEmptyCollapsedBorders();
135
    void setHasEmptyCollapsedBorder(CollapsedBorderSide, bool empty) const;
135
    void setHasEmptyCollapsedBorder(CollapsedBorderSide, bool empty) const;
- a/Source/WebCore/rendering/RenderTableCol.cpp -2 / +2 lines
Lines 123-129 bool RenderTableCol::canHaveChildren() const a/Source/WebCore/rendering/RenderTableCol.cpp_sec1
123
    return isTableColumnGroup();
123
    return isTableColumnGroup();
124
}
124
}
125
125
126
LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
126
LayoutRect RenderTableCol::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
127
{
127
{
128
    // For now, just repaint the whole table.
128
    // For now, just repaint the whole table.
129
    // FIXME: Find a better way to do this, e.g., need to repaint all the cells that we
129
    // FIXME: Find a better way to do this, e.g., need to repaint all the cells that we
Lines 133-139 LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelO a/Source/WebCore/rendering/RenderTableCol.cpp_sec2
133
    RenderTable* parentTable = table();
133
    RenderTable* parentTable = table();
134
    if (!parentTable)
134
    if (!parentTable)
135
        return LayoutRect();
135
        return LayoutRect();
136
    return parentTable->clippedOverflowRectForRepaint(repaintContainer);
136
    return parentTable->clippedOverflowRect(repaintContainer, context);
137
}
137
}
138
138
139
void RenderTableCol::imageChanged(WrappedImagePtr, const IntRect*)
139
void RenderTableCol::imageChanged(WrappedImagePtr, const IntRect*)
- a/Source/WebCore/rendering/RenderTableCol.h -1 / +1 lines
Lines 77-83 private: a/Source/WebCore/rendering/RenderTableCol.h_sec1
77
    bool canHaveChildren() const override;
77
    bool canHaveChildren() const override;
78
    bool requiresLayer() const override { return false; }
78
    bool requiresLayer() const override { return false; }
79
79
80
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
80
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
81
    void imageChanged(WrappedImagePtr, const IntRect* = 0) override;
81
    void imageChanged(WrappedImagePtr, const IntRect* = 0) override;
82
82
83
    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
83
    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
- a/Source/WebCore/rendering/RenderTableRow.cpp -4 / +4 lines
Lines 151-157 void RenderTableRow::layout() a/Source/WebCore/rendering/RenderTableRow.cpp_sec1
151
    // We only ever need to repaint if our cells didn't, which menas that they didn't need
151
    // We only ever need to repaint if our cells didn't, which menas that they didn't need
152
    // layout, so we know that our bounds didn't change. This code is just making up for
152
    // layout, so we know that our bounds didn't change. This code is just making up for
153
    // the fact that we did not repaint in setStyle() because we had a layout hint.
153
    // the fact that we did not repaint in setStyle() because we had a layout hint.
154
    // We cannot call repaint() because our clippedOverflowRectForRepaint() is taken from the
154
    // We cannot call repaint() because our clippedOverflowRect() is taken from the
155
    // parent table, and being mid-layout, that is invalid. Instead, we repaint our cells.
155
    // parent table, and being mid-layout, that is invalid. Instead, we repaint our cells.
156
    if (selfNeedsLayout() && checkForRepaintDuringLayout()) {
156
    if (selfNeedsLayout() && checkForRepaintDuringLayout()) {
157
        for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell())
157
        for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell())
Lines 162-178 void RenderTableRow::layout() a/Source/WebCore/rendering/RenderTableRow.cpp_sec2
162
    clearNeedsLayout();
162
    clearNeedsLayout();
163
}
163
}
164
164
165
LayoutRect RenderTableRow::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
165
LayoutRect RenderTableRow::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
166
{
166
{
167
    ASSERT(parent());
167
    ASSERT(parent());
168
    // Rows and cells are in the same coordinate space. We need to both compute our overflow rect (which
168
    // Rows and cells are in the same coordinate space. We need to both compute our overflow rect (which
169
    // will accommodate a row outline and any visual effects on the row itself), but we also need to add in
169
    // will accommodate a row outline and any visual effects on the row itself), but we also need to add in
170
    // the repaint rects of cells.
170
    // the repaint rects of cells.
171
    LayoutRect result = RenderBox::clippedOverflowRectForRepaint(repaintContainer);
171
    LayoutRect result = RenderBox::clippedOverflowRect(repaintContainer, context);
172
    for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) {
172
    for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) {
173
        // Even if a cell is a repaint container, it's the row that paints the background behind it.
173
        // Even if a cell is a repaint container, it's the row that paints the background behind it.
174
        // So we don't care if a cell is a repaintContainer here.
174
        // So we don't care if a cell is a repaintContainer here.
175
        result.uniteIfNonZero(cell->clippedOverflowRectForRepaint(repaintContainer));
175
        result.uniteIfNonZero(cell->clippedOverflowRect(repaintContainer, context));
176
    }
176
    }
177
    return result;
177
    return result;
178
}
178
}
- a/Source/WebCore/rendering/RenderTableRow.h -1 / +1 lines
Lines 74-80 private: a/Source/WebCore/rendering/RenderTableRow.h_sec1
74
    void willBeRemovedFromTree(IsInternalMove) override;
74
    void willBeRemovedFromTree(IsInternalMove) override;
75
75
76
    void layout() override;
76
    void layout() override;
77
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
77
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
78
78
79
    bool requiresLayer() const override { return hasOverflowClip() || hasTransformRelatedProperty() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickilyPositioned(); }
79
    bool requiresLayer() const override { return hasOverflowClip() || hasTransformRelatedProperty() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickilyPositioned(); }
80
80
- a/Source/WebCore/rendering/RenderText.cpp -3 / +3 lines
Lines 1577-1583 LayoutRect RenderText::linesVisualOverflowBoundingBox() const a/Source/WebCore/rendering/RenderText.cpp_sec1
1577
    return m_lineBoxes.visualOverflowBoundingBox(*this);
1577
    return m_lineBoxes.visualOverflowBoundingBox(*this);
1578
}
1578
}
1579
1579
1580
LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
1580
LayoutRect RenderText::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
1581
{
1581
{
1582
    RenderObject* rendererToRepaint = containingBlock();
1582
    RenderObject* rendererToRepaint = containingBlock();
1583
1583
Lines 1588-1596 LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObjec a/Source/WebCore/rendering/RenderText.cpp_sec2
1588
1588
1589
    // The renderer we chose to repaint may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint.
1589
    // The renderer we chose to repaint may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint.
1590
    if (repaintContainer && repaintContainer != rendererToRepaint && !rendererToRepaint->isDescendantOf(repaintContainer))
1590
    if (repaintContainer && repaintContainer != rendererToRepaint && !rendererToRepaint->isDescendantOf(repaintContainer))
1591
        return repaintContainer->clippedOverflowRectForRepaint(repaintContainer);
1591
        return repaintContainer->clippedOverflowRect(repaintContainer, context);
1592
1592
1593
    return rendererToRepaint->clippedOverflowRectForRepaint(repaintContainer);
1593
    return rendererToRepaint->clippedOverflowRect(repaintContainer, context);
1594
}
1594
}
1595
1595
1596
LayoutRect RenderText::collectSelectionGeometriesForLineBoxes(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent, Vector<LayoutRect>* rects)
1596
LayoutRect RenderText::collectSelectionGeometriesForLineBoxes(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent, Vector<LayoutRect>* rects)
- a/Source/WebCore/rendering/RenderText.h -1 / +1 lines
Lines 202-208 private: a/Source/WebCore/rendering/RenderText.h_sec1
202
202
203
    void setSelectionState(HighlightState) final;
203
    void setSelectionState(HighlightState) final;
204
    LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) final;
204
    LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) final;
205
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const final;
205
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const final;
206
206
207
    void computePreferredLogicalWidths(float leadWidth, HashSet<const Font*>& fallbackFonts, GlyphOverflow&);
207
    void computePreferredLogicalWidths(float leadWidth, HashSet<const Font*>& fallbackFonts, GlyphOverflow&);
208
208
- a/Source/WebCore/rendering/RenderView.cpp -1 / +1 lines
Lines 754-760 void RenderView::updateVisibleViewportRect(const IntRect& visibleRect) a/Source/WebCore/rendering/RenderView.cpp_sec1
754
    resumePausedImageAnimationsIfNeeded(visibleRect);
754
    resumePausedImageAnimationsIfNeeded(visibleRect);
755
755
756
    for (auto* renderer : m_visibleInViewportRenderers) {
756
    for (auto* renderer : m_visibleInViewportRenderers) {
757
        auto state = visibleRect.intersects(enclosingIntRect(renderer->absoluteClippedOverflowRect())) ? VisibleInViewportState::Yes : VisibleInViewportState::No;
757
        auto state = visibleRect.intersects(enclosingIntRect(renderer->absoluteClippedOverflowRectForRepaint())) ? VisibleInViewportState::Yes : VisibleInViewportState::No;
758
        renderer->setVisibleInViewportState(state);
758
        renderer->setVisibleInViewportState(state);
759
    }
759
    }
760
}
760
}
- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp -1 / +1 lines
Lines 93-99 void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&) a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp_sec1
93
    RenderBlock::paint(childPaintInfo, childPoint);
93
    RenderBlock::paint(childPaintInfo, childPoint);
94
}
94
}
95
95
96
LayoutRect RenderSVGForeignObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
96
LayoutRect RenderSVGForeignObject::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const
97
{
97
{
98
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
98
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
99
}
99
}
- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h -1 / +1 lines
Lines 39-45 public: a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h_sec1
39
39
40
    void paint(PaintInfo&, const LayoutPoint&) override;
40
    void paint(PaintInfo&, const LayoutPoint&) override;
41
41
42
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
42
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
43
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
43
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
44
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
44
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
45
45
- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h -1 / +1 lines
Lines 45-51 private: a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h_sec1
45
    // These overrides are needed to prevent ASSERTs on <svg><stop /></svg>
45
    // These overrides are needed to prevent ASSERTs on <svg><stop /></svg>
46
    // RenderObject's default implementations ASSERT_NOT_REACHED()
46
    // RenderObject's default implementations ASSERT_NOT_REACHED()
47
    // https://bugs.webkit.org/show_bug.cgi?id=20400
47
    // https://bugs.webkit.org/show_bug.cgi?id=20400
48
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); }
48
    LayoutRect clippedOverflowRect(const RenderLayerModelObject*, VisibleRectContext) const override { return LayoutRect(); }
49
    FloatRect objectBoundingBox() const override { return FloatRect(); }
49
    FloatRect objectBoundingBox() const override { return FloatRect(); }
50
    FloatRect strokeBoundingBox() const override { return FloatRect(); }
50
    FloatRect strokeBoundingBox() const override { return FloatRect(); }
51
    FloatRect repaintRectInLocalCoordinates() const override { return FloatRect(); }
51
    FloatRect repaintRectInLocalCoordinates() const override { return FloatRect(); }
- a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h -2 / +2 lines
Lines 40-47 private: a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h_sec1
40
    const char* renderName() const override { return "RenderSVGHiddenContainer"; }
40
    const char* renderName() const override { return "RenderSVGHiddenContainer"; }
41
41
42
    void paint(PaintInfo&, const LayoutPoint&) final;
42
    void paint(PaintInfo&, const LayoutPoint&) final;
43
    
43
44
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const final { return LayoutRect(); }
44
    LayoutRect clippedOverflowRect(const RenderLayerModelObject*, VisibleRectContext) const final { return LayoutRect(); }
45
    void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const final;
45
    void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const final;
46
46
47
    bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) final;
47
    bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) final;
- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp -1 / +1 lines
Lines 70-76 FloatRect RenderSVGInline::repaintRectInLocalCoordinates() const a/Source/WebCore/rendering/svg/RenderSVGInline.cpp_sec1
70
    return FloatRect();
70
    return FloatRect();
71
}
71
}
72
72
73
LayoutRect RenderSVGInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
73
LayoutRect RenderSVGInline::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const
74
{
74
{
75
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
75
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
76
}
76
}
- a/Source/WebCore/rendering/svg/RenderSVGInline.h -1 / +1 lines
Lines 50-56 private: a/Source/WebCore/rendering/svg/RenderSVGInline.h_sec1
50
    FloatRect strokeBoundingBox() const final;
50
    FloatRect strokeBoundingBox() const final;
51
    FloatRect repaintRectInLocalCoordinates() const final;
51
    FloatRect repaintRectInLocalCoordinates() const final;
52
52
53
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const final;
53
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const final;
54
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
54
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
55
    void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const final;
55
    void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const final;
56
    const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const final;
56
    const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const final;
- a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp -1 / +1 lines
Lines 47-53 RenderSVGModelObject::RenderSVGModelObject(SVGElement& element, RenderStyle&& st a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp_sec1
47
{
47
{
48
}
48
}
49
49
50
LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
50
LayoutRect RenderSVGModelObject::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const
51
{
51
{
52
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
52
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
53
}
53
}
- a/Source/WebCore/rendering/svg/RenderSVGModelObject.h -1 / +1 lines
Lines 46-52 class SVGElement; a/Source/WebCore/rendering/svg/RenderSVGModelObject.h_sec1
46
class RenderSVGModelObject : public RenderElement {
46
class RenderSVGModelObject : public RenderElement {
47
    WTF_MAKE_ISO_ALLOCATED(RenderSVGModelObject);
47
    WTF_MAKE_ISO_ALLOCATED(RenderSVGModelObject);
48
public:
48
public:
49
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
49
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
50
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
50
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
51
    LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap*) const final;
51
    LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap*) const final;
52
52
- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp -2 / +2 lines
Lines 351-357 const AffineTransform& RenderSVGRoot::localToParentTransform() const a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp_sec1
351
    return m_localToParentTransform;
351
    return m_localToParentTransform;
352
}
352
}
353
353
354
LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
354
LayoutRect RenderSVGRoot::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext context) const
355
{
355
{
356
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
356
    if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent())
357
        return LayoutRect();
357
        return LayoutRect();
Lines 363-369 LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelOb a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp_sec2
363
    if (m_hasBoxDecorations || hasRenderOverflow())
363
    if (m_hasBoxDecorations || hasRenderOverflow())
364
        repaintRect.unite(unionRect(localSelectionRect(false), visualOverflowRect()));
364
        repaintRect.unite(unionRect(localSelectionRect(false), visualOverflowRect()));
365
365
366
    return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer);
366
    return RenderReplaced::computeRect(enclosingIntRect(repaintRect), repaintContainer, context);
367
}
367
}
368
368
369
Optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
369
Optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
- a/Source/WebCore/rendering/svg/RenderSVGRoot.h -1 / +1 lines
Lines 92-98 private: a/Source/WebCore/rendering/svg/RenderSVGRoot.h_sec1
92
92
93
    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
93
    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
94
94
95
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
95
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
96
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
96
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
97
97
98
    void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
98
    void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
- a/Source/WebCore/rendering/svg/RenderSVGText.cpp -1 / +1 lines
Lines 87-93 const RenderSVGText* RenderSVGText::locateRenderSVGTextAncestor(const RenderObje a/Source/WebCore/rendering/svg/RenderSVGText.cpp_sec1
87
    return lineageOfType<RenderSVGText>(start).first();
87
    return lineageOfType<RenderSVGText>(start).first();
88
}
88
}
89
89
90
LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
90
LayoutRect RenderSVGText::clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const
91
{
91
{
92
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
92
    return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
93
}
93
}
- a/Source/WebCore/rendering/svg/RenderSVGText.h -1 / +1 lines
Lines 77-83 private: a/Source/WebCore/rendering/svg/RenderSVGText.h_sec1
77
77
78
    void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
78
    void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
79
79
80
    LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
80
    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
81
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
81
    Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
82
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
82
    Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override;
83
83
- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp -1 / +1 lines
Lines 239-245 static TextStream& writePositionAndStyle(TextStream& ts, const RenderElement& re a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp_sec1
239
        ts << " clipped";
239
        ts << " clipped";
240
    }
240
    }
241
241
242
    ts << " " << enclosingIntRect(renderer.absoluteClippedOverflowRect());
242
    ts << " " << enclosingIntRect(renderer.absoluteClippedOverflowRectForRepaint());
243
243
244
    writeStyle(ts, renderer);
244
    writeStyle(ts, renderer);
245
    return ts;
245
    return ts;
- a/LayoutTests/ChangeLog +11 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2021-05-18  Chris Lord  <clord@igalia.com>
2
3
        [WPE] Spatial navigation tests fail with async overflow scrolling enabled
4
        https://bugs.webkit.org/show_bug.cgi?id=225922
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Remove failure expectations for spatial navigation tests on WPE.
9
10
        * platform/wpe/TestExpectations:
11
1
2021-05-10  Philippe Normand  <pnormand@igalia.com>
12
2021-05-10  Philippe Normand  <pnormand@igalia.com>
2
13
3
        [GStreamer] fast/mediastream/MediaStream-video-element-video-tracks-disabled.html fails
14
        [GStreamer] fast/mediastream/MediaStream-video-element-video-tracks-disabled.html fails
- a/LayoutTests/platform/wpe/TestExpectations -3 lines
Lines 739-747 webkit.org/b/225379 [ Debug ] imported/w3c/web-platform-tests/webxr/xrDevice_req a/LayoutTests/platform/wpe/TestExpectations_sec1
739
webkit.org/b/225379 [ Debug ] imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html [ Crash ]
739
webkit.org/b/225379 [ Debug ] imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html [ Crash ]
740
740
741
# Test failing since async scrolling was activated in WPE.
741
# Test failing since async scrolling was activated in WPE.
742
webkit.org/b/224596 fast/spatial-navigation/snav-clipped-overflowed-content.html [ Failure ]
743
webkit.org/b/224596 fast/spatial-navigation/snav-only-clipped-overflow-content.html [ Failure ]
744
webkit.org/b/224596 fast/spatial-navigation/snav-simple-content-overflow.html [ Failure ]
745
webkit.org/b/224596 css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on-parent.html [ ImageOnlyFailure ]
742
webkit.org/b/224596 css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on-parent.html [ ImageOnlyFailure ]
746
webkit.org/b/224596 css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on.html [ ImageOnlyFailure ]
743
webkit.org/b/224596 css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on.html [ ImageOnlyFailure ]
747
webkit.org/b/224596 fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html [ ImageOnlyFailure ]
744
webkit.org/b/224596 fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html [ ImageOnlyFailure ]

Return to Bug 225922