| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 | 608 |
| 609 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 609 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
| 610 const LayoutBox& box = toLayoutBox(object); | 610 const LayoutBox& box = toLayoutBox(object); |
| 611 // The <input> elements can't have contents thus CSS overflow property | 611 // The <input> elements can't have contents thus CSS overflow property |
| 612 // doesn't apply. However for layout purposes we do generate child layout | 612 // doesn't apply. However for layout purposes we do generate child layout |
| 613 // objects for them, e.g. button label. We should clip the overflow from | 613 // objects for them, e.g. button label. We should clip the overflow from |
| 614 // those children. This is called control clip and we technically treat them | 614 // those children. This is called control clip and we technically treat them |
| 615 // like overflow clip. | 615 // like overflow clip. |
| 616 LayoutRect clipRect; | 616 LayoutRect clipRect; |
| 617 if (box.shouldClipOverflow()) { | 617 if (box.shouldClipOverflow()) { |
| 618 clipRect = LayoutRect(box.overflowClipRect(context.current.paintOffset)); | 618 clipRect = LayoutRect(pixelSnappedIntRect( |
| 619 box.overflowClipRect(context.current.paintOffset))); |
| 619 } else { | 620 } else { |
| 620 if (auto* properties = object.getMutableForPainting().paintProperties()) { | 621 if (auto* properties = object.getMutableForPainting().paintProperties()) { |
| 621 context.forceSubtreeUpdate |= properties->clearInnerBorderRadiusClip(); | 622 context.forceSubtreeUpdate |= properties->clearInnerBorderRadiusClip(); |
| 622 context.forceSubtreeUpdate |= properties->clearOverflowClip(); | 623 context.forceSubtreeUpdate |= properties->clearOverflowClip(); |
| 623 } | 624 } |
| 624 return; | 625 return; |
| 625 } | 626 } |
| 626 | 627 |
| 627 auto& properties = object.getMutableForPainting().ensurePaintProperties(); | 628 auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| 628 const auto* currentClip = context.current.clip; | 629 const auto* currentClip = context.current.clip; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 updateOverflowClip(object, context); | 976 updateOverflowClip(object, context); |
| 976 updatePerspective(object, context); | 977 updatePerspective(object, context); |
| 977 updateSvgLocalToBorderBoxTransform(object, context); | 978 updateSvgLocalToBorderBoxTransform(object, context); |
| 978 updateScrollAndScrollTranslation(object, context); | 979 updateScrollAndScrollTranslation(object, context); |
| 979 updateOutOfFlowContext(object, context); | 980 updateOutOfFlowContext(object, context); |
| 980 | 981 |
| 981 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 982 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 982 } | 983 } |
| 983 | 984 |
| 984 } // namespace blink | 985 } // namespace blink |
| OLD | NEW |