Chromium Code Reviews| 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" |
| 11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
| 12 #include "core/layout/svg/LayoutSVGRoot.h" | 12 #include "core/layout/svg/LayoutSVGRoot.h" |
| 13 #include "core/paint/FindPropertiesNeedingUpdate.h" | 13 #include "core/paint/FindPropertiesNeedingUpdate.h" |
| 14 #include "core/paint/ObjectPaintProperties.h" | 14 #include "core/paint/ObjectPaintProperties.h" |
| 15 #include "core/paint/PaintLayer.h" | 15 #include "core/paint/PaintLayer.h" |
| 16 #include "core/paint/SVGRootPainter.h" | 16 #include "core/paint/SVGRootPainter.h" |
| 17 #include "platform/transforms/TransformationMatrix.h" | 17 #include "platform/transforms/TransformationMatrix.h" |
| 18 #include "wtf/PtrUtil.h" | 18 #include "wtf/PtrUtil.h" |
| 19 #include <memory> | 19 #include <memory> |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 PaintPropertyTreeBuilderContext | 23 PaintPropertyTreeBuilderContext |
| 24 PaintPropertyTreeBuilder::setupInitialContext() { | 24 PaintPropertyTreeBuilder::setupInitialContext() { |
| 25 PaintPropertyTreeBuilderContext context; | 25 PaintPropertyTreeBuilderContext context; |
| 26 | |
| 27 context.current.clip = context.absolutePosition.clip = | 26 context.current.clip = context.absolutePosition.clip = |
| 28 context.fixedPosition.clip = ClipPaintPropertyNode::root(); | 27 context.fixedPosition.clip = ClipPaintPropertyNode::root(); |
| 29 context.currentEffect = EffectPaintPropertyNode::root(); | 28 context.currentEffect = EffectPaintPropertyNode::root(); |
| 30 context.current.transform = context.absolutePosition.transform = | 29 context.current.transform = context.absolutePosition.transform = |
| 31 context.fixedPosition.transform = TransformPaintPropertyNode::root(); | 30 context.fixedPosition.transform = TransformPaintPropertyNode::root(); |
| 32 context.current.scroll = context.absolutePosition.scroll = | 31 context.current.scroll = context.absolutePosition.scroll = |
| 33 context.fixedPosition.scroll = ScrollPaintPropertyNode::root(); | 32 context.fixedPosition.scroll = ScrollPaintPropertyNode::root(); |
| 34 | |
| 35 // Ensure scroll tree properties are reset. They will be rebuilt during the | |
| 36 // tree walk. | |
| 37 ScrollPaintPropertyNode::root()->clearMainThreadScrollingReasons(); | |
| 38 | |
| 39 return context; | 33 return context; |
| 40 } | 34 } |
| 41 | 35 |
| 42 void updateFrameViewPreTranslation( | 36 void updateFrameViewPreTranslation( |
| 43 FrameView& frameView, | 37 FrameView& frameView, |
| 44 PassRefPtr<const TransformPaintPropertyNode> parent, | 38 PassRefPtr<const TransformPaintPropertyNode> parent, |
| 45 const TransformationMatrix& matrix, | 39 const TransformationMatrix& matrix, |
| 46 const FloatPoint3D& origin) { | 40 const FloatPoint3D& origin) { |
| 47 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); | 41 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| 48 if (auto* existingPreTranslation = frameView.preTranslation()) { | 42 if (auto* existingPreTranslation = frameView.preTranslation()) { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 75 const FloatPoint3D& origin) { | 69 const FloatPoint3D& origin) { |
| 76 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); | 70 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| 77 if (auto* existingScrollTranslation = frameView.scrollTranslation()) { | 71 if (auto* existingScrollTranslation = frameView.scrollTranslation()) { |
| 78 existingScrollTranslation->update(std::move(parent), matrix, origin); | 72 existingScrollTranslation->update(std::move(parent), matrix, origin); |
| 79 } else { | 73 } else { |
| 80 frameView.setScrollTranslation( | 74 frameView.setScrollTranslation( |
| 81 TransformPaintPropertyNode::create(std::move(parent), matrix, origin)); | 75 TransformPaintPropertyNode::create(std::move(parent), matrix, origin)); |
| 82 } | 76 } |
| 83 } | 77 } |
| 84 | 78 |
| 85 void updateFrameViewScroll( | 79 void updateFrameViewScroll( |
|
Xianzhu
2016/11/17 19:03:04
Nit not necessarily to be addressed in this CL: we
pdr.
2016/11/17 21:01:36
Good ideas all around. I'll do this in a followup
pdr.
2016/11/17 22:30:03
I started this in parallel and found out why we di
| |
| 86 FrameView& frameView, | 80 FrameView& frameView, |
| 87 PassRefPtr<ScrollPaintPropertyNode> parent, | 81 PassRefPtr<const ScrollPaintPropertyNode> parent, |
| 88 PassRefPtr<const TransformPaintPropertyNode> scrollOffset, | 82 PassRefPtr<const TransformPaintPropertyNode> scrollOffset, |
| 89 const IntSize& clip, | 83 const IntSize& clip, |
| 90 const IntSize& bounds, | 84 const IntSize& bounds, |
| 91 bool userScrollableHorizontal, | 85 bool userScrollableHorizontal, |
| 92 bool userScrollableVertical) { | 86 bool userScrollableVertical, |
| 87 bool threadedScrollingDisabled, | |
| 88 bool hasBackgroundAttachmentFixedDescendants) { | |
| 93 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); | 89 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| 94 if (auto* existingScroll = frameView.scroll()) { | 90 if (auto* existingScroll = frameView.scroll()) { |
| 95 existingScroll->update(std::move(parent), std::move(scrollOffset), clip, | 91 existingScroll->update(std::move(parent), std::move(scrollOffset), clip, |
| 96 bounds, userScrollableHorizontal, | 92 bounds, userScrollableHorizontal, |
| 97 userScrollableVertical); | 93 userScrollableVertical, threadedScrollingDisabled, |
| 94 hasBackgroundAttachmentFixedDescendants); | |
| 98 } else { | 95 } else { |
| 99 frameView.setScroll(ScrollPaintPropertyNode::create( | 96 frameView.setScroll(ScrollPaintPropertyNode::create( |
| 100 std::move(parent), std::move(scrollOffset), clip, bounds, | 97 std::move(parent), std::move(scrollOffset), clip, bounds, |
| 101 userScrollableHorizontal, userScrollableVertical)); | 98 userScrollableHorizontal, userScrollableVertical, |
| 99 threadedScrollingDisabled, hasBackgroundAttachmentFixedDescendants)); | |
| 102 } | 100 } |
| 103 } | 101 } |
| 104 | 102 |
| 105 void PaintPropertyTreeBuilder::updateProperties( | 103 void PaintPropertyTreeBuilder::updateProperties( |
| 106 FrameView& frameView, | 104 FrameView& frameView, |
| 107 PaintPropertyTreeBuilderContext& context) { | 105 PaintPropertyTreeBuilderContext& context) { |
| 108 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 106 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 109 // With root layer scrolling, the LayoutView (a LayoutObject) properties are | 107 // With root layer scrolling, the LayoutView (a LayoutObject) properties are |
| 110 // updated like other objects (see updatePropertiesAndContextForSelf and | 108 // updated like other objects (see updatePropertiesAndContextForSelf and |
| 111 // updatePropertiesAndContextForChildren) instead of needing LayoutView- | 109 // updatePropertiesAndContextForChildren) instead of needing LayoutView- |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 141 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); | 139 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); |
| 142 updateFrameViewScrollTranslation(frameView, frameView.preTranslation(), | 140 updateFrameViewScrollTranslation(frameView, frameView.preTranslation(), |
| 143 frameScroll, FloatPoint3D()); | 141 frameScroll, FloatPoint3D()); |
| 144 | 142 |
| 145 IntSize scrollClip = frameView.visibleContentSize(); | 143 IntSize scrollClip = frameView.visibleContentSize(); |
| 146 IntSize scrollBounds = frameView.contentsSize(); | 144 IntSize scrollBounds = frameView.contentsSize(); |
| 147 bool userScrollableHorizontal = | 145 bool userScrollableHorizontal = |
| 148 frameView.userInputScrollable(HorizontalScrollbar); | 146 frameView.userInputScrollable(HorizontalScrollbar); |
| 149 bool userScrollableVertical = | 147 bool userScrollableVertical = |
| 150 frameView.userInputScrollable(VerticalScrollbar); | 148 frameView.userInputScrollable(VerticalScrollbar); |
| 149 bool threadedScrollingDisabled = | |
| 150 !frameView.frame().settings()->threadedScrollingEnabled(); | |
| 151 bool hasBackgroundAttachmentFixedDescendants = | |
| 152 frameView.hasBackgroundAttachmentFixedObjects(); | |
|
Xianzhu
2016/11/17 19:03:04
Can the above code be moved into updateFrameViewSc
pdr.
2016/11/17 21:01:36
I'd prefer if we leave them here because this code
Xianzhu
2016/11/17 21:25:02
Sounds good.
| |
| 151 updateFrameViewScroll(frameView, context.current.scroll, | 153 updateFrameViewScroll(frameView, context.current.scroll, |
| 152 frameView.scrollTranslation(), scrollClip, | 154 frameView.scrollTranslation(), scrollClip, |
| 153 scrollBounds, userScrollableHorizontal, | 155 scrollBounds, userScrollableHorizontal, |
| 154 userScrollableVertical); | 156 userScrollableVertical, threadedScrollingDisabled, |
| 157 hasBackgroundAttachmentFixedDescendants); | |
| 155 } else { | 158 } else { |
| 156 // Ensure pre-existing properties are cleared when there is no scrolling. | 159 // Ensure pre-existing properties are cleared when there is no scrolling. |
| 157 frameView.setScrollTranslation(nullptr); | 160 frameView.setScrollTranslation(nullptr); |
| 158 frameView.setScroll(nullptr); | 161 frameView.setScroll(nullptr); |
| 159 } | 162 } |
| 160 } | 163 } |
| 161 | 164 |
| 162 // Initialize the context for current, absolute and fixed position cases. | 165 // Initialize the context for current, absolute and fixed position cases. |
| 163 // They are the same, except that scroll translation does not apply to | 166 // They are the same, except that scroll translation does not apply to |
| 164 // fixed position descendants. | 167 // fixed position descendants. |
| 165 const auto* fixedTransformNode = frameView.preTranslation() | 168 const auto* fixedTransformNode = frameView.preTranslation() |
| 166 ? frameView.preTranslation() | 169 ? frameView.preTranslation() |
| 167 : context.current.transform; | 170 : context.current.transform; |
| 168 auto* fixedScrollNode = context.current.scroll; | 171 auto* fixedScrollNode = context.current.scroll; |
| 169 DCHECK(frameView.preTranslation()); | 172 DCHECK(frameView.preTranslation()); |
| 170 context.current.transform = frameView.preTranslation(); | 173 context.current.transform = frameView.preTranslation(); |
| 171 DCHECK(frameView.contentClip()); | 174 DCHECK(frameView.contentClip()); |
| 172 context.current.clip = frameView.contentClip(); | 175 context.current.clip = frameView.contentClip(); |
| 173 if (const auto* scrollTranslation = frameView.scrollTranslation()) | 176 if (const auto* scrollTranslation = frameView.scrollTranslation()) |
| 174 context.current.transform = scrollTranslation; | 177 context.current.transform = scrollTranslation; |
| 175 if (auto* scroll = frameView.scroll()) | 178 if (const auto* scroll = frameView.scroll()) |
| 176 context.current.scroll = scroll; | 179 context.current.scroll = scroll; |
| 177 context.current.paintOffset = LayoutPoint(); | 180 context.current.paintOffset = LayoutPoint(); |
| 178 context.current.renderingContextID = 0; | 181 context.current.renderingContextID = 0; |
| 179 context.current.shouldFlattenInheritedTransform = true; | 182 context.current.shouldFlattenInheritedTransform = true; |
| 180 context.absolutePosition = context.current; | 183 context.absolutePosition = context.current; |
| 181 context.containerForAbsolutePosition = nullptr; | 184 context.containerForAbsolutePosition = nullptr; |
| 182 context.fixedPosition = context.current; | 185 context.fixedPosition = context.current; |
| 183 context.fixedPosition.transform = fixedTransformNode; | 186 context.fixedPosition.transform = fixedTransformNode; |
| 184 context.fixedPosition.scroll = fixedScrollNode; | 187 context.fixedPosition.scroll = fixedScrollNode; |
| 185 | 188 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 needsScrollbarPaintOffset = true; | 498 needsScrollbarPaintOffset = true; |
| 496 } | 499 } |
| 497 } | 500 } |
| 498 } | 501 } |
| 499 | 502 |
| 500 auto* properties = object.getMutableForPainting().paintProperties(); | 503 auto* properties = object.getMutableForPainting().paintProperties(); |
| 501 if (!needsScrollbarPaintOffset && properties) | 504 if (!needsScrollbarPaintOffset && properties) |
| 502 properties->clearScrollbarPaintOffset(); | 505 properties->clearScrollbarPaintOffset(); |
| 503 } | 506 } |
| 504 | 507 |
| 505 void PaintPropertyTreeBuilder::updateMainThreadScrollingReasons( | |
| 506 const LayoutObject& object, | |
| 507 PaintPropertyTreeBuilderContext& context) { | |
| 508 // TODO(pdr): Mark properties as needing an update for main thread scroll | |
| 509 // reasons and ensure reason changes are propagated to ancestors to account | |
| 510 // for the parent walk below. https://crbug.com/664672. | |
| 511 | |
| 512 if (context.current.scroll && | |
| 513 !object.document().settings()->threadedScrollingEnabled()) { | |
| 514 context.current.scroll->addMainThreadScrollingReasons( | |
| 515 MainThreadScrollingReason::kThreadedScrollingDisabled); | |
| 516 } | |
| 517 | |
| 518 if (object.isBackgroundAttachmentFixedObject()) { | |
| 519 auto* scrollNode = context.current.scroll; | |
| 520 while ( | |
| 521 scrollNode && | |
| 522 !scrollNode->hasMainThreadScrollingReasons( | |
| 523 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects)) { | |
| 524 scrollNode->addMainThreadScrollingReasons( | |
| 525 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); | |
| 526 scrollNode = scrollNode->parent(); | |
| 527 } | |
| 528 } | |
| 529 } | |
| 530 | |
| 531 void PaintPropertyTreeBuilder::updateOverflowClip( | 508 void PaintPropertyTreeBuilder::updateOverflowClip( |
| 532 const LayoutObject& object, | 509 const LayoutObject& object, |
| 533 PaintPropertyTreeBuilderContext& context) { | 510 PaintPropertyTreeBuilderContext& context) { |
| 534 if (!object.isBox()) | 511 if (!object.isBox()) |
| 535 return; | 512 return; |
| 536 | 513 |
| 537 if (object.needsPaintPropertyUpdate()) { | 514 if (object.needsPaintPropertyUpdate()) { |
| 538 const LayoutBox& box = toLayoutBox(object); | 515 const LayoutBox& box = toLayoutBox(object); |
| 539 // The <input> elements can't have contents thus CSS overflow property | 516 // The <input> elements can't have contents thus CSS overflow property |
| 540 // doesn't apply. However for layout purposes we do generate child layout | 517 // doesn't apply. However for layout purposes we do generate child layout |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 context.current.transform, matrix, FloatPoint3D(), | 645 context.current.transform, matrix, FloatPoint3D(), |
| 669 context.current.shouldFlattenInheritedTransform, | 646 context.current.shouldFlattenInheritedTransform, |
| 670 context.current.renderingContextID); | 647 context.current.renderingContextID); |
| 671 | 648 |
| 672 IntSize scrollClip = scrollableArea->visibleContentRect().size(); | 649 IntSize scrollClip = scrollableArea->visibleContentRect().size(); |
| 673 IntSize scrollBounds = scrollableArea->contentsSize(); | 650 IntSize scrollBounds = scrollableArea->contentsSize(); |
| 674 bool userScrollableHorizontal = | 651 bool userScrollableHorizontal = |
| 675 scrollableArea->userInputScrollable(HorizontalScrollbar); | 652 scrollableArea->userInputScrollable(HorizontalScrollbar); |
| 676 bool userScrollableVertical = | 653 bool userScrollableVertical = |
| 677 scrollableArea->userInputScrollable(VerticalScrollbar); | 654 scrollableArea->userInputScrollable(VerticalScrollbar); |
| 655 bool threadedScrollingDisabled = | |
| 656 !object.document().settings()->threadedScrollingEnabled(); | |
| 657 // Checking for descendants in the layout tree has two downsides: | |
| 658 // 1) There can be more descendants in layout order than in paint | |
| 659 // order (e.g., fixed position objects). | |
| 660 // 2) Iterating overall all background attachment fixed objects for | |
| 661 // every scroll node can be slow, though there will be no objects | |
| 662 // in the common case. | |
| 663 bool hasBackgroundAttachmentFixedDescendants = | |
| 664 object.frameView()->hasBackgroundAttachmentFixedDescendants(object); | |
| 678 object.getMutableForPainting().ensurePaintProperties().updateScroll( | 665 object.getMutableForPainting().ensurePaintProperties().updateScroll( |
| 679 context.current.scroll, | 666 context.current.scroll, |
| 680 object.paintProperties()->scrollTranslation(), scrollClip, | 667 object.paintProperties()->scrollTranslation(), scrollClip, |
| 681 scrollBounds, userScrollableHorizontal, userScrollableVertical); | 668 scrollBounds, userScrollableHorizontal, userScrollableVertical, |
| 669 threadedScrollingDisabled, hasBackgroundAttachmentFixedDescendants); | |
| 682 } else { | 670 } else { |
| 683 // Ensure pre-existing properties are cleared when there is no | 671 // Ensure pre-existing properties are cleared when there is no |
| 684 // scrolling. | 672 // scrolling. |
| 685 auto* properties = object.getMutableForPainting().paintProperties(); | 673 auto* properties = object.getMutableForPainting().paintProperties(); |
| 686 if (properties) { | 674 if (properties) { |
| 687 properties->clearScrollTranslation(); | 675 properties->clearScrollTranslation(); |
| 688 properties->clearScroll(); | 676 properties->clearScroll(); |
| 689 } | 677 } |
| 690 } | 678 } |
| 691 } | 679 } |
| 692 } | 680 } |
| 693 | 681 |
| 694 if (object.paintProperties() && object.paintProperties()->scroll()) { | 682 if (object.paintProperties() && object.paintProperties()->scroll()) { |
| 695 context.current.transform = object.paintProperties()->scrollTranslation(); | 683 context.current.transform = object.paintProperties()->scrollTranslation(); |
| 696 const auto* scroll = object.paintProperties()->scroll(); | 684 context.current.scroll = object.paintProperties()->scroll(); |
| 697 // TODO(pdr): Remove this const cast. | |
| 698 context.current.scroll = const_cast<ScrollPaintPropertyNode*>(scroll); | |
| 699 context.current.shouldFlattenInheritedTransform = false; | 685 context.current.shouldFlattenInheritedTransform = false; |
| 700 } | 686 } |
| 701 } | 687 } |
| 702 | 688 |
| 703 void PaintPropertyTreeBuilder::updateOutOfFlowContext( | 689 void PaintPropertyTreeBuilder::updateOutOfFlowContext( |
| 704 const LayoutObject& object, | 690 const LayoutObject& object, |
| 705 PaintPropertyTreeBuilderContext& context) { | 691 PaintPropertyTreeBuilderContext& context) { |
| 706 if (object.canContainAbsolutePositionObjects()) { | 692 if (object.canContainAbsolutePositionObjects()) { |
| 707 context.absolutePosition = context.current; | 693 context.absolutePosition = context.current; |
| 708 context.containerForAbsolutePosition = &object; | 694 context.containerForAbsolutePosition = &object; |
| 709 } | 695 } |
| 710 | 696 |
| 711 if (object.isLayoutView()) { | 697 if (object.isLayoutView()) { |
| 712 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 698 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 713 const auto* initialFixedTransform = context.fixedPosition.transform; | 699 const auto* initialFixedTransform = context.fixedPosition.transform; |
| 714 auto* initialFixedScroll = context.fixedPosition.scroll; | 700 const auto* initialFixedScroll = context.fixedPosition.scroll; |
| 715 | 701 |
| 716 context.fixedPosition = context.current; | 702 context.fixedPosition = context.current; |
| 717 | 703 |
| 718 // Fixed position transform and scroll nodes should not be affected. | 704 // Fixed position transform and scroll nodes should not be affected. |
| 719 context.fixedPosition.transform = initialFixedTransform; | 705 context.fixedPosition.transform = initialFixedTransform; |
| 720 context.fixedPosition.scroll = initialFixedScroll; | 706 context.fixedPosition.scroll = initialFixedScroll; |
| 721 } | 707 } |
| 722 } else if (object.canContainFixedPositionObjects()) { | 708 } else if (object.canContainFixedPositionObjects()) { |
| 723 context.fixedPosition = context.current; | 709 context.fixedPosition = context.current; |
| 724 } else if (object.getMutableForPainting().paintProperties() && | 710 } else if (object.getMutableForPainting().paintProperties() && |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 780 containingBlock.paintProperties()->localBorderBoxProperties(); | 766 containingBlock.paintProperties()->localBorderBoxProperties(); |
| 781 DCHECK(properties); | 767 DCHECK(properties); |
| 782 | 768 |
| 783 context.transform = properties->propertyTreeState.transform(); | 769 context.transform = properties->propertyTreeState.transform(); |
| 784 context.paintOffset = properties->paintOffset; | 770 context.paintOffset = properties->paintOffset; |
| 785 context.shouldFlattenInheritedTransform = | 771 context.shouldFlattenInheritedTransform = |
| 786 context.transform && context.transform->flattensInheritedTransform(); | 772 context.transform && context.transform->flattensInheritedTransform(); |
| 787 context.renderingContextID = | 773 context.renderingContextID = |
| 788 context.transform ? context.transform->renderingContextID() : 0; | 774 context.transform ? context.transform->renderingContextID() : 0; |
| 789 context.clip = properties->propertyTreeState.clip(); | 775 context.clip = properties->propertyTreeState.clip(); |
| 790 context.scroll = const_cast<ScrollPaintPropertyNode*>( | 776 context.scroll = properties->propertyTreeState.scroll(); |
| 791 properties->propertyTreeState.scroll()); | |
| 792 } | 777 } |
| 793 | 778 |
| 794 static void deriveBorderBoxFromContainerContext( | 779 static void deriveBorderBoxFromContainerContext( |
| 795 const LayoutObject& object, | 780 const LayoutObject& object, |
| 796 PaintPropertyTreeBuilderContext& context) { | 781 PaintPropertyTreeBuilderContext& context) { |
| 797 if (!object.isBoxModelObject()) | 782 if (!object.isBoxModelObject()) |
| 798 return; | 783 return; |
| 799 | 784 |
| 800 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); | 785 const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object); |
| 801 | 786 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 890 #endif | 875 #endif |
| 891 | 876 |
| 892 deriveBorderBoxFromContainerContext(object, context); | 877 deriveBorderBoxFromContainerContext(object, context); |
| 893 | 878 |
| 894 updatePaintOffsetTranslation(object, context); | 879 updatePaintOffsetTranslation(object, context); |
| 895 updateTransform(object, context); | 880 updateTransform(object, context); |
| 896 updateEffect(object, context); | 881 updateEffect(object, context); |
| 897 updateCssClip(object, context); | 882 updateCssClip(object, context); |
| 898 updateLocalBorderBoxContext(object, context); | 883 updateLocalBorderBoxContext(object, context); |
| 899 updateScrollbarPaintOffset(object, context); | 884 updateScrollbarPaintOffset(object, context); |
| 900 updateMainThreadScrollingReasons(object, context); | |
| 901 } | 885 } |
| 902 | 886 |
| 903 void PaintPropertyTreeBuilder::updatePropertiesForChildren( | 887 void PaintPropertyTreeBuilder::updatePropertiesForChildren( |
| 904 const LayoutObject& object, | 888 const LayoutObject& object, |
| 905 PaintPropertyTreeBuilderContext& context) { | 889 PaintPropertyTreeBuilderContext& context) { |
| 906 if (!object.isBoxModelObject() && !object.isSVG()) | 890 if (!object.isBoxModelObject() && !object.isSVG()) |
| 907 return; | 891 return; |
| 908 | 892 |
| 909 #if DCHECK_IS_ON() | 893 #if DCHECK_IS_ON() |
| 910 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object); | 894 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object); |
| 911 #endif | 895 #endif |
| 912 | 896 |
| 913 updateOverflowClip(object, context); | 897 updateOverflowClip(object, context); |
| 914 updatePerspective(object, context); | 898 updatePerspective(object, context); |
| 915 updateSvgLocalToBorderBoxTransform(object, context); | 899 updateSvgLocalToBorderBoxTransform(object, context); |
| 916 updateScrollAndScrollTranslation(object, context); | 900 updateScrollAndScrollTranslation(object, context); |
| 917 updateOutOfFlowContext(object, context); | 901 updateOutOfFlowContext(object, context); |
| 918 } | 902 } |
| 919 | 903 |
| 920 } // namespace blink | 904 } // namespace blink |
| OLD | NEW |