Bug 87186 - Add a Setting to make position:fixed form a new stacking context
Summary: Add a Setting to make position:fixed form a new stacking context
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Robinson
URL:
Keywords:
: 85067 (view as bug list)
Depends on: 87201 87367
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-22 17:05 PDT by James Robinson
Modified: 2012-06-11 07:08 PDT (History)
16 users (show)

See Also:


Attachments
Patch (16.57 KB, patch)
2012-05-22 17:14 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Patch for landing (16.67 KB, patch)
2012-05-23 14:08 PDT, James Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2012-05-22 17:05:24 PDT
Add a Setting to make position:fixed form a new stacking context
Comment 1 James Robinson 2012-05-22 17:14:17 PDT
Created attachment 143407 [details]
Patch
Comment 2 WebKit Review Bot 2012-05-22 17:18:26 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Adam Barth 2012-05-22 17:57:37 PDT
Comment on attachment 143407 [details]
Patch

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

> Source/WebKit/chromium/public/WebSettings.h:153
> +    virtual void setFixedPositionCreatesStackingContext(bool) = 0;

Do you think we should alphabetize this list?
Comment 4 James Robinson 2012-05-22 18:20:34 PDT
Comment on attachment 143407 [details]
Patch

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

>> Source/WebKit/chromium/public/WebSettings.h:153
>> +    virtual void setFixedPositionCreatesStackingContext(bool) = 0;
> 
> Do you think we should alphabetize this list?

I don't know, I couldn't discern any existing organization in this list so I just added this to the end.
Comment 5 Adam Barth 2012-05-22 18:25:36 PDT
Ok.  I can post an alphabetization patch after you land this one.
Comment 6 James Robinson 2012-05-22 18:40:40 PDT
Committed r118095: <http://trac.webkit.org/changeset/118095>
Comment 7 WebKit Review Bot 2012-05-22 21:03:53 PDT
Re-opened since this is blocked by 87201
Comment 8 Kenneth Rohde Christiansen 2012-05-23 00:52:48 PDT
Comment on attachment 143407 [details]
Patch

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

> Source/WebCore/css/StyleResolver.cpp:2052
>  #ifdef FIXED_POSITION_CREATES_STACKING_CONTEXT
>          || style->position() == FixedPosition
> +#else
> +        || (style->position() == FixedPosition && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
>  #endif

Why not just turn this on for Qt? Yael?
Comment 9 Kenneth Rohde Christiansen 2012-05-23 00:53:44 PDT
(In reply to comment #8)
> (From update of attachment 143407 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143407&action=review
> 
> > Source/WebCore/css/StyleResolver.cpp:2052
> >  #ifdef FIXED_POSITION_CREATES_STACKING_CONTEXT
> >          || style->position() == FixedPosition
> > +#else
> > +        || (style->position() == FixedPosition && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
> >  #endif
> 
> Why not just turn this on for Qt? Yael?

I mean I believe we are the only ones using FIXED_POSIT... but I guess we can use the setting instead
Comment 10 Arvid Nilsson 2012-05-23 01:00:57 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > (From update of attachment 143407 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=143407&action=review
> > 
> > > Source/WebCore/css/StyleResolver.cpp:2052
> > >  #ifdef FIXED_POSITION_CREATES_STACKING_CONTEXT
> > >          || style->position() == FixedPosition
> > > +#else
> > > +        || (style->position() == FixedPosition && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
> > >  #endif
> > 
> > Why not just turn this on for Qt? Yael?
> 
> I mean I believe we are the only ones using FIXED_POSIT... but I guess we can use the setting instead

The BlackBerry port also opts in to FIXED_POSIT... these days. But we'd also be happy to use the setting instead.
Comment 11 James Robinson 2012-05-23 10:03:58 PDT
I think it'd be a good idea for other ports to move over to the Setting, but I'll leave that to decision up to them.
Comment 12 Yael 2012-05-23 12:46:20 PDT
(In reply to comment #8)
> (From update of attachment 143407 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143407&action=review
> 
> > Source/WebCore/css/StyleResolver.cpp:2052
> >  #ifdef FIXED_POSITION_CREATES_STACKING_CONTEXT
> >          || style->position() == FixedPosition
> > +#else
> > +        || (style->position() == FixedPosition && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
> >  #endif
> 
> Why not just turn this on for Qt? Yael?

Please see https://bugs.webkit.org/show_bug.cgi?id=83980#c3
Comment 13 James Robinson 2012-05-23 12:50:16 PDT
In chromium we need to have this be a setting to verify compatibility issues.  I think Simon's other comment is out of date, requiresCompositingForPosition() is aware of the acceleratedCompositingForFixedPositionEnabled compositing trigger which should cover this.
Comment 14 James Robinson 2012-05-23 14:08:14 PDT
Created attachment 143649 [details]
Patch for landing
Comment 15 WebKit Review Bot 2012-05-23 16:13:32 PDT
Comment on attachment 143649 [details]
Patch for landing

Clearing flags on attachment: 143649

Committed r118263: <http://trac.webkit.org/changeset/118263>
Comment 16 WebKit Review Bot 2012-05-23 16:13:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Ádám Kallai 2012-05-24 02:07:21 PDT
This test fails on Qt. 

 * fast/block/positioning/fixed-position-stacking-context.html

Diff:

--- /home/webkitbuildbot/slaves/release32bit-NRWT/buildslave/qt-linux-32-release-NRWT/build/layout-test-results/fast/block/positioning/fixed-position-stacking-context-expected.txt 
+++ /home/webkitbuildbot/slaves/release32bit-NRWT/buildslave/qt-linux-32-release-NRWT/build/layout-test-results/fast/block/positioning/fixed-position-stacking-context-actual.txt 
@@ -8,6 +8,6 @@
 layer at (0,0) size 100x100
   RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
 layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+layer at (0,0) size 100x100
   RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
-layer at (0,0) size 100x100
-  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#008000]

We got a red rectangle on Qt platform. Could you check it, please?
Comment 18 Kristóf Kosztyó 2012-05-24 04:04:51 PDT
I skipped the test in r118346: <http://trac.webkit.org/changeset/118346> to paint the bot green.
Comment 19 James Robinson 2012-05-24 10:15:34 PDT
(In reply to comment #17)
> This test fails on Qt. 
> 
>  * fast/block/positioning/fixed-position-stacking-context.html
> 
> Diff:
> 
> --- /home/webkitbuildbot/slaves/release32bit-NRWT/buildslave/qt-linux-32-release-NRWT/build/layout-test-results/fast/block/positioning/fixed-position-stacking-context-expected.txt 
> +++ /home/webkitbuildbot/slaves/release32bit-NRWT/buildslave/qt-linux-32-release-NRWT/build/layout-test-results/fast/block/positioning/fixed-position-stacking-context-actual.txt 
> @@ -8,6 +8,6 @@
>  layer at (0,0) size 100x100
>    RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
>  layer at (0,0) size 100x100
> +  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
> +layer at (0,0) size 100x100
>    RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
> -layer at (0,0) size 100x100
> -  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
> 
> We got a red rectangle on Qt platform. Could you check it, please?

Since you are using the #define to control this behavior instead of the Setting, you'll need Qt-specific baselines for this test.
Comment 20 Iain Merrick 2012-06-11 07:08:24 PDT
*** Bug 85067 has been marked as a duplicate of this bug. ***