| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 525 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
| 526 const LayoutBox& box = toLayoutBox(object); | 526 const LayoutBox& box = toLayoutBox(object); |
| 527 // The <input> elements can't have contents thus CSS overflow property | 527 // The <input> elements can't have contents thus CSS overflow property |
| 528 // doesn't apply. However for layout purposes we do generate child layout | 528 // doesn't apply. However for layout purposes we do generate child layout |
| 529 // objects for them, e.g. button label. We should clip the overflow from | 529 // objects for them, e.g. button label. We should clip the overflow from |
| 530 // those children. This is called control clip and we technically treat them | 530 // those children. This is called control clip and we technically treat them |
| 531 // like overflow clip. | 531 // like overflow clip. |
| 532 LayoutRect clipRect; | 532 LayoutRect clipRect; |
| 533 if (box.hasControlClip()) { | 533 if (box.hasControlClip()) { |
| 534 clipRect = box.controlClipRect(context.current.paintOffset); | 534 clipRect = box.controlClipRect(context.current.paintOffset); |
| 535 } else if (box.hasOverflowClip() || box.styleRef().containsPaint() || | 535 } else if (box.shouldClipOverflow()) { |
| 536 (box.isSVGRoot() && | |
| 537 toLayoutSVGRoot(box).shouldApplyViewportClip())) { | |
| 538 clipRect = LayoutRect(pixelSnappedIntRect( | 536 clipRect = LayoutRect(pixelSnappedIntRect( |
| 539 box.overflowClipRect(context.current.paintOffset))); | 537 box.overflowClipRect(context.current.paintOffset))); |
| 540 } else { | 538 } else { |
| 541 if (auto* properties = object.getMutableForPainting().paintProperties()) { | 539 if (auto* properties = object.getMutableForPainting().paintProperties()) { |
| 542 context.forceSubtreeUpdate |= properties->clearInnerBorderRadiusClip(); | 540 context.forceSubtreeUpdate |= properties->clearInnerBorderRadiusClip(); |
| 543 context.forceSubtreeUpdate |= properties->clearOverflowClip(); | 541 context.forceSubtreeUpdate |= properties->clearOverflowClip(); |
| 544 } | 542 } |
| 545 return; | 543 return; |
| 546 } | 544 } |
| 547 | 545 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 #endif | 905 #endif |
| 908 | 906 |
| 909 updateOverflowClip(object, context); | 907 updateOverflowClip(object, context); |
| 910 updatePerspective(object, context); | 908 updatePerspective(object, context); |
| 911 updateSvgLocalToBorderBoxTransform(object, context); | 909 updateSvgLocalToBorderBoxTransform(object, context); |
| 912 updateScrollAndScrollTranslation(object, context); | 910 updateScrollAndScrollTranslation(object, context); |
| 913 updateOutOfFlowContext(object, context); | 911 updateOutOfFlowContext(object, context); |
| 914 } | 912 } |
| 915 | 913 |
| 916 } // namespace blink | 914 } // namespace blink |
| OLD | NEW |