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

Side by Side 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 unified diff | 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 »
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 21 matching lines...) Expand all
32 #include "core/fetch/ImageResource.h" 32 #include "core/fetch/ImageResource.h"
33 #include "core/frame/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/frame/RemoteFrame.h" 34 #include "core/frame/RemoteFrame.h"
35 #include "core/html/HTMLCanvasElement.h" 35 #include "core/html/HTMLCanvasElement.h"
36 #include "core/html/HTMLIFrameElement.h" 36 #include "core/html/HTMLIFrameElement.h"
37 #include "core/html/HTMLMediaElement.h" 37 #include "core/html/HTMLMediaElement.h"
38 #include "core/html/HTMLVideoElement.h" 38 #include "core/html/HTMLVideoElement.h"
39 #include "core/html/canvas/CanvasRenderingContext.h" 39 #include "core/html/canvas/CanvasRenderingContext.h"
40 #include "core/inspector/InspectorInstrumentation.h" 40 #include "core/inspector/InspectorInstrumentation.h"
41 #include "core/layout/LayoutEmbeddedObject.h" 41 #include "core/layout/LayoutEmbeddedObject.h"
42 #include "core/layout/LayoutHTMLCanvas.h"
42 #include "core/layout/LayoutImage.h" 43 #include "core/layout/LayoutImage.h"
43 #include "core/layout/LayoutPart.h" 44 #include "core/layout/LayoutPart.h"
44 #include "core/layout/LayoutVideo.h" 45 #include "core/layout/LayoutVideo.h"
45 #include "core/layout/LayoutView.h" 46 #include "core/layout/LayoutView.h"
46 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 47 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
47 #include "core/style/KeyframeList.h" 48 #include "core/style/KeyframeList.h"
48 #include "core/page/ChromeClient.h" 49 #include "core/page/ChromeClient.h"
49 #include "core/page/Page.h" 50 #include "core/page/Page.h"
50 #include "core/page/scrolling/ScrollingCoordinator.h" 51 #include "core/page/scrolling/ScrollingCoordinator.h"
51 #include "core/paint/DeprecatedPaintLayerPainter.h" 52 #include "core/paint/DeprecatedPaintLayerPainter.h"
(...skipping 15 matching lines...) Expand all
67 namespace blink { 68 namespace blink {
68 69
69 using namespace HTMLNames; 70 using namespace HTMLNames;
70 71
71 static IntRect clipBox(LayoutBox* layoutObject); 72 static IntRect clipBox(LayoutBox* layoutObject);
72 73
73 static IntRect contentsRect(const LayoutObject* layoutObject) 74 static IntRect contentsRect(const LayoutObject* layoutObject)
74 { 75 {
75 if (!layoutObject->isBox()) 76 if (!layoutObject->isBox())
76 return IntRect(); 77 return IntRect();
78 if (layoutObject->isCanvas())
79 return pixelSnappedIntRect(toLayoutHTMLCanvas(layoutObject)->replacedCon tentRect());
80 if (layoutObject->isVideo())
81 return toLayoutVideo(layoutObject)->videoBox();
77 82
78 return layoutObject->isVideo() ? 83 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect());
79 toLayoutVideo(layoutObject)->videoBox() :
80 pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect());
81 } 84 }
82 85
83 static IntRect backgroundRect(const LayoutObject* layoutObject) 86 static IntRect backgroundRect(const LayoutObject* layoutObject)
84 { 87 {
85 if (!layoutObject->isBox()) 88 if (!layoutObject->isBox())
86 return IntRect(); 89 return IntRect();
87 90
88 LayoutRect rect; 91 LayoutRect rect;
89 const LayoutBox* box = toLayoutBox(layoutObject); 92 const LayoutBox* box = toLayoutBox(layoutObject);
90 EFillBox clip = box->style()->backgroundClip(); 93 EFillBox clip = box->style()->backgroundClip();
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2345 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2343 name = "Scrolling Block Selection Layer"; 2346 name = "Scrolling Block Selection Layer";
2344 } else { 2347 } else {
2345 ASSERT_NOT_REACHED(); 2348 ASSERT_NOT_REACHED();
2346 } 2349 }
2347 2350
2348 return name; 2351 return name;
2349 } 2352 }
2350 2353
2351 } // namespace blink 2354 } // namespace blink
OLDNEW
« 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