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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.h

Issue 2469903002: Use appropriate background object visual rect for composited table cell backgrounds. (Closed)
Patch Set: Rename test. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutTableCell.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.h b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
index f3b067dadd0e090a5ec86ff8ed07e9f97801a152..3145a831c081da7bc5ae9182235986102d60b6d4 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCell.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
@@ -288,12 +288,12 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const override;
void invalidateDisplayItemClients(PaintInvalidationReason) const override;
+ // TODO(wkorman): Consider making this a struct again as it once was.
// TODO(wkorman): Consider renaming to more clearly differentiate from
// CollapsedBorderValue.
- class CollapsedBorderValues : public DisplayItemClient {
+ class CollapsedBorderValues {
public:
- CollapsedBorderValues(const LayoutTable&,
- const CollapsedBorderValue& startBorder,
+ CollapsedBorderValues(const CollapsedBorderValue& startBorder,
const CollapsedBorderValue& endBorder,
const CollapsedBorderValue& beforeBorder,
const CollapsedBorderValue& afterBorder);
@@ -305,19 +305,31 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
void setCollapsedBorderValues(const CollapsedBorderValues& other);
+ private:
+ CollapsedBorderValue m_startBorder;
+ CollapsedBorderValue m_endBorder;
+ CollapsedBorderValue m_beforeBorder;
+ CollapsedBorderValue m_afterBorder;
+ };
+
+ // Composited table cells may paint content such as borders and backgrounds
+ // into their table's graphics layer. In such cases we must use the table's
+ // visual rect for that painting. Thus, we use this class to act as a separate
+ // display item client for unique id purposes on a per-cell basis.
+ class CompositedTableCell : public DisplayItemClient {
+ public:
+ CompositedTableCell(const LayoutTable&);
+
// DisplayItemClient methods.
String debugName() const;
LayoutRect visualRect() const;
private:
const LayoutTable& m_layoutTable;
- CollapsedBorderValue m_startBorder;
- CollapsedBorderValue m_endBorder;
- CollapsedBorderValue m_beforeBorder;
- CollapsedBorderValue m_afterBorder;
};
bool usesTableAsAdditionalDisplayItemClient() const;
+ const CompositedTableCell* compositedTableCell() const;
const CollapsedBorderValues* collapsedBorderValues() const {
return m_collapsedBorderValues.get();
}
@@ -330,6 +342,7 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
LayoutBox* locationContainer() const override { return section(); }
protected:
+ void ensureIsReadyForPaintInvalidation() override;
void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override;
void computePreferredLogicalWidths() override;
@@ -432,6 +445,7 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
int m_intrinsicPaddingAfter;
std::unique_ptr<CollapsedBorderValues> m_collapsedBorderValues;
+ std::unique_ptr<CompositedTableCell> m_compositedTableCell;
};
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCell, isTableCell());

Powered by Google App Engine
This is Rietveld 408576698