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