Commit eeebb4ab authored by eae's avatar eae Committed by Commit bot

Add BorderBoxOutsets method to LayoutBoxModelObject

R=dgrogan@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2878723003
Cr-Commit-Position: refs/heads/master@{#471163}
parent a0494357
...@@ -286,6 +286,11 @@ class CORE_EXPORT LayoutBoxModelObject : public LayoutObject { ...@@ -286,6 +286,11 @@ class CORE_EXPORT LayoutBoxModelObject : public LayoutObject {
LayoutUnit BorderWidth() const { return BorderLeft() + BorderRight(); } LayoutUnit BorderWidth() const { return BorderLeft() + BorderRight(); }
LayoutUnit BorderHeight() const { return BorderTop() + BorderBottom(); } LayoutUnit BorderHeight() const { return BorderTop() + BorderBottom(); }
virtual LayoutRectOutsets BorderBoxOutsets() const {
return LayoutRectOutsets(BorderTop(), BorderRight(), BorderBottom(),
BorderLeft());
}
// Insets from the border box to the inside of the border. // Insets from the border box to the inside of the border.
LayoutRectOutsets BorderInsets() const { LayoutRectOutsets BorderInsets() const {
return LayoutRectOutsets(-BorderTop(), -BorderRight(), -BorderBottom(), return LayoutRectOutsets(-BorderTop(), -BorderRight(), -BorderBottom(),
......
...@@ -77,9 +77,7 @@ void BoxPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info, ...@@ -77,9 +77,7 @@ void BoxPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info,
// The background painting code assumes that the borders are part of the // The background painting code assumes that the borders are part of the
// paintRect so we expand the paintRect by the border size when painting the // paintRect so we expand the paintRect by the border size when painting the
// background into the scrolling contents layer. // background into the scrolling contents layer.
paint_rect.ExpandEdges(layout_box_.BorderTop(), layout_box_.BorderRight(), paint_rect.Expand(layout_box_.BorderBoxOutsets());
layout_box_.BorderBottom(),
layout_box_.BorderLeft());
} else { } else {
paint_rect = layout_box_.BorderBoxRect(); paint_rect = layout_box_.BorderBoxRect();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment