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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp

Issue 2111623002: Canvas objects did not mark themselves for layout when they're a flex item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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);

Powered by Google App Engine
This is Rietveld 408576698