Bug 1463820 - Add "widgets.css" as an author stylesheet for migrating "components.css". r=bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Sun, 24 Jun 2018 12:31:07 +0100
changeset 809967 97ad11e2640e791ea820aef34ca56138a7e0e63e
parent 809377 27e90ec610a4c8f6b2a73d79cb1a4df38e822e6a
child 809968 5fcb9f650fe82f7eac8ab8f6238f418b0e345092
push id113849
push userpaolo.mozmail@amadzone.org
push dateSun, 24 Jun 2018 11:35:53 +0000
reviewersbgrins
bugs1463820
milestone62.0a1
Bug 1463820 - Add "widgets.css" as an author stylesheet for migrating "components.css". r=bgrins MozReview-Commit-ID: CPJ3HcOZdIl
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsLayoutStylesheetCache.h
toolkit/content/components.css
toolkit/content/jar.mn
toolkit/content/widgets.css
toolkit/themes/linux/global/global.css
toolkit/themes/osx/global/global.css
toolkit/themes/windows/global/global.css
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -143,16 +143,27 @@ nsLayoutStylesheetCache::XULComponentsSh
     LoadSheetURL("chrome://global/content/components.css",
                  &mXULComponentsSheet, eAgentSheetFeatures, eCrash);
   }
 
   return mXULComponentsSheet;
 }
 
 StyleSheet*
+nsLayoutStylesheetCache::XULWidgetsSheet()
+{
+  if (!mXULWidgetsSheet) {
+    LoadSheetURL("chrome://global/content/widgets.css",
+                 &mXULWidgetsSheet, eAuthorSheetFeatures, eCrash);
+  }
+
+  return mXULWidgetsSheet;
+}
+
+StyleSheet*
 nsLayoutStylesheetCache::QuirkSheet()
 {
   return mQuirkSheet;
 }
 
 StyleSheet*
 nsLayoutStylesheetCache::SVGSheet()
 {
@@ -293,16 +304,17 @@ nsLayoutStylesheetCache::SizeOfIncluding
   MEASURE(mQuirkSheet);
   MEASURE(mSVGSheet);
   MEASURE(mScrollbarsSheet);
   MEASURE(mUASheet);
   MEASURE(mUserChromeSheet);
   MEASURE(mUserContentSheet);
   MEASURE(mXULSheet);
   MEASURE(mXULComponentsSheet);
+  MEASURE(mXULWidgetsSheet);
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
   // - gCSSLoader
 
   return n;
 }
 
@@ -332,16 +344,17 @@ nsLayoutStylesheetCache::nsLayoutStylesh
   LoadSheetURL("resource://gre-resources/quirk.css",
                &mQuirkSheet, eAgentSheetFeatures, eCrash);
   LoadSheetURL("resource://gre/res/svg.css",
                &mSVGSheet, eAgentSheetFeatures, eCrash);
   if (XRE_IsParentProcess()) {
     // We know we need xul.css for the UI, so load that now too:
     XULSheet();
     XULComponentsSheet();
+    XULWidgetsSheet();
   }
 
   if (gUserContentSheetURL) {
     MOZ_ASSERT(XRE_IsContentProcess(), "Only used in content processes.");
     LoadSheet(gUserContentSheetURL, &mUserContentSheet,
               eUserSheetFeatures, eLogToConsole);
     gUserContentSheetURL = nullptr;
   }
--- a/layout/style/nsLayoutStylesheetCache.h
+++ b/layout/style/nsLayoutStylesheetCache.h
@@ -47,16 +47,17 @@ class nsLayoutStylesheetCache final
   mozilla::StyleSheet* FormsSheet();
   mozilla::StyleSheet* UserContentSheet();
   mozilla::StyleSheet* UserChromeSheet();
   mozilla::StyleSheet* UASheet();
   mozilla::StyleSheet* HTMLSheet();
   mozilla::StyleSheet* MinimalXULSheet();
   mozilla::StyleSheet* XULSheet();
   mozilla::StyleSheet* XULComponentsSheet();
+  mozilla::StyleSheet* XULWidgetsSheet();
   mozilla::StyleSheet* QuirkSheet();
   mozilla::StyleSheet* SVGSheet();
   mozilla::StyleSheet* MathMLSheet();
   mozilla::StyleSheet* CounterStylesSheet();
   mozilla::StyleSheet* NoScriptSheet();
   mozilla::StyleSheet* NoFramesSheet();
   mozilla::StyleSheet* ChromePreferenceSheet(nsPresContext* aPresContext);
   mozilla::StyleSheet* ContentPreferenceSheet(nsPresContext* aPresContext);
@@ -108,11 +109,12 @@ private:
   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;
+  RefPtr<mozilla::StyleSheet> mXULWidgetsSheet;
 };
 
 #endif
--- a/toolkit/content/components.css
+++ b/toolkit/content/components.css
@@ -1,14 +1,19 @@
 /* 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/. */
 
-/* ===== components.css =================================================
-  == Styles ported from XBL <resources>, loaded as UA styles in every XUL doc
-  ======================================================================= */
+/* ===== components.css ==================================================
+   ==
+   == THESE STYLES WILL BE MOVED TO "widgets.css".
+   ==
+   == These are loaded as UA syles, but eventually they will become
+   == document styles in "widgets.css". See bug 1463820 for details.
+   ==
+   ======================================================================= */
 
 @import url("chrome://global/skin/dropmarker.css");
 @import url("chrome://global/skin/groupbox.css");
 @import url("chrome://global/skin/menu.css");
 @import url("chrome://global/skin/menulist.css");
 @import url("chrome://global/skin/toolbar.css");
 @import url("chrome://global/skin/splitter.css");
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -57,16 +57,17 @@ toolkit.jar:
    content/global/resetProfile.xul
    content/global/resetProfileProgress.xul
    content/global/TopLevelVideoDocument.js
    content/global/timepicker.xhtml
    content/global/treeUtils.js
 #ifndef MOZ_FENNEC
    content/global/viewZoomOverlay.js
 #endif
+   content/global/widgets.css
    content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
    content/global/bindings/browser.xml         (widgets/browser.xml)
    content/global/bindings/button.xml          (widgets/button.xml)
    content/global/bindings/calendar.js         (widgets/calendar.js)
    content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
    content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
    content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
    content/global/bindings/datepicker.js       (widgets/datepicker.js)
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets.css
@@ -0,0 +1,7 @@
+/* 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/. */
+
+/* ===== widgets.css =====================================================
+   == Styles ported from XBL <resources>, loaded in every XUL document.
+   ======================================================================= */
--- a/toolkit/themes/linux/global/global.css
+++ b/toolkit/themes/linux/global/global.css
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== global.css =====================================================
   == Styles that apply everywhere.
   ======================================================================= */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/content/widgets.css");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
 }
--- a/toolkit/themes/osx/global/global.css
+++ b/toolkit/themes/osx/global/global.css
@@ -1,14 +1,15 @@
 /* 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/. */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/content/widgets.css");
 
 %include shared.inc
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
--- a/toolkit/themes/windows/global/global.css
+++ b/toolkit/themes/windows/global/global.css
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== global.css =====================================================
   == Styles that apply everywhere.
   ======================================================================= */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/content/widgets.css");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
 }