Bug 103598 - Only create stacking context for -webkit-overflow-scrolling:touch elements when element allows scrolling
Summary: Only create stacking context for -webkit-overflow-scrolling:touch elements wh...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-28 21:14 PST by Tien-Ren Chen
Modified: 2017-07-18 08:30 PDT (History)
11 users (show)

See Also:


Attachments
Patch (6.80 KB, patch)
2012-11-28 21:20 PST, Tien-Ren Chen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tien-Ren Chen 2012-11-28 21:14:08 PST
Only create stacking context for -webkit-overflow-scrolling:touch elements when element allows scrolling
Comment 1 Tien-Ren Chen 2012-11-28 21:20:20 PST
Created attachment 176641 [details]
Patch
Comment 2 Alexandre Elias 2012-11-29 02:25:30 PST
In the original bug https://bugs.webkit.org/show_bug.cgi?id=78664 jamesr mentioned that "It also looks like the logic this patch added to CSSStyleSelector.cpp doesn't quite match the iOS5 code drop :(".  Could we double-check this at the same time?  The latest code drop is at http://www.opensource.apple.com/release/ios-601/
Comment 3 Tien-Ren Chen 2012-11-29 15:38:14 PST
(In reply to comment #2)
> In the original bug https://bugs.webkit.org/show_bug.cgi?id=78664 jamesr mentioned that "It also looks like the logic this patch added to CSSStyleSelector.cpp doesn't quite match the iOS5 code drop :(".  Could we double-check this at the same time?  The latest code drop is at http://www.opensource.apple.com/release/ios-601/

This is what I see in StyleResolver.cpp, WebCore-1640.1:
#if ENABLE(OVERFLOW_SCROLLING)
        // Touch overflow scrolling creates a stacking context.
        || style->useTouchOverflowScrolling()
#endif
        // Touch overflow scrolling creates stacking context.
        || ((style->overflowX() != OHIDDEN || style->overflowY() != OHIDDEN) && style->useTouchOverflowScrolling())

So iOS6 is creating stacking context everywhere -webkit-overflow-scrolling:touch is used. I will verify that on my phone later.
Comment 4 Simon Fraser (smfr) 2012-11-29 15:42:58 PST
(In reply to comment #3)
> So iOS6 is creating stacking context everywhere -webkit-overflow-scrolling:touch is used. I will verify that on my phone later.

Yes it is.
Comment 5 Alexandre Elias 2013-01-08 15:54:04 PST
Comment on attachment 176641 [details]
Patch

Clearing r? flag.  Let's leave this as is since iOS Safari has this behavior.
Comment 6 Nicolas BADIA 2013-04-16 04:08:20 PDT
I was going to open a new issue but I guess that fixing this one will fix mine too.

Here is a jsFiddle to show the issue: http://jsfiddle.net/nicolasbadia/yaVBW/

On mobile, when overflow-scrolling is set to touch, the green div is over the red one, otherwise the red one is over the green one (which is always the case on desktop and also the right behaviour).