| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 context.transform = properties->propertyTreeState.transform(); | 784 context.transform = properties->propertyTreeState.transform(); |
| 785 context.paintOffset = properties->paintOffset; | 785 context.paintOffset = properties->paintOffset; |
| 786 context.shouldFlattenInheritedTransform = | 786 context.shouldFlattenInheritedTransform = |
| 787 context.transform && context.transform->flattensInheritedTransform(); | 787 context.transform && context.transform->flattensInheritedTransform(); |
| 788 context.renderingContextID = | 788 context.renderingContextID = |
| 789 context.transform ? context.transform->renderingContextID() : 0; | 789 context.transform ? context.transform->renderingContextID() : 0; |
| 790 context.clip = properties->propertyTreeState.clip(); | 790 context.clip = properties->propertyTreeState.clip(); |
| 791 context.scroll = properties->propertyTreeState.scroll(); | 791 context.scroll = properties->propertyTreeState.scroll(); |
| 792 } | 792 } |
| 793 | 793 |
| 794 static void deriveBorderBoxFromContainerContext( | 794 void PaintPropertyTreeBuilder::updateContextForBoxPosition( |
| 795 const LayoutObject& object, | 795 const LayoutObject& object, |
| 796 PaintPropertyTreeBuilderContext& context) { | 796 PaintPropertyTreeBuilderContext& context) { |
| 797 if (!object.isBoxModelObject()) | 797 if (!object.isBoxModelObject()) |
| 798 return; | 798 return; |
| 799 | 799 |
| 800 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); | 800 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); |
| 801 | |
| 802 switch (object.styleRef().position()) { | 801 switch (object.styleRef().position()) { |
| 803 case StaticPosition: | 802 case StaticPosition: |
| 804 break; | 803 break; |
| 805 case RelativePosition: | 804 case RelativePosition: |
| 806 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); | 805 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); |
| 807 break; | 806 break; |
| 808 case AbsolutePosition: { | 807 case AbsolutePosition: { |
| 809 if (context.isUnderMultiColumnSpanner) { | 808 if (context.isUnderMultiColumnSpanner) { |
| 810 const LayoutObject* container = boxModelObject.container(); | 809 const LayoutObject* container = boxModelObject.container(); |
| 811 if (container != context.containerForAbsolutePosition) { | 810 if (container != context.containerForAbsolutePosition) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 void PaintPropertyTreeBuilder::updatePropertiesForSelf( | 876 void PaintPropertyTreeBuilder::updatePropertiesForSelf( |
| 878 const LayoutObject& object, | 877 const LayoutObject& object, |
| 879 PaintPropertyTreeBuilderContext& context) { | 878 PaintPropertyTreeBuilderContext& context) { |
| 880 if (!object.isBoxModelObject() && !object.isSVG()) | 879 if (!object.isBoxModelObject() && !object.isSVG()) |
| 881 return; | 880 return; |
| 882 | 881 |
| 883 #if DCHECK_IS_ON() | 882 #if DCHECK_IS_ON() |
| 884 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); | 883 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); |
| 885 #endif | 884 #endif |
| 886 | 885 |
| 887 deriveBorderBoxFromContainerContext(object, context); | |
| 888 | |
| 889 updatePaintOffsetTranslation(object, context); | 886 updatePaintOffsetTranslation(object, context); |
| 890 updateTransform(object, context); | 887 updateTransform(object, context); |
| 891 updateEffect(object, context); | 888 updateEffect(object, context); |
| 892 updateCssClip(object, context); | 889 updateCssClip(object, context); |
| 893 updateLocalBorderBoxContext(object, context); | 890 updateLocalBorderBoxContext(object, context); |
| 894 updateScrollbarPaintOffset(object, context); | 891 updateScrollbarPaintOffset(object, context); |
| 895 } | 892 } |
| 896 | 893 |
| 897 void PaintPropertyTreeBuilder::updatePropertiesForChildren( | 894 void PaintPropertyTreeBuilder::updatePropertiesForChildren( |
| 898 const LayoutObject& object, | 895 const LayoutObject& object, |
| 899 PaintPropertyTreeBuilderContext& context) { | 896 PaintPropertyTreeBuilderContext& context) { |
| 900 if (!object.isBoxModelObject() && !object.isSVG()) | 897 if (!object.isBoxModelObject() && !object.isSVG()) |
| 901 return; | 898 return; |
| 902 | 899 |
| 903 #if DCHECK_IS_ON() | 900 #if DCHECK_IS_ON() |
| 904 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); | 901 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); |
| 905 #endif | 902 #endif |
| 906 | 903 |
| 907 updateOverflowClip(object, context); | 904 updateOverflowClip(object, context); |
| 908 updatePerspective(object, context); | 905 updatePerspective(object, context); |
| 909 updateSvgLocalToBorderBoxTransform(object, context); | 906 updateSvgLocalToBorderBoxTransform(object, context); |
| 910 updateScrollAndScrollTranslation(object, context); | 907 updateScrollAndScrollTranslation(object, context); |
| 911 updateOutOfFlowContext(object, context); | 908 updateOutOfFlowContext(object, context); |
| 912 } | 909 } |
| 913 | 910 |
| 914 } // namespace blink | 911 } // namespace blink |
| OLD | NEW |