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. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 Apple Inc. All rights
reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 LayoutRect visualRect() const; | 297 LayoutRect visualRect() const; |
298 | 298 |
299 private: | 299 private: |
300 const LayoutTable& m_layoutTable; | 300 const LayoutTable& m_layoutTable; |
301 CollapsedBorderValue m_startBorder; | 301 CollapsedBorderValue m_startBorder; |
302 CollapsedBorderValue m_endBorder; | 302 CollapsedBorderValue m_endBorder; |
303 CollapsedBorderValue m_beforeBorder; | 303 CollapsedBorderValue m_beforeBorder; |
304 CollapsedBorderValue m_afterBorder; | 304 CollapsedBorderValue m_afterBorder; |
305 }; | 305 }; |
306 | 306 |
307 bool usesTableAsAdditionalDisplayItemClient() const; | 307 class RowBackgroundDisplayItemClient : public DisplayItemClient { |
| 308 public: |
| 309 RowBackgroundDisplayItemClient(const LayoutTableRow&); |
| 310 |
| 311 // DisplayItemClient methods. |
| 312 String debugName() const; |
| 313 LayoutRect visualRect() const; |
| 314 |
| 315 private: |
| 316 const LayoutTableRow& m_layoutTableRow; |
| 317 }; |
| 318 |
| 319 bool usesCompositedCellDisplayItemClients() const; |
308 const CollapsedBorderValues* collapsedBorderValues() const { | 320 const CollapsedBorderValues* collapsedBorderValues() const { |
309 return m_collapsedBorderValues.get(); | 321 return m_collapsedBorderValues.get(); |
310 } | 322 } |
| 323 const DisplayItemClient& backgroundDisplayItemClient() const { |
| 324 return m_rowBackgroundDisplayItemClient |
| 325 ? static_cast<const DisplayItemClient&>( |
| 326 *m_rowBackgroundDisplayItemClient) |
| 327 : *this; |
| 328 } |
311 | 329 |
312 LayoutRect debugRect() const override; | 330 LayoutRect debugRect() const override; |
313 | 331 |
314 void adjustChildDebugRect(LayoutRect&) const override; | 332 void adjustChildDebugRect(LayoutRect&) const override; |
315 | 333 |
316 // A table cell's location is relative to its containing section. | 334 // A table cell's location is relative to its containing section. |
317 LayoutBox* locationContainer() const override { return section(); } | 335 LayoutBox* locationContainer() const override { return section(); } |
318 | 336 |
| 337 void ensureIsReadyForPaintInvalidation() override; |
| 338 |
319 protected: | 339 protected: |
320 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; | 340 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; |
321 void computePreferredLogicalWidths() override; | 341 void computePreferredLogicalWidths() override; |
322 | 342 |
323 void addLayerHitTestRects(LayerHitTestRects&, | 343 void addLayerHitTestRects(LayerHitTestRects&, |
324 const PaintLayer* currentCompositedLayer, | 344 const PaintLayer* currentCompositedLayer, |
325 const LayoutPoint& layerOffset, | 345 const LayoutPoint& layerOffset, |
326 const LayoutRect& containerRect) const override; | 346 const LayoutRect& containerRect) const override; |
327 | 347 |
328 private: | 348 private: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 431 |
412 // The intrinsic padding. | 432 // The intrinsic padding. |
413 // See class comment for what they are. | 433 // See class comment for what they are. |
414 // | 434 // |
415 // Note: Those fields are using non-subpixel units (int) | 435 // Note: Those fields are using non-subpixel units (int) |
416 // because we don't do fractional arithmetic on tables. | 436 // because we don't do fractional arithmetic on tables. |
417 int m_intrinsicPaddingBefore; | 437 int m_intrinsicPaddingBefore; |
418 int m_intrinsicPaddingAfter; | 438 int m_intrinsicPaddingAfter; |
419 | 439 |
420 std::unique_ptr<CollapsedBorderValues> m_collapsedBorderValues; | 440 std::unique_ptr<CollapsedBorderValues> m_collapsedBorderValues; |
| 441 std::unique_ptr<RowBackgroundDisplayItemClient> |
| 442 m_rowBackgroundDisplayItemClient; |
421 }; | 443 }; |
422 | 444 |
423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCell, isTableCell()); | 445 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCell, isTableCell()); |
424 | 446 |
425 inline LayoutTableCell* LayoutTableCell::previousCell() const { | 447 inline LayoutTableCell* LayoutTableCell::previousCell() const { |
426 return toLayoutTableCell(LayoutObject::previousSibling()); | 448 return toLayoutTableCell(LayoutObject::previousSibling()); |
427 } | 449 } |
428 | 450 |
429 inline LayoutTableCell* LayoutTableCell::nextCell() const { | 451 inline LayoutTableCell* LayoutTableCell::nextCell() const { |
430 return toLayoutTableCell(LayoutObject::nextSibling()); | 452 return toLayoutTableCell(LayoutObject::nextSibling()); |
431 } | 453 } |
432 | 454 |
433 inline LayoutTableCell* LayoutTableRow::firstCell() const { | 455 inline LayoutTableCell* LayoutTableRow::firstCell() const { |
434 return toLayoutTableCell(firstChild()); | 456 return toLayoutTableCell(firstChild()); |
435 } | 457 } |
436 | 458 |
437 inline LayoutTableCell* LayoutTableRow::lastCell() const { | 459 inline LayoutTableCell* LayoutTableRow::lastCell() const { |
438 return toLayoutTableCell(lastChild()); | 460 return toLayoutTableCell(lastChild()); |
439 } | 461 } |
440 | 462 |
441 } // namespace blink | 463 } // namespace blink |
442 | 464 |
443 #endif // LayoutTableCell_h | 465 #endif // LayoutTableCell_h |
OLD | NEW |