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/layout/svg/SVGLayoutSupport.h" | |
13 #include "core/paint/FindPropertiesNeedingUpdate.h" | 14 #include "core/paint/FindPropertiesNeedingUpdate.h" |
14 #include "core/paint/ObjectPaintProperties.h" | 15 #include "core/paint/ObjectPaintProperties.h" |
15 #include "core/paint/PaintLayer.h" | 16 #include "core/paint/PaintLayer.h" |
16 #include "core/paint/SVGRootPainter.h" | 17 #include "core/paint/SVGRootPainter.h" |
17 #include "platform/transforms/TransformationMatrix.h" | 18 #include "platform/transforms/TransformationMatrix.h" |
18 #include "wtf/PtrUtil.h" | 19 #include "wtf/PtrUtil.h" |
19 #include <memory> | 20 #include <memory> |
20 | 21 |
21 namespace blink { | 22 namespace blink { |
22 | 23 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 context.current.shouldFlattenInheritedTransform = true; | 362 context.current.shouldFlattenInheritedTransform = true; |
362 } | 363 } |
363 } | 364 } |
364 } | 365 } |
365 | 366 |
366 void PaintPropertyTreeBuilder::updateEffect( | 367 void PaintPropertyTreeBuilder::updateEffect( |
367 const LayoutObject& object, | 368 const LayoutObject& object, |
368 PaintPropertyTreeBuilderContext& context) { | 369 PaintPropertyTreeBuilderContext& context) { |
369 const ComputedStyle& style = object.styleRef(); | 370 const ComputedStyle& style = object.styleRef(); |
370 | 371 |
371 // TODO(crbug.com/673500): style.isStackingContext() is only meaningful for | 372 const bool isIsolatedGroup = |
372 // HTML elements. What we really want to ask is whether the element starts | 373 (object.isSVG() && !object.isSVGRoot()) |
373 // an isolated group, and SVGs use a different rule. | 374 ? SVGLayoutSupport::willIsolateBlendingDescendantsForObject(&object) |
374 if (!style.isStackingContext()) { | 375 : (object.isBoxModelObject() && style.isStackingContext()); |
376 const bool isSVGGraphicsElement = | |
chrishtr
2016/12/15 19:21:23
Why skip SVG graphics elements?
trchen
2016/12/15 23:49:46
It is to include SVG graphics elements. SVGLayoutS
| |
377 object.isSVGShape() || object.isSVGImage() || object.isSVGText(); | |
378 if (!isIsolatedGroup && !isSVGGraphicsElement) { | |
375 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 379 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
376 if (auto* properties = object.getMutableForPainting().paintProperties()) | 380 if (auto* properties = object.getMutableForPainting().paintProperties()) |
377 context.forceSubtreeUpdate |= properties->clearEffect(); | 381 context.forceSubtreeUpdate |= properties->clearEffect(); |
378 } | 382 } |
379 return; | 383 return; |
380 } | 384 } |
381 | 385 |
382 // TODO(trchen): Can't omit effect node if we have 3D children. | 386 // TODO(trchen): Can't omit effect node if we have 3D children. |
383 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 387 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
384 bool effectNodeNeeded = false; | 388 bool effectNodeNeeded = false; |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
928 #endif | 932 #endif |
929 | 933 |
930 updateOverflowClip(object, context); | 934 updateOverflowClip(object, context); |
931 updatePerspective(object, context); | 935 updatePerspective(object, context); |
932 updateSvgLocalToBorderBoxTransform(object, context); | 936 updateSvgLocalToBorderBoxTransform(object, context); |
933 updateScrollAndScrollTranslation(object, context); | 937 updateScrollAndScrollTranslation(object, context); |
934 updateOutOfFlowContext(object, context); | 938 updateOutOfFlowContext(object, context); |
935 } | 939 } |
936 | 940 |
937 } // namespace blink | 941 } // namespace blink |
OLD | NEW |