Merge inbound to m-c.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 21 May 2013 13:24:13 -0400
changeset 144877 97f49d0b228c2b8e5a770fdc1ff0b17c9b3a6e2a
parent 144876 0a830609f6197d2b786a97bbd99bd0412ff5c052 (current diff)
parent 144783 f9dc5e76d66bb96e6e051c26974e77499b3e90d5 (diff)
child 144878 3abd26f4295cc13348efc6277d070f0d2f47aef1
child 144883 5b14f002a622867c65c8c45633b82c7ca76a96e1
child 144889 a6f2feef48a52bcbfa846d16444d774b37f31315
child 144906 8d56511bfcec713e3e497160f1e5e011148983ae
child 170848 afbba110951393091bd05144e9367e287fe82678
push id368
push userbbajaj@mozilla.com
push dateMon, 09 Sep 2013 22:57:58 +0000
treeherdermozilla-release@5a4f47ae1217 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone24.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
Merge inbound to m-c.
--- a/widget/xpwidgets/nsNativeTheme.cpp
+++ b/widget/xpwidgets/nsNativeTheme.cpp
@@ -677,25 +677,28 @@ nsNativeTheme::IsRangeHorizontal(nsIFram
   MOZ_ASSERT(rangeFrame->GetType() == nsGkAtoms::rangeFrame);
 
   return static_cast<nsRangeFrame*>(rangeFrame)->IsHorizontal();
 }
 
 bool
 nsNativeTheme::IsDarkBackground(nsIFrame* aFrame)
 {
-  nsIScrollableFrame* scrollFrame = aFrame->GetScrollTargetFrame();
+  nsIScrollableFrame* scrollFrame = nullptr;
   while (!scrollFrame && aFrame) {
+    scrollFrame = aFrame->GetScrollTargetFrame();
     aFrame = aFrame->GetParent();
-    scrollFrame = aFrame->GetScrollTargetFrame();
   }
+  if (!scrollFrame)
+    return false;
+
   nsIFrame* frame = scrollFrame->GetScrolledFrame();
   nsStyleContext* bgSC;
   if (nsCSSRendering::FindBackground(frame, &bgSC)) {
     nscolor bgColor = bgSC->StyleBackground()->mBackgroundColor;
     // Consider the background color dark if the sum of the r, g and b values is
-    // less than 384 in a semi-transparent docement.  This heuristic matches what
+    // less than 384 in a semi-transparent document.  This heuristic matches what
     // WebKit does, and we can improve it later if needed.
     return NS_GET_A(bgColor) > 127 &&
            NS_GET_R(bgColor) + NS_GET_G(bgColor) + NS_GET_B(bgColor) < 384;
   }
   return false;
 }