Bug 1370757 - Don't expand the dirty rect for Mac native widget drawing. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Sat, 10 Jun 2017 15:34:09 -0400
changeset 411477 7642d6435b63f797aa519aae2659b7f4ee96942b
parent 411476 34bb128e167e830831d649b193b0231dd89bb864
child 411478 d8871fb0af7d50668441c15650ce0e37cb1b05d5
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1370757
milestone55.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 1370757 - Don't expand the dirty rect for Mac native widget drawing. r=mattwoodrow Extending it didn't play well with invalidation; widgets would only be able to draw outside if the invalidated region of the current paint was larger than the widget's declared paint rect but not if the widget was the only thing that got invalidated. Any legitimate widget overflow should instead be handled by GetWidgetOverflow. The DrawCellWithSnapping overflow is considered to stay within the focus ring's bounds. I fuzzed two reftests which have extremely slight variance when -moz-appearance is combined with box-shadow. I don't really understand this failure but I don't think it's worth looking into either. MozReview-Commit-ID: ECYxnCTafdh
layout/reftests/css-ui-invalid/default-style/reftest.list
widget/cocoa/nsNativeThemeCocoa.mm
--- a/layout/reftests/css-ui-invalid/default-style/reftest.list
+++ b/layout/reftests/css-ui-invalid/default-style/reftest.list
@@ -1,10 +1,10 @@
 == input.html input-ref.html
-fuzzy-if(webrender,1-1,6-6) == button.html button-ref.html
+fuzzy-if(webrender,1-1,6-6) fuzzy-if(cocoaWidget,2,32) == button.html button-ref.html
 == textarea.html textarea-ref.html
 == select.html select-ref.html
 == fieldset.html fieldset-ref.html
 == output.html output-ref.html
 random-if(winWidget) needs-focus == input-focus.html input-focus-ref.html # Intermittent failures, bug 660224
-needs-focus == button-focus.html button-focus-ref.html
+needs-focus fuzzy-if(cocoaWidget,1,10) == button-focus.html button-focus-ref.html
 needs-focus == textarea-focus.html textarea-focus-ref.html
 random-if(winWidget) needs-focus == select-focus.html select-focus-ref.html # Intermittent failures, bug 660224
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2296,24 +2296,16 @@ nsNativeThemeCocoa::DrawWidgetBackground
   gfx::Rect nativeDirtyRect = NSRectToRect(aDirtyRect, p2a);
   gfxRect nativeWidgetRect(aRect.x, aRect.y, aRect.width, aRect.height);
   nativeWidgetRect.ScaleInverse(gfxFloat(p2a));
   float nativeWidgetHeight = round(nativeWidgetRect.Height());
   nativeWidgetRect.Round();
   if (nativeWidgetRect.IsEmpty())
     return NS_OK; // Don't attempt to draw invisible widgets.
 
-  // Bug 1059031 -
-  // Quartz theme drawing often adjusts drawing rects, so make
-  // sure our surface is big enough for that.
-  // For example, DrawCellWithSnapping snaps the drawing rect, and that can
-  // result in us drawing outside of what we thought the bounds were.
-  // The 5 is just a guess of how much margin we need to handle that.
-  nativeDirtyRect.Inflate(5);
-
   AutoRestoreTransform autoRestoreTransform(&aDrawTarget);
 
   bool hidpi = IsHiDPIContext(aFrame->PresContext()->DeviceContext());
   if (hidpi) {
     // Use high-resolution drawing.
     nativeWidgetRect.Scale(0.5f);
     nativeWidgetHeight *= 0.5f;
     nativeDirtyRect.Scale(0.5f);