Bug 150837 - [css-grid] Support positioned grid children
Summary: [css-grid] Support positioned grid children
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: InRadar
Depends on:
Blocks: 60731 150231
  Show dependency treegraph
 
Reported: 2015-11-03 07:00 PST by Manuel Rego Casasnovas
Modified: 2016-03-10 16:08 PST (History)
8 users (show)

See Also:


Attachments
Patch (68.55 KB, patch)
2015-11-03 07:22 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 2015-11-03 07:00:28 PST
Grid spec has some particularities regarding positioned elements that we should support:
https://drafts.csswg.org/css-grid/#abspos

This has been already implemented on Blink, so we need to port the different patches from the following bug:
http://code.google.com/p/chromium/issues/detail?id=273898
Comment 1 Manuel Rego Casasnovas 2015-11-03 07:22:07 PST
Created attachment 264691 [details]
Patch
Comment 2 Darin Adler 2015-11-04 09:34:50 PST
Comment on attachment 264691 [details]
Patch

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

Unfortunate that so many of the tests just write out PASS PASS PASS without making clearer what each PASS represents.

> Source/WebCore/rendering/RenderBlock.h:316
> +    virtual void layoutPositionedObject(RenderBox&, bool relayoutChildren, bool fixedPositionObjectsOnly);

A little disappointing that we have to make one more function virtual, meaning we slow down all layout at least a tiny bit.
Comment 3 Manuel Rego Casasnovas 2015-11-05 00:50:15 PST
Thanks for the review!

(In reply to comment #2)
> Comment on attachment 264691 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=264691&action=review
> 
> Unfortunate that so many of the tests just write out PASS PASS PASS without
> making clearer what each PASS represents.

Yeah, we've many of those in grid layout, maybe we should think in some kind of refactoring in the tests so we provide more information.

> > Source/WebCore/rendering/RenderBlock.h:316
> > +    virtual void layoutPositionedObject(RenderBox&, bool relayoutChildren, bool fixedPositionObjectsOnly);
> 
> A little disappointing that we have to make one more function virtual,
> meaning we slow down all layout at least a tiny bit.

This only affects positioned elements, so I guess only layouts with positioned elements will be affected.

I cannot think in a better way right now. We might have a method only in grid to prepare positioned children for layout, but we'd be looping twice the list of positioned elements (first in the new method, then in layoutPositionedObjects()), so I guess it's worse than current approach.
Comment 4 WebKit Commit Bot 2015-11-05 01:31:39 PST
Comment on attachment 264691 [details]
Patch

Clearing flags on attachment: 264691

Committed r192054: <http://trac.webkit.org/changeset/192054>
Comment 5 WebKit Commit Bot 2015-11-05 01:31:42 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Brent Fulgham 2016-03-10 16:08:20 PST
<rdar://problem/24913184>