Changeset 252724 in webkit
- Timestamp:
- Nov 20, 2019 5:48:28 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252720 r252724 1 2019-11-20 Simon Fraser <simon.fraser@apple.com> 2 3 getComputedStyle returns "auto" for zIndex property even after it has been set, on non-positioned elements 4 https://bugs.webkit.org/show_bug.cgi?id=15562 5 6 Reviewed by Antti Koivisto. 7 8 * fast/css-grid-layout/grid-item-z-index-support-expected.txt: 9 * fast/css-grid-layout/grid-item-z-index-support.html: 10 * fast/css/getComputedStyle/getComputedStyle-zIndex-auto-expected.txt: 11 * fast/css/getComputedStyle/getComputedStyle-zIndex-auto.html: 12 1 13 2019-11-20 Kate Cheney <katherine_cheney@apple.com> 2 14 -
trunk/LayoutTests/fast/css-grid-layout/grid-item-z-index-support-expected.txt
r170474 r252724 6 6 Test z-index property for a regular element 7 7 PASS getComputedStyle(item, '').getPropertyValue('z-index') is 'auto' 8 PASS getComputedStyle(item, '').getPropertyValue('z-index') is ' auto'8 PASS getComputedStyle(item, '').getPropertyValue('z-index') is '-10' 9 9 Test z-index property once the element becomes a grid item 10 10 PASS getComputedStyle(item, '').getPropertyValue('z-index') is '-10' -
trunk/LayoutTests/fast/css-grid-layout/grid-item-z-index-support.html
r200510 r252724 15 15 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'auto'"); 16 16 item.style.zIndex = "-10"; 17 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "' auto'");17 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'-10'"); 18 18 19 19 debug('Test z-index property once the element becomes a grid item'); -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-zIndex-auto-expected.txt
r41464 r252724 1 1 Non-positioned Div: 2 Computed Style = auto (Should be auto)2 Computed Style = 20 (Should be 20) 3 3 element.style.zIndex = 20 (Should be 20) 4 4 -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-zIndex-auto.html
r120683 r252724 16 16 var compStyle = element.ownerDocument.defaultView.getComputedStyle(element, null); 17 17 log("Non-positioned Div:"); 18 log(" Computed Style = " + compStyle.zIndex + " (Should be auto)");18 log(" Computed Style = " + compStyle.zIndex + " (Should be 20)"); 19 19 log(" element.style.zIndex = " + element.style.zIndex + " (Should be 20)"); 20 20 log(""); -
trunk/LayoutTests/imported/w3c/ChangeLog
r252681 r252724 1 2019-11-20 Simon Fraser <simon.fraser@apple.com> 2 3 getComputedStyle returns "auto" for zIndex property even after it has been set, on non-positioned elements 4 https://bugs.webkit.org/show_bug.cgi?id=15562 5 6 Reviewed by Antti Koivisto. 7 8 More passing tests. 9 10 * web-platform-tests/css/css-position/inheritance-expected.txt: 11 * web-platform-tests/css/css-values/calc-integer-expected.txt: 12 * web-platform-tests/css/css-values/calc-z-index-fractions-001-expected.txt: 13 * web-platform-tests/css/css-values/minmax-integer-computed-expected.txt: 14 1 15 2019-11-19 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/inheritance-expected.txt
r251641 r252724 18 18 FAIL Property inset-end has initial value auto assert_true: inset-end doesn't seem to be supported in the computed style expected true got false 19 19 FAIL Property inset-end does not inherit assert_true: expected true got false 20 FAIL Property z-index has initial value auto assert_equals: expected "auto" but got "0" 20 PASS Property z-index has initial value auto 21 21 PASS Property z-index does not inherit 22 22 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-integer-expected.txt
r251521 r252724 1 1 2 FAIL Sanity assert_equals: expected "2" but got "auto" 3 FAIL Basic division works assert_equals: expected "2" but got "auto" 4 FAIL Rounds up if fractional part is >= 0.5 assert_equals: expected "1" but got "auto" 5 FAIL Accepts numbers, and rounds assert_equals: expected "1" but got "auto" 6 FAIL Operation between <integer> and <number> works assert_equals: expected "3" but got "auto" 7 FAIL Rounds down if fractional part is < 0.5 assert_equals: expected "0" but got "auto" 8 FAIL Only rounds at the end of the conversion assert_equals: expected "1" but got "auto" 2 PASS Sanity 3 PASS Basic division works 4 PASS Rounds up if fractional part is >= 0.5 5 PASS Accepts numbers, and rounds 6 PASS Operation between <integer> and <number> works 7 PASS Rounds down if fractional part is < 0.5 8 PASS Only rounds at the end of the conversion 9 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-z-index-fractions-001-expected.txt
r251521 r252724 1 1 2 FAIL testing z-index: calc(3 / 2) assert_equals: expected "2" but got "auto" 3 FAIL testing z-index: calc(-3 / 2) assert_equals: expected "-1" but got " auto"2 PASS testing z-index: calc(3 / 2) 3 FAIL testing z-index: calc(-3 / 2) assert_equals: expected "-1" but got "-2" 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/minmax-integer-computed-expected.txt
r251521 r252724 1 1 2 PASS Property z-index value 'min(1)' computes to ' auto'3 PASS Property z-index value 'max(1)' computes to ' auto'4 PASS Property z-index value 'min(0.4)' computes to ' auto'5 PASS Property z-index value 'min(0.6)' computes to ' auto'6 PASS Property z-index value 'max(0.4)' computes to ' auto'7 PASS Property z-index value 'max(0.6)' computes to ' auto'8 PASS Property z-index value 'min(1.1, max(0.4, 0.6))' computes to ' auto'9 PASS Property z-index value 'max(0.3, min(1.1, 0.4))' computes to ' auto'10 PASS Property z-index value 'calc(min(0.3, 0.6) * 2)' computes to ' auto'11 PASS Property z-index value 'calc(max(0.3, 0.6) / 2)' computes to ' auto'2 PASS Property z-index value 'min(1)' computes to '1' 3 PASS Property z-index value 'max(1)' computes to '1' 4 PASS Property z-index value 'min(0.4)' computes to '0' 5 PASS Property z-index value 'min(0.6)' computes to '1' 6 PASS Property z-index value 'max(0.4)' computes to '0' 7 PASS Property z-index value 'max(0.6)' computes to '1' 8 PASS Property z-index value 'min(1.1, max(0.4, 0.6))' computes to '1' 9 PASS Property z-index value 'max(0.3, min(1.1, 0.4))' computes to '0' 10 PASS Property z-index value 'calc(min(0.3, 0.6) * 2)' computes to '1' 11 PASS Property z-index value 'calc(max(0.3, 0.6) / 2)' computes to '0' 12 12 -
trunk/Source/WebCore/ChangeLog
r252723 r252724 1 2019-11-20 Simon Fraser <simon.fraser@apple.com> 2 3 getComputedStyle returns "auto" for zIndex property even after it has been set, on non-positioned elements 4 https://bugs.webkit.org/show_bug.cgi?id=15562 5 6 Reviewed by Antti Koivisto. 7 8 The computed value of z-index should be the specified value, but Style::Adjuster::adjust() set z-index 9 to auto on non-positioned elements, so we reported the incorrect computed value. 10 11 Fix by storing the specified value in RenderStyle as "zIndex", and the used value as "effectiveZIndex", and 12 converting all rendering code to use the "effective" variants. getComputedStyle reads "zIndex". 13 14 Style::Adjuster::adjust() copies zIndex to effectiveZIndex for positioned elements. 15 16 Tests: fast/css/getComputedStyle/getComputedStyle-zIndex-auto.html 17 18 * animation/KeyframeEffect.cpp: 19 (WebCore::KeyframeEffect::apply): 20 * css/CSSComputedStyleDeclaration.cpp: 21 (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): 22 * css/CSSProperties.json: 23 * html/HTMLInputElement.cpp: 24 (WebCore::HTMLInputElement::createInnerTextStyle): 25 * page/animation/CSSPropertyAnimation.cpp: 26 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 27 * page/animation/CompositeAnimation.cpp: 28 (WebCore::CompositeAnimation::animate): 29 * rendering/RenderBox.cpp: 30 (WebCore::isCandidateForOpaquenessTest): 31 * rendering/RenderBox.h: 32 * rendering/RenderElement.cpp: 33 (WebCore::RenderElement::styleWillChange): 34 * rendering/RenderFullScreen.cpp: 35 (WebCore::createFullScreenStyle): 36 * rendering/RenderLayer.cpp: 37 (WebCore::canCreateStackingContext): 38 (WebCore::RenderLayer::shouldBeCSSStackingContext const): 39 (WebCore::RenderLayer::calculateClipRects const): 40 * rendering/RenderLayer.h: 41 * rendering/RenderLayerCompositor.cpp: 42 (WebCore::RenderLayerCompositor::logLayerInfo): 43 * rendering/RenderLayerModelObject.cpp: 44 (WebCore::RenderLayerModelObject::styleWillChange): 45 * rendering/RenderTreeAsText.cpp: 46 (WebCore::RenderTreeAsText::writeRenderObject): 47 * rendering/style/RenderStyle.cpp: 48 (WebCore::RenderStyle::changeRequiresLayerRepaint const): 49 * rendering/style/RenderStyle.h: 50 (WebCore::RenderStyle::specifiedZIndex const): 51 (WebCore::RenderStyle::hasAutoSpecifiedZIndex const): 52 (WebCore::RenderStyle::setSpecifiedZIndex): 53 (WebCore::RenderStyle::setHasAutoSpecifiedZIndex): 54 (WebCore::RenderStyle::usedZIndex const): 55 (WebCore::RenderStyle::hasAutoUsedZIndex const): 56 (WebCore::RenderStyle::setUsedZIndex): 57 (WebCore::RenderStyle::setHasAutoUsedZIndex): 58 (WebCore::RenderStyle::hasAutoZIndex const): Deleted. 59 (WebCore::RenderStyle::setHasAutoZIndex): Deleted. 60 (WebCore::RenderStyle::zIndex const): Deleted. 61 (WebCore::RenderStyle::setZIndex): Deleted. 62 * rendering/style/StyleBoxData.cpp: 63 (WebCore::StyleBoxData::StyleBoxData): 64 (WebCore::StyleBoxData::operator== const): 65 * rendering/style/StyleBoxData.h: 66 (WebCore::StyleBoxData::specifiedZIndex const): 67 (WebCore::StyleBoxData::hasAutoSpecifiedZIndex const): 68 (WebCore::StyleBoxData::usedZIndex const): 69 (WebCore::StyleBoxData::hasAutoUsedZIndex const): 70 (WebCore::StyleBoxData::zIndex const): Deleted. 71 (WebCore::StyleBoxData::hasAutoZIndex const): Deleted. 72 * style/StyleAdjuster.cpp: 73 (WebCore::Style::Adjuster::adjust const): 74 1 75 2019-11-19 Ryosuke Niwa <rniwa@webkit.org> 2 76 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r252546 r252724 1061 1061 // For every property targeted by at least one animation effect that is current or in effect, the user agent 1062 1062 // must act as if the will-change property ([css-will-change-1]) on the target element includes the property. 1063 if (m_triggersStackingContext && targetStyle.hasAuto ZIndex())1064 targetStyle.set ZIndex(0);1063 if (m_triggersStackingContext && targetStyle.hasAutoUsedZIndex()) 1064 targetStyle.setUsedZIndex(0); 1065 1065 } 1066 1066 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r252392 r252724 3227 3227 return fontVariantEastAsianPropertyValue(style.fontDescription().variantEastAsianVariant(), style.fontDescription().variantEastAsianWidth(), style.fontDescription().variantEastAsianRuby()); 3228 3228 case CSSPropertyZIndex: 3229 if (style.hasAuto ZIndex())3229 if (style.hasAutoSpecifiedZIndex()) 3230 3230 return cssValuePool.createIdentifierValue(CSSValueAuto); 3231 return cssValuePool.createValue(style. zIndex(), CSSUnitType::CSS_NUMBER);3231 return cssValuePool.createValue(style.specifiedZIndex(), CSSUnitType::CSS_NUMBER); 3232 3232 case CSSPropertyZoom: 3233 3233 return cssValuePool.createValue(style.zoom(), CSSUnitType::CSS_NUMBER); -
trunk/Source/WebCore/css/CSSProperties.json
r252336 r252724 4357 4357 "z-index": { 4358 4358 "codegen-properties": { 4359 "auto-functions": true 4359 "auto-functions": true, 4360 "name-for-methods": "SpecifiedZIndex" 4360 4361 }, 4361 4362 "specification": { -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r252478 r252724 2093 2093 textBlockStyle.setMaskImage(StyleGeneratedImage::create(autoFillStrongPasswordMaskImage())); 2094 2094 // A stacking context is needed for the mask. 2095 if (textBlockStyle.hasAuto ZIndex())2096 textBlockStyle.set ZIndex(0);2095 if (textBlockStyle.hasAutoUsedZIndex()) 2096 textBlockStyle.setUsedZIndex(0); 2097 2097 } 2098 2098 -
trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
r252554 r252724 1613 1613 new PropertyWrapper<float>(CSSPropertyWebkitBorderHorizontalSpacing, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing), 1614 1614 new PropertyWrapper<float>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing), 1615 new PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle:: zIndex, &RenderStyle::setZIndex),1615 new PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::specifiedZIndex, &RenderStyle::setSpecifiedZIndex), 1616 1616 new PropertyWrapper<short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans), 1617 1617 new PropertyWrapper<short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows), -
trunk/Source/WebCore/page/animation/CompositeAnimation.cpp
r252546 r252724 338 338 // includes all the properties animated by the animation. 339 339 if (forceStackingContext && animatedStyle) { 340 if (animatedStyle->hasAuto ZIndex())341 animatedStyle->set ZIndex(0);340 if (animatedStyle->hasAutoUsedZIndex()) 341 animatedStyle->setUsedZIndex(0); 342 342 } 343 343 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r252716 r252724 1483 1483 return false; 1484 1484 // FIXME: Deal with z-index. 1485 if (!childStyle.hasAuto ZIndex())1485 if (!childStyle.hasAutoUsedZIndex()) 1486 1486 return false; 1487 1487 if (childLayer->hasTransform() || childLayer->isTransparent() || childLayer->hasFilter()) -
trunk/Source/WebCore/rendering/RenderBox.h
r252716 r252724 54 54 return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() 55 55 || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || style().specifiesColumns() 56 || !style().hasAuto ZIndex() || hasRunningAcceleratedAnimations();56 || !style().hasAutoUsedZIndex() || hasRunningAcceleratedAnimations(); 57 57 } 58 58 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r252628 r252724 712 712 // we need to dirty our stacking context's z-order list. 713 713 bool visibilityChanged = m_style.visibility() != newStyle.visibility() 714 || m_style. zIndex() != newStyle.zIndex()715 || m_style.hasAuto ZIndex() != newStyle.hasAutoZIndex();714 || m_style.usedZIndex() != newStyle.usedZIndex() 715 || m_style.hasAutoUsedZIndex() != newStyle.hasAutoUsedZIndex(); 716 716 717 717 if (visibilityChanged) -
trunk/Source/WebCore/rendering/RenderFullScreen.cpp
r244440 r252724 68 68 69 69 // Create a stacking context: 70 fullscreenStyle.set ZIndex(INT_MAX);70 fullscreenStyle.setUsedZIndex(INT_MAX); 71 71 72 72 fullscreenStyle.setFontDescription({ }); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r252628 r252724 567 567 || renderer.hasReflection() 568 568 || renderer.style().hasIsolation() 569 || !renderer.style().hasAuto ZIndex()569 || !renderer.style().hasAutoUsedZIndex() 570 570 || (renderer.style().willChange() && renderer.style().willChange()->canCreateStackingContext()); 571 571 } … … 588 588 bool RenderLayer::shouldBeCSSStackingContext() const 589 589 { 590 return !renderer().style().hasAuto ZIndex() || isRenderViewLayer();590 return !renderer().style().hasAutoUsedZIndex() || isRenderViewLayer(); 591 591 } 592 592 … … 6602 6602 // likely be folded along with the rest. 6603 6603 if (oldStyle) { 6604 if (oldStyle-> zIndex() != renderer().style().zIndex() || oldStyle->visibility() != renderer().style().visibility()) {6604 if (oldStyle->usedZIndex() != renderer().style().usedZIndex() || oldStyle->visibility() != renderer().style().visibility()) { 6605 6605 dirtyStackingContextZOrderLists(); 6606 6606 if (isStackingContext()) … … 6811 6811 // Map in our mask. 6812 6812 newStyle.setMaskBoxImage(renderer().style().boxReflect()->mask()); 6813 6813 6814 6814 // Style has transform and mask, so needs to be stacking context. 6815 newStyle.set ZIndex(0);6815 newStyle.setUsedZIndex(0); 6816 6816 6817 6817 return newStyle; -
trunk/Source/WebCore/rendering/RenderLayer.h
r252353 r252724 649 649 LayoutSize offsetFromAncestor(const RenderLayer*, ColumnOffsetAdjustment = DontAdjustForColumns) const; 650 650 651 int zIndex() const { return renderer().style(). zIndex(); }651 int zIndex() const { return renderer().style().usedZIndex(); } 652 652 653 653 enum PaintLayerFlag { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r252439 r252724 1394 1394 logString.append(pad(' ', 12 + depth * 2, hex(reinterpret_cast<uintptr_t>(&layer), Lowercase)), " id ", backing->graphicsLayer()->primaryLayerID(), " (", FormattedNumber::fixedWidth(absoluteBounds.x().toFloat(), 3), ',', FormattedNumber::fixedWidth(absoluteBounds.y().toFloat(), 3), '-', FormattedNumber::fixedWidth(absoluteBounds.maxX().toFloat(), 3), ',', FormattedNumber::fixedWidth(absoluteBounds.maxY().toFloat(), 3), ") ", FormattedNumber::fixedWidth(backing->backingStoreMemoryEstimate() / 1024, 2), "KB"); 1395 1395 1396 if (!layer.renderer().style().hasAuto ZIndex())1397 logString.append(" z-index: ", layer.renderer().style(). zIndex());1396 if (!layer.renderer().style().hasAutoUsedZIndex()) 1397 logString.append(" z-index: ", layer.renderer().style().usedZIndex()); 1398 1398 1399 1399 logString.append(" (", logReasonsForCompositing(layer), ") "); -
trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp
r249080 r252724 133 133 if (hasLayer()) { 134 134 if (oldStyle->position() != newStyle.position() 135 || oldStyle-> zIndex() != newStyle.zIndex()136 || oldStyle->hasAuto ZIndex() != newStyle.hasAutoZIndex()135 || oldStyle->usedZIndex() != newStyle.usedZIndex() 136 || oldStyle->hasAutoUsedZIndex() != newStyle.hasAutoUsedZIndex() 137 137 || !(oldStyle->clip() == newStyle.clip()) 138 138 || oldStyle->hasClip() != newStyle.hasClip() -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r250519 r252724 177 177 ts << " " << static_cast<const void*>(&o); 178 178 179 if (o.style(). zIndex())180 ts << " zI: " << o.style(). zIndex();179 if (o.style().usedZIndex()) // FIXME: This should use !hasAutoUsedZIndex(). 180 ts << " zI: " << o.style().usedZIndex(); 181 181 182 182 if (o.node()) { -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r252546 r252724 983 983 { 984 984 // Style::Resolver has ensured that zIndex is non-auto only if it's applicable. 985 if (m_boxData-> zIndex() != other.m_boxData->zIndex() || m_boxData->hasAutoZIndex() != other.m_boxData->hasAutoZIndex())985 if (m_boxData->usedZIndex() != other.m_boxData->usedZIndex() || m_boxData->hasAutoUsedZIndex() != other.m_boxData->hasAutoUsedZIndex()) 986 986 return true; 987 987 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r252546 r252724 1030 1030 void setPrintColorAdjust(PrintColorAdjust value) { m_inheritedFlags.printColorAdjust = static_cast<unsigned>(value); } 1031 1031 1032 bool hasAutoZIndex() const { return m_boxData->hasAutoZIndex(); } 1033 void setHasAutoZIndex() { SET_VAR(m_boxData, m_hasAutoZIndex, true); SET_VAR(m_boxData, m_zIndex, 0); } 1034 int zIndex() const { return m_boxData->zIndex(); } 1035 void setZIndex(int v) { SET_VAR(m_boxData, m_hasAutoZIndex, false); SET_VAR(m_boxData, m_zIndex, v); } 1032 int specifiedZIndex() const { return m_boxData->specifiedZIndex(); } 1033 bool hasAutoSpecifiedZIndex() const { return m_boxData->hasAutoSpecifiedZIndex(); } 1034 void setSpecifiedZIndex(int v) 1035 { 1036 SET_VAR(m_boxData, m_hasAutoSpecifiedZIndex, false); 1037 SET_VAR(m_boxData, m_specifiedZIndex, v); 1038 } 1039 void setHasAutoSpecifiedZIndex() 1040 { 1041 SET_VAR(m_boxData, m_hasAutoSpecifiedZIndex, true); 1042 SET_VAR(m_boxData, m_specifiedZIndex, 0); 1043 } 1044 1045 int usedZIndex() const { return m_boxData->usedZIndex(); } 1046 bool hasAutoUsedZIndex() const { return m_boxData->hasAutoUsedZIndex(); } 1047 void setUsedZIndex(int v) 1048 { 1049 SET_VAR(m_boxData, m_hasAutoUsedZIndex, false); 1050 SET_VAR(m_boxData, m_usedZIndex, v); 1051 } 1052 void setHasAutoUsedZIndex() 1053 { 1054 SET_VAR(m_boxData, m_hasAutoUsedZIndex, true); 1055 SET_VAR(m_boxData, m_usedZIndex, 0); 1056 } 1036 1057 1037 1058 void setHasAutoWidows() { SET_VAR(m_rareInheritedData, hasAutoWidows, true); SET_VAR(m_rareInheritedData, widows, initialWidows()); } -
trunk/Source/WebCore/rendering/style/StyleBoxData.cpp
r232018 r252724 30 30 struct SameSizeAsStyleBoxData : public RefCounted<SameSizeAsStyleBoxData> { 31 31 Length length[7]; 32 int m_zIndex ;32 int m_zIndex[2]; 33 33 uint32_t bitfields; 34 34 }; … … 41 41 , m_minHeight(RenderStyle::initialMinSize()) 42 42 , m_maxHeight(RenderStyle::initialMaxSize()) 43 , m_zIndex(0) 44 , m_hasAutoZIndex(true) 43 , m_specifiedZIndex(0) 44 , m_usedZIndex(0) 45 , m_hasAutoSpecifiedZIndex(true) 46 , m_hasAutoUsedZIndex(true) 45 47 , m_boxSizing(static_cast<unsigned>(BoxSizing::ContentBox)) 46 48 #if ENABLE(CSS_BOX_DECORATION_BREAK) … … 59 61 , m_maxHeight(o.m_maxHeight) 60 62 , m_verticalAlign(o.m_verticalAlign) 61 , m_zIndex(o.m_zIndex) 62 , m_hasAutoZIndex(o.m_hasAutoZIndex) 63 , m_specifiedZIndex(o.m_specifiedZIndex) 64 , m_usedZIndex(o.m_usedZIndex) 65 , m_hasAutoSpecifiedZIndex(o.m_hasAutoSpecifiedZIndex) 66 , m_hasAutoUsedZIndex(o.m_hasAutoUsedZIndex) 63 67 , m_boxSizing(o.m_boxSizing) 64 68 #if ENABLE(CSS_BOX_DECORATION_BREAK) … … 76 80 { 77 81 return m_width == o.m_width 78 && m_height == o.m_height 79 && m_minWidth == o.m_minWidth 80 && m_maxWidth == o.m_maxWidth 81 && m_minHeight == o.m_minHeight 82 && m_maxHeight == o.m_maxHeight 83 && m_verticalAlign == o.m_verticalAlign 84 && m_zIndex == o.m_zIndex 85 && m_hasAutoZIndex == o.m_hasAutoZIndex 86 && m_boxSizing == o.m_boxSizing 82 && m_height == o.m_height 83 && m_minWidth == o.m_minWidth 84 && m_maxWidth == o.m_maxWidth 85 && m_minHeight == o.m_minHeight 86 && m_maxHeight == o.m_maxHeight 87 && m_verticalAlign == o.m_verticalAlign 88 && m_specifiedZIndex == o.m_specifiedZIndex 89 && m_hasAutoSpecifiedZIndex == o.m_hasAutoSpecifiedZIndex 90 && m_usedZIndex == o.m_usedZIndex 91 && m_hasAutoUsedZIndex == o.m_hasAutoUsedZIndex 92 && m_boxSizing == o.m_boxSizing 87 93 #if ENABLE(CSS_BOX_DECORATION_BREAK) 88 94 && m_boxDecorationBreak == o.m_boxDecorationBreak 89 95 #endif 90 96 ; 91 97 } 92 98 -
trunk/Source/WebCore/rendering/style/StyleBoxData.h
r232018 r252724 54 54 const Length& verticalAlign() const { return m_verticalAlign; } 55 55 56 int zIndex() const { return m_zIndex; } 57 bool hasAutoZIndex() const { return m_hasAutoZIndex; } 58 56 int specifiedZIndex() const { return m_specifiedZIndex; } 57 bool hasAutoSpecifiedZIndex() const { return m_hasAutoSpecifiedZIndex; } 58 59 int usedZIndex() const { return m_usedZIndex; } 60 bool hasAutoUsedZIndex() const { return m_hasAutoUsedZIndex; } 61 59 62 BoxSizing boxSizing() const { return static_cast<BoxSizing>(m_boxSizing); } 60 63 #if ENABLE(CSS_BOX_DECORATION_BREAK) … … 79 82 Length m_verticalAlign; 80 83 81 int m_zIndex; 82 unsigned m_hasAutoZIndex : 1; 84 int m_specifiedZIndex; 85 int m_usedZIndex; 86 unsigned m_hasAutoSpecifiedZIndex : 1; 87 unsigned m_hasAutoUsedZIndex : 1; 83 88 unsigned m_boxSizing : 1; // BoxSizing 84 89 #if ENABLE(CSS_BOX_DECORATION_BREAK) -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r252631 r252724 295 295 296 296 // Make sure our z-index value is only applied if the object is positioned. 297 if (style.position() == PositionType::Static && !m_parentBoxStyle.isDisplayFlexibleOrGridBox()) 298 style.setHasAutoZIndex(); 297 if (style.hasAutoSpecifiedZIndex() || (style.position() == PositionType::Static && !m_parentBoxStyle.isDisplayFlexibleOrGridBox())) 298 style.setHasAutoUsedZIndex(); 299 else 300 style.setUsedZIndex(style.specifiedZIndex()); 299 301 300 302 // Auto z-index becomes 0 for the root element and transparent objects. This prevents 301 303 // cases where objects that should be blended as a single unit end up with a non-transparent 302 304 // object wedged in between them. Auto z-index also becomes 0 for objects that specify transforms/masks/reflections. 303 if (style.hasAuto ZIndex()) {305 if (style.hasAutoUsedZIndex()) { 304 306 if ((m_element && m_document.documentElement() == m_element) 305 307 || style.opacity() < 1.0f … … 317 319 || style.position() == PositionType::Fixed 318 320 || style.willChangeCreatesStackingContext()) 319 style.set ZIndex(0);321 style.setUsedZIndex(0); 320 322 } 321 323 … … 386 388 #if ENABLE(OVERFLOW_SCROLLING_TOUCH) 387 389 // Touch overflow scrolling creates a stacking context. 388 if (style.hasAuto ZIndex() && style.useTouchOverflowScrolling() && (isScrollableOverflow(style.overflowX()) || isScrollableOverflow(style.overflowY())))389 style.set ZIndex(0);390 if (style.hasAutoUsedZIndex() && style.useTouchOverflowScrolling() && (isScrollableOverflow(style.overflowX()) || isScrollableOverflow(style.overflowY()))) 391 style.setUsedZIndex(0); 390 392 #endif 391 393
Note: See TracChangeset
for help on using the changeset viewer.