| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMNodeIds.h" | 7 #include "core/dom/DOMNodeIds.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 if (object.paintProperties() && object.paintProperties()->scroll()) { | 813 if (object.paintProperties() && object.paintProperties()->scroll()) { |
| 814 context.current.transform = object.paintProperties()->scrollTranslation(); | 814 context.current.transform = object.paintProperties()->scrollTranslation(); |
| 815 context.current.scroll = object.paintProperties()->scroll(); | 815 context.current.scroll = object.paintProperties()->scroll(); |
| 816 context.current.shouldFlattenInheritedTransform = false; | 816 context.current.shouldFlattenInheritedTransform = false; |
| 817 } | 817 } |
| 818 } | 818 } |
| 819 | 819 |
| 820 void PaintPropertyTreeBuilder::updateOutOfFlowContext( | 820 void PaintPropertyTreeBuilder::updateOutOfFlowContext( |
| 821 const LayoutObject& object, | 821 const LayoutObject& object, |
| 822 PaintPropertyTreeBuilderContext& context) { | 822 PaintPropertyTreeBuilderContext& context) { |
| 823 if (object.isLayoutBlock()) | 823 if (object.isLayoutBlock()) { |
| 824 context.paintOffsetForFloat = context.current.paintOffset; | 824 context.paintOffsetForNonStackedFloat = context.paintOffsetForStackedFloat = |
| 825 context.current.paintOffset; |
| 826 } else if (object.styleRef().isStacked()) { |
| 827 context.paintOffsetForStackedFloat = context.current.paintOffset; |
| 828 } |
| 825 | 829 |
| 826 if (object.canContainAbsolutePositionObjects()) { | 830 if (object.canContainAbsolutePositionObjects()) { |
| 827 context.absolutePosition = context.current; | 831 context.absolutePosition = context.current; |
| 828 context.containerForAbsolutePosition = &object; | 832 context.containerForAbsolutePosition = &object; |
| 829 } | 833 } |
| 830 | 834 |
| 831 if (object.isLayoutView()) { | 835 if (object.isLayoutView()) { |
| 832 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 836 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 833 const auto* initialFixedTransform = context.fixedPosition.transform; | 837 const auto* initialFixedTransform = context.fixedPosition.transform; |
| 834 const auto* initialFixedScroll = context.fixedPosition.scroll; | 838 const auto* initialFixedScroll = context.fixedPosition.scroll; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 } | 882 } |
| 879 | 883 |
| 880 void PaintPropertyTreeBuilder::updateContextForBoxPosition( | 884 void PaintPropertyTreeBuilder::updateContextForBoxPosition( |
| 881 const LayoutObject& object, | 885 const LayoutObject& object, |
| 882 PaintPropertyTreeBuilderContext& context) { | 886 PaintPropertyTreeBuilderContext& context) { |
| 883 if (!object.isBoxModelObject()) | 887 if (!object.isBoxModelObject()) |
| 884 return; | 888 return; |
| 885 | 889 |
| 886 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); | 890 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); |
| 887 | 891 |
| 888 if (boxModelObject.isFloating()) | 892 if (boxModelObject.isFloating()) { |
| 889 context.current.paintOffset = context.paintOffsetForFloat; | 893 context.current.paintOffset = boxModelObject.styleRef().isStacked() |
| 894 ? context.paintOffsetForStackedFloat |
| 895 : context.paintOffsetForNonStackedFloat; |
| 896 } |
| 890 | 897 |
| 891 // Multicolumn spanners are painted starting at the multicolumn container (but | 898 // Multicolumn spanners are painted starting at the multicolumn container (but |
| 892 // still inherit properties in layout-tree order) so reset the paint offset. | 899 // still inherit properties in layout-tree order) so reset the paint offset. |
| 893 if (boxModelObject.isColumnSpanAll()) | 900 if (boxModelObject.isColumnSpanAll()) |
| 894 context.current.paintOffset = boxModelObject.container()->paintOffset(); | 901 context.current.paintOffset = boxModelObject.container()->paintOffset(); |
| 895 | 902 |
| 896 switch (object.styleRef().position()) { | 903 switch (object.styleRef().position()) { |
| 897 case StaticPosition: | 904 case StaticPosition: |
| 898 break; | 905 break; |
| 899 case RelativePosition: | 906 case RelativePosition: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 updateOverflowClip(object, context); | 996 updateOverflowClip(object, context); |
| 990 updatePerspective(object, context); | 997 updatePerspective(object, context); |
| 991 updateSvgLocalToBorderBoxTransform(object, context); | 998 updateSvgLocalToBorderBoxTransform(object, context); |
| 992 updateScrollAndScrollTranslation(object, context); | 999 updateScrollAndScrollTranslation(object, context); |
| 993 updateOutOfFlowContext(object, context); | 1000 updateOutOfFlowContext(object, context); |
| 994 | 1001 |
| 995 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1002 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 996 } | 1003 } |
| 997 | 1004 |
| 998 } // namespace blink | 1005 } // namespace blink |
| OLD | NEW |