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

Side by Side 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: review comments Created 4 years, 5 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 | « third_party/WebKit/LayoutTests/css3/flexbox/canvas-dynamic-change.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) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 if (!parent()) 65 if (!parent())
66 return; 66 return;
67 67
68 if (!preferredLogicalWidthsDirty()) 68 if (!preferredLogicalWidthsDirty())
69 setPreferredLogicalWidthsDirty(); 69 setPreferredLogicalWidthsDirty();
70 70
71 LayoutSize oldSize = size(); 71 LayoutSize oldSize = size();
72 updateLogicalWidth(); 72 updateLogicalWidth();
73 updateLogicalHeight(); 73 updateLogicalHeight();
74 if (oldSize == size()) 74 if (oldSize == size() && !hasOverrideLogicalContentWidth() && !hasOverrideLo gicalContentHeight()) {
75 // If we have an override size, then we're probably a flex item, and the
76 // check above is insufficient because updateLogical{Width,Height} just
77 // used the override size. We actually have to mark ourselves as needing
78 // layout so the flex algorithm can run and compute our size correctly.
75 return; 79 return;
80 }
76 81
77 if (!selfNeedsLayout()) 82 if (!selfNeedsLayout())
78 setNeedsLayout(LayoutInvalidationReason::SizeChanged); 83 setNeedsLayout(LayoutInvalidationReason::SizeChanged);
79 } 84 }
80 85
81 PaintInvalidationReason LayoutHTMLCanvas::invalidatePaintIfNeeded(const PaintInv alidationState& paintInvalidationState) 86 PaintInvalidationReason LayoutHTMLCanvas::invalidatePaintIfNeeded(const PaintInv alidationState& paintInvalidationState)
82 { 87 {
83 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv alidationState); 88 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv alidationState);
84 HTMLCanvasElement* element = toHTMLCanvasElement(node()); 89 HTMLCanvasElement* element = toHTMLCanvasElement(node());
85 if (element->isDirty()) { 90 if (element->isDirty()) {
(...skipping 11 matching lines...) Expand all
97 return CompositingReasonNone; 102 return CompositingReasonNone;
98 } 103 }
99 104
100 void LayoutHTMLCanvas::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle) 105 void LayoutHTMLCanvas::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
101 { 106 {
102 LayoutReplaced::styleDidChange(diff, oldStyle); 107 LayoutReplaced::styleDidChange(diff, oldStyle);
103 toHTMLCanvasElement(node())->styleDidChange(oldStyle, styleRef()); 108 toHTMLCanvasElement(node())->styleDidChange(oldStyle, styleRef());
104 } 109 }
105 110
106 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/canvas-dynamic-change.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698