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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp

Issue 2153283002: [css-tables] Clean up code that detects significant border changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the big refactor 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
OLDNEW
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/style/ComputedStyle.h" 8 #include "core/style/ComputedStyle.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 void LayoutTableBoxComponent::styleDidChange(StyleDifference diff, const Compute dStyle* oldStyle) 12 void LayoutTableBoxComponent::styleDidChange(StyleDifference diff, const Compute dStyle* oldStyle)
12 { 13 {
13 LayoutBox::styleDidChange(diff, oldStyle); 14 LayoutBox::styleDidChange(diff, oldStyle);
14 15
15 if (parent() && oldStyle) { 16 if (parent() && oldStyle) {
16 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != resolveColor( CSSPropertyBackgroundColor) 17 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != resolveColor( CSSPropertyBackgroundColor)
17 || oldStyle->backgroundLayers() != styleRef().backgroundLayers()) 18 || oldStyle->backgroundLayers() != styleRef().backgroundLayers())
18 m_backgroundChangedSinceLastPaintInvalidation = true; 19 m_backgroundChangedSinceLastPaintInvalidation = true;
19 } 20 }
20 } 21 }
21 22
22 void LayoutTableBoxComponent::imageChanged(WrappedImagePtr, const IntRect*) 23 void LayoutTableBoxComponent::imageChanged(WrappedImagePtr, const IntRect*)
23 { 24 {
24 setShouldDoFullPaintInvalidation(); 25 setShouldDoFullPaintInvalidation();
25 m_backgroundChangedSinceLastPaintInvalidation = true; 26 m_backgroundChangedSinceLastPaintInvalidation = true;
26 } 27 }
27 28
29 /*static*/ bool LayoutTableBoxComponent::doCellsHaveDirtyWidth(const LayoutObjec t& tablePart, const LayoutTable& table, const StyleDifference& diff, const Compu tedStyle& oldStyle)
eae 2016/07/18 16:21:53 Uncomment or remove static modifier.
dgrogan 2016/07/18 17:24:27 I removed it... it's only allowed to be specified
30 {
31 // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayo ut when border sizes
32 // change: checking diff.needsFullLayout() is an optimization, not required for correctness.
33 // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old opti mization but now it
34 // seems that diff.needsFullLayout() implies tablePart.needsLayout().
35 return diff.needsFullLayout() && tablePart.needsLayout() && table.collapseBo rders() && !oldStyle.border().sizeEquals(tablePart.style()->border());
36 }
37
28 } // namespace blink 38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698