RESOLVED FIXED 167831
Simple line layout: Skip 16bit specific checks on 8bit content.
https://bugs.webkit.org/show_bug.cgi?id=167831
Summary Simple line layout: Skip 16bit specific checks on 8bit content.
alan baradlay
Reported 2017-02-03 21:08:49 PST
They are redundant.
Attachments
Patch (6.52 KB, patch)
2017-02-03 21:13 PST, alan baradlay
no flags
Patch (7.38 KB, patch)
2017-02-04 07:24 PST, alan baradlay
koivisto: review+
Patch (7.61 KB, patch)
2017-02-04 07:59 PST, alan baradlay
no flags
Radar WebKit Bug Importer
Comment 1 2017-02-03 21:09:15 PST
alan baradlay
Comment 2 2017-02-03 21:13:22 PST
Myles C. Maxfield
Comment 3 2017-02-03 21:25:13 PST
Comment on attachment 300601 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300601&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:-139 > -template <typename CharacterType> Historically, we've gotten some speedups by using the template to generate a completely new loop for 8-bit code rather than doing it at runtime. We might not want to lose this benefit. > Source/WebCore/rendering/SimpleLineLayout.cpp:160 > + // 16bit checks start here. Redundant with the line above. Should remove. > Source/WebCore/rendering/SimpleLineLayout.cpp:163 > bool isLatinIncludingExtendedB = character <= 0x01FF; What does this have to do with justification? > Source/WebCore/rendering/SimpleLineLayout.cpp:169 > + if (lineHeightConstraint && primaryFont.boundsForGlyph(glyphData.glyph).height() > *lineHeightConstraint) Why doesn't this need to be done in the 8-bit case? Any glyph can have giant bounds (see Zapfino) > Source/WebCore/rendering/SimpleLineLayout.cpp:195 > + // FIXME: Do not return until after checking all children. Why? > Source/WebCore/rendering/SimpleLineLayout.cpp:196 > + if (!textRenderer.textLength()) Why don't you just detect this case early and ASSERT() here? It's really easy to measure 0 length runs.
alan baradlay
Comment 4 2017-02-03 21:54:30 PST
> > Source/WebCore/rendering/SimpleLineLayout.cpp:160 > > + // 16bit checks start here. > > Redundant with the line above. Should remove. Ok. I just wanted to emphasize that this is for 16bit only. > > > Source/WebCore/rendering/SimpleLineLayout.cpp:163 > > bool isLatinIncludingExtendedB = character <= 0x01FF; > > What does this have to do with justification? This is a hack for iBooks content (extend justified text support to Latin-B + punctuation. see r210948 -we talked about this a week ago.) > > > Source/WebCore/rendering/SimpleLineLayout.cpp:169 > > + if (lineHeightConstraint && primaryFont.boundsForGlyph(glyphData.glyph).height() > *lineHeightConstraint) > > Why doesn't this need to be done in the 8-bit case? Any glyph can have giant > bounds (see Zapfino) Yes, I missed this. Thanks. > > > Source/WebCore/rendering/SimpleLineLayout.cpp:195 > > + // FIXME: Do not return until after checking all children. > > Why? Because we could still do SLL on a block that has multiple text children even when one of them is empty. > > > Source/WebCore/rendering/SimpleLineLayout.cpp:196 > > + if (!textRenderer.textLength()) > > Why don't you just detect this case early and ASSERT() here? It's really > easy to measure 0 length runs. This is the part where we start looking into the content (as opposed to css properties). We can move checks around, but the current grouping is as follows: basic tree structure checks, css properties, content.
alan baradlay
Comment 5 2017-02-04 07:24:52 PST
Antti Koivisto
Comment 6 2017-02-04 07:32:34 PST
Comment on attachment 300623 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300623&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:141 > +template <typename CharacterType> > +static AvoidanceReasonFlags canUseForCharacter(CharacterType character, bool textIsJustified, IncludeReasons includeReasons) It might be nicer to to first declare the template and then provide both specializations separately: template <typename CharacterType> AvoidanceReasonFlags canUseForCharacter(CharacterType, bool textIsJustified, IncludeReasons); template<> AvoidanceReasonFlags canUseForCharacter(UChar character, bool textIsJustified, IncludeReasons includeReasons) { ... I don't think 'static' is needed.
Antti Koivisto
Comment 7 2017-02-04 07:39:29 PST
Comment on attachment 300623 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300623&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:189 > + canUseForCharacter(character, textIsJustified, includeReasons); Should we do something with the return value?
alan baradlay
Comment 8 2017-02-04 07:59:09 PST
WebKit Commit Bot
Comment 9 2017-02-04 08:36:26 PST
Comment on attachment 300624 [details] Patch Clearing flags on attachment: 300624 Committed r211671: <http://trac.webkit.org/changeset/211671>
WebKit Commit Bot
Comment 10 2017-02-04 08:36:31 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.