Bug 191176 - Web Inspector: View: introduce a didLayoutSubtree
Summary: Web Inspector: View: introduce a didLayoutSubtree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-01 16:44 PDT by Devin Rousso
Modified: 2018-11-01 21:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.89 KB, patch)
2018-11-01 17:01 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (4.21 KB, patch)
2018-11-01 18:37 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2018-11-01 16:44:29 PDT
The `WI.View` layout system works from a top-down approach, meaning that parents call `layout()` before their children, which can sometimes prevent the parent from querying for values on the child (e.g. `WI.Table` rows or `WI.DataGrid` nodes) as they don't get created until the child calls `layout()`.  Inside `WI.View.prototype._layoutSubtree`, we recursively iterate over the entire subtree rooted at the parent and call `layout()` for each view encountered.  Since this entire operation is synchronous, we can add an `afterLayout` function that gets called at the end of `WI.View.prototype._layoutSubtree`, meaning that it will get called after all children have `layout()`.
Comment 1 Devin Rousso 2018-11-01 17:01:18 PDT
Created attachment 353662 [details]
Patch
Comment 2 Matt Baker 2018-11-01 17:36:08 PDT
Comment on attachment 353662 [details]
Patch

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

r=me

> LayoutTests/ChangeLog:10
> +        (TestPage.registerInitializer.WI.TestView.prototype.afterLayout): Added.

r=me. Overall this looks good! I'm not sure about the method name though; what about didLayout, or didLayoutSubtree?
Comment 3 Devin Rousso 2018-11-01 18:37:10 PDT
Created attachment 353673 [details]
Patch
Comment 4 WebKit Commit Bot 2018-11-01 21:12:04 PDT
Comment on attachment 353673 [details]
Patch

Clearing flags on attachment: 353673

Committed r237720: <https://trac.webkit.org/changeset/237720>
Comment 5 WebKit Commit Bot 2018-11-01 21:12:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-11-01 21:13:18 PDT
<rdar://problem/45752633>