Bug 1317541 - Merge number-control.css back into forms.css. r=mats
authorCameron McCormack <cam@mcc.id.au>
Tue, 10 Apr 2018 11:04:41 +1000
changeset 452986 7d516d8ca975622b519a7687e4791a9b2f1ceba6
parent 452985 a7b1e8229011cf671ff8ff498d03ccd03825f735
child 452987 279d83c6f6ed28e669028ffb98b2b176c98bb34f
push idunknown
push userunknown
push dateunknown
reviewersmats
bugs1317541
milestone61.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 1317541 - Merge number-control.css back into forms.css. r=mats MozReview-Commit-ID: AGfsSF4dORN
dom/svg/SVGDocument.cpp
layout/base/nsDocumentViewer.cpp
layout/style/jar.mn
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsLayoutStylesheetCache.h
layout/style/res/forms.css
layout/style/res/number-control.css
--- a/dom/svg/SVGDocument.cpp
+++ b/dom/svg/SVGDocument.cpp
@@ -152,17 +152,16 @@ SVGDocument::EnsureNonSVGUserAgentStyleS
           }
         }
       }
     }
   }
 
   auto cache = nsLayoutStylesheetCache::Singleton();
 
-  EnsureOnDemandBuiltInUASheet(cache->NumberControlSheet());
   EnsureOnDemandBuiltInUASheet(cache->FormsSheet());
   EnsureOnDemandBuiltInUASheet(cache->CounterStylesSheet());
   EnsureOnDemandBuiltInUASheet(cache->HTMLSheet());
   if (nsLayoutUtils::ShouldUseNoFramesSheet(this)) {
     EnsureOnDemandBuiltInUASheet(cache->NoFramesSheet());
   }
   if (nsLayoutUtils::ShouldUseNoScriptSheet(this)) {
     EnsureOnDemandBuiltInUASheet(cache->NoScriptSheet());
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2403,21 +2403,16 @@ nsDocumentViewer::CreateStyleSet(nsIDocu
     // !!! SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded.
 
     // SVGForeignObjectElement::BindToTree calls SVGDocument::
     // EnsureNonSVGUserAgentStyleSheetsLoaded to loads these UA sheet
     // on-demand. (Excluding the quirks sheet, which should never be loaded for
     // an SVG document, and excluding xul.css which will be loaded on demand by
     // nsXULElement::BindToTree.)
 
-    sheet = cache->NumberControlSheet();
-    if (sheet) {
-      styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsServo());
-    }
-
     sheet = cache->FormsSheet();
     if (sheet) {
       styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsServo());
     }
 
     if (aDocument->LoadsFullXULStyleSheetUpFront()) {
       // This is the only place components.css gets loaded, unlike xul.css
       sheet = cache->XULComponentsSheet();
--- a/layout/style/jar.mn
+++ b/layout/style/jar.mn
@@ -5,17 +5,16 @@
 toolkit.jar:
 *  res/ua.css                                (res/ua.css)
 *  res/html.css                              (res/html.css)
    res/quirk.css                             (res/quirk.css)
    res/counterstyles.css                     (res/counterstyles.css)
    res/noscript.css                          (res/noscript.css)
    res/noframes.css                          (res/noframes.css)
 *  res/forms.css                             (res/forms.css)
-   res/number-control.css                    (res/number-control.css)
    res/arrow.gif                             (res/arrow.gif)
    res/arrow-left.gif                        (res/arrow-left.gif)
    res/arrow-right.gif                       (res/arrow-right.gif)
    res/arrowd.gif                            (res/arrowd.gif)
    res/arrowd-left.gif                       (res/arrowd-left.gif)
    res/arrowd-right.gif                      (res/arrowd-right.gif)
    res/accessiblecaret-normal@1x.png         (res/accessiblecaret-normal@1x.png)
    res/accessiblecaret-normal@1.5x.png       (res/accessiblecaret-normal@1.5x.png)
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -54,17 +54,16 @@ nsLayoutStylesheetCache::Observe(nsISupp
   }
   else if (!strcmp(aTopic, "profile-do-change")) {
     InitFromProfile();
   }
   else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
            strcmp(aTopic, "chrome-flush-caches") == 0) {
     mScrollbarsSheet = nullptr;
     mFormsSheet = nullptr;
-    mNumberControlSheet = nullptr;
   }
   else {
     NS_NOTREACHED("Unexpected observer topic.");
   }
   return NS_OK;
 }
 
 StyleSheet*
@@ -87,27 +86,16 @@ nsLayoutStylesheetCache::FormsSheet()
     LoadSheetURL("resource://gre-resources/forms.css",
                  &mFormsSheet, eAgentSheetFeatures, eCrash);
   }
 
   return mFormsSheet;
 }
 
 StyleSheet*
