RESOLVED FIXED 138346
Simple line layout: Abstract out content iteration and text handling in general.
https://bugs.webkit.org/show_bug.cgi?id=138346
Summary Simple line layout: Abstract out content iteration and text handling in general.
zalan
Reported 2014-11-03 19:55:43 PST
This is in preparation to support multiple render elements in simple line layout.
Attachments
Patch (18.99 KB, patch)
2014-11-03 20:10 PST, zalan
no flags
Patch (20.13 KB, patch)
2014-11-04 15:22 PST, zalan
no flags
Patch (20.13 KB, patch)
2014-11-04 16:03 PST, zalan
no flags
zalan
Comment 1 2014-11-03 20:10:11 PST
zalan
Comment 2 2014-11-03 20:14:57 PST
I am not too happy about the RenderFlowContentIterator name. The class does a lot more than just iterating. Alternatively we could move some of the (non-iterating)class functions back to static inline and pass the RenderFlowContentIterator object around.
Antti Koivisto
Comment 3 2014-11-04 06:03:59 PST
Comment on attachment 240904 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240904&action=review Looks like right direction. > Source/WebCore/rendering/SimpleLineLayout.cpp:216 > +template <typename CharacterType> class RenderFlowContentIterator { I think we usually put template arguments to a line of their own for classes. ContentIterator? FlowIterator? Actually this class doesn't really feel like an iterator at all. If I understand correctly it doesn't hold the current position and doesn't change state during traversal. Maybe it should? Or maybe it should just be named differently (FlowContents or similar perhaps)? > Source/WebCore/rendering/SimpleLineLayout.cpp:225 > + unsigned findNextBreakablePosition(unsigned position) I think this is logically const too though LazyLineBreakIterator interface currently requires non-const call.
Antti Koivisto
Comment 4 2014-11-04 06:07:02 PST
LazyLineBreakIterator itself is poorly named. It looks more like a sort of iterator cache.
zalan
Comment 5 2014-11-04 15:22:50 PST
Antti Koivisto
Comment 6 2014-11-04 15:41:47 PST
Comment on attachment 240960 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240960&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:444 > + const Style& style = contentIterator.style(); Could use auto& > Source/WebCore/rendering/SimpleLineLayout.cpp:551 > + const Style style = contentIterator.style(); This can be reference: auto& > Source/WebCore/rendering/SimpleLineLayout.cpp:678 > + FlowContentIterator<CharacterType> contentIterator = FlowContentIterator<CharacterType>(flow); This could use auto
Antti Koivisto
Comment 7 2014-11-04 15:44:32 PST
Comment on attachment 240960 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240960&action=review >> Source/WebCore/rendering/SimpleLineLayout.cpp:678 >> + FlowContentIterator<CharacterType> contentIterator = FlowContentIterator<CharacterType>(flow); > > This could use auto Actually this could just be FlowContentIterator<CharacterType> contentIterator(flow)
zalan
Comment 8 2014-11-04 16:03:52 PST
WebKit Commit Bot
Comment 9 2014-11-04 19:47:40 PST
Comment on attachment 240974 [details] Patch Clearing flags on attachment: 240974 Committed r175601: <http://trac.webkit.org/changeset/175601>
WebKit Commit Bot
Comment 10 2014-11-04 19:47:44 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.