Changeset 152335 in webkit
- Timestamp:
- Jul 2, 2013 8:19:06 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152333 r152335 1 2013-07-02 Simon Fraser <simon.fraser@apple.com> 2 3 Don't set z-index: 0 on lots of elements with -webkit-overflow-scrolling: touch 4 https://bugs.webkit.org/show_bug.cgi?id=118337 5 6 Reviewed by Benjamin Poulain. 7 8 -webkit-overflow-scrolling: touch is an inherited property that, on iOS, controls 9 the behavior of overflow scrolling content, and causes overflow scrolling elements 10 to become CSS stacking contexts. 11 12 However, the code was too aggressive in setting style->setZIndex(0), doing so 13 for any element with overflow != hidden. Since the default for overflow is visible, 14 that meant almost every element. 15 16 Previously, this didn't really matter. However, since r125693, any renderer with non-auto 17 z-index gets a RenderLayer, and that RenderLayer will become a stacking context. The result 18 was too many RenderLayers and incorrect stacking context behavior. 19 20 Fix by ensuring that -webkit-overflow-scrolling: touch only affects elements which 21 are actually scrollable. 22 23 Also move the code that does this to below the code that adjust overflow style 24 for different elements. 25 26 * css/StyleResolver.cpp: 27 (WebCore::isScrollableOverflow): 28 (WebCore::StyleResolver::adjustRenderStyle): 29 1 30 2013-07-02 Commit Queue <commit-queue@webkit.org> 2 31 -
trunk/Source/WebCore/css/StyleResolver.cpp
r152218 r152335 1353 1353 } 1354 1354 1355 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) 1356 static bool isScrollableOverflow(EOverflow overflow) 1357 { 1358 return overflow == OSCROLL || overflow == OAUTO || overflow == OOVERLAY; 1359 } 1360 #endif 1361 1355 1362 void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentStyle, Element *e) 1356 1363 { … … 1471 1478 || style->position() == StickyPosition 1472 1479 || (style->position() == FixedPosition && e && e->document()->page() && e->document()->page()->settings()->fixedPositionCreatesStackingContext()) 1473 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)1474 // Touch overflow scrolling creates a stacking context.1475 || ((style->overflowX() != OHIDDEN || style->overflowY() != OHIDDEN) && style->useTouchOverflowScrolling())1476 #endif1477 1480 #if ENABLE(DIALOG_ELEMENT) 1478 1481 || (e && e->isInTopLayer()) … … 1526 1529 style->setOverflowY(OVISIBLE); 1527 1530 } 1531 1532 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) 1533 // Touch overflow scrolling creates a stacking context. 1534 if (style->useTouchOverflowScrolling() && (isScrollableOverflow(style->overflowX()) || isScrollableOverflow(style->overflowY()))) 1535 style->setZIndex(0); 1536 #endif 1528 1537 1529 1538 // Cull out any useless layers and also repeat patterns into additional layers.
Note: See TracChangeset
for help on using the changeset viewer.