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

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

Issue 2602823002: Validate objects are a box when clipping layers for clip-path. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/clip/clip-path-inline-element-crash-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index e14024d9ff0f58b6c2b25fa6c38a0eb535f3502b..593f586be5e0e62f806386fc44b172ede81ac74a 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -967,7 +967,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(
// If we have a layer that clips children, position it.
IntRect clippingBox;
- if (m_childContainmentLayer)
+ if (m_childContainmentLayer && layoutObject()->isBox())
clippingBox = clipBox(toLayoutBox(layoutObject()));
updateChildTransformLayerGeometry();
@@ -1043,7 +1043,8 @@ void CompositedLayerMapping::computeGraphicsLayerParentLocation(
const IntRect& ancestorCompositingBounds,
IntPoint& graphicsLayerParentLocation) {
if (compositingContainer &&
- compositingContainer->compositedLayerMapping()->hasClippingLayer()) {
+ compositingContainer->compositedLayerMapping()->hasClippingLayer() &&
+ compositingContainer->layoutObject()->isBox()) {
// If the compositing ancestor has a layer to clip children, we parent in
// that, and therefore position relative to it.
IntRect clippingBox =
@@ -1360,7 +1361,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry(
}
void CompositedLayerMapping::updateChildClippingMaskLayerGeometry() {
- if (!m_childClippingMaskLayer || !layoutObject()->style()->clipPath())
+ if (!m_childClippingMaskLayer || !layoutObject()->style()->clipPath() ||
+ !layoutObject()->isBox())
return;
LayoutBox* layoutBox = toLayoutBox(layoutObject());
IntRect clientBox = enclosingIntRect(layoutBox->clientBoxRect());
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/clip/clip-path-inline-element-crash-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698