Title: [254339] trunk/Source/WebCore
Revision
254339
Author
[email protected]
Date
2020-01-10 07:46:26 -0800 (Fri, 10 Jan 2020)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (254338 => 254339)


--- trunk/Source/WebCore/ChangeLog	2020-01-10 15:22:43 UTC (rev 254338)
+++ trunk/Source/WebCore/ChangeLog	2020-01-10 15:46:26 UTC (rev 254339)
@@ -1,3 +1,30 @@
+2020-01-10  Antti Koivisto  <[email protected]>
+
+        [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:
+
 2020-01-10  Zalan Bujtas  <[email protected]>
 
         [LFC] Replace FormattingContext::EscapeTypes with EscapeReasons

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (254338 => 254339)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2020-01-10 15:22:43 UTC (rev 254338)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2020-01-10 15:46:26 UTC (rev 254339)
@@ -413,11 +413,22 @@
 }
 #endif
 
+static Vector<FloatQuad> collectAbsoluteQuadsForNonComplexPaths(const RenderText& textRenderer, bool* wasFixed)
+{
+    // FIXME: This generic function doesn't currently cover everything that is needed for the complex line layout path.
+    ASSERT(!textRenderer.usesComplexLineLayoutPath());
+
+    Vector<FloatQuad> quads;
+    for (auto& box : LineLayoutTraversal::textBoxesFor(textRenderer))
+        quads.append(textRenderer.localToAbsoluteQuad(FloatQuad(box.rect()), UseTransforms, wasFixed));
+    return quads;
+}
+
 Vector<FloatQuad> RenderText::absoluteQuadsClippedToEllipsis() const
 {
-    if (auto* layout = simpleLineLayout()) {
+    if (!usesComplexLineLayoutPath()) {
         ASSERT(style().textOverflow() != TextOverflow::Ellipsis);
-        return SimpleLineLayout::collectAbsoluteQuads(*this, *layout, nullptr);
+        return collectAbsoluteQuadsForNonComplexPaths(*this, nullptr);
     }
     return m_lineBoxes.absoluteQuads(*this, nullptr, RenderTextLineBoxes::ClipToEllipsis);
 }
@@ -424,8 +435,8 @@
 
 void RenderText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
 {
-    if (auto* layout = simpleLineLayout()) {
-        quads.appendVector(SimpleLineLayout::collectAbsoluteQuads(*this, *layout, wasFixed));
+    if (!usesComplexLineLayoutPath()) {
+        quads.appendVector(collectAbsoluteQuadsForNonComplexPaths(*this, wasFixed));
         return;
     }
     quads.appendVector(m_lineBoxes.absoluteQuads(*this, wasFixed, RenderTextLineBoxes::NoClipping));
@@ -1329,6 +1340,26 @@
     return downcast<RenderBlockFlow>(*parent()).simpleLineLayout();
 }
 
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+const LayoutIntegration::LineLayout* RenderText::layoutFormattingContextLineLayout() const
+{
+    if (!is<RenderBlockFlow>(*parent()))
+        return nullptr;
+    return downcast<RenderBlockFlow>(*parent()).layoutFormattingContextLineLayout();
+}
+#endif
+
+bool RenderText::usesComplexLineLayoutPath() const
+{
+    if (simpleLineLayout())
+        return false;
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+    if (layoutFormattingContextLineLayout())
+        return false;
+#endif
+    return true;
+}
+
 float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     if (from >= text().length())

Modified: trunk/Source/WebCore/rendering/RenderText.h (254338 => 254339)


--- trunk/Source/WebCore/rendering/RenderText.h	2020-01-10 15:22:43 UTC (rev 254338)
+++ trunk/Source/WebCore/rendering/RenderText.h	2020-01-10 15:46:26 UTC (rev 254339)
@@ -35,6 +35,10 @@
 class InlineTextBox;
 struct GlyphOverflow;
 
+namespace LayoutIntegration {
+class LineLayout;
+}
+
 class RenderText : public RenderObject {
     WTF_MAKE_ISO_ALLOCATED(RenderText);
 public:
@@ -165,6 +169,10 @@
 
     void ensureLineBoxes();
     const SimpleLineLayout::Layout* simpleLineLayout() const;
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+    const LayoutIntegration::LineLayout* layoutFormattingContextLineLayout() const;
+#endif
+    bool usesComplexLineLayoutPath() const;
 
     StringView stringView(unsigned start = 0, Optional<unsigned> stop = WTF::nullopt) const;
 

Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (254338 => 254339)


--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2020-01-10 15:22:43 UTC (rev 254338)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2020-01-10 15:46:26 UTC (rev 254339)
@@ -185,15 +185,6 @@
     }
 }
 
-Vector<FloatQuad> collectAbsoluteQuads(const RenderObject& renderer, const Layout& layout, bool* wasFixed)
-{
-    Vector<FloatQuad> quads;
-    auto& resolver = layout.runResolver();
-    for (auto run : resolver.rangeForRenderer(renderer))
-        quads.append(renderer.localToAbsoluteQuad(FloatQuad(run.rect()), UseTransforms, wasFixed));
-    return quads;
-}
-
 unsigned textOffsetForPoint(const LayoutPoint& point, const RenderText& renderer, const Layout& layout)
 {
     auto& flow = downcast<RenderBlockFlow>(*renderer.parent());

Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h (254338 => 254339)


--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h	2020-01-10 15:22:43 UTC (rev 254338)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h	2020-01-10 15:46:26 UTC (rev 254339)
@@ -49,7 +49,6 @@
 bool hitTestFlow(const RenderBlockFlow&, const Layout&, const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
 void collectFlowOverflow(RenderBlockFlow&, const Layout&);
 
-Vector<FloatQuad> collectAbsoluteQuads(const RenderObject&, const Layout&, bool* wasFixed);
 unsigned textOffsetForPoint(const LayoutPoint&, const RenderText&, const Layout&);
 Vector<FloatQuad> collectAbsoluteQuadsForRange(const RenderObject&, unsigned start, unsigned end, const Layout&, bool ignoreEmptyTextSelections, bool* wasFixed);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to