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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 return; | 336 return; |
337 const LayoutBox& box = toLayoutBox(object); | 337 const LayoutBox& box = toLayoutBox(object); |
338 | 338 |
339 // The <input> elements can't have contents thus CSS overflow property doesn
't apply. | 339 // The <input> elements can't have contents thus CSS overflow property doesn
't apply. |
340 // However for layout purposes we do generate child layout objects for them,
e.g. button label. | 340 // However for layout purposes we do generate child layout objects for them,
e.g. button label. |
341 // We should clip the overflow from those children. This is called control c
lip and we | 341 // We should clip the overflow from those children. This is called control c
lip and we |
342 // technically treat them like overflow clip. | 342 // technically treat them like overflow clip. |
343 LayoutRect clipRect; | 343 LayoutRect clipRect; |
344 if (box.hasControlClip()) { | 344 if (box.hasControlClip()) { |
345 clipRect = box.controlClipRect(context.current.paintOffset); | 345 clipRect = box.controlClipRect(context.current.paintOffset); |
346 } else if (box.hasOverflowClip()) { | 346 } else if (box.hasOverflowClip() || (box.isSVGRoot() && toLayoutSVGRoot(box)
.shouldApplyViewportClip())) { |
347 clipRect = box.overflowClipRect(context.current.paintOffset); | 347 clipRect = box.overflowClipRect(context.current.paintOffset); |
348 } else { | 348 } else { |
349 if (ObjectPaintProperties* properties = object.getMutableForPainting().o
bjectPaintProperties()) | 349 if (ObjectPaintProperties* properties = object.getMutableForPainting().o
bjectPaintProperties()) |
350 properties->clearOverflowClip(); | 350 properties->clearOverflowClip(); |
351 return; | 351 return; |
352 } | 352 } |
353 | 353 |
354 // This need to be in top-level block to hold the reference until we finish
creating the normal clip node. | 354 // This need to be in top-level block to hold the reference until we finish
creating the normal clip node. |
355 RefPtr<ClipPaintPropertyNode> borderRadiusClip; | 355 RefPtr<ClipPaintPropertyNode> borderRadiusClip; |
356 if (box.styleRef().hasBorderRadius()) { | 356 if (box.styleRef().hasBorderRadius()) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 return; | 555 return; |
556 | 556 |
557 updateOverflowClip(object, context); | 557 updateOverflowClip(object, context); |
558 updatePerspective(object, context); | 558 updatePerspective(object, context); |
559 updateSvgLocalToBorderBoxTransform(object, context); | 559 updateSvgLocalToBorderBoxTransform(object, context); |
560 updateScrollAndScrollTranslation(object, context); | 560 updateScrollAndScrollTranslation(object, context); |
561 updateOutOfFlowContext(object, context); | 561 updateOutOfFlowContext(object, context); |
562 } | 562 } |
563 | 563 |
564 } // namespace blink | 564 } // namespace blink |
OLD | NEW |