| 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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 if (boxModelObject.isFloating()) | 874 if (boxModelObject.isFloating()) |
| 875 context.current.paintOffset = context.paintOffsetForFloat; | 875 context.current.paintOffset = context.paintOffsetForFloat; |
| 876 | 876 |
| 877 // Multicolumn spanners are painted starting at the multicolumn container (but | 877 // Multicolumn spanners are painted starting at the multicolumn container (but |
| 878 // still inherit properties in layout-tree order) so reset the paint offset. | 878 // still inherit properties in layout-tree order) so reset the paint offset. |
| 879 if (boxModelObject.isColumnSpanAll()) | 879 if (boxModelObject.isColumnSpanAll()) |
| 880 context.current.paintOffset = boxModelObject.container()->paintOffset(); | 880 context.current.paintOffset = boxModelObject.container()->paintOffset(); |
| 881 | 881 |
| 882 switch (object.styleRef().position()) { | 882 switch (object.styleRef().position()) { |
| 883 case StaticPosition: | 883 case EPosition::kStatic: |
| 884 break; | 884 break; |
| 885 case RelativePosition: | 885 case EPosition::kRelative: |
| 886 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); | 886 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); |
| 887 break; | 887 break; |
| 888 case AbsolutePosition: { | 888 case EPosition::kAbsolute: { |
| 889 DCHECK(context.containerForAbsolutePosition == | 889 DCHECK(context.containerForAbsolutePosition == |
| 890 boxModelObject.container()); | 890 boxModelObject.container()); |
| 891 context.current = context.absolutePosition; | 891 context.current = context.absolutePosition; |
| 892 | 892 |
| 893 // Absolutely positioned content in an inline should be positioned | 893 // Absolutely positioned content in an inline should be positioned |
| 894 // relative to the inline. | 894 // relative to the inline. |
| 895 const LayoutObject* container = context.containerForAbsolutePosition; | 895 const LayoutObject* container = context.containerForAbsolutePosition; |
| 896 if (container && container->isInFlowPositioned() && | 896 if (container && container->isInFlowPositioned() && |
| 897 container->isLayoutInline()) { | 897 container->isLayoutInline()) { |
| 898 DCHECK(object.isBox()); | 898 DCHECK(object.isBox()); |
| 899 context.current.paintOffset += | 899 context.current.paintOffset += |
| 900 toLayoutInline(container)->offsetForInFlowPositionedInline( | 900 toLayoutInline(container)->offsetForInFlowPositionedInline( |
| 901 toLayoutBox(object)); | 901 toLayoutBox(object)); |
| 902 } | 902 } |
| 903 break; | 903 break; |
| 904 } | 904 } |
| 905 case StickyPosition: | 905 case EPosition::kSticky: |
| 906 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); | 906 context.current.paintOffset += boxModelObject.offsetForInFlowPosition(); |
| 907 break; | 907 break; |
| 908 case FixedPosition: | 908 case EPosition::kFixed: |
| 909 context.current = context.fixedPosition; | 909 context.current = context.fixedPosition; |
| 910 break; | 910 break; |
| 911 default: | 911 default: |
| 912 ASSERT_NOT_REACHED(); | 912 ASSERT_NOT_REACHED(); |
| 913 } | 913 } |
| 914 | 914 |
| 915 if (boxModelObject.isBox()) { | 915 if (boxModelObject.isBox()) { |
| 916 // TODO(pdr): Several calls in this function walk back up the tree to | 916 // TODO(pdr): Several calls in this function walk back up the tree to |
| 917 // calculate containers (e.g., physicalLocation, offsetForInFlowPosition*). | 917 // calculate containers (e.g., physicalLocation, offsetForInFlowPosition*). |
| 918 // The containing block and other containers can be stored on | 918 // The containing block and other containers can be stored on |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 updateOverflowClip(object, context); | 977 updateOverflowClip(object, context); |
| 978 updatePerspective(object, context); | 978 updatePerspective(object, context); |
| 979 updateSvgLocalToBorderBoxTransform(object, context); | 979 updateSvgLocalToBorderBoxTransform(object, context); |
| 980 updateScrollAndScrollTranslation(object, context); | 980 updateScrollAndScrollTranslation(object, context); |
| 981 updateOutOfFlowContext(object, context); | 981 updateOutOfFlowContext(object, context); |
| 982 | 982 |
| 983 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 983 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 984 } | 984 } |
| 985 | 985 |
| 986 } // namespace blink | 986 } // namespace blink |
| OLD | NEW |