[Webkit-unassigned] [Bug 184182] New: Fix the lifetime of the TextRun

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 30 10:21:20 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=184182

            Bug ID: 184182
           Summary: Fix the lifetime of the TextRun
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

InlineTextBox::createTextRun() takes a non-const lvalue reference. It is tempting to change the signature of this method to take a const lvalue reference. But this was done intentionally. TextRun is effectively a StringView: it does not own the passed string. We rely on the compiler to prevent calls like createTextRun("abc").

A possible Solution is to make InlineTextBox own three TextRuns:

class InlineTextBox {

private:
    mutable std::uniqe_ptr<TextRun> m_textRun;
    mutable std::uniqe_ptr<TextRun> m_combinedTextRun;
    mutable std::uniqe_ptr<TextRun> m_hyphenatedTextRun;
};

Then we can replace InlineTextBox::createTextRun(String&) by InlineTextBox::textRun(bool ignoreCombinedText = false, bool ignoreHyphen = false) const.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180330/3f4d107b/attachment.html>


More information about the webkit-unassigned mailing list