[LFC][Integration] Fix DisplayRunPath offsets
https://bugs.webkit.org/show_bug.cgi?id=204949

Reviewed by Zalan Bujtas.

Fixes output of tests like fast/text/system-font-zero-size.html with LFC integration enabled.

* rendering/line/LineLayoutTraversalDisplayRunPath.h:
(WebCore::LineLayoutTraversal::DisplayRunPath::DisplayRunPath):
(WebCore::LineLayoutTraversal::DisplayRunPath::localStartOffset const):
(WebCore::LineLayoutTraversal::DisplayRunPath::localEndOffset const):

Display::Run offsets are already local.

(WebCore::LineLayoutTraversal::DisplayRunPath::length const):
(WebCore::LineLayoutTraversal::DisplayRunPath::runs const):
(WebCore::LineLayoutTraversal::DisplayRunPath::firstRun const): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 4ebbf1c..5b553f8 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2019-12-06  Antti Koivisto  <antti@apple.com>
+
+        [LFC][Integration] Fix DisplayRunPath offsets
+        https://bugs.webkit.org/show_bug.cgi?id=204949
+
+        Reviewed by Zalan Bujtas.
+
+        Fixes output of tests like fast/text/system-font-zero-size.html with LFC integration enabled.
+
+        * rendering/line/LineLayoutTraversalDisplayRunPath.h:
+        (WebCore::LineLayoutTraversal::DisplayRunPath::DisplayRunPath):
+        (WebCore::LineLayoutTraversal::DisplayRunPath::localStartOffset const):
+        (WebCore::LineLayoutTraversal::DisplayRunPath::localEndOffset const):
+
+        Display::Run offsets are already local.
+
+        (WebCore::LineLayoutTraversal::DisplayRunPath::length const):
+        (WebCore::LineLayoutTraversal::DisplayRunPath::runs const):
+        (WebCore::LineLayoutTraversal::DisplayRunPath::firstRun const): Deleted.
+
 2019-12-05  Chris Dumez  <cdumez@apple.com>
 
         Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders
diff --git a/Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h b/Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h
index d20241c..5ca4f8f 100644
--- a/Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h
+++ b/Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h
@@ -42,7 +42,6 @@
 public:
     DisplayRunPath(const Display::InlineContent& inlineContent, size_t startIndex, size_t endIndex)
         : m_inlineContent(&inlineContent)
-        , m_startIndex(startIndex)
         , m_endIndex(endIndex)
         , m_runIndex(startIndex)
     { }
@@ -65,9 +64,9 @@
 
     bool hasHyphen() const { return false; } // FIXME: Implement.
     StringView text() const { return run().textContext()->content(); }
-    unsigned localStartOffset() const { return run().textContext()->start() - firstRun().textContext()->start(); }
-    unsigned localEndOffset() const { return run().textContext()->end() - firstRun().textContext()->start(); }
-    unsigned length() const { return run().textContext()->end() - run().textContext()->start(); }
+    unsigned localStartOffset() const { return run().textContext()->start(); }
+    unsigned localEndOffset() const { return run().textContext()->end(); }
+    unsigned length() const { return run().textContext()->length(); }
 
     bool isLastOnLine() const
     {
@@ -93,11 +92,9 @@
 
 private:
     const Display::InlineContent::Runs& runs() const { return m_inlineContent->runs; }
-    const Display::Run& firstRun() const { return runs()[m_startIndex]; }
     const Display::Run& run() const { return runs()[m_runIndex]; }
 
     RefPtr<const Display::InlineContent> m_inlineContent;
-    size_t m_startIndex { 0 };
     size_t m_endIndex { 0 };
     size_t m_runIndex { 0 };
 };