Bug 201076

Summary: Implement layout system independent text box iterator
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, ggaren, sam, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
none
patch none

Description Antti Koivisto 2019-08-23 05:52:53 PDT
Add a generic way to traverse line layout without caring about the details of the underlying layout system.
Comment 1 Antti Koivisto 2019-08-23 06:00:35 PDT
Created attachment 377124 [details]
patch
Comment 2 Antti Koivisto 2019-08-23 06:19:50 PDT
Created attachment 377125 [details]
patch
Comment 3 Simon Fraser (smfr) 2019-08-23 11:13:56 PDT
Comment on attachment 377125 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=377125&action=review

> Source/WebCore/rendering/line/DisplayAccessTextBoxes.h:39
> +namespace DisplayAccess {

I don't like this name for two reasons. First, "Display" can be read as a verb. Second you're not accessing displays.
Comment 4 Antti Koivisto 2019-08-23 12:01:53 PDT
Display as in "display tree". But suggestions are welcome.
Comment 5 Antti Koivisto 2019-08-23 13:43:53 PDT
I think I'll go with 'LineInterface' for the namespace.
Comment 6 Sam Weinig 2019-08-23 14:35:06 PDT
Can you help me understand what a LineInterface::TextBox (or DisplayAccess::TextBox) is supposed to represent. With both of those names, I can't quite wrap my head around it.
Comment 7 Antti Koivisto 2019-08-23 14:54:00 PDT
(In reply to Sam Weinig from comment #6)
> Can you help me understand what a LineInterface::TextBox (or
> DisplayAccess::TextBox) is supposed to represent. With both of those names,
> I can't quite wrap my head around it.

It is an interface for accessing (layout generated) text box properties that hides the underlying data structures. There will be similar interfaces for other inline box types. Note that TextBox itself is just a temporary generated by the iterator, it is not an interesting type in itself.

The goal is be able to write code that accesses line layout without having to write multiple versions for different paths (we have two and a third one on the way).
Comment 8 Antti Koivisto 2019-08-23 23:33:52 PDT
Created attachment 377204 [details]
patch
Comment 9 Antti Koivisto 2019-08-23 23:35:09 PDT
Called it LineLayoutInterface
Comment 10 WebKit Commit Bot 2019-08-24 06:31:56 PDT
Comment on attachment 377204 [details]
patch

Clearing flags on attachment: 377204

Committed r249084: <https://trac.webkit.org/changeset/249084>
Comment 11 WebKit Commit Bot 2019-08-24 06:31:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2019-08-24 06:32:16 PDT
<rdar://problem/54670697>
Comment 13 Simon Fraser (smfr) 2019-08-26 10:58:51 PDT
Comment on attachment 377204 [details]
patch

I would prefer we avoid "interface" in names. See VideoFullscreenInterface, for which I can never grok the meaning of "interface".