Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2127663002: Adjust background clip when local attachment is used with non-visible overflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restrict to the padding box rect when attachment is local on scrollable element. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect()); 91 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect());
92 } 92 }
93 93
94 static IntRect backgroundRect(const LayoutObject* layoutObject) 94 static IntRect backgroundRect(const LayoutObject* layoutObject)
95 { 95 {
96 if (!layoutObject->isBox()) 96 if (!layoutObject->isBox())
97 return IntRect(); 97 return IntRect();
98 98
99 LayoutRect rect; 99 LayoutRect rect;
100 const LayoutBox* box = toLayoutBox(layoutObject); 100 const LayoutBox* box = toLayoutBox(layoutObject);
101 EFillBox clip = box->style()->backgroundClip(); 101 return pixelSnappedIntRect(box->backgroundClipRect());
102 switch (clip) {
103 case BorderFillBox:
104 rect = box->borderBoxRect();
105 break;
106 case PaddingFillBox:
107 rect = box->paddingBoxRect();
108 break;
109 case ContentFillBox:
110 rect = box->contentBoxRect();
111 break;
112 case TextFillBox:
113 break;
114 }
115
116 return pixelSnappedIntRect(rect);
117 } 102 }
118 103
119 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject) 104 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject)
120 { 105 {
121 if (layoutObject->isCanvas()) { 106 if (layoutObject->isCanvas()) {
122 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); 107 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
123 if (CanvasRenderingContext* context = canvas->renderingContext()) 108 if (CanvasRenderingContext* context = canvas->renderingContext())
124 return context->isAccelerated(); 109 return context->isAccelerated();
125 } 110 }
126 return false; 111 return false;
(...skipping 2542 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2654 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2670 name = "Scrolling Contents Layer"; 2655 name = "Scrolling Contents Layer";
2671 } else { 2656 } else {
2672 ASSERT_NOT_REACHED(); 2657 ASSERT_NOT_REACHED();
2673 } 2658 }
2674 2659
2675 return name; 2660 return name;
2676 } 2661 }
2677 2662
2678 } // namespace blink 2663 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698