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

Changeset 285171 in webkit


Ignore:
Timestamp:
Nov 2, 2021, 12:02:46 PM (5 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Provide bidi properties when constructing TextRun
​https://bugs.webkit.org/show_bug.cgi?id=232632

Reviewed by Alan Bujtas.

Enable correct painting of bidi text runs.

  • layout/integration/InlineIteratorBoxModernPath.h:

(WebCore::InlineIterator::BoxModernPath::createTextRun const):
(WebCore::InlineIterator::BoxModernPath::renderText const):
(WebCore::InlineIterator::BoxModernPath::direction const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r285170 r285171  
     12021-11-02  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Provide bidi properties when constructing TextRun
     4        https://bugs.webkit.org/show_bug.cgi?id=232632
     5
     6        Reviewed by Alan Bujtas.
     7
     8        Enable correct painting of bidi text runs.
     9
     10        * layout/integration/InlineIteratorBoxModernPath.h:
     11        (WebCore::InlineIterator::BoxModernPath::createTextRun const):
     12        (WebCore::InlineIterator::BoxModernPath::renderText const):
     13        (WebCore::InlineIterator::BoxModernPath::direction const):
     14
    1152021-11-02  Kate Cheney  <katherine_cheney@apple.com>
    216
  • trunk/Source/WebCore/layout/integration/InlineIteratorBoxModernPath.h

    r285083 r285171  
    5656
    5757    bool isHorizontal() const { return true; }
     58    // FIXME: Provide or remove.
    5859    bool dirOverride() const { return false; }
    5960    bool isLineBreak() const { return box().isLineBreak(); }
    … …  
    289290        }();
    290291
    291         TextRun textRun { textForRun, xPos, expansion.horizontalExpansion, expansion.behavior };
     292        bool directionalOverride = dirOverride() || style.rtlOrdering() == Order::Visual;
     293        bool characterScanForCodePath = !renderText().canUseSimpleFontCodePath();
     294        TextRun textRun { textForRun, xPos, expansion.horizontalExpansion, expansion.behavior, direction(), directionalOverride, characterScanForCodePath };
    292295        textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
    293296        return textRun;
    294297    };
    295298
     299    const RenderText& renderText() const { return downcast<RenderText>(renderer()); }
     300    TextDirection direction() const { return bidiLevel() % 2 ? TextDirection::RTL : TextDirection::LTR; }
     301
    296302    RefPtr<const LayoutIntegration::InlineContent> m_inlineContent;
    297303    size_t m_boxIndex { 0 };
Note: See TracChangeset for help on using the changeset viewer.