OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 #include "core/frame/LocalFrameView.h" | 47 #include "core/frame/LocalFrameView.h" |
48 #include "core/frame/Settings.h" | 48 #include "core/frame/Settings.h" |
49 #include "core/layout/LayoutView.h" | 49 #include "core/layout/LayoutView.h" |
50 #include "core/paint/ObjectPaintProperties.h" | 50 #include "core/paint/ObjectPaintProperties.h" |
51 #include "core/paint/PaintLayer.h" | 51 #include "core/paint/PaintLayer.h" |
52 #include "platform/graphics/paint/GeometryMapper.h" | 52 #include "platform/graphics/paint/GeometryMapper.h" |
53 | 53 |
54 namespace blink { | 54 namespace blink { |
55 | 55 |
56 static bool HasOverflowClip( | 56 static bool HasOverflowClip(const PaintLayer& layer) { |
57 const PaintLayer& layer) { | |
58 if (!layer.GetLayoutObject().IsBox()) | 57 if (!layer.GetLayoutObject().IsBox()) |
59 return false; | 58 return false; |
60 const LayoutBox& box = ToLayoutBox(layer.GetLayoutObject()); | 59 const LayoutBox& box = ToLayoutBox(layer.GetLayoutObject()); |
61 return box.ShouldClipOverflow(); | 60 return box.ShouldClipOverflow(); |
62 } | 61 } |
63 | 62 |
64 bool ClipRectsContext::ShouldRespectRootLayerClip() const { | 63 bool ClipRectsContext::ShouldRespectRootLayerClip() const { |
65 if (respect_overflow_clip == kIgnoreOverflowClip) | 64 if (respect_overflow_clip == kIgnoreOverflowClip) |
66 return false; | 65 return false; |
67 | 66 |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 *context.root_layer->GetLayoutObject().LocalBorderBoxProperties(); | 485 *context.root_layer->GetLayoutObject().LocalBorderBoxProperties(); |
487 | 486 |
488 auto* ancestor_properties = | 487 auto* ancestor_properties = |
489 context.root_layer->GetLayoutObject().PaintProperties(); | 488 context.root_layer->GetLayoutObject().PaintProperties(); |
490 if (!ancestor_properties) | 489 if (!ancestor_properties) |
491 return; | 490 return; |
492 | 491 |
493 if (context.ShouldRespectRootLayerClip()) { | 492 if (context.ShouldRespectRootLayerClip()) { |
494 const auto* ancestor_css_clip = ancestor_properties->CssClip(); | 493 const auto* ancestor_css_clip = ancestor_properties->CssClip(); |
495 if (ancestor_css_clip) { | 494 if (ancestor_css_clip) { |
496 DCHECK_EQ(destination_property_tree_state.Clip(), | 495 DCHECK_EQ(destination_property_tree_state.Clip(), ancestor_css_clip); |
497 ancestor_css_clip); | |
498 destination_property_tree_state.SetClip(ancestor_css_clip->Parent()); | 496 destination_property_tree_state.SetClip(ancestor_css_clip->Parent()); |
499 } | 497 } |
500 } else { | 498 } else { |
501 const auto* ancestor_overflow_clip = ancestor_properties->OverflowClip(); | 499 const auto* ancestor_overflow_clip = ancestor_properties->OverflowClip(); |
502 if (ancestor_overflow_clip) { | 500 if (ancestor_overflow_clip) { |
503 DCHECK_EQ(destination_property_tree_state.Clip(), | 501 DCHECK_EQ(destination_property_tree_state.Clip(), |
504 ancestor_overflow_clip->Parent()); | 502 ancestor_overflow_clip->Parent()); |
505 destination_property_tree_state.SetClip(ancestor_overflow_clip); | 503 destination_property_tree_state.SetClip(ancestor_overflow_clip); |
506 } | 504 } |
507 } | 505 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 DCHECK(!use_geometry_mapper_); | 586 DCHECK(!use_geometry_mapper_); |
589 ClipRectsContext context(root_layer, kPaintingClipRects, | 587 ClipRectsContext context(root_layer, kPaintingClipRects, |
590 kIgnorePlatformOverlayScrollbarSize, | 588 kIgnorePlatformOverlayScrollbarSize, |
591 subpixel_accumulation); | 589 subpixel_accumulation); |
592 if (respect_overflow_clip == kIgnoreOverflowClip) | 590 if (respect_overflow_clip == kIgnoreOverflowClip) |
593 context.SetIgnoreOverflowClip(); | 591 context.SetIgnoreOverflowClip(); |
594 return GetClipRects(context); | 592 return GetClipRects(context); |
595 } | 593 } |
596 | 594 |
597 } // namespace blink | 595 } // namespace blink |
OLD | NEW |