| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |