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

Unified Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1147363009: Use replacedContentBox for LayoutHTMLCanvas when deciding PaintLayer's contentBox. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated the test Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
diff --git a/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp b/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
index fc2c90301e5f2cb76329c407751128477f965ec3..2296bfca73d9705ae87f64251b6cd97b1aa83872 100644
--- a/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
+++ b/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
@@ -39,6 +39,7 @@
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/layout/LayoutEmbeddedObject.h"
+#include "core/layout/LayoutHTMLCanvas.h"
#include "core/layout/LayoutImage.h"
#include "core/layout/LayoutPart.h"
#include "core/layout/LayoutVideo.h"
@@ -74,10 +75,12 @@ static IntRect contentsRect(const LayoutObject* layoutObject)
{
if (!layoutObject->isBox())
return IntRect();
+ if (layoutObject->isCanvas())
+ return pixelSnappedIntRect(toLayoutHTMLCanvas(layoutObject)->replacedContentRect());
+ if (layoutObject->isVideo())
+ return toLayoutVideo(layoutObject)->videoBox();
- return layoutObject->isVideo() ?
- toLayoutVideo(layoutObject)->videoBox() :
- pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect());
+ return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect());
}
static IntRect backgroundRect(const LayoutObject* layoutObject)
« no previous file with comments | « LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698