Use ContentSize() for content size stored for paint invalidation

LayoutBox::ContentSize() is more to the point than calling
LayoutBox::ContentBoxRect() and then do Size() on the result (ignoring
the position.) Hopefully it is also faster (4 vs 8 virtual calls.)

Change-Id: If8c370446fad49d976d1d7576ac7041cd8d78180
Reviewed-on: https://chromium-review.googlesource.com/733164
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510846}
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 9dc0c87..c6c17d2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -5991,7 +5991,7 @@
     SavePreviousContentBoxSizeAndLayoutOverflowRect() {
   auto& rare_data = GetLayoutBox().EnsureRareData();
   rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
-  rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
+  rare_data.previous_content_box_size_ = GetLayoutBox().ContentSize();
   rare_data.previous_layout_overflow_rect_ =
       GetLayoutBox().LayoutOverflowRect();
 }
diff --git a/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
index e90ca50..e5dcceeb 100644
--- a/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
@@ -99,7 +99,7 @@
 
   if ((style.BackgroundLayers().ThisOrNextLayersUseContentBox() ||
        style.MaskLayers().ThisOrNextLayersUseContentBox()) &&
-      box_.PreviousContentBoxSize() != box_.ContentBoxRect().Size())
+      box_.PreviousContentBoxSize() != box_.ContentSize())
     return PaintInvalidationReason::kGeometry;
 
   LayoutSize old_border_box_size = box_.PreviousSize();
@@ -329,7 +329,7 @@
   // crbug.com/490533
   if ((style.BackgroundLayers().ThisOrNextLayersUseContentBox() ||
        style.MaskLayers().ThisOrNextLayersUseContentBox()) &&
-      box_.ContentBoxRect().Size() != box_.Size())
+      box_.ContentSize() != box_.Size())
     return true;
   if ((BackgroundGeometryDependsOnLayoutOverflowRect() ||
        BackgroundPaintsOntoScrollingContentsLayer()) &&