| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutTableBoxComponent.h" | 5 #include "core/layout/LayoutTableBoxComponent.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutTable.h" | 7 #include "core/layout/LayoutTable.h" |
| 8 #include "core/style/ComputedStyle.h" | 8 #include "core/style/ComputedStyle.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 void LayoutTableBoxComponent::styleDidChange(StyleDifference diff, | |
| 13 const ComputedStyle* oldStyle) { | |
| 14 LayoutBox::styleDidChange(diff, oldStyle); | |
| 15 | |
| 16 if (parent() && oldStyle) { | |
| 17 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != | |
| 18 resolveColor(CSSPropertyBackgroundColor) || | |
| 19 oldStyle->backgroundLayers() != styleRef().backgroundLayers()) | |
| 20 m_backgroundChangedSinceLastPaintInvalidation = true; | |
| 21 } | |
| 22 } | |
| 23 | |
| 24 void LayoutTableBoxComponent::imageChanged(WrappedImagePtr, const IntRect*) { | |
| 25 setShouldDoFullPaintInvalidation(); | |
| 26 m_backgroundChangedSinceLastPaintInvalidation = true; | |
| 27 } | |
| 28 | |
| 29 bool LayoutTableBoxComponent::doCellsHaveDirtyWidth( | 12 bool LayoutTableBoxComponent::doCellsHaveDirtyWidth( |
| 30 const LayoutObject& tablePart, | 13 const LayoutObject& tablePart, |
| 31 const LayoutTable& table, | 14 const LayoutTable& table, |
| 32 const StyleDifference& diff, | 15 const StyleDifference& diff, |
| 33 const ComputedStyle& oldStyle) { | 16 const ComputedStyle& oldStyle) { |
| 34 // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayout | 17 // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayout |
| 35 // when border sizes change: checking diff.needsFullLayout() is an | 18 // when border sizes change: checking diff.needsFullLayout() is an |
| 36 // optimization, not required for correctness. | 19 // optimization, not required for correctness. |
| 37 // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old | 20 // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old |
| 38 // optimization but now it seems that diff.needsFullLayout() implies | 21 // optimization but now it seems that diff.needsFullLayout() implies |
| 39 // tablePart.needsLayout(). | 22 // tablePart.needsLayout(). |
| 40 return diff.needsFullLayout() && tablePart.needsLayout() && | 23 return diff.needsFullLayout() && tablePart.needsLayout() && |
| 41 table.collapseBorders() && | 24 table.collapseBorders() && |
| 42 !oldStyle.border().sizeEquals(tablePart.style()->border()); | 25 !oldStyle.border().sizeEquals(tablePart.style()->border()); |
| 43 } | 26 } |
| 44 | 27 |
| 45 } // namespace blink | 28 } // namespace blink |
| OLD | NEW |