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/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 } | 744 } |
745 } | 745 } |
746 | 746 |
747 if (object.paintProperties() && object.paintProperties()->scroll()) { | 747 if (object.paintProperties() && object.paintProperties()->scroll()) { |
748 context.current.transform = object.paintProperties()->scrollTranslation(); | 748 context.current.transform = object.paintProperties()->scrollTranslation(); |
749 context.current.scroll = object.paintProperties()->scroll(); | 749 context.current.scroll = object.paintProperties()->scroll(); |
750 context.current.shouldFlattenInheritedTransform = false; | 750 context.current.shouldFlattenInheritedTransform = false; |
751 } | 751 } |
752 } | 752 } |
753 | 753 |
754 void PaintPropertyTreeBuilder::updateOutOfFlowContext( | 754 void PaintPropertyTreeBuilder::updateOutOfFlowAndFloatContext( |
755 const LayoutObject& object, | 755 const LayoutObject& object, |
756 PaintPropertyTreeBuilderContext& context) { | 756 PaintPropertyTreeBuilderContext& context) { |
| 757 if (object.isLayoutBlock()) |
| 758 context.paintOffsetForFloat = context.current.paintOffset; |
| 759 |
757 if (object.canContainAbsolutePositionObjects()) { | 760 if (object.canContainAbsolutePositionObjects()) { |
758 context.absolutePosition = context.current; | 761 context.absolutePosition = context.current; |
759 context.containerForAbsolutePosition = &object; | 762 context.containerForAbsolutePosition = &object; |
760 } | 763 } |
761 | 764 |
762 if (object.isLayoutView()) { | 765 if (object.isLayoutView()) { |
763 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 766 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
764 const auto* initialFixedTransform = context.fixedPosition.transform; | 767 const auto* initialFixedTransform = context.fixedPosition.transform; |
765 const auto* initialFixedScroll = context.fixedPosition.scroll; | 768 const auto* initialFixedScroll = context.fixedPosition.scroll; |
766 | 769 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 context.scroll = properties->propertyTreeState.scroll(); | 844 context.scroll = properties->propertyTreeState.scroll(); |
842 } | 845 } |
843 | 846 |
844 void PaintPropertyTreeBuilder::updateContextForBoxPosition( | 847 void PaintPropertyTreeBuilder::updateContextForBoxPosition( |
845 const LayoutObject& object, | 848 const LayoutObject& object, |
846 PaintPropertyTreeBuilderContext& context) { | 849 PaintPropertyTreeBuilderContext& context) { |
847 if (!object.isBoxModelObject()) | 850 if (!object.isBoxModelObject()) |
848 return; | 851 return; |
849 | 852 |
850 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); | 853 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); |
| 854 |
| 855 if (boxModelObject.isFloating()) |
| 856 context.current.paintOffset = context.paintOffsetForFloat; |
| 857 |
851 switch (object.styleRef().position()) { | 858 switch (object.styleRef().position()) { |
852 case StaticPosition: | 859 case StaticPosition: |
853 break; | 860 break; |
854 case RelativePosition: | 861 case RelativePosition: |
855 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); | 862 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); |
856 break; | 863 break; |
857 case AbsolutePosition: { | 864 case AbsolutePosition: { |
858 if (context.isUnderMultiColumnSpanner) { | 865 if (context.isUnderMultiColumnSpanner) { |
859 const LayoutObject* container = boxModelObject.container(); | 866 const LayoutObject* container = boxModelObject.container(); |
860 if (container != context.containerForAbsolutePosition) { | 867 if (container != context.containerForAbsolutePosition) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 return; | 955 return; |
949 | 956 |
950 #if DCHECK_IS_ON() | 957 #if DCHECK_IS_ON() |
951 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); | 958 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); |
952 #endif | 959 #endif |
953 | 960 |
954 updateOverflowClip(object, context); | 961 updateOverflowClip(object, context); |
955 updatePerspective(object, context); | 962 updatePerspective(object, context); |
956 updateSvgLocalToBorderBoxTransform(object, context); | 963 updateSvgLocalToBorderBoxTransform(object, context); |
957 updateScrollAndScrollTranslation(object, context); | 964 updateScrollAndScrollTranslation(object, context); |
958 updateOutOfFlowContext(object, context); | 965 updateOutOfFlowAndFloatContext(object, context); |
959 } | 966 } |
960 | 967 |
961 } // namespace blink | 968 } // namespace blink |
OLD | NEW |