Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp b/third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp |
| index cd52e66b8a434a7d42469e8b5fc7a64da3d4b0e8..94ccfa7805754de07de49346232121fd8abf2175 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp |
| @@ -57,13 +57,15 @@ void LayoutHTMLCanvas::canvasSizeChanged() |
| IntSize canvasSize = toHTMLCanvasElement(node())->size(); |
| LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasSize.height() * style()->effectiveZoom()); |
| - if (zoomedSize == intrinsicSize()) |
| + if (zoomedSize == intrinsicSize()) { |
|
eae
2016/06/29 20:20:13
Please either revert this style only change or cha
cbiesinger
2016/06/29 20:36:51
Ah, oops, that was an accidental leftover.
|
| return; |
| + } |
| setIntrinsicSize(zoomedSize); |
| - if (!parent()) |
| + if (!parent()) { |
| return; |
| + } |
| if (!preferredLogicalWidthsDirty()) |
| setPreferredLogicalWidthsDirty(); |
| @@ -71,8 +73,13 @@ void LayoutHTMLCanvas::canvasSizeChanged() |
| LayoutSize oldSize = size(); |
| updateLogicalWidth(); |
| updateLogicalHeight(); |
| - if (oldSize == size()) |
| + if (oldSize == size() && !hasOverrideLogicalContentWidth() && !hasOverrideLogicalContentHeight()) { |
| + // If we have an override size, then we're probably a flex item, and the |
|
eae
2016/06/29 20:20:13
Nice comment!
|
| + // check above is insufficient because updateLogical{Width,Height} just |
| + // used the override size. We actually have to mark ourselves as needing |
| + // layout so the flex algorithm can run and compute our size correctly. |
| return; |
| + } |
| if (!selfNeedsLayout()) |
| setNeedsLayout(LayoutInvalidationReason::SizeChanged); |