-nsLayoutStylesheetCache::NumberControlSheet()
-{
-  if (!mNumberControlSheet) {
-    LoadSheetURL("resource://gre-resources/number-control.css",
-                 &mNumberControlSheet, eAgentSheetFeatures, eCrash);
-  }
-
-  return mNumberControlSheet;
-}
-
-StyleSheet*
 nsLayoutStylesheetCache::UserContentSheet()
 {
   return mUserContentSheet;
 }
 
 StyleSheet*
 nsLayoutStylesheetCache::UserChromeSheet()
 {
@@ -297,17 +285,16 @@ nsLayoutStylesheetCache::SizeOfIncluding
   MEASURE(mCounterStylesSheet);
   MEASURE(mDesignModeSheet);
   MEASURE(mFormsSheet);
   MEASURE(mHTMLSheet);
   MEASURE(mMathMLSheet);
   MEASURE(mMinimalXULSheet);
   MEASURE(mNoFramesSheet);
   MEASURE(mNoScriptSheet);
-  MEASURE(mNumberControlSheet);
   MEASURE(mQuirkSheet);
   MEASURE(mSVGSheet);
   MEASURE(mScrollbarsSheet);
   MEASURE(mUASheet);
   MEASURE(mUserChromeSheet);
   MEASURE(mUserContentSheet);
   MEASURE(mXULSheet);
   MEASURE(mXULComponentsSheet);
--- a/layout/style/nsLayoutStylesheetCache.h
+++ b/layout/style/nsLayoutStylesheetCache.h
@@ -40,17 +40,16 @@ class nsLayoutStylesheetCache final
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIMEMORYREPORTER
 
   static nsLayoutStylesheetCache* Singleton();
 
   mozilla::StyleSheet* ScrollbarsSheet();
   mozilla::StyleSheet* FormsSheet();
-  mozilla::StyleSheet* NumberControlSheet();
   mozilla::StyleSheet* UserContentSheet();
   mozilla::StyleSheet* UserChromeSheet();
   mozilla::StyleSheet* UASheet();
   mozilla::StyleSheet* HTMLSheet();
   mozilla::StyleSheet* MinimalXULSheet();
   mozilla::StyleSheet* XULSheet();
   mozilla::StyleSheet* XULComponentsSheet();
   mozilla::StyleSheet* QuirkSheet();
@@ -101,17 +100,16 @@ private:
   RefPtr<mozilla::StyleSheet> mCounterStylesSheet;
   RefPtr<mozilla::StyleSheet> mDesignModeSheet;
   RefPtr<mozilla::StyleSheet> mFormsSheet;
   RefPtr<mozilla::StyleSheet> mHTMLSheet;
   RefPtr<mozilla::StyleSheet> mMathMLSheet;
   RefPtr<mozilla::StyleSheet> mMinimalXULSheet;
   RefPtr<mozilla::StyleSheet> mNoFramesSheet;
   RefPtr<mozilla::StyleSheet> mNoScriptSheet;
-  RefPtr<mozilla::StyleSheet> mNumberControlSheet;
   RefPtr<mozilla::StyleSheet> mQuirkSheet;
   RefPtr<mozilla::StyleSheet> mSVGSheet;
   RefPtr<mozilla::StyleSheet> mScrollbarsSheet;
   RefPtr<mozilla::StyleSheet> mUASheet;
   RefPtr<mozilla::StyleSheet> mUserChromeSheet;
   RefPtr<mozilla::StyleSheet> mUserContentSheet;
   RefPtr<mozilla::StyleSheet> mXULSheet;
   RefPtr<mozilla::StyleSheet> mXULComponentsSheet;
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -1029,19 +1029,24 @@ input[type=range]::-moz-range-thumb {
   height: 1em;
   border: 0.1em solid #999;
   border-radius: 0.5em;
   background-color: #F0F0F0;
   /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
   -moz-user-select: none ! important;
 }
 
-/* As a temporary workaround until bug 677302 the rule for input[type=number]
- * has moved to number-control.css
- */
+input[type="number"] {
+  -moz-appearance: number-input;
+  /* Has to revert some properties applied by the generic input rule. */
+  -moz-binding: none;
+  inline-size: 20ch; /* It'd be nice if this matched the default inline-size
+                        of <input type=text>, but that's not easy to achieve
+                        due to platform differences. */
+}
 
 input[type=number]::-moz-number-wrapper {
   /* Prevent styling that would change the type of frame we construct. */
   display: flex;
   float: none !important;
   position: static !important;
   block-size: 100%;
 }
deleted file mode 100644
--- a/layout/style/res/number-control.css
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* This file exists purely because we need the styling for input[type=number]
- * to apply only if the pref dom.forms.number is true. Once bug 677302 is
- * fixed this rule can move back to forms.css.
- */
-
-input[type="number"] {
-  -moz-appearance: number-input;
-  /* Has to revert some properties applied by the generic input rule. */
-  -moz-binding: none;
-  inline-size: 20ch; /* It'd be nice if this matched the default inline-size
-                        of <input type=text>, but that's not easy to achieve
-                        due to platform differences. */
-}
-