| 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 if (object.paintProperties() && object.paintProperties()->scroll()) { | 797 if (object.paintProperties() && object.paintProperties()->scroll()) { |
| 798 context.current.transform = object.paintProperties()->scrollTranslation(); | 798 context.current.transform = object.paintProperties()->scrollTranslation(); |
| 799 context.current.scroll = object.paintProperties()->scroll(); | 799 context.current.scroll = object.paintProperties()->scroll(); |
| 800 context.current.shouldFlattenInheritedTransform = false; | 800 context.current.shouldFlattenInheritedTransform = false; |
| 801 } | 801 } |
| 802 } | 802 } |
| 803 | 803 |
| 804 void PaintPropertyTreeBuilder::updateOutOfFlowContext( | 804 void PaintPropertyTreeBuilder::updateOutOfFlowContext( |
| 805 const LayoutObject& object, | 805 const LayoutObject& object, |
| 806 PaintPropertyTreeBuilderContext& context) { | 806 PaintPropertyTreeBuilderContext& context) { |
| 807 if (object.isLayoutBlock()) |
| 808 context.paintOffsetForFloat = context.current.paintOffset; |
| 809 |
| 807 if (object.canContainAbsolutePositionObjects()) { | 810 if (object.canContainAbsolutePositionObjects()) { |
| 808 context.absolutePosition = context.current; | 811 context.absolutePosition = context.current; |
| 809 context.containerForAbsolutePosition = &object; | 812 context.containerForAbsolutePosition = &object; |
| 810 } | 813 } |
| 811 | 814 |
| 812 if (object.isLayoutView()) { | 815 if (object.isLayoutView()) { |
| 813 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 816 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 814 const auto* initialFixedTransform = context.fixedPosition.transform; | 817 const auto* initialFixedTransform = context.fixedPosition.transform; |
| 815 const auto* initialFixedScroll = context.fixedPosition.scroll; | 818 const auto* initialFixedScroll = context.fixedPosition.scroll; |
| 816 | 819 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 context.scroll = properties->propertyTreeState.scroll(); | 894 context.scroll = properties->propertyTreeState.scroll(); |
| 892 } | 895 } |
| 893 | 896 |
| 894 void PaintPropertyTreeBuilder::updateContextForBoxPosition( | 897 void PaintPropertyTreeBuilder::updateContextForBoxPosition( |
| 895 const LayoutObject& object, | 898 const LayoutObject& object, |
| 896 PaintPropertyTreeBuilderContext& context) { | 899 PaintPropertyTreeBuilderContext& context) { |
| 897 if (!object.isBoxModelObject()) | 900 if (!object.isBoxModelObject()) |
| 898 return; | 901 return; |
| 899 | 902 |
| 900 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); | 903 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); |
| 904 |
| 905 if (boxModelObject.isFloating()) |
| 906 context.current.paintOffset = context.paintOffsetForFloat; |
| 907 |
| 901 switch (object.styleRef().position()) { | 908 switch (object.styleRef().position()) { |
| 902 case StaticPosition: | 909 case StaticPosition: |
| 903 break; | 910 break; |
| 904 case RelativePosition: | 911 case RelativePosition: |
| 905 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); | 912 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); |
| 906 break; | 913 break; |
| 907 case AbsolutePosition: { | 914 case AbsolutePosition: { |
| 908 if (context.isUnderMultiColumnSpanner) { | 915 if (context.isUnderMultiColumnSpanner) { |
| 909 const LayoutObject* container = boxModelObject.container(); | 916 const LayoutObject* container = boxModelObject.container(); |
| 910 if (container != context.containerForAbsolutePosition) { | 917 if (container != context.containerForAbsolutePosition) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 updateOverflowClip(object, context); | 1016 updateOverflowClip(object, context); |
| 1010 updatePerspective(object, context); | 1017 updatePerspective(object, context); |
| 1011 updateSvgLocalToBorderBoxTransform(object, context); | 1018 updateSvgLocalToBorderBoxTransform(object, context); |
| 1012 updateScrollAndScrollTranslation(object, context); | 1019 updateScrollAndScrollTranslation(object, context); |
| 1013 updateOutOfFlowContext(object, context); | 1020 updateOutOfFlowContext(object, context); |
| 1014 | 1021 |
| 1015 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1022 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 1016 } | 1023 } |
| 1017 | 1024 |
| 1018 } // namespace blink | 1025 } // namespace blink |
| OLD | NEW |