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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.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 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return (BorderBefore() + PaddingBefore() + ContentLogicalHeight()).ToInt(); 469 return (BorderBefore() + PaddingBefore() + ContentLogicalHeight()).ToInt();
470 } 470 }
471 471
472 void LayoutTableCell::StyleDidChange(StyleDifference diff, 472 void LayoutTableCell::StyleDidChange(StyleDifference diff,
473 const ComputedStyle* old_style) { 473 const ComputedStyle* old_style) {
474 DCHECK_EQ(Style()->Display(), EDisplay::kTableCell); 474 DCHECK_EQ(Style()->Display(), EDisplay::kTableCell);
475 475
476 LayoutBlockFlow::StyleDidChange(diff, old_style); 476 LayoutBlockFlow::StyleDidChange(diff, old_style);
477 SetHasBoxDecorationBackground(true); 477 SetHasBoxDecorationBackground(true);
478 478
479 if (Parent() && Section() && old_style && 479 if (!old_style)
480 Style()->Height() != old_style->Height()) 480 return;
481
482 if (Parent() && Section() && Style()->Height() != old_style->Height())
481 Section()->RowLogicalHeightChanged(Row()); 483 Section()->RowLogicalHeightChanged(Row());
482 484
483 // Our intrinsic padding pushes us down to align with the baseline of other 485 // Our intrinsic padding pushes us down to align with the baseline of other
484 // cells on the row. If our vertical-align has changed then so will the 486 // cells on the row. If our vertical-align has changed then so will the
485 // padding needed to align with other cells - clear it so we can recalculate 487 // padding needed to align with other cells - clear it so we can recalculate
486 // it from scratch. 488 // it from scratch.
487 if (old_style && Style()->VerticalAlign() != old_style->VerticalAlign()) 489 if (Style()->VerticalAlign() != old_style->VerticalAlign())
488 ClearIntrinsicPadding(); 490 ClearIntrinsicPadding();
489 491
490 // If border was changed, notify table.
491 if (!Parent()) 492 if (!Parent())
492 return; 493 return;
493 LayoutTable* table = this->Table(); 494 LayoutTable* table = Table();
494 if (!table) 495 if (!table)
495 return; 496 return;
496 if (!table->SelfNeedsLayout() && !table->NormalChildNeedsLayout() && 497
497 old_style && old_style->Border() != Style()->Border()) 498 LayoutTableBoxComponent::InvalidateCollapsedBordersOnStyleChange(
498 table->InvalidateCollapsedBorders(); 499 *this, *table, diff, *old_style);
499 500
500 if (LayoutTableBoxComponent::DoCellsHaveDirtyWidth(*this, *table, diff, 501 if (LayoutTableBoxComponent::DoCellsHaveDirtyWidth(*this, *table, diff,
501 *old_style)) { 502 *old_style)) {
502 if (PreviousCell()) { 503 if (PreviousCell()) {
503 // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is 504 // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is
504 // needed instead of setNeedsLayout. 505 // needed instead of setNeedsLayout.
505 PreviousCell()->SetChildNeedsLayout(); 506 PreviousCell()->SetChildNeedsLayout();
506 PreviousCell()->SetPreferredLogicalWidthsDirty(kMarkOnlyThis); 507 PreviousCell()->SetPreferredLogicalWidthsDirty(kMarkOnlyThis);
507 } 508 }
508 if (NextCell()) { 509 if (NextCell()) {
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 } 1482 }
1482 1483
1483 bool LayoutTableCell::HasLineIfEmpty() const { 1484 bool LayoutTableCell::HasLineIfEmpty() const {
1484 if (GetNode() && HasEditableStyle(*GetNode())) 1485 if (GetNode() && HasEditableStyle(*GetNode()))
1485 return true; 1486 return true;
1486 1487
1487 return LayoutBlock::HasLineIfEmpty(); 1488 return LayoutBlock::HasLineIfEmpty();
1488 } 1489 }
1489 1490
1490 } // namespace blink 1491 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698