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.h

Issue 2890543002: Improve LayoutTable outer collapsed border calculation (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, 2009, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 bool HasLineIfEmpty() const override; 350 bool HasLineIfEmpty() const override;
351 351
352 static bool CompareInDOMOrder(const LayoutTableCell* cell1, 352 static bool CompareInDOMOrder(const LayoutTableCell* cell1,
353 const LayoutTableCell* cell2) { 353 const LayoutTableCell* cell2) {
354 DCHECK(cell1->Section() == cell2->Section()); 354 DCHECK(cell1->Section() == cell2->Section());
355 if (cell1->RowIndex() == cell2->RowIndex()) 355 if (cell1->RowIndex() == cell2->RowIndex())
356 return cell1->absolute_column_index_ < cell2->absolute_column_index_; 356 return cell1->absolute_column_index_ < cell2->absolute_column_index_;
357 return cell1->RowIndex() < cell2->RowIndex(); 357 return cell1->RowIndex() < cell2->RowIndex();
358 } 358 }
359 359
360 // For LayoutTable to compute its collapsed outer borders.
361 unsigned CollapsedOuterBorderBefore() const {
362 return CollapsedBorderHalfBefore(true);
363 }
364 unsigned CollapsedOuterBorderAfter() const {
365 return CollapsedBorderHalfAfter(true);
366 }
367 unsigned CollapsedOuterBorderStart() const {
368 return CollapsedBorderHalfStart(true);
369 }
370 unsigned CollapsedOuterBorderEnd() const {
371 return CollapsedBorderHalfEnd(true);
372 }
373
360 protected: 374 protected:
361 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; 375 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override;
362 void ComputePreferredLogicalWidths() override; 376 void ComputePreferredLogicalWidths() override;
363 377
364 void AddLayerHitTestRects(LayerHitTestRects&, 378 void AddLayerHitTestRects(LayerHitTestRects&,
365 const PaintLayer* current_composited_layer, 379 const PaintLayer* current_composited_layer,
366 const LayoutPoint& layer_offset, 380 const LayoutPoint& layer_offset,
367 const LayoutRect& container_rect) const override; 381 const LayoutRect& container_rect) const override;
368 382
369 PaintInvalidationReason InvalidatePaint( 383 PaintInvalidationReason InvalidatePaint(
(...skipping 14 matching lines...) Expand all
384 void PaintBoxDecorationBackground(const PaintInfo&, 398 void PaintBoxDecorationBackground(const PaintInfo&,
385 const LayoutPoint&) const override; 399 const LayoutPoint&) const override;
386 void PaintMask(const PaintInfo&, const LayoutPoint&) const override; 400 void PaintMask(const PaintInfo&, const LayoutPoint&) const override;
387 401
388 LayoutSize OffsetFromContainer(const LayoutObject*) const override; 402 LayoutSize OffsetFromContainer(const LayoutObject*) const override;
389 403
390 void ComputeOverflow(LayoutUnit old_client_after_edge, 404 void ComputeOverflow(LayoutUnit old_client_after_edge,
391 bool recompute_floats = false) override; 405 bool recompute_floats = false) override;
392 LayoutRect LocalVisualRect() const override; 406 LayoutRect LocalVisualRect() const override;
393 407
394 LayoutUnit CollapsedBorderHalfLeft(bool outer) const; 408 unsigned CollapsedBorderHalfLeft(bool outer) const;
395 LayoutUnit CollapsedBorderHalfRight(bool outer) const; 409 unsigned CollapsedBorderHalfRight(bool outer) const;
396 LayoutUnit CollapsedBorderHalfTop(bool outer) const; 410 unsigned CollapsedBorderHalfTop(bool outer) const;
397 LayoutUnit CollapsedBorderHalfBottom(bool outer) const; 411 unsigned CollapsedBorderHalfBottom(bool outer) const;
398 412
399 LayoutUnit CollapsedBorderHalfStart(bool outer) const; 413 unsigned CollapsedBorderHalfStart(bool outer) const;
400 LayoutUnit CollapsedBorderHalfEnd(bool outer) const; 414 unsigned CollapsedBorderHalfEnd(bool outer) const;
401 LayoutUnit CollapsedBorderHalfBefore(bool outer) const; 415 unsigned CollapsedBorderHalfBefore(bool outer) const;
402 LayoutUnit CollapsedBorderHalfAfter(bool outer) const; 416 unsigned CollapsedBorderHalfAfter(bool outer) const;
403 417
404 void SetIntrinsicPaddingBefore(int p) { intrinsic_padding_before_ = p; } 418 void SetIntrinsicPaddingBefore(int p) { intrinsic_padding_before_ = p; }
405 void SetIntrinsicPaddingAfter(int p) { intrinsic_padding_after_ = p; } 419 void SetIntrinsicPaddingAfter(int p) { intrinsic_padding_after_ = p; }
406 void SetIntrinsicPadding(int before, int after) { 420 void SetIntrinsicPadding(int before, int after) {
407 SetIntrinsicPaddingBefore(before); 421 SetIntrinsicPaddingBefore(before);
408 SetIntrinsicPaddingAfter(after); 422 SetIntrinsicPaddingAfter(after);
409 } 423 }
410 424
411 inline bool IsInStartColumn() const; 425 inline bool IsInStartColumn() const;
412 inline bool IsInEndColumn() const; 426 inline bool IsInEndColumn() const;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 return ToLayoutTableCell(FirstChild()); 503 return ToLayoutTableCell(FirstChild());
490 } 504 }
491 505
492 inline LayoutTableCell* LayoutTableRow::LastCell() const { 506 inline LayoutTableCell* LayoutTableRow::LastCell() const {
493 return ToLayoutTableCell(LastChild()); 507 return ToLayoutTableCell(LastChild());
494 } 508 }
495 509
496 } // namespace blink 510 } // namespace blink
497 511
498 #endif // LayoutTableCell_h 512 #endif // LayoutTableCell_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698