Bug 158655 - Remove positioned descendants when RenderBlock is no longer a containing block.
Summary: Remove positioned descendants when RenderBlock is no longer a containing block.
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: zalan
URL:
Keywords: InRadar
: 158656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-10 22:23 PDT by zalan
Modified: 2016-06-13 09:41 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.94 KB, patch)
2016-06-10 22:28 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (6.13 KB, patch)
2016-06-11 20:25 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (6.47 KB, patch)
2016-06-12 13:12 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2016-06-10 22:23:54 PDT
1. Size the browser window to over 1000px
2. Load http://www.stubhub.com/beyonce-tickets-beyonc--santa-clara-levi-s-stadium-9-17-2016/event/9578810/ (webarchive attached)
3. Size the browser window to trigger narrow layout so that the ticket list moves below the stadium picture.
4. Scroll the tickets
Comment 1 zalan 2016-06-10 22:24:18 PDT
rdar://problem/26510032
Comment 2 zalan 2016-06-10 22:28:18 PDT
Created attachment 281079 [details]
Patch
Comment 3 zalan 2016-06-11 16:23:12 PDT
*** Bug 158656 has been marked as a duplicate of this bug. ***
Comment 4 zalan 2016-06-11 20:25:21 PDT
Created attachment 281117 [details]
Patch
Comment 5 Simon Fraser (smfr) 2016-06-12 08:22:28 PDT
Comment on attachment 281117 [details]
Patch

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

> Source/WebCore/rendering/RenderBlock.cpp:251
> +    // We are no longer the containing block for fixed descendants.
> +    if (hadTransform && !willHaveTransform) {
> +        removePositionedObjects(nullptr, NewContainingBlock);
> +        return;
> +    }

I assume it's OK to be overly aggressive here in removal, because we'll re-add descendants later anyway? If so, it would be nice to say that in a comment.

> LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html:4
> +<title>This tests that we can re-parent fixed positioned elements properly.</title>

It's not really re-parenting, right?
Comment 6 zalan 2016-06-12 13:12:35 PDT
Created attachment 281126 [details]
Patch
Comment 7 zalan 2016-06-12 13:13:23 PDT
(In reply to comment #5)
> Comment on attachment 281117 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=281117&action=review
> 
> > Source/WebCore/rendering/RenderBlock.cpp:251
> > +    // We are no longer the containing block for fixed descendants.
> > +    if (hadTransform && !willHaveTransform) {
> > +        removePositionedObjects(nullptr, NewContainingBlock);
> > +        return;
> > +    }
> 
> I assume it's OK to be overly aggressive here in removal, because we'll
> re-add descendants later anyway? If so, it would be nice to say that in a
> comment.
Done.

> 
> > LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html:4
> > +<title>This tests that we can re-parent fixed positioned elements properly.</title>
> 
> It's not really re-parenting, right?
Fixed.
Comment 8 WebKit Commit Bot 2016-06-12 13:44:10 PDT
Comment on attachment 281126 [details]
Patch

Clearing flags on attachment: 281126

Committed r201984: <http://trac.webkit.org/changeset/201984>
Comment 9 WebKit Commit Bot 2016-06-12 13:44:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Simon Fraser (smfr) 2016-06-13 09:41:12 PDT
Comment on attachment 281126 [details]
Patch

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

> LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html:31
> +        newChild.style.positioned = "absolute";

Typo!