⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282150 in webkit


Ignore:
Timestamp:
Sep 8, 2021, 10:11:09 AM (5 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Hovering over link switches to legacy inline boxes
https://bugs.webkit.org/show_bug.cgi?id=226812
<rdar://problem/79394047>

Reviewed by Alan Bujtas.

LayoutTests/imported/w3c:

  • web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt:

Source/WebCore:

Implement rect/quad collection functions in RenderInline by getting data from LFC.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const):

Some tests taking LFC path were affected by the missing implementation here.

(WebCore::LayoutIntegration::LineLayout::collectInlineBoxRects const):

  • layout/integration/LayoutIntegrationLineLayout.h:
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::generateLineBoxRects const):
(WebCore::RenderInline::absoluteRects const):
(WebCore::RenderInline::absoluteQuads const):
(WebCore::RenderInline::absoluteQuadsIgnoringContinuation const):
(WebCore::RenderInline::absoluteQuadsForSelection const):
(WebCore::RenderInline::addFocusRingRects):

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r282144 r282150  
     12021-09-08  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Hovering over link switches to legacy inline boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=226812
     5        <rdar://problem/79394047>
     6
     7        Reviewed by Alan Bujtas.
     8
     9        * web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt:
     10
    1112021-09-08  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt

    r254129 r282150  
    11
    2 FAIL getBoundingClientRect-empty-inline assert_equals: y expected 92 but got 0
     2PASS getBoundingClientRect-empty-inline
    33
  • trunk/Source/WebCore/ChangeLog

    r282149 r282150  
     12021-09-08  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Hovering over link switches to legacy inline boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=226812
     5        <rdar://problem/79394047>
     6
     7        Reviewed by Alan Bujtas.
     8
     9        Implement rect/quad collection functions in RenderInline by getting data from LFC.
     10
     11        * layout/integration/LayoutIntegrationLineLayout.cpp:
     12        (WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const):
     13
     14        Some tests taking LFC path were affected by the missing implementation here.
     15
     16        (WebCore::LayoutIntegration::LineLayout::collectInlineBoxRects const):
     17        * layout/integration/LayoutIntegrationLineLayout.h:
     18        * rendering/RenderInline.cpp:
     19        (WebCore::RenderInline::generateLineBoxRects const):
     20        (WebCore::RenderInline::absoluteRects const):
     21        (WebCore::RenderInline::absoluteQuads const):
     22        (WebCore::RenderInline::absoluteQuadsIgnoringContinuation const):
     23        (WebCore::RenderInline::absoluteQuadsForSelection const):
     24        (WebCore::RenderInline::addFocusRingRects):
     25
    1262021-09-08  Youenn Fablet  <youenn@apple.com>
    227
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r282060 r282150  
    426426LayoutRect LineLayout::visualOverflowBoundingBoxRectFor(const RenderInline& renderInline) const
    427427{
    428     // FIXME: This doesn't contain overflow.
    429     return enclosingBorderBoxRectFor(renderInline);
     428    LayoutRect result;
     429
     430    auto& layoutBox = m_boxTree.layoutBoxForRenderer(renderInline);
     431    for (auto& run : m_inlineContent->runs) {
     432        if (&run.layoutBox() != &layoutBox)
     433            continue;
     434        result.unite(Layout::toLayoutRect(run.inkOverflow()));
     435    }
     436
     437    return result;
     438}
     439
     440Vector<FloatRect> LineLayout::collectInlineBoxRects(const RenderInline& renderInline) const
     441{
     442    if (!m_inlineContent)
     443        return { };
     444
     445    Vector<FloatRect> result;
     446
     447    auto& layoutBox = m_boxTree.layoutBoxForRenderer(renderInline);
     448    for (auto& run : m_inlineContent->runs) {
     449        if (&run.layoutBox() != &layoutBox)
     450            continue;
     451        result.append(run.logicalRect());
     452    }
     453
     454    return result;
    430455}
    431456
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r281377 r282150  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
     30#include "FloatRect.h"
    3031#include "LayoutIntegrationBoxTree.h"
    3132#include "LayoutIntegrationLineIterator.h"
     
    9899    LayoutRect enclosingBorderBoxRectFor(const RenderInline&) const;
    99100    LayoutRect visualOverflowBoundingBoxRectFor(const RenderInline&) const;
     101    Vector<FloatRect> collectInlineBoxRects(const RenderInline&) const;
    100102
    101103    const RenderObject& rendererForLayoutBox(const Layout::Box&) const;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r282129 r282150  
    254254void RenderInline::generateLineBoxRects(GeneratorContext& context) const
    255255{
     256#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     257    if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this)) {
     258        auto inlineBoxRects = lineLayout->collectInlineBoxRects(*this);
     259        if (inlineBoxRects.isEmpty()) {
     260            context.addRect({ });
     261            return;
     262        }
     263        for (auto inlineBoxRect : inlineBoxRects)
     264            context.addRect(inlineBoxRect);
     265        return;
     266    }
     267#endif
    256268    if (!alwaysCreateLineBoxes())
    257269        generateCulledLineBoxRects(context, this);
     
    343355}
    344356
    345 namespace {
    346 
    347357class AbsoluteRectsGeneratorContext {
    348358public:
     
    362372};
    363373
    364 } // unnamed namespace
    365 
    366374void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
    367375{
    368 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    369     if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))
    370         lineLayout->flow().ensureLineBoxes();
    371 #endif
    372376    Vector<LayoutRect> lineboxRects;
    373377    AbsoluteRectsGeneratorContext context(lineboxRects, accumulatedOffset);
     
    384388    }
    385389}
    386 
    387390
    388391namespace {
     
    410413void RenderInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
    411414{
    412 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    413     if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))
    414         lineLayout->flow().ensureLineBoxes();
    415 #endif
    416415    absoluteQuadsIgnoringContinuation({ }, quads, wasFixed);
    417416    if (continuation())
     
    421420void RenderInline::absoluteQuadsIgnoringContinuation(const FloatRect&, Vector<FloatQuad>& quads, bool*) const
    422421{
    423 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    424     if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))
    425         lineLayout->flow().ensureLineBoxes();
    426 #endif
    427422    AbsoluteQuadsGeneratorContext context(this, quads);
    428423    generateLineBoxRects(context);
     
    432427void RenderInline::absoluteQuadsForSelection(Vector<FloatQuad>& quads) const
    433428{
    434 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    435     if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))
    436         lineLayout->flow().ensureLineBoxes();
    437 #endif
    438429    AbsoluteQuadsGeneratorContext context(this, quads);
    439430    generateLineBoxRects(context);
     
    611602}
    612603
    613 namespace {
    614 
    615604class LinesBoundingBoxGeneratorContext {
    616605public:
     
    624613    FloatRect& m_rect;
    625614};
    626 
    627 } // unnamed namespace
    628615
    629616IntRect RenderInline::linesBoundingBox() const
     
    12191206void RenderInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer)
    12201207{
    1221 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    1222     if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))
    1223         lineLayout->flow().ensureLineBoxes();
    1224 #endif
    12251208    AbsoluteRectsGeneratorContext context(rects, additionalOffset);
    12261209    generateLineBoxRects(context);
Note: See TracChangeset for help on using the changeset viewer.