OLD | NEW |
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 LayoutRect visualRect() const; | 310 LayoutRect visualRect() const; |
311 | 311 |
312 private: | 312 private: |
313 const LayoutTable& m_layoutTable; | 313 const LayoutTable& m_layoutTable; |
314 CollapsedBorderValue m_startBorder; | 314 CollapsedBorderValue m_startBorder; |
315 CollapsedBorderValue m_endBorder; | 315 CollapsedBorderValue m_endBorder; |
316 CollapsedBorderValue m_beforeBorder; | 316 CollapsedBorderValue m_beforeBorder; |
317 CollapsedBorderValue m_afterBorder; | 317 CollapsedBorderValue m_afterBorder; |
318 }; | 318 }; |
319 | 319 |
320 bool usesTableAsAdditionalDisplayItemClient() const; | 320 class RowBackgroundDisplayItemClient : public DisplayItemClient { |
| 321 public: |
| 322 RowBackgroundDisplayItemClient(const LayoutTableRow&); |
| 323 |
| 324 // DisplayItemClient methods. |
| 325 String debugName() const; |
| 326 LayoutRect visualRect() const; |
| 327 |
| 328 private: |
| 329 const LayoutTableRow& m_layoutTableRow; |
| 330 }; |
| 331 |
| 332 bool usesCompositedCellDisplayItemClients() const; |
321 const CollapsedBorderValues* collapsedBorderValues() const { | 333 const CollapsedBorderValues* collapsedBorderValues() const { |
322 return m_collapsedBorderValues.get(); | 334 return m_collapsedBorderValues.get(); |
323 } | 335 } |
| 336 const DisplayItemClient& backgroundDisplayItemClient() const { |
| 337 return m_rowBackgroundDisplayItemClient |
| 338 ? static_cast<const DisplayItemClient&>( |
| 339 *m_rowBackgroundDisplayItemClient) |
| 340 : *this; |
| 341 } |
324 | 342 |
325 LayoutRect debugRect() const override; | 343 LayoutRect debugRect() const override; |
326 | 344 |
327 void adjustChildDebugRect(LayoutRect&) const override; | 345 void adjustChildDebugRect(LayoutRect&) const override; |
328 | 346 |
329 // A table cell's location is relative to its containing section. | 347 // A table cell's location is relative to its containing section. |
330 LayoutBox* locationContainer() const override { return section(); } | 348 LayoutBox* locationContainer() const override { return section(); } |
331 | 349 |
| 350 void ensureIsReadyForPaintInvalidation() override; |
| 351 |
332 protected: | 352 protected: |
333 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; | 353 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; |
334 void computePreferredLogicalWidths() override; | 354 void computePreferredLogicalWidths() override; |
335 | 355 |
336 void addLayerHitTestRects(LayerHitTestRects&, | 356 void addLayerHitTestRects(LayerHitTestRects&, |
337 const PaintLayer* currentCompositedLayer, | 357 const PaintLayer* currentCompositedLayer, |
338 const LayoutPoint& layerOffset, | 358 const LayoutPoint& layerOffset, |
339 const LayoutRect& containerRect) const override; | 359 const LayoutRect& containerRect) const override; |
340 | 360 |
341 private: | 361 private: |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 441 |
422 // The intrinsic padding. | 442 // The intrinsic padding. |
423 // See class comment for what they are. | 443 // See class comment for what they are. |
424 // | 444 // |
425 // Note: Those fields are using non-subpixel units (int) | 445 // Note: Those fields are using non-subpixel units (int) |
426 // because we don't do fractional arithmetic on tables. | 446 // because we don't do fractional arithmetic on tables. |
427 int m_intrinsicPaddingBefore; | 447 int m_intrinsicPaddingBefore; |
428 int m_intrinsicPaddingAfter; | 448 int m_intrinsicPaddingAfter; |
429 | 449 |
430 std::unique_ptr<CollapsedBorderValues> m_collapsedBorderValues; | 450 std::unique_ptr<CollapsedBorderValues> m_collapsedBorderValues; |
| 451 std::unique_ptr<RowBackgroundDisplayItemClient> |
| 452 m_rowBackgroundDisplayItemClient; |
431 }; | 453 }; |
432 | 454 |
433 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCell, isTableCell()); | 455 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCell, isTableCell()); |
434 | 456 |
435 inline LayoutTableCell* LayoutTableCell::previousCell() const { | 457 inline LayoutTableCell* LayoutTableCell::previousCell() const { |
436 return toLayoutTableCell(LayoutObject::previousSibling()); | 458 return toLayoutTableCell(LayoutObject::previousSibling()); |
437 } | 459 } |
438 | 460 |
439 inline LayoutTableCell* LayoutTableCell::nextCell() const { | 461 inline LayoutTableCell* LayoutTableCell::nextCell() const { |
440 return toLayoutTableCell(LayoutObject::nextSibling()); | 462 return toLayoutTableCell(LayoutObject::nextSibling()); |
441 } | 463 } |
442 | 464 |
443 inline LayoutTableCell* LayoutTableRow::firstCell() const { | 465 inline LayoutTableCell* LayoutTableRow::firstCell() const { |
444 return toLayoutTableCell(firstChild()); | 466 return toLayoutTableCell(firstChild()); |
445 } | 467 } |
446 | 468 |
447 inline LayoutTableCell* LayoutTableRow::lastCell() const { | 469 inline LayoutTableCell* LayoutTableRow::lastCell() const { |
448 return toLayoutTableCell(lastChild()); | 470 return toLayoutTableCell(lastChild()); |
449 } | 471 } |
450 | 472 |
451 } // namespace blink | 473 } // namespace blink |
452 | 474 |
453 #endif // LayoutTableCell_h | 475 #endif // LayoutTableCell_h |
OLD | NEW |