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

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

Issue 2642193011: Unify all types of overflow-related clips for paint and hit testing. (Closed)
Patch Set: none Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index ad19771f6b349521ea4d6cd01e048152b0b0e037..6245df237f467b09253150d7f41cdc040858f773 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -1058,14 +1058,16 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
int caretOffset,
LayoutUnit* extraWidthToEndOfLine = nullptr) override;
+ // Returns whether content which overflows should be clipped. This is not just
+ // because of overflow clip, but other types of clip as well, such as
+ // control clips or contain: paint.
+ virtual bool shouldClipOverflow() const;
+
+ // Returns the intersection of all overflow clips which apply.
virtual LayoutRect overflowClipRect(
const LayoutPoint& location,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const;
LayoutRect clipRect(const LayoutPoint& location) const;
- virtual bool hasControlClip() const { return false; }
- virtual LayoutRect controlClipRect(const LayoutPoint&) const {
- return LayoutRect();
- }
// Returns the combination of overflow clip, contain: paint clip and CSS clip
// for this object, in local space.
@@ -1305,9 +1307,13 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
void ensureIsReadyForPaintInvalidation() override;
- virtual bool shouldClipOverflow() const;
+ virtual bool hasControlClip() const { return false; }
protected:
+ virtual LayoutRect controlClipRect(const LayoutPoint&) const {
+ return LayoutRect();
+ }
+
void willBeDestroyed() override;
void insertedIntoTree() override;

Powered by Google App Engine
This is Rietveld 408576698