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

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

Issue 2838643003: Invalidate collapsed borders using currentColor when color changes (Closed)
Patch Set: Created 3 years, 7 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/layout/LayoutTable.h"
8 #include "core/paint/ObjectPaintInvalidator.h" 8 #include "core/paint/ObjectPaintInvalidator.h"
9 #include "core/style/ComputedStyle.h" 9 #include "core/style/ComputedStyle.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 void LayoutTableBoxComponent::InvalidateCollapsedBordersOnStyleChange(
14 const LayoutObject& table_part,
15 LayoutTable& table,
16 const StyleDifference& diff,
17 const ComputedStyle& old_style) {
Xianzhu 2017/04/24 21:09:22 This doesn't include the !table->SelfNeedsLayout()
18 if (old_style.Border() != table_part.StyleRef().Border() ||
19 (diff.TextDecorationOrColorChanged() &&
20 table_part.StyleRef().HasBorderColorReferencingCurrentColor()))
21 table.InvalidateCollapsedBorders();
22 }
23
13 bool LayoutTableBoxComponent::DoCellsHaveDirtyWidth( 24 bool LayoutTableBoxComponent::DoCellsHaveDirtyWidth(
14 const LayoutObject& table_part, 25 const LayoutObject& table_part,
15 const LayoutTable& table, 26 const LayoutTable& table,
16 const StyleDifference& diff, 27 const StyleDifference& diff,
17 const ComputedStyle& old_style) { 28 const ComputedStyle& old_style) {
18 // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayout 29 // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayout
19 // when border sizes change: checking diff.needsFullLayout() is an 30 // when border sizes change: checking diff.needsFullLayout() is an
20 // optimization, not required for correctness. 31 // optimization, not required for correctness.
21 // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old 32 // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old
22 // optimization but now it seems that diff.needsFullLayout() implies 33 // optimization but now it seems that diff.needsFullLayout() implies
(...skipping 18 matching lines...) Expand all
41 auto& box = static_cast<LayoutTableBoxComponent&>(layout_object_); 52 auto& box = static_cast<LayoutTableBoxComponent&>(layout_object_);
42 if (box.last_paint_result_ != kFullyPainted && 53 if (box.last_paint_result_ != kFullyPainted &&
43 box.last_paint_rect_ != paint_rect) 54 box.last_paint_rect_ != paint_rect)
44 layout_object_.SetDisplayItemsUncached(); 55 layout_object_.SetDisplayItemsUncached();
45 56
46 box.last_paint_result_ = paint_result; 57 box.last_paint_result_ = paint_result;
47 box.last_paint_rect_ = paint_rect; 58 box.last_paint_rect_ = paint_rect;
48 } 59 }
49 60
50 } // namespace blink 61 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698