WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 165007
[meta] [css-grid] Isolate track sizing and items placement data from RenderGrid internal state
https%3A%2F%2Fbugs.webkit.org%2Fshow_bug.cgi?id=165007
Summary
[meta] [css-grid] Isolate track sizing and items placement data from RenderGr...
Sergio Villar Senin
Reported
2016-11-21 03:30:11 PST
The most important piece of code in RenderGrid is the track sizing algorithm which is used to determine the sizes of the tracks (rows and columns) of the grid. That algorithm is used for both the layout phase and the preferred widths (intrinsic size) computations. The problem is that both computations are using exactly the same data structures cached in the RenderGrid object. That's nice for performance reasons but it is also a potential source of problems. The risk is low ATM because we do always clear those caches after a layout or a preferred widths computation but that is something that will not stay forever like this, as we want to reuse some computations between layouts (like the placement of items) in order to improve performance. Actually it's already causing some issues right now, like for example the need of using ugly const_casts in computeIntrinsicLogicalWidths() which is supposed to be a const method. I'm filing this metabug as the process will require several patches.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Sergio Villar Senin
Comment 1
2016-11-28 12:04:59 PST
I'm adding here the steps required to complete this isolation process: 1- Split gridColumnCount()/gridRowCount() so there are 2 different pairs of methods: one pair which returns the actual size of the grid and another which returns the size of the data structure used to represent it 2- Create a new class called Grid which encapsulates grid's internal representation 3- Move items' placement caches to the Grid class 4- Pass the Grid class to all the items' placement methods 5- Use a different Grid object for the intrinsic size computation. Layout will be still using m_grid 6- Const-ify all items' placement methods, including placeItemsOnGrid() 7- Remove ugly const_cast<> in computeIntrinsicLogicalWidths and that's it.
Sergio Villar Senin
Comment 2
2017-01-31 08:04:27 PST
Closing this as it was completed.
Top of Page
Format For Printing
XML
Clone This Bug