Bug 154336 - [css-grid] Avoid duplicated calls to resolution code
Summary: [css-grid] Avoid duplicated calls to resolution code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords:
Depends on:
Blocks: 153488
  Show dependency treegraph
 
Reported: 2016-02-17 05:39 PST by Manuel Rego Casasnovas
Modified: 2016-02-23 10:17 PST (History)
8 users (show)

See Also:


Attachments
Patch (10.00 KB, patch)
2016-02-17 05:46 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rego Casasnovas 2016-02-17 05:39:53 PST
We're calling several times per item to the same methods in order to resolve the grid positions over an over.

Now that GridSpan doesn't have pointers anymore, we could just call the resolution code once and store it in the GridCoordinates cache.

This is a port from Blink of https://codereview.chromium.org/1465153004/
Comment 1 Manuel Rego Casasnovas 2016-02-17 05:46:51 PST
Created attachment 271550 [details]
Patch
Comment 2 Sergio Villar Senin 2016-02-23 08:58:25 PST
Comment on attachment 271550 [details]
Patch

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

Nice change

> Source/WebCore/rendering/RenderGrid.cpp:1184
> +    for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {

Perhaps not for this patch but we should make OrderIterator a stl iterator-like class so that instead of first() and next() we have begin() and end() and we could do things like

for (auto child : m_orderIterator)
Comment 3 Manuel Rego Casasnovas 2016-02-23 09:30:03 PST
(In reply to comment #2)
> Comment on attachment 271550 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=271550&action=review
> 
> Nice change

Thanks for the review!

> > Source/WebCore/rendering/RenderGrid.cpp:1184
> > +    for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
> 
> Perhaps not for this patch but we should make OrderIterator a stl
> iterator-like class so that instead of first() and next() we have begin()
> and end() and we could do things like
> 
> for (auto child : m_orderIterator)

Note down in bug #154590.
Comment 4 WebKit Commit Bot 2016-02-23 10:17:12 PST
Comment on attachment 271550 [details]
Patch

Clearing flags on attachment: 271550

Committed r196983: <http://trac.webkit.org/changeset/196983>
Comment 5 WebKit Commit Bot 2016-02-23 10:17:16 PST
All reviewed patches have been landed.  Closing bug.