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

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

Issue 2432663002: Use table as display item client for painting composited collapsed table cell borders. (Closed)
Patch Set: Created 4 years, 2 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 #if ENABLE(ASSERT) 280 #if ENABLE(ASSERT)
281 bool isFirstOrLastCellInRow() const { 281 bool isFirstOrLastCellInRow() const {
282 return !table()->cellAfter(this) || !table()->cellBefore(this); 282 return !table()->cellAfter(this) || !table()->cellBefore(this);
283 } 283 }
284 #endif 284 #endif
285 285
286 const char* name() const override { return "LayoutTableCell"; } 286 const char* name() const override { return "LayoutTableCell"; }
287 287
288 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const override; 288 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const override;
289 void invalidateDisplayItemClients(PaintInvalidationReason) const override;
289 290
290 struct CollapsedBorderValues { 291 // TODO(wkorman): Consider renaming to more clearly differentiate from
291 CollapsedBorderValue startBorder; 292 // CollapsedBorderValue.
292 CollapsedBorderValue endBorder; 293 class CollapsedBorderValues : public DisplayItemClient {
293 CollapsedBorderValue beforeBorder; 294 public:
294 CollapsedBorderValue afterBorder; 295 CollapsedBorderValues(const LayoutTable&,
296 const CollapsedBorderValue& startBorder,
297 const CollapsedBorderValue& endBorder,
298 const CollapsedBorderValue& beforeBorder,
299 const CollapsedBorderValue& afterBorder);
300
301 const CollapsedBorderValue& startBorder() const { return m_startBorder; }
302 const CollapsedBorderValue& endBorder() const { return m_endBorder; }
303 const CollapsedBorderValue& beforeBorder() const { return m_beforeBorder; }
304 const CollapsedBorderValue& afterBorder() const { return m_afterBorder; }
305
306 void setCollapsedBorderValues(const CollapsedBorderValues& other);
307
308 // DisplayItemClient methods.
309 String debugName() const;
310 LayoutRect visualRect() const;
311
312 private:
313 const LayoutTable& m_layoutTable;
314 CollapsedBorderValue m_startBorder;
315 CollapsedBorderValue m_endBorder;
316 CollapsedBorderValue m_beforeBorder;
317 CollapsedBorderValue m_afterBorder;
295 }; 318 };
319
320 bool usesTableAsDisplayItemClient() const;
chrishtr 2016/10/19 01:13:21 usesTableAsAdditionalDisplayItemClient()
wkorman 2016/10/19 23:07:39 Done.
296 const CollapsedBorderValues* collapsedBorderValues() const { 321 const CollapsedBorderValues* collapsedBorderValues() const {
297 return m_collapsedBorderValues.get(); 322 return m_collapsedBorderValues.get();
298 } 323 }
299 324
300 LayoutRect debugRect() const override; 325 LayoutRect debugRect() const override;
301 326
302 void adjustChildDebugRect(LayoutRect&) const override; 327 void adjustChildDebugRect(LayoutRect&) const override;
303 328
304 // A table cell's location is relative to its containing section. 329 // A table cell's location is relative to its containing section.
305 LayoutBox* locationContainer() const override { return section(); } 330 LayoutBox* locationContainer() const override { return section(); }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 return toLayoutTableCell(firstChild()); 448 return toLayoutTableCell(firstChild());
424 } 449 }
425 450
426 inline LayoutTableCell* LayoutTableRow::lastCell() const { 451 inline LayoutTableCell* LayoutTableRow::lastCell() const {
427 return toLayoutTableCell(lastChild()); 452 return toLayoutTableCell(lastChild());
428 } 453 }
429 454
430 } // namespace blink 455 } // namespace blink
431 456
432 #endif // LayoutTableCell_h 457 #endif // LayoutTableCell_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698