Bug 1514962 - Use GetPaddingRectRelativeToSelf() instead of `GetPaddingRect() - GetPosition()`. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 19 Dec 2018 17:14:45 +0000
changeset 451397 21b1d3d8658407cea5de05ef0a9f82a62db94b2a
parent 451396 c1b46f5fc73bf34193b70d8aba86a1d6f3597357
child 451398 bfd9d5e58fe0180617996ebe00c623ea2bccdcb6
push id75034
push userhikezoe@mozilla.com
push dateWed, 19 Dec 2018 20:53:37 +0000
treeherderautoland@bfd9d5e58fe0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1514962
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1514962 - Use GetPaddingRectRelativeToSelf() instead of `GetPaddingRect() - GetPosition()`. r=botond Differential Revision: https://phabricator.services.mozilla.com/D14833
layout/generic/nsGfxScrollFrame.cpp
layout/painting/nsCSSRendering.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -6038,17 +6038,17 @@ nsRect ScrollFrameHelper::GetUnsnappedSc
     const nsRect& aScrolledFrameOverflowArea,
     const nsSize& aScrollPortSize) const {
   return nsLayoutUtils::GetScrolledRect(mScrolledFrame,
                                         aScrolledFrameOverflowArea,
                                         aScrollPortSize, GetScrolledFrameDir());
 }
 
 nsMargin ScrollFrameHelper::GetActualScrollbarSizes() const {
-  nsRect r = mOuter->GetPaddingRect() - mOuter->GetPosition();
+  nsRect r = mOuter->GetPaddingRectRelativeToSelf();
 
   return nsMargin(mScrollPort.y - r.y, r.XMost() - mScrollPort.XMost(),
                   r.YMost() - mScrollPort.YMost(), mScrollPort.x - r.x);
 }
 
 void ScrollFrameHelper::SetScrollbarVisibility(nsIFrame* aScrollbar,
                                                bool aVisible) {
   nsScrollbarFrame* scrollbar = do_QueryFrame(aScrollbar);
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1435,18 +1435,18 @@ void nsCSSRendering::PaintBoxShadowOuter
   if (nativeTheme) {
     // Optimize non-leaf native-themed frames by skipping computing pixels
     // in the padding-box. We assume the padding-box is going to be painted
     // opaquely for non-leaf frames.
     // XXX this may not be a safe assumption; we should make this go away
     // by optimizing box-shadow drawing more for the cases where we don't have a
     // skip-rect.
     useSkipGfxRect = !aForFrame->IsLeaf();
-    nsRect paddingRect = aForFrame->GetPaddingRect() -
-                         aForFrame->GetPosition() + aFrameArea.TopLeft();
+    nsRect paddingRect =
+        aForFrame->GetPaddingRectRelativeToSelf() + aFrameArea.TopLeft();
     skipGfxRect = nsLayoutUtils::RectToGfxRect(paddingRect, oneDevPixel);
   } else if (hasBorderRadius) {
     skipGfxRect.Deflate(gfxMargin(
         std::max(borderRadii[C_TL].height, borderRadii[C_TR].height), 0,
         std::max(borderRadii[C_BL].height, borderRadii[C_BR].height), 0));
   }
 
   for (uint32_t i = shadows->Length(); i > 0; --i) {