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

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

Issue 2522923003: Reference table row via the cell for row background display item client. (Closed)
Patch Set: Integrate feedback. Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 return firstLineBaseline; 463 return firstLineBaseline;
464 return (borderBefore() + paddingBefore() + contentLogicalHeight()).toInt(); 464 return (borderBefore() + paddingBefore() + contentLogicalHeight()).toInt();
465 } 465 }
466 466
467 void LayoutTableCell::ensureIsReadyForPaintInvalidation() { 467 void LayoutTableCell::ensureIsReadyForPaintInvalidation() {
468 LayoutBlockFlow::ensureIsReadyForPaintInvalidation(); 468 LayoutBlockFlow::ensureIsReadyForPaintInvalidation();
469 if (!usesCompositedCellDisplayItemClients()) 469 if (!usesCompositedCellDisplayItemClients())
470 return; 470 return;
471 if (!m_rowBackgroundDisplayItemClient) { 471 if (!m_rowBackgroundDisplayItemClient) {
472 m_rowBackgroundDisplayItemClient = 472 m_rowBackgroundDisplayItemClient =
473 wrapUnique(new LayoutTableCell::RowBackgroundDisplayItemClient(*row())); 473 wrapUnique(new LayoutTableCell::RowBackgroundDisplayItemClient(*this));
474 } 474 }
475 } 475 }
476 476
477 void LayoutTableCell::styleDidChange(StyleDifference diff, 477 void LayoutTableCell::styleDidChange(StyleDifference diff,
478 const ComputedStyle* oldStyle) { 478 const ComputedStyle* oldStyle) {
479 DCHECK_EQ(style()->display(), EDisplay::TableCell); 479 DCHECK_EQ(style()->display(), EDisplay::TableCell);
480 480
481 LayoutBlockFlow::styleDidChange(diff, oldStyle); 481 LayoutBlockFlow::styleDidChange(diff, oldStyle);
482 setHasBoxDecorationBackground(true); 482 setHasBoxDecorationBackground(true);
483 483
(...skipping 29 matching lines...) Expand all
513 if (nextCell()) { 513 if (nextCell()) {
514 // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is 514 // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is
515 // needed instead of setNeedsLayout. 515 // needed instead of setNeedsLayout.
516 nextCell()->setChildNeedsLayout(); 516 nextCell()->setChildNeedsLayout();
517 nextCell()->setPreferredLogicalWidthsDirty(MarkOnlyThis); 517 nextCell()->setPreferredLogicalWidthsDirty(MarkOnlyThis);
518 } 518 }
519 } 519 }
520 } 520 }
521 521
522 LayoutTableCell::RowBackgroundDisplayItemClient::RowBackgroundDisplayItemClient( 522 LayoutTableCell::RowBackgroundDisplayItemClient::RowBackgroundDisplayItemClient(
523 const LayoutTableRow& layoutTableRow) 523 const LayoutTableCell& layoutTableCell)
524 : m_layoutTableRow(layoutTableRow) {} 524 : m_layoutTableCell(layoutTableCell) {}
525 525
526 String LayoutTableCell::RowBackgroundDisplayItemClient::debugName() const { 526 String LayoutTableCell::RowBackgroundDisplayItemClient::debugName() const {
527 return "RowBackground"; 527 return "RowBackground";
528 } 528 }
529 529
530 LayoutRect LayoutTableCell::RowBackgroundDisplayItemClient::visualRect() const { 530 LayoutRect LayoutTableCell::RowBackgroundDisplayItemClient::visualRect() const {
531 return m_layoutTableRow.visualRect(); 531 return m_layoutTableCell.row()->visualRect();
532 } 532 }
533 533
534 // The following rules apply for resolving conflicts and figuring out which 534 // The following rules apply for resolving conflicts and figuring out which
535 // border to use. 535 // border to use.
536 // (1) Borders with the 'border-style' of 'hidden' take precedence over all 536 // (1) Borders with the 'border-style' of 'hidden' take precedence over all
537 // other conflicting borders. Any border with this value suppresses all 537 // other conflicting borders. Any border with this value suppresses all
538 // borders at this location. 538 // borders at this location.
539 // (2) Borders with a style of 'none' have the lowest priority. Only if the 539 // (2) Borders with a style of 'none' have the lowest priority. Only if the
540 // border properties of all the elements meeting at this edge are 'none' 540 // border properties of all the elements meeting at this edge are 'none'
541 // will the border be omitted (but note that 'none' is the default value for 541 // will the border be omitted (but note that 'none' is the default value for
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 cb->adjustChildDebugRect(rect); 1481 cb->adjustChildDebugRect(rect);
1482 1482
1483 return rect; 1483 return rect;
1484 } 1484 }
1485 1485
1486 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const { 1486 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const {
1487 r.move(0, -intrinsicPaddingBefore()); 1487 r.move(0, -intrinsicPaddingBefore());
1488 } 1488 }
1489 1489
1490 } // namespace blink 1490 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698