WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
177607
Extract logic to compute text to render into common function
https://bugs.webkit.org/show_bug.cgi?id=177607
Summary
Extract logic to compute text to render into common function
Daniel Bates
Reported
2017-09-28 09:47:25 PDT
Extract logic to compute text to render into common function.
Attachments
Patch
(16.63 KB, patch)
2017-09-28 09:48 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(15.44 KB, patch)
2017-09-28 16:09 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2017-09-28 09:48:13 PDT
Created
attachment 322091
[details]
Patch
Daniel Bates
Comment 2
2017-09-28 11:29:45 PDT
Comment on
attachment 322091
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=322091&action=review
> Source/WebCore/rendering/InlineTextBox.cpp:1100 > +auto InlineTextBox::text(bool ignoreCombinedText, bool ignoreHyphen) const -> StringAndLengthIgnoringTruncation
Maybe it would be preferred to use enum instead of booleans? Ideally, with the exception of the offset-to-position and position-to-offset functions all of the code would always respect combined text and hyphens (i.e. call text(), which is equal to calling text(false, false)).
Daniel Bates
Comment 3
2017-09-28 11:31:11 PDT
(In reply to Daniel Bates from
comment #2
)
> Comment on
attachment 322091
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=322091&action=review
> > > Source/WebCore/rendering/InlineTextBox.cpp:1100 > > +auto InlineTextBox::text(bool ignoreCombinedText, bool ignoreHyphen) const -> StringAndLengthIgnoringTruncation > > Maybe it would be preferred to use enum...
*enums (though we could define one enum with two enumerators and have this function take an OptionSet if that is preferred).
Daniel Bates
Comment 4
2017-09-28 11:39:09 PDT
As far as I can tell if a text box is combined text or has a hyphen then it cannot be truncated. I make use of this assumption in the implementation of InlineTextBox::text() in
attachment 322091
[details]
to always return the substring from the start offset associated wit the text box (InlineTextBox::m_start) to the end of the text box (InlineTextBox::m_len) when ignoring combined text or ignoring the hyphen. Let me know if this assumption is wrong.
alan
Comment 5
2017-09-28 11:41:33 PDT
Comment on
attachment 322091
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=322091&action=review
> Source/WebCore/rendering/InlineTextBox.cpp:725 > + auto text = this->text(ignoreCombinedText, ignoreHyphen); > + TextRun textRun = createTextRun(text);
At this point StringAndLengthIgnoringTruncation is only used for creating a run. Is this just an intermediate step/change?
Daniel Bates
Comment 6
2017-09-28 16:07:46 PDT
(In reply to zalan from
comment #5
)
> Comment on
attachment 322091
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=322091&action=review
> > > Source/WebCore/rendering/InlineTextBox.cpp:725 > > + auto text = this->text(ignoreCombinedText, ignoreHyphen); > > + TextRun textRun = createTextRun(text); > > At this point StringAndLengthIgnoringTruncation is only used for creating a > run. Is this just an intermediate step/change?
Actually, we do not need StringAndLengthIgnoringTruncation because we do not need to track the length of the text ignoring truncation. See
bug #177620
.
Daniel Bates
Comment 7
2017-09-28 16:09:22 PDT
Created
attachment 322135
[details]
Patch
Daniel Bates
Comment 8
2017-09-29 16:42:07 PDT
Comment on
attachment 322135
[details]
Patch Clearing flags on attachment: 322135 Committed
r222670
: <
http://trac.webkit.org/changeset/222670
>
Daniel Bates
Comment 9
2017-09-29 16:42:10 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2017-09-29 16:42:40 PDT
<
rdar://problem/34750483
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug