Changeset 254339 in webkit


Ignore:
Timestamp:
Jan 10, 2020 7:46:26 AM (4 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Fix accessibility/scroll-to-make-visible-iframe-offscreen.html
https://bugs.webkit.org/show_bug.cgi?id=206063

Reviewed by Zalan Bujtas.

This is failing due to missing LFC implementation for RenderText::absoluteQuad.

  • rendering/RenderText.cpp:

(WebCore::collectAbsoluteQuadsForNonComplexPaths):

Implement generic version for collecting absolute quads. It doesn't cover everything that is needed for
the complex path so that still calls into layout system specific code.

(WebCore::RenderText::absoluteQuadsClippedToEllipsis const):
(WebCore::RenderText::absoluteQuads const):
(WebCore::RenderText::layoutFormattingContextLineLayout const):
(WebCore::RenderText::usesComplexLineLayoutPath const):

  • rendering/RenderText.h:
  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::collectAbsoluteQuads): Deleted.

Not needed anymore.

  • rendering/SimpleLineLayoutFunctions.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r254336 r254339  
     12020-01-10  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Fix accessibility/scroll-to-make-visible-iframe-offscreen.html
     4        https://bugs.webkit.org/show_bug.cgi?id=206063
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        This is failing due to missing LFC implementation for RenderText::absoluteQuad.
     9
     10        * rendering/RenderText.cpp:
     11        (WebCore::collectAbsoluteQuadsForNonComplexPaths):
     12
     13        Implement generic version for collecting absolute quads. It doesn't cover everything that is needed for
     14        the complex path so that still calls into layout system specific code.
     15
     16        (WebCore::RenderText::absoluteQuadsClippedToEllipsis const):
     17        (WebCore::RenderText::absoluteQuads const):
     18        (WebCore::RenderText::layoutFormattingContextLineLayout const):
     19        (WebCore::RenderText::usesComplexLineLayoutPath const):
     20        * rendering/RenderText.h:
     21        * rendering/SimpleLineLayoutFunctions.cpp:
     22        (WebCore::SimpleLineLayout::collectAbsoluteQuads): Deleted.
     23
     24        Not needed anymore.
     25
     26        * rendering/SimpleLineLayoutFunctions.h:
     27
    1282020-01-10  Zalan Bujtas  <zalan@apple.com>
    229
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r254159 r254339  
    414414#endif
    415415
     416static Vector<FloatQuad> collectAbsoluteQuadsForNonComplexPaths(const RenderText& textRenderer, bool* wasFixed)
     417{
     418    // FIXME: This generic function doesn't currently cover everything that is needed for the complex line layout path.
     419    ASSERT(!textRenderer.usesComplexLineLayoutPath());
     420
     421    Vector<FloatQuad> quads;
     422    for (auto& box : LineLayoutTraversal::textBoxesFor(textRenderer))
     423        quads.append(textRenderer.localToAbsoluteQuad(FloatQuad(box.rect()), UseTransforms, wasFixed));
     424    return quads;
     425}
     426
    416427Vector<FloatQuad> RenderText::absoluteQuadsClippedToEllipsis() const
    417428{
    418     if (auto* layout = simpleLineLayout()) {
     429    if (!usesComplexLineLayoutPath()) {
    419430        ASSERT(style().textOverflow() != TextOverflow::Ellipsis);
    420         return SimpleLineLayout::collectAbsoluteQuads(*this, *layout, nullptr);
     431        return collectAbsoluteQuadsForNonComplexPaths(*this, nullptr);
    421432    }
    422433    return m_lineBoxes.absoluteQuads(*this, nullptr, RenderTextLineBoxes::ClipToEllipsis);
     
    425436void RenderText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
    426437{
    427     if (auto* layout = simpleLineLayout()) {
    428         quads.appendVector(SimpleLineLayout::collectAbsoluteQuads(*this, *layout, wasFixed));
     438    if (!usesComplexLineLayoutPath()) {
     439        quads.appendVector(collectAbsoluteQuadsForNonComplexPaths(*this, wasFixed));
    429440        return;
    430441    }
     
    13301341}
    13311342
     1343#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     1344const LayoutIntegration::LineLayout* RenderText::layoutFormattingContextLineLayout() const
     1345{
     1346    if (!is<RenderBlockFlow>(*parent()))
     1347        return nullptr;
     1348    return downcast<RenderBlockFlow>(*parent()).layoutFormattingContextLineLayout();
     1349}
     1350#endif
     1351
     1352bool RenderText::usesComplexLineLayoutPath() const
     1353{
     1354    if (simpleLineLayout())
     1355        return false;
     1356#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     1357    if (layoutFormattingContextLineLayout())
     1358        return false;
     1359#endif
     1360    return true;
     1361}
     1362
    13321363float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    13331364{
  • trunk/Source/WebCore/rendering/RenderText.h

    r254153 r254339  
    3636struct GlyphOverflow;
    3737
     38namespace LayoutIntegration {
     39class LineLayout;
     40}
     41
    3842class RenderText : public RenderObject {
    3943    WTF_MAKE_ISO_ALLOCATED(RenderText);
     
    166170    void ensureLineBoxes();
    167171    const SimpleLineLayout::Layout* simpleLineLayout() const;
     172#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     173    const LayoutIntegration::LineLayout* layoutFormattingContextLineLayout() const;
     174#endif
     175    bool usesComplexLineLayoutPath() const;
    168176
    169177    StringView stringView(unsigned start = 0, Optional<unsigned> stop = WTF::nullopt) const;
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp

    r254153 r254339  
    186186}
    187187
    188 Vector<FloatQuad> collectAbsoluteQuads(const RenderObject& renderer, const Layout& layout, bool* wasFixed)
    189 {
    190     Vector<FloatQuad> quads;
    191     auto& resolver = layout.runResolver();
    192     for (auto run : resolver.rangeForRenderer(renderer))
    193         quads.append(renderer.localToAbsoluteQuad(FloatQuad(run.rect()), UseTransforms, wasFixed));
    194     return quads;
    195 }
    196 
    197188unsigned textOffsetForPoint(const LayoutPoint& point, const RenderText& renderer, const Layout& layout)
    198189{
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h

    r254153 r254339  
    5050void collectFlowOverflow(RenderBlockFlow&, const Layout&);
    5151
    52 Vector<FloatQuad> collectAbsoluteQuads(const RenderObject&, const Layout&, bool* wasFixed);
    5352unsigned textOffsetForPoint(const LayoutPoint&, const RenderText&, const Layout&);
    5453Vector<FloatQuad> collectAbsoluteQuadsForRange(const RenderObject&, unsigned start, unsigned end, const Layout&, bool ignoreEmptyTextSelections, bool* wasFixed);
Note: See TracChangeset for help on using the changeset viewer.