Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
roytam1 2021-04-02 10:50:32 +08:00
commit 7f6520be1a
85 changed files with 1013 additions and 385 deletions

View file

@ -1,6 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Services = object with smart getters for common XPCOM services // Services = object with smart getters for common XPCOM services
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: HTML -*- <!-- -*- Mode: HTML -*-
# This Source Code Form is subject to the terms of the Mozilla Public 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<bindings id="tabPreviews" <bindings id="tabPreviews"
xmlns="http://www.mozilla.org/xbl" xmlns="http://www.mozilla.org/xbl"

View file

@ -1,12 +0,0 @@
<stringbundleset id="stringbundleset"/>
<commandset id="mainCommandSet"/>
<commandset id="baseMenuCommandSet"/>
<commandset id="placesCommands"/>
<broadcasterset id="mainBroadcasterSet"/>
<keyset id="mainKeyset"/>
<keyset id="baseMenuKeyset"/>
<menubar id="main-menubar"/>

View file

@ -1,32 +0,0 @@
<?xml version="1.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/.
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
<overlay id="downloadManagerOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="downloadManager">
#include browserMountPoints.inc
<script type="application/javascript"><![CDATA[
window.addEventListener("load", function(event) {
// Bug 405696: Map Edit -> Find command to the download manager's command
var findMenuItem = document.getElementById("menu_find");
findMenuItem.setAttribute("command", "cmd_findDownload");
findMenuItem.setAttribute("key", "key_findDownload");
// Bug 429614: Map Edit -> Select All command to download manager's command
let selectAllMenuItem = document.getElementById("menu_selectAll");
selectAllMenuItem.setAttribute("command", "cmd_selectAllDownloads");
selectAllMenuItem.setAttribute("key", "key_selectAllDownloads");
}, false);
]]></script>
</window>
</overlay>

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: HTML -*- <!-- -*- Mode: HTML -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

View file

@ -1,18 +0,0 @@
<?xml version="1.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/.
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
<overlay id="jsConsoleOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="JSConsoleWindow">
#include browserMountPoints.inc
</window>
</overlay>

View file

@ -1,67 +0,0 @@
<?xml version="1.0"?>
# -*- Mode: HTML -*-
#
# 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/.
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
# All DTD information is stored in a separate file so that it can be shared by
# hiddenWindow.xul.
#include browser-doctype.inc
<overlay id="hidden-overlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
# All JS files which are not content (only) dependent that browser.xul
# wishes to include *must* go into the global-scripts.inc file
# so that they can be shared by this overlay.
#include global-scripts.inc
#ifdef MOZ_DEVTOOLS
#include global-devtools-theme-scripts.inc
#endif
<script type="application/javascript">
function OpenBrowserWindowFromDockMenu(options) {
let win = OpenBrowserWindow(options);
win.addEventListener("load", function listener() {
win.removeEventListener("load", listener);
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
.getService(Ci.nsIMacDockSupport);
dockSupport.activateApplication(true);
});
return win;
}
addEventListener("load", function() { gBrowserInit.nonBrowserWindowStartup() }, false);
addEventListener("unload", function() { gBrowserInit.nonBrowserWindowShutdown() }, false);
</script>
# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
# browser-sets.inc file for sharing with hiddenWindow.xul.
#include browser-sets.inc
# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by
# hiddenWindow.xul.
#include browser-menubar.inc
<!-- Dock menu -->
<popupset>
<menupopup id="menu_mac_dockmenu">
<!-- The command cannot be cmd_newNavigator because we need to activate
the application. -->
<menuitem label="&newNavigatorCmd.label;" oncommand="OpenBrowserWindowFromDockMenu();"
id="macDockMenuNewWindow" />
<menuitem label="&newPrivateWindow.label;" oncommand="OpenBrowserWindowFromDockMenu({private: true});" />
</menupopup>
</popupset>
</overlay>

View file

@ -1,7 +1,7 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",

View file

@ -1,18 +0,0 @@
<?xml version="1.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/.
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
<overlay id="softwareUpdateOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="updates">
#include browserMountPoints.inc
</window>
</overlay>

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: HTML -*- <!-- -*- Mode: HTML -*-
# This Source Code Form is subject to the terms of the Mozilla Public 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE bindings [ <!DOCTYPE bindings [
<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd"> <!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd">

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?> <?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>

View file

@ -11,7 +11,7 @@ browser.jar:
% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css % style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css
% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/ % style chrome://global/content/customizeToolbar.xul chrome://browser/skin/
* content/browser/aboutDialog.xul (content/aboutDialog.xul) * content/browser/aboutDialog.xul (content/aboutDialog.xul)
* content/browser/aboutDialog.js (content/aboutDialog.js) content/browser/aboutDialog.js (content/aboutDialog.js)
content/browser/aboutDialog.css (content/aboutDialog.css) content/browser/aboutDialog.css (content/aboutDialog.css)
content/browser/autorecovery.js (content/autorecovery.js) content/browser/autorecovery.js (content/autorecovery.js)
content/browser/autorecovery.xul (content/autorecovery.xul) content/browser/autorecovery.xul (content/autorecovery.xul)
@ -24,7 +24,7 @@ browser.jar:
#ifdef MOZ_DEVTOOLS #ifdef MOZ_DEVTOOLS
content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js) content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js)
#endif #endif
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
content/browser/content.js (content/content.js) content/browser/content.js (content/content.js)
content/browser/padlock.xul (content/padlock.xul) content/browser/padlock.xul (content/padlock.xul)
content/browser/padlock.js (content/padlock.js) content/browser/padlock.js (content/padlock.js)
@ -45,23 +45,23 @@ browser.jar:
content/browser/safeMode.css (content/safeMode.css) content/browser/safeMode.css (content/safeMode.css)
content/browser/safeMode.js (content/safeMode.js) content/browser/safeMode.js (content/safeMode.js)
* content/browser/safeMode.xul (content/safeMode.xul) * content/browser/safeMode.xul (content/safeMode.xul)
* content/browser/sanitize.js (content/sanitize.js) content/browser/sanitize.js (content/sanitize.js)
* content/browser/sanitize.xul (content/sanitize.xul) * content/browser/sanitize.xul (content/sanitize.xul)
* content/browser/sanitizeDialog.js (content/sanitizeDialog.js) * content/browser/sanitizeDialog.js (content/sanitizeDialog.js)
content/browser/sanitizeDialog.css (content/sanitizeDialog.css) content/browser/sanitizeDialog.css (content/sanitizeDialog.css)
content/browser/autocomplete.css (content/autocomplete.css) content/browser/autocomplete.css (content/autocomplete.css)
* content/browser/autocomplete.xml (content/autocomplete.xml) content/browser/autocomplete.xml (content/autocomplete.xml)
content/browser/tabbrowser.css (content/tabbrowser.css) content/browser/tabbrowser.css (content/tabbrowser.css)
* content/browser/tabbrowser.xml (content/tabbrowser.xml) * content/browser/tabbrowser.xml (content/tabbrowser.xml)
* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
* content/browser/utilityOverlay.js (content/utilityOverlay.js) * content/browser/utilityOverlay.js (content/utilityOverlay.js)
content/browser/web-panels.js (content/web-panels.js) content/browser/web-panels.js (content/web-panels.js)
* content/browser/web-panels.xul (content/web-panels.xul) * content/browser/web-panels.xul (content/web-panels.xul)
* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul) * content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul)
* content/browser/nsContextMenu.js (content/nsContextMenu.js) * content/browser/nsContextMenu.js (content/nsContextMenu.js)
# XXX: We should exclude this one as well (bug 71895) # XXX: We should exclude this one as well (bug 71895)
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul) content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul)
#ifdef XP_WIN #ifdef XP_WIN
content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul)
#endif #endif

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://browser/content/downloads/allDownloadsViewOverlay.css"?> <?xml-stylesheet href="chrome://browser/content/downloads/allDownloadsViewOverlay.css"?>
<?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?> <?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?>

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/"?> <?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://browser/content/downloads/contentAreaDownloadsView.css"?> <?xml-stylesheet href="chrome://browser/content/downloads/contentAreaDownloadsView.css"?>

View file

@ -1,8 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: HTML; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# License, v. 2.0. If a copy of the MPL was not distributed with this file, file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
# You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://browser/content/downloads/downloads.css"?> <?xml-stylesheet href="chrome://browser/content/downloads/downloads.css"?>
<?xml-stylesheet href="chrome://browser/skin/downloads/downloads.css"?> <?xml-stylesheet href="chrome://browser/skin/downloads/downloads.css"?>

View file

@ -3,16 +3,16 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar: browser.jar:
* content/browser/downloads/download.xml (content/download.xml) content/browser/downloads/download.xml (content/download.xml)
content/browser/downloads/download.css (content/download.css) content/browser/downloads/download.css (content/download.css)
content/browser/downloads/downloads.css (content/downloads.css) content/browser/downloads/downloads.css (content/downloads.css)
* content/browser/downloads/downloads.js (content/downloads.js) content/browser/downloads/downloads.js (content/downloads.js)
* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul) content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul)
content/browser/downloads/indicator.js (content/indicator.js) content/browser/downloads/indicator.js (content/indicator.js)
content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul) content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul)
* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul) content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul)
content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js) content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js)
content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css) content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css)
* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul) content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul)
content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js) content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js)
content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css) content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css)

View file

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar: browser.jar:
* content/browser/pageinfo/pageInfo.xul content/browser/pageinfo/pageInfo.xul
content/browser/pageinfo/pageInfo.js content/browser/pageinfo/pageInfo.js
content/browser/pageinfo/pageInfo.css content/browser/pageinfo/pageInfo.css
content/browser/pageinfo/pageInfo.xml content/browser/pageinfo/pageInfo.xml

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://browser/content/pageinfo/pageInfo.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/pageinfo/pageInfo.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/pageInfo.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/pageInfo.css" type="text/css"?>

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- --> <?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://browser/content/places/places.css"?> <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<bindings id="placesMenuBindings" <bindings id="placesMenuBindings"
xmlns="http://www.mozilla.org/xbl" xmlns="http://www.mozilla.org/xbl"

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://browser/content/places/places.css"?> <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/content/places/organizer.css"?> <?xml-stylesheet href="chrome://browser/content/places/organizer.css"?>

View file

@ -1,7 +1,7 @@
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- // -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
var SidebarUtils = { var SidebarUtils = {
handleTreeClick: function(aTree, aEvent, aGutterSelect) { handleTreeClick: function(aTree, aEvent, aGutterSelect) {

View file

@ -8,27 +8,27 @@ browser.jar:
# attributes separately # attributes separately
content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul) content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul)
* content/browser/places/places.xul (content/places.xul) * content/browser/places/places.xul (content/places.xul)
* content/browser/places/places.js (content/places.js) content/browser/places/places.js (content/places.js)
content/browser/places/places.css (content/places.css) content/browser/places/places.css (content/places.css)
content/browser/places/organizer.css (content/organizer.css) content/browser/places/organizer.css (content/organizer.css)
content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul) content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul)
content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js) content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js)
content/browser/places/placesOverlay.xul (content/placesOverlay.xul) content/browser/places/placesOverlay.xul (content/placesOverlay.xul)
* content/browser/places/menu.xml (content/menu.xml) content/browser/places/menu.xml (content/menu.xml)
content/browser/places/tree.xml (content/tree.xml) content/browser/places/tree.xml (content/tree.xml)
content/browser/places/controller.js (content/controller.js) content/browser/places/controller.js (content/controller.js)
content/browser/places/treeView.js (content/treeView.js) content/browser/places/treeView.js (content/treeView.js)
* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js)
# keep the Places version of the history sidebar at history/history-panel.xul # keep the Places version of the history sidebar at history/history-panel.xul
# to prevent having to worry about between versions of the browser # to prevent having to worry about between versions of the browser
* content/browser/history/history-panel.xul (content/history-panel.xul) content/browser/history/history-panel.xul (content/history-panel.xul)
content/browser/places/history-panel.js (content/history-panel.js) content/browser/places/history-panel.js (content/history-panel.js)
# ditto for the bookmarks sidebar # ditto for the bookmarks sidebar
content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul) content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul)
content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js) content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js)
* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js) content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js)
content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul) content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul)
content/browser/places/moveBookmarks.js (content/moveBookmarks.js) content/browser/places/moveBookmarks.js (content/moveBookmarks.js)
content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul) content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul)
content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js) content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js)
* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul) content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul)

View file

@ -1,7 +1,6 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/.
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Load DownloadUtils module for convertByteUnits // Load DownloadUtils module for convertByteUnits
Components.utils.import("resource://gre/modules/DownloadUtils.jsm"); Components.utils.import("resource://gre/modules/DownloadUtils.jsm");

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE overlay [ <!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">

View file

@ -1,6 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
var gAppManagerDialog = { var gAppManagerDialog = {
_removed: [], _removed: [],

View file

@ -1,9 +1,6 @@
/* // This Source Code Form is subject to the terms of the Mozilla Public
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- // License, v. 2.0. If a copy of the MPL was not distributed with this
# This Source Code Form is subject to the terms of the Mozilla Public // file, You can obtain one at http://mozilla.org/MPL/2.0/.
# 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/.
*/
//****************************************************************************// //****************************************************************************//
// Constants & Enumeration Values // Constants & Enumeration Values

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gConnectionsDialog = { var gConnectionsDialog = {
beforeAccept: function () beforeAccept: function ()

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/connection.dtd"> <!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/connection.dtd">

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gContentPane = { var gContentPane = {

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const nsICookie = Components.interfaces.nsICookie; const nsICookie = Components.interfaces.nsICookie;

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// browser.display.languageList LOCK ALL when LOCKED // browser.display.languageList LOCK ALL when LOCKED

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

View file

@ -8,25 +8,25 @@ browser.jar:
content/browser/preferences/applications.xul content/browser/preferences/applications.xul
* content/browser/preferences/applications.js * content/browser/preferences/applications.js
content/browser/preferences/applicationManager.xul content/browser/preferences/applicationManager.xul
* content/browser/preferences/applicationManager.js content/browser/preferences/applicationManager.js
* content/browser/preferences/colors.xul * content/browser/preferences/colors.xul
* content/browser/preferences/cookies.xul content/browser/preferences/cookies.xul
* content/browser/preferences/cookies.js content/browser/preferences/cookies.js
* content/browser/preferences/content.xul * content/browser/preferences/content.xul
content/browser/preferences/content.js content/browser/preferences/content.js
* content/browser/preferences/connection.xul content/browser/preferences/connection.xul
content/browser/preferences/connection.js content/browser/preferences/connection.js
* content/browser/preferences/fonts.xul content/browser/preferences/fonts.xul
content/browser/preferences/fonts.js content/browser/preferences/fonts.js
content/browser/preferences/handlers.xml content/browser/preferences/handlers.xml
content/browser/preferences/handlers.css content/browser/preferences/handlers.css
* content/browser/preferences/languages.xul content/browser/preferences/languages.xul
content/browser/preferences/languages.js content/browser/preferences/languages.js
* content/browser/preferences/main.xul * content/browser/preferences/main.xul
content/browser/preferences/main.js content/browser/preferences/main.js
content/browser/preferences/newtaburl.js content/browser/preferences/newtaburl.js
content/browser/preferences/permissions.xul content/browser/preferences/permissions.xul
* content/browser/preferences/permissions.js content/browser/preferences/permissions.js
* content/browser/preferences/preferences.xul * content/browser/preferences/preferences.xul
content/browser/preferences/privacy.xul content/browser/preferences/privacy.xul
content/browser/preferences/privacy.js content/browser/preferences/privacy.js

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gLanguagesDialog = { var gLanguagesDialog = {

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/languages.dtd"> <!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/languages.dtd">

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE overlay [ <!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">

View file

@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. */ // file, You can obtain one at http://mozilla.org/MPL/2.0/.
var gNewtabUrl = { var gNewtabUrl = {
/** /**

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/global.css"?> <?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?> <?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gSanitizeDialog = Object.freeze({ var gSanitizeDialog = Object.freeze({
onClearHistoryChanged: function () { onClearHistoryChanged: function () {

View file

@ -1,7 +1,6 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper", XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
"resource://gre/modules/LoginHelper.jsm"); "resource://gre/modules/LoginHelper.jsm");

View file

@ -1,7 +1,6 @@
//* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ // This Source Code Form is subject to the terms of the Mozilla Public
/* 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
* 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/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** /**
* SelectBookmarkDialog controls the user interface for the "Use Bookmark for * SelectBookmarkDialog controls the user interface for the "Use Bookmark for

View file

@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public // 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 // 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/. */ // file, You can obtain one at http://mozilla.org/MPL/2.0/.
Components.utils.import("resource://services-sync/main.js"); Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");

View file

@ -1,7 +1,6 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/.
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
var gTabsPane = { var gTabsPane = {

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE overlay [ <!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
# This Source Code Form is subject to the terms of the Mozilla Public 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/.
--> -->
<!DOCTYPE html [ <!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

View file

@ -3,4 +3,4 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar: browser.jar:
* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml) content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml)

View file

@ -1,8 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: HTML -*- <!-- This Source Code Form is subject to the terms of the Mozilla Public
# 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
# 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/. -->
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<!DOCTYPE bindings [ <!DOCTYPE bindings [
<!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd" > <!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd" >

View file

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar: browser.jar:
* content/browser/search/search.xml (content/search.xml) content/browser/search/search.xml (content/search.xml)
content/browser/search/searchbarBindings.css (content/searchbarBindings.css) content/browser/search/searchbarBindings.css (content/searchbarBindings.css)
content/browser/search/engineManager.xul (content/engineManager.xul) content/browser/search/engineManager.xul (content/engineManager.xul)
content/browser/search/engineManager.js (content/engineManager.js) content/browser/search/engineManager.js (content/engineManager.js)

View file

@ -4,5 +4,5 @@
browser.jar: browser.jar:
* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml) * content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml)
* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js) content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js)
content/browser/content-sessionStore.js (content/content-sessionStore.js) content/browser/content-sessionStore.js (content/content-sessionStore.js)

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- --> <?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
# This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 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/. file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/setDesktopBackground.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/setDesktopBackground.css" type="text/css"?>

View file

@ -3,5 +3,5 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar: browser.jar:
* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul)
* content/browser/setDesktopBackground.js (content/setDesktopBackground.js) * content/browser/setDesktopBackground.js (content/setDesktopBackground.js)

View file

@ -6,11 +6,39 @@
#include "mozilla/dom/HTMLDetailsElement.h" #include "mozilla/dom/HTMLDetailsElement.h"
#include "mozilla/dom/HTMLDetailsElementBinding.h" #include "mozilla/dom/HTMLDetailsElementBinding.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Details) #include "mozilla/dom/HTMLUnknownElement.h"
#include "mozilla/Preferences.h"
// Expand NS_IMPL_NS_NEW_HTML_ELEMENT(Details) to add pref check.
nsGenericHTMLElement*
NS_NewHTMLDetailsElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
if (!mozilla::dom::HTMLDetailsElement::IsDetailsEnabled()) {
return new mozilla::dom::HTMLUnknownElement(aNodeInfo);
}
return new mozilla::dom::HTMLDetailsElement(aNodeInfo);
}
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
/* static */ bool
HTMLDetailsElement::IsDetailsEnabled()
{
static bool isDetailsEnabled = false;
static bool added = false;
if (!added) {
Preferences::AddBoolVarCache(&isDetailsEnabled,
"dom.details_element.enabled");
added = true;
}
return isDetailsEnabled;
}
HTMLDetailsElement::~HTMLDetailsElement() HTMLDetailsElement::~HTMLDetailsElement()
{ {
} }

View file

@ -23,6 +23,8 @@ class HTMLDetailsElement final : public nsGenericHTMLElement
public: public:
using NodeInfo = mozilla::dom::NodeInfo; using NodeInfo = mozilla::dom::NodeInfo;
static bool IsDetailsEnabled();
explicit HTMLDetailsElement(already_AddRefed<NodeInfo>& aNodeInfo) explicit HTMLDetailsElement(already_AddRefed<NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo) : nsGenericHTMLElement(aNodeInfo)
{ {

View file

@ -14,7 +14,17 @@
#include "mozilla/TextEvents.h" #include "mozilla/TextEvents.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Summary) // Expand NS_IMPL_NS_NEW_HTML_ELEMENT(Summary) to add pref check.
nsGenericHTMLElement*
NS_NewHTMLSummaryElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
if (!mozilla::dom::HTMLDetailsElement::IsDetailsEnabled()) {
return new mozilla::dom::HTMLUnknownElement(aNodeInfo);
}
return new mozilla::dom::HTMLSummaryElement(aNodeInfo);
}
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -95,6 +95,7 @@ interface GlobalEventHandlers {
[Pref="dom.select_events.enabled"] [Pref="dom.select_events.enabled"]
attribute EventHandler onselectstart; attribute EventHandler onselectstart;
[Pref="dom.details_element.enabled"]
attribute EventHandler ontoggle; attribute EventHandler ontoggle;
// Pointer events handlers // Pointer events handlers

View file

@ -11,7 +11,7 @@
* and create derivative works of this document. * and create derivative works of this document.
*/ */
[HTMLConstructor] [HTMLConstructor, Pref="dom.details_element.enabled"]
interface HTMLDetailsElement : HTMLElement { interface HTMLDetailsElement : HTMLElement {
[CEReactions, SetterThrows] [CEReactions, SetterThrows]
attribute boolean open; attribute boolean open;

View file

@ -0,0 +1,133 @@
Add an ICU API for formatting a number into constituent parts (sign, integer, grouping separator, decimal, fraction, &c.) for use in implementing Intl.NumberFormat.prototype.formatToParts.
https://ssl.icu-project.org/trac/ticket/12684
diff --git a/intl/icu/source/i18n/unicode/unum.h b/intl/icu/source/i18n/unicode/unum.h
--- a/intl/icu/source/i18n/unicode/unum.h
+++ b/intl/icu/source/i18n/unicode/unum.h
@@ -20,16 +20,17 @@
#include "unicode/localpointer.h"
#include "unicode/uloc.h"
#include "unicode/ucurr.h"
#include "unicode/umisc.h"
#include "unicode/parseerr.h"
#include "unicode/uformattable.h"
#include "unicode/udisplaycontext.h"
+#include "unicode/ufieldpositer.h"
/**
* \file
* \brief C API: NumberFormat
*
* <h2> Number Format C API </h2>
*
* Number Format C API Provides functions for
@@ -647,16 +648,66 @@ U_STABLE int32_t U_EXPORT2
unum_formatUFormattable(const UNumberFormat* fmt,
const UFormattable *number,
UChar *result,
int32_t resultLength,
UFieldPosition *pos,
UErrorCode *status);
/**
+* Format a double using a UNumberFormat according to the UNumberFormat's locale,
+* and initialize a UFieldPositionIterator that enumerates the subcomponents of
+* the resulting string.
+*
+* @param format
+* The formatter to use.
+* @param number
+* The number to format.
+* @param result
+* A pointer to a buffer to receive the NULL-terminated formatted
+* number. If the formatted number fits into dest but cannot be
+* NULL-terminated (length == resultLength) then the error code is set
+* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't
+* fit into result then the error code is set to
+* U_BUFFER_OVERFLOW_ERROR.
+* @param resultLength
+* The maximum size of result.
+* @param fpositer
+* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open}
+* (may be NULL if field position information is not needed, but in this
+* case it's preferable to use {@link #unum_formatDouble}). Iteration
+* information already present in the UFieldPositionIterator is deleted,
+* and the iterator is reset to apply to the fields in the formatted
+* string created by this function call. The field values and indexes
+* returned by {@link #ufieldpositer_next} represent fields denoted by
+* the UNumberFormatFields enum. Fields are not returned in a guaranteed
+* order. Fields cannot overlap, but they may nest. For example, 1234
+* could format as "1,234" which might consist of a grouping separator
+* field for ',' and an integer field encompassing the entire string.
+* @param status
+* A pointer to an UErrorCode to receive any errors
+* @return
+* The total buffer size needed; if greater than resultLength, the
+* output was truncated.
+* @see unum_formatDouble
+* @see unum_parse
+* @see unum_parseDouble
+* @see UFieldPositionIterator
+* @see UNumberFormatFields
+* @stable ICU 59
+*/
+U_STABLE int32_t U_EXPORT2
+unum_formatDoubleForFields(const UNumberFormat* format,
+ double number,
+ UChar* result,
+ int32_t resultLength,
+ UFieldPositionIterator* fpositer,
+ UErrorCode* status);
+
+/**
* Parse a string into an integer using a UNumberFormat.
* The string will be parsed according to the UNumberFormat's locale.
* Note: parsing is not supported for styles UNUM_DECIMAL_COMPACT_SHORT
* and UNUM_DECIMAL_COMPACT_LONG.
* @param fmt The formatter to use.
* @param text The text to parse.
* @param textLength The length of text, or -1 if null-terminated.
* @param parsePos If not NULL, on input a pointer to an integer specifying the offset at which
diff --git a/intl/icu/source/i18n/unum.cpp b/intl/icu/source/i18n/unum.cpp
--- a/intl/icu/source/i18n/unum.cpp
+++ b/intl/icu/source/i18n/unum.cpp
@@ -870,9 +870,37 @@ unum_formatUFormattable(const UNumberFor
if(pos != 0) {
pos->beginIndex = fp.getBeginIndex();
pos->endIndex = fp.getEndIndex();
}
return res.extract(result, resultLength, *status);
}
+U_CAPI int32_t U_EXPORT2
+unum_formatDoubleForFields(const UNumberFormat* format,
+ double number,
+ UChar* result,
+ int32_t resultLength,
+ UFieldPositionIterator* fpositer,
+ UErrorCode* status)
+{
+ if (U_FAILURE(*status))
+ return -1;
+
+ if (result == NULL ? resultLength != 0 : resultLength < 0) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return -1;
+ }
+
+ UnicodeString res;
+ if (result != NULL) {
+ // NULL destination for pure preflighting: empty dummy string
+ // otherwise, alias the destination buffer
+ res.setTo(result, 0, resultLength);
+ }
+
+ ((const NumberFormat*)format)->format(number, res, (FieldPositionIterator*)fpositer, *status);
+
+ return res.extract(result, resultLength, *status);
+}
+
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -25,6 +25,7 @@
#include "unicode/parseerr.h" #include "unicode/parseerr.h"
#include "unicode/uformattable.h" #include "unicode/uformattable.h"
#include "unicode/udisplaycontext.h" #include "unicode/udisplaycontext.h"
#include "unicode/ufieldpositer.h"
/** /**
* \file * \file
@ -651,6 +652,56 @@ unum_formatUFormattable(const UNumberFormat* fmt,
UFieldPosition *pos, UFieldPosition *pos,
UErrorCode *status); UErrorCode *status);
/**
* Format a double using a UNumberFormat according to the UNumberFormat's locale,
* and initialize a UFieldPositionIterator that enumerates the subcomponents of
* the resulting string.
*
* @param format
* The formatter to use.
* @param number
* The number to format.
* @param result
* A pointer to a buffer to receive the NULL-terminated formatted
* number. If the formatted number fits into dest but cannot be
* NULL-terminated (length == resultLength) then the error code is set
* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't
* fit into result then the error code is set to
* U_BUFFER_OVERFLOW_ERROR.
* @param resultLength
* The maximum size of result.
* @param fpositer
* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open}
* (may be NULL if field position information is not needed, but in this
* case it's preferable to use {@link #unum_formatDouble}). Iteration
* information already present in the UFieldPositionIterator is deleted,
* and the iterator is reset to apply to the fields in the formatted
* string created by this function call. The field values and indexes
* returned by {@link #ufieldpositer_next} represent fields denoted by
* the UNumberFormatFields enum. Fields are not returned in a guaranteed
* order. Fields cannot overlap, but they may nest. For example, 1234
* could format as "1,234" which might consist of a grouping separator
* field for ',' and an integer field encompassing the entire string.
* @param status
* A pointer to an UErrorCode to receive any errors
* @return
* The total buffer size needed; if greater than resultLength, the
* output was truncated.
* @see unum_formatDouble
* @see unum_parse
* @see unum_parseDouble
* @see UFieldPositionIterator
* @see UNumberFormatFields
* @stable ICU 59
*/
U_STABLE int32_t U_EXPORT2
unum_formatDoubleForFields(const UNumberFormat* format,
double number,
UChar* result,
int32_t resultLength,
UFieldPositionIterator* fpositer,
UErrorCode* status);
/** /**
* Parse a string into an integer using a UNumberFormat. * Parse a string into an integer using a UNumberFormat.
* The string will be parsed according to the UNumberFormat's locale. * The string will be parsed according to the UNumberFormat's locale.

View file

@ -875,4 +875,32 @@ unum_formatUFormattable(const UNumberFormat* fmt,
return res.extract(result, resultLength, *status); return res.extract(result, resultLength, *status);
} }
U_CAPI int32_t U_EXPORT2
unum_formatDoubleForFields(const UNumberFormat* format,
double number,
UChar* result,
int32_t resultLength,
UFieldPositionIterator* fpositer,
UErrorCode* status)
{
if (U_FAILURE(*status))
return -1;
if (result == NULL ? resultLength != 0 : resultLength < 0) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return -1;
}
UnicodeString res;
if (result != NULL) {
// NULL destination for pure preflighting: empty dummy string
// otherwise, alias the destination buffer
res.setTo(result, 0, resultLength);
}
((const NumberFormat*)format)->format(number, res, (FieldPositionIterator*)fpositer, *status);
return res.extract(result, resultLength, *status);
}
#endif /* #if !UCONFIG_NO_FORMATTING */ #endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -72,6 +72,7 @@ for patch in \
bug-1198952-workaround-make-3.82-bug.diff \ bug-1198952-workaround-make-3.82-bug.diff \
bug-1228227-bug-1263325-libc++-gcc_hidden.diff \ bug-1228227-bug-1263325-libc++-gcc_hidden.diff \
ucol_getKeywordValuesForLocale-ulist_resetList.diff \ ucol_getKeywordValuesForLocale-ulist_resetList.diff \
unum_formatDoubleForFields.diff \
; do ; do
echo "Applying local patch $patch" echo "Applying local patch $patch"
patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch

View file

@ -13,7 +13,6 @@
#include "mozilla/Casting.h" #include "mozilla/Casting.h"
#include "mozilla/PodOperations.h" #include "mozilla/PodOperations.h"
#include "mozilla/Range.h" #include "mozilla/Range.h"
#include "mozilla/ScopeExit.h"
#include <string.h> #include <string.h>
@ -23,6 +22,7 @@
#include "jsobj.h" #include "jsobj.h"
#include "builtin/IntlTimeZoneData.h" #include "builtin/IntlTimeZoneData.h"
#include "ds/Sort.h"
#include "unicode/plurrule.h" #include "unicode/plurrule.h"
#include "unicode/ucal.h" #include "unicode/ucal.h"
#include "unicode/ucol.h" #include "unicode/ucol.h"
@ -48,8 +48,8 @@ using namespace js;
using mozilla::AssertedCast; using mozilla::AssertedCast;
using mozilla::IsFinite; using mozilla::IsFinite;
using mozilla::IsNaN;
using mozilla::IsNegativeZero; using mozilla::IsNegativeZero;
using mozilla::MakeScopeExit;
using mozilla::PodCopy; using mozilla::PodCopy;
@ -755,6 +755,7 @@ static const JSFunctionSpec numberFormat_static_methods[] = {
static const JSFunctionSpec numberFormat_methods[] = { static const JSFunctionSpec numberFormat_methods[] = {
JS_SELF_HOSTED_FN("resolvedOptions", "Intl_NumberFormat_resolvedOptions", 0, 0), JS_SELF_HOSTED_FN("resolvedOptions", "Intl_NumberFormat_resolvedOptions", 0, 0),
JS_SELF_HOSTED_FN("formatToParts", "Intl_NumberFormat_formatToParts", 1, 0),
#if JS_HAS_TOSOURCE #if JS_HAS_TOSOURCE
JS_FN(js_toSource_str, numberFormat_toSource, 0, 0), JS_FN(js_toSource_str, numberFormat_toSource, 0, 0),
#endif #endif
@ -1186,31 +1187,55 @@ NewUNumberFormat(JSContext* cx, HandleObject numberFormat)
return toClose.forget(); return toClose.forget();
} }
static bool using FormattedNumberChars = Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE>;
intl_FormatNumber(JSContext* cx, UNumberFormat* nf, double x, MutableHandleValue result)
{
// FormatNumber doesn't consider -0.0 to be negative.
if (IsNegativeZero(x))
x = 0.0;
Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE> chars(cx); static bool
if (!chars.resize(INITIAL_CHAR_BUFFER_SIZE)) PartitionNumberPattern(JSContext* cx, UNumberFormat* nf, double* x,
return false; UFieldPositionIterator* fpositer, FormattedNumberChars& formattedChars)
UErrorCode status = U_ZERO_ERROR; {
int size = unum_formatDouble(nf, x, Char16ToUChar(chars.begin()), INITIAL_CHAR_BUFFER_SIZE, // PartitionNumberPattern doesn't consider -0.0 to be negative.
nullptr, &status); if (IsNegativeZero(*x))
*x = 0.0;
MOZ_ASSERT(formattedChars.length() == 0,
"formattedChars must initially be empty");
MOZ_ALWAYS_TRUE(formattedChars.resize(INITIAL_CHAR_BUFFER_SIZE));
UErrorCode status = U_ZERO_ERROR;
int32_t resultSize;
resultSize =
unum_formatDoubleForFields(nf, *x,
Char16ToUChar(formattedChars.begin()), INITIAL_CHAR_BUFFER_SIZE,
fpositer, &status);
if (status == U_BUFFER_OVERFLOW_ERROR) { if (status == U_BUFFER_OVERFLOW_ERROR) {
if (!chars.resize(size)) if (!formattedChars.resize(size_t(resultSize)))
return false; return false;
status = U_ZERO_ERROR; status = U_ZERO_ERROR;
unum_formatDouble(nf, x, Char16ToUChar(chars.begin()), size, nullptr, &status); #ifdef DEBUG
int32_t size =
#endif
unum_formatDoubleForFields(nf, *x, Char16ToUChar(formattedChars.begin()), resultSize,
fpositer, &status);
MOZ_ASSERT(size == resultSize);
} }
if (U_FAILURE(status)) { if (U_FAILURE(status)) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR); JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
return false; return false;
} }
JSString* str = NewStringCopyN<CanGC>(cx, chars.begin(), size); return formattedChars.resize(size_t(resultSize));
}
static bool
intl_FormatNumber(JSContext* cx, UNumberFormat* nf, double x, MutableHandleValue result)
{
// Passing null for |fpositer| will just not compute partition information,
// letting us common up all ICU number-formatting code.
FormattedNumberChars chars(cx);
if (!PartitionNumberPattern(cx, nf, &x, nullptr, chars))
return false;
JSString* str = NewStringCopyN<CanGC>(cx, chars.begin(), chars.length());
if (!str) if (!str)
return false; return false;
@ -1218,13 +1243,410 @@ intl_FormatNumber(JSContext* cx, UNumberFormat* nf, double x, MutableHandleValue
return true; return true;
} }
using FieldType = ImmutablePropertyNamePtr JSAtomState::*;
static FieldType
GetFieldTypeForNumberField(UNumberFormatFields fieldName, double d)
{
// See intl/icu/source/i18n/unicode/unum.h for a detailed field list. This
// list is deliberately exhaustive: cases might have to be added/removed if
// this code is compiled with a different ICU with more UNumberFormatFields
// enum initializers. Please guard such cases with appropriate ICU
// version-testing #ifdefs, should cross-version divergence occur.
switch (fieldName) {
case UNUM_INTEGER_FIELD:
if (IsNaN(d))
return &JSAtomState::nan;
if (!IsFinite(d))
return &JSAtomState::infinity;
return &JSAtomState::integer;
case UNUM_GROUPING_SEPARATOR_FIELD:
return &JSAtomState::group;
case UNUM_DECIMAL_SEPARATOR_FIELD:
return &JSAtomState::decimal;
case UNUM_FRACTION_FIELD:
return &JSAtomState::fraction;
case UNUM_SIGN_FIELD: {
MOZ_ASSERT(!IsNegativeZero(d),
"-0 should have been excluded by PartitionNumberPattern");
// Manual trawling through the ICU call graph appears to indicate that
// the basic formatting we request will never include a positive sign.
// But this analysis may be mistaken, so don't absolutely trust it.
return d < 0 ? &JSAtomState::minusSign : &JSAtomState::plusSign;
}
case UNUM_PERCENT_FIELD:
return &JSAtomState::percentSign;
case UNUM_CURRENCY_FIELD:
return &JSAtomState::currency;
case UNUM_PERMILL_FIELD:
MOZ_ASSERT_UNREACHABLE("unexpected permill field found, even though "
"we don't use any user-defined patterns that "
"would require a permill field");
break;
case UNUM_EXPONENT_SYMBOL_FIELD:
case UNUM_EXPONENT_SIGN_FIELD:
case UNUM_EXPONENT_FIELD:
MOZ_ASSERT_UNREACHABLE("exponent field unexpectedly found in "
"formatted number, even though UNUM_SCIENTIFIC "
"and scientific notation were never requested");
break;
case UNUM_FIELD_COUNT:
MOZ_ASSERT_UNREACHABLE("format field sentinel value returned by "
"iterator!");
break;
}
MOZ_ASSERT_UNREACHABLE("unenumerated, undocumented format field returned "
"by iterator");
return nullptr;
}
static bool
intl_FormatNumberToParts(JSContext* cx, UNumberFormat* nf, double x, MutableHandleValue result)
{
UErrorCode status = U_ZERO_ERROR;
UFieldPositionIterator* fpositer = ufieldpositer_open(&status);
if (U_FAILURE(status)) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
return false;
}
MOZ_ASSERT(fpositer);
ScopedICUObject<UFieldPositionIterator, ufieldpositer_close> toClose(fpositer);
FormattedNumberChars chars(cx);
if (!PartitionNumberPattern(cx, nf, &x, fpositer, chars))
return false;
RootedArrayObject partsArray(cx, NewDenseEmptyArray(cx));
if (!partsArray)
return false;
RootedString overallResult(cx, NewStringCopyN<CanGC>(cx, chars.begin(), chars.length()));
if (!overallResult)
return false;
// First, vacuum up fields in the overall formatted string.
struct Field
{
uint32_t begin;
uint32_t end;
FieldType type;
// Needed for vector-resizing scratch space.
Field() = default;
Field(uint32_t begin, uint32_t end, FieldType type)
: begin(begin), end(end), type(type)
{}
};
using FieldsVector = Vector<Field, 16>;
FieldsVector fields(cx);
int32_t fieldInt, beginIndexInt, endIndexInt;
while ((fieldInt = ufieldpositer_next(fpositer, &beginIndexInt, &endIndexInt)) >= 0) {
MOZ_ASSERT(beginIndexInt >= 0);
MOZ_ASSERT(endIndexInt >= 0);
MOZ_ASSERT(beginIndexInt < endIndexInt,
"erm, aren't fields always non-empty?");
FieldType type = GetFieldTypeForNumberField(UNumberFormatFields(fieldInt), x);
if (!fields.emplaceBack(uint32_t(beginIndexInt), uint32_t(endIndexInt), type))
return false;
}
// Second, merge sort the fields vector. Expand the vector to have scratch
// space for performing the sort.
size_t fieldsLen = fields.length();
if (!fields.resizeUninitialized(fieldsLen * 2))
return false;
MOZ_ALWAYS_TRUE(MergeSort(fields.begin(), fieldsLen, fields.begin() + fieldsLen,
[](const Field& left, const Field& right,
bool* lessOrEqual)
{
// Sort first by begin index, then to place
// enclosing fields before nested fields.
*lessOrEqual = left.begin < right.begin ||
(left.begin == right.begin &&
left.end > right.end);
return true;
}));
// Deallocate the scratch space.
if (!fields.resize(fieldsLen))
return false;
// Third, iterate over the sorted field list to generate a sequence of
// parts (what ECMA-402 actually exposes). A part is a maximal character
// sequence entirely within no field or a single most-nested field.
//
// Diagrams may be helpful to illustrate how fields map to parts. Consider
// formatting -28,114,774,228,750.32, the US national surplus (negative
// because it's actually a debt) on March 31, 2021.
//
// var options =
// { style: "currency", currency: "USD", currencyDisplay: "name" };
// var usdFormatter = new Intl.NumberFormat("en-US", options);
// usdFormatter.format(-28114774228750.32);
//
// The formatted result is "-28,114,774,228,750.32 US dollars". ICU
// identifies these fields in the string:
//
// UNUM_GROUPING_SEPARATOR_FIELD
// |
// UNUM_SIGN_FIELD | UNUM_DECIMAL_SEPARATOR_FIELD
// | __________/| |
// | / | | | |
// "-28,114,774,228,750.32 US dollars"
// \________________/ |/ \_______/
// | | |
// UNUM_INTEGER_FIELD | UNUM_CURRENCY_FIELD
// |
// UNUM_FRACTION_FIELD
//
// These fields map to parts as follows:
//
// integer decimal
// _____|________ |
// / /| |\ |\ |\ | literal
// /| / | | \ | \ | \| |
// "-28,114,774,228,750.32 US dollars"
// | \___|___|___/ |/ \________/
// | | | |
// | group | currency
// | |
// minusSign fraction
//
// The sign is a part. Each comma is a part, splitting the integer field
// into parts for trillions/billions/&c. digits. The decimal point is a
// part. Cents are a part. The space between cents and currency is a part
// (outside any field). Last, the currency field is a part.
//
// Because parts fully partition the formatted string, we only track the
// end of each part -- the beginning is implicitly the last part's end.
struct Part
{
uint32_t end;
FieldType type;
};
class PartGenerator
{
// The fields in order from start to end, then least to most nested.
const FieldsVector& fields;
// Index of the current field, in |fields|, being considered to
// determine part boundaries. |lastEnd <= fields[index].begin| is an
// invariant.
size_t index;
// The end index of the last part produced, always less than or equal
// to |limit|, strictly increasing.
uint32_t lastEnd;
// The length of the overall formatted string.
const uint32_t limit;
Vector<size_t, 4> enclosingFields;
void popEnclosingFieldsEndingAt(uint32_t end) {
MOZ_ASSERT_IF(enclosingFields.length() > 0,
fields[enclosingFields.back()].end >= end);
while (enclosingFields.length() > 0 && fields[enclosingFields.back()].end == end)
enclosingFields.popBack();
}
bool nextPartInternal(Part* part) {
size_t len = fields.length();
MOZ_ASSERT(index <= len);
// If we're out of fields, all that remains are part(s) consisting
// of trailing portions of enclosing fields, and maybe a final
// literal part.
if (index == len) {
if (enclosingFields.length() > 0) {
const auto& enclosing = fields[enclosingFields.popCopy()];
part->end = enclosing.end;
part->type = enclosing.type;
// If additional enclosing fields end where this part ends,
// pop them as well.
popEnclosingFieldsEndingAt(part->end);
} else {
part->end = limit;
part->type = &JSAtomState::literal;
}
return true;
}
// Otherwise we still have a field to process.
const Field* current = &fields[index];
MOZ_ASSERT(lastEnd <= current->begin);
MOZ_ASSERT(current->begin < current->end);
// But first, deal with inter-field space.
if (lastEnd < current->begin) {
if (enclosingFields.length() > 0) {
// Space between fields, within an enclosing field, is part
// of that enclosing field, until the start of the current
// field or the end of the enclosing field, whichever is
// earlier.
const auto& enclosing = fields[enclosingFields.back()];
part->end = std::min(enclosing.end, current->begin);
part->type = enclosing.type;
popEnclosingFieldsEndingAt(part->end);
} else {
// If there's no enclosing field, the space is a literal.
part->end = current->begin;
part->type = &JSAtomState::literal;
}
return true;
}
// Otherwise, the part spans a prefix of the current field. Find
// the most-nested field containing that prefix.
const Field* next;
do {
current = &fields[index];
// If the current field is last, the part extends to its end.
if (++index == len) {
part->end = current->end;
part->type = current->type;
return true;
}
next = &fields[index];
MOZ_ASSERT(current->begin <= next->begin);
MOZ_ASSERT(current->begin < next->end);
// If the next field nests within the current field, push an
// enclosing field. (If there are no nested fields, don't
// bother pushing a field that'd be immediately popped.)
if (current->end > next->begin) {
if (!enclosingFields.append(index - 1))
return false;
}
// Do so until the next field begins after this one.
} while (current->begin == next->begin);
part->type = current->type;
if (current->end <= next->begin) {
// The next field begins after the current field ends. Therefore
// the current part ends at the end of the current field.
part->end = current->end;
popEnclosingFieldsEndingAt(part->end);
} else {
// The current field encloses the next one. The current part
// ends where the next field/part will start.
part->end = next->begin;
}
return true;
}
public:
PartGenerator(JSContext* cx, const FieldsVector& vec, uint32_t limit)
: fields(vec), index(0), lastEnd(0), limit(limit), enclosingFields(cx)
{}
bool nextPart(bool* hasPart, Part* part) {
// There are no parts left if we've partitioned the entire string.
if (lastEnd == limit) {
MOZ_ASSERT(enclosingFields.length() == 0);
*hasPart = false;
return true;
}
if (!nextPartInternal(part))
return false;
*hasPart = true;
lastEnd = part->end;
return true;
}
};
// Finally, generate the result array.
size_t lastEndIndex = 0;
uint32_t partIndex = 0;
RootedObject singlePart(cx);
RootedValue propVal(cx);
PartGenerator gen(cx, fields, chars.length());
do {
bool hasPart;
Part part;
if (!gen.nextPart(&hasPart, &part))
return false;
if (!hasPart)
break;
FieldType type = part.type;
size_t endIndex = part.end;
MOZ_ASSERT(lastEndIndex < endIndex);
singlePart = NewBuiltinClassInstance<PlainObject>(cx);
if (!singlePart)
return false;
propVal.setString(cx->names().*type);
if (!DefineProperty(cx, singlePart, cx->names().type, propVal))
return false;
JSLinearString* partSubstr =
NewDependentString(cx, overallResult, lastEndIndex, endIndex - lastEndIndex);
if (!partSubstr)
return false;
propVal.setString(partSubstr);
if (!DefineProperty(cx, singlePart, cx->names().value, propVal))
return false;
propVal.setObject(*singlePart);
if (!DefineElement(cx, partsArray, partIndex, propVal))
return false;
lastEndIndex = endIndex;
partIndex++;
} while (true);
MOZ_ASSERT(lastEndIndex == chars.length(),
"result array must partition the entire string");
result.setObject(*partsArray);
return true;
}
bool bool
js::intl_FormatNumber(JSContext* cx, unsigned argc, Value* vp) js::intl_FormatNumber(JSContext* cx, unsigned argc, Value* vp)
{ {
CallArgs args = CallArgsFromVp(argc, vp); CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 2); MOZ_ASSERT(args.length() == 3);
MOZ_ASSERT(args[0].isObject()); MOZ_ASSERT(args[0].isObject());
MOZ_ASSERT(args[1].isNumber()); MOZ_ASSERT(args[1].isNumber());
MOZ_ASSERT(args[2].isBoolean());
RootedObject numberFormat(cx, &args[0].toObject()); RootedObject numberFormat(cx, &args[0].toObject());
@ -1252,8 +1674,18 @@ js::intl_FormatNumber(JSContext* cx, unsigned argc, Value* vp)
} }
// Use the UNumberFormat to actually format the number. // Use the UNumberFormat to actually format the number.
double d = args[1].toNumber();
RootedValue result(cx); RootedValue result(cx);
bool success = intl_FormatNumber(cx, nf, args[1].toNumber(), &result);
bool success;
if (args[2].toBoolean()) {
success = intl_FormatNumberToParts(cx, nf, d, &result);
} else {
MOZ_ASSERT(!args[2].toBoolean(),
"shouldn't be doing formatToParts without an ICU that "
"supports it");
success = intl_FormatNumber(cx, nf, d, &result);
}
if (!isNumberFormatInstance) if (!isNumberFormatInstance)
unum_close(nf); unum_close(nf);
@ -2145,8 +2577,6 @@ intl_FormatDateTime(JSContext* cx, UDateFormat* df, double x, MutableHandleValue
return true; return true;
} }
using FieldType = ImmutablePropertyNamePtr JSAtomState::*;
static FieldType static FieldType
GetFieldTypeForFormatField(UDateFormatField fieldName) GetFieldTypeForFormatField(UDateFormatField fieldName)
{ {
@ -2251,7 +2681,7 @@ intl_FormatToPartsDateTime(JSContext* cx, UDateFormat* df, double x, MutableHand
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR); JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
return false; return false;
} }
auto closeFieldPosIter = MakeScopeExit([&]() { ufieldpositer_close(fpositer); }); ScopedICUObject<UFieldPositionIterator, ufieldpositer_close> toClose(fpositer);
int resultSize = int resultSize =
udat_formatForFields(df, x, Char16ToUChar(chars.begin()), INITIAL_CHAR_BUFFER_SIZE, udat_formatForFields(df, x, Char16ToUChar(chars.begin()), INITIAL_CHAR_BUFFER_SIZE,
@ -2285,7 +2715,6 @@ intl_FormatToPartsDateTime(JSContext* cx, UDateFormat* df, double x, MutableHand
uint32_t partIndex = 0; uint32_t partIndex = 0;
RootedObject singlePart(cx); RootedObject singlePart(cx);
RootedValue partType(cx); RootedValue partType(cx);
RootedString partSubstr(cx);
RootedValue val(cx); RootedValue val(cx);
auto AppendPart = [&](FieldType type, size_t beginIndex, size_t endIndex) { auto AppendPart = [&](FieldType type, size_t beginIndex, size_t endIndex) {
@ -2297,7 +2726,8 @@ intl_FormatToPartsDateTime(JSContext* cx, UDateFormat* df, double x, MutableHand
if (!DefineProperty(cx, singlePart, cx->names().type, partType)) if (!DefineProperty(cx, singlePart, cx->names().type, partType))
return false; return false;
partSubstr = SubstringKernel(cx, overallResult, beginIndex, endIndex - beginIndex); JSLinearString* partSubstr =
NewDependentString(cx, overallResult, beginIndex, endIndex - beginIndex);
if (!partSubstr) if (!partSubstr)
return false; return false;

View file

@ -2140,7 +2140,7 @@ function numberFormatFormatToBind(value) {
// Step 1.a.ii-iii. // Step 1.a.ii-iii.
var x = ToNumber(value); var x = ToNumber(value);
return intl_FormatNumber(this, x); return intl_FormatNumber(this, x, /* formatToParts = */ false);
} }
@ -2168,6 +2168,19 @@ function Intl_NumberFormat_format_get() {
return internals.boundFormat; return internals.boundFormat;
} }
function Intl_NumberFormat_formatToParts(value) {
// Step 1.
var nf = this;
// Steps 2-3.
getNumberFormatInternals(nf, "formatToParts");
// Step 4.
var x = ToNumber(value);
// Step 5.
return intl_FormatNumber(nf, x, /* formatToParts = */ true);
}
/** /**
* Returns the resolved options for a NumberFormat object. * Returns the resolved options for a NumberFormat object.

View file

@ -36,7 +36,7 @@ function Number_toLocaleString() {
} }
// Step 5. // Step 5.
return intl_FormatNumber(numberFormat, x); return intl_FormatNumber(numberFormat, x, /* formatToParts = */ false);
} }
// ES6 draft ES6 20.1.2.4 // ES6 draft ES6 20.1.2.4

View file

@ -82,10 +82,10 @@
macro(currencyDisplay, currencyDisplay, "currencyDisplay") \ macro(currencyDisplay, currencyDisplay, "currencyDisplay") \
macro(DateTimeFormat, DateTimeFormat, "DateTimeFormat") \ macro(DateTimeFormat, DateTimeFormat, "DateTimeFormat") \
macro(DateTimeFormatFormatGet, DateTimeFormatFormatGet, "Intl_DateTimeFormat_format_get") \ macro(DateTimeFormatFormatGet, DateTimeFormatFormatGet, "Intl_DateTimeFormat_format_get") \
macro(DateTimeFormatFormatToParts, DateTimeFormatFormatToParts, "Intl_DateTimeFormat_formatToParts") \
macro(day, day, "day") \ macro(day, day, "day") \
macro(dayPeriod, dayPeriod, "dayPeriod") \ macro(dayPeriod, dayPeriod, "dayPeriod") \
macro(debugger, debugger, "debugger") \ macro(debugger, debugger, "debugger") \
macro(decimal, decimal, "decimal") \
macro(decodeURI, decodeURI, "decodeURI") \ macro(decodeURI, decodeURI, "decodeURI") \
macro(decodeURIComponent, decodeURIComponent, "decodeURIComponent") \ macro(decodeURIComponent, decodeURIComponent, "decodeURIComponent") \
macro(DefaultBaseClassConstructor, DefaultBaseClassConstructor, "DefaultBaseClassConstructor") \ macro(DefaultBaseClassConstructor, DefaultBaseClassConstructor, "DefaultBaseClassConstructor") \
@ -142,6 +142,7 @@
macro(forceInterpreter, forceInterpreter, "forceInterpreter") \ macro(forceInterpreter, forceInterpreter, "forceInterpreter") \
macro(forEach, forEach, "forEach") \ macro(forEach, forEach, "forEach") \
macro(format, format, "format") \ macro(format, format, "format") \
macro(fraction, fraction, "fraction") \
macro(frame, frame, "frame") \ macro(frame, frame, "frame") \
macro(from, from, "from") \ macro(from, from, "from") \
macro(fulfilled, fulfilled, "fulfilled") \ macro(fulfilled, fulfilled, "fulfilled") \
@ -160,6 +161,7 @@
macro(getPrototypeOf, getPrototypeOf, "getPrototypeOf") \ macro(getPrototypeOf, getPrototypeOf, "getPrototypeOf") \
macro(global, global, "global") \ macro(global, global, "global") \
macro(globalThis, globalThis, "globalThis") \ macro(globalThis, globalThis, "globalThis") \
macro(group, group, "group") \
macro(Handle, Handle, "Handle") \ macro(Handle, Handle, "Handle") \
macro(has, has, "has") \ macro(has, has, "has") \
macro(hasOwn, hasOwn, "hasOwn") \ macro(hasOwn, hasOwn, "hasOwn") \
@ -174,6 +176,7 @@
macro(includes, includes, "includes") \ macro(includes, includes, "includes") \
macro(incumbentGlobal, incumbentGlobal, "incumbentGlobal") \ macro(incumbentGlobal, incumbentGlobal, "incumbentGlobal") \
macro(index, index, "index") \ macro(index, index, "index") \
macro(infinity, infinity, "infinity") \
macro(Infinity, Infinity, "Infinity") \ macro(Infinity, Infinity, "Infinity") \
macro(InitializeCollator, InitializeCollator, "InitializeCollator") \ macro(InitializeCollator, InitializeCollator, "InitializeCollator") \
macro(InitializeDateTimeFormat, InitializeDateTimeFormat, "InitializeDateTimeFormat") \ macro(InitializeDateTimeFormat, InitializeDateTimeFormat, "InitializeDateTimeFormat") \
@ -189,6 +192,7 @@
macro(Int8x16, Int8x16, "Int8x16") \ macro(Int8x16, Int8x16, "Int8x16") \
macro(Int16x8, Int16x8, "Int16x8") \ macro(Int16x8, Int16x8, "Int16x8") \
macro(Int32x4, Int32x4, "Int32x4") \ macro(Int32x4, Int32x4, "Int32x4") \
macro(integer, integer, "integer") \
macro(interface, interface, "interface") \ macro(interface, interface, "interface") \
macro(InterpretGeneratorResume, InterpretGeneratorResume, "InterpretGeneratorResume") \ macro(InterpretGeneratorResume, InterpretGeneratorResume, "InterpretGeneratorResume") \
macro(isEntryPoint, isEntryPoint, "isEntryPoint") \ macro(isEntryPoint, isEntryPoint, "isEntryPoint") \
@ -223,6 +227,7 @@
macro(minimumFractionDigits, minimumFractionDigits, "minimumFractionDigits") \ macro(minimumFractionDigits, minimumFractionDigits, "minimumFractionDigits") \
macro(minimumIntegerDigits, minimumIntegerDigits, "minimumIntegerDigits") \ macro(minimumIntegerDigits, minimumIntegerDigits, "minimumIntegerDigits") \
macro(minimumSignificantDigits, minimumSignificantDigits, "minimumSignificantDigits") \ macro(minimumSignificantDigits, minimumSignificantDigits, "minimumSignificantDigits") \
macro(minusSign, minusSign, "minusSign") \
macro(minute, minute, "minute") \ macro(minute, minute, "minute") \
macro(missingArguments, missingArguments, "missingArguments") \ macro(missingArguments, missingArguments, "missingArguments") \
macro(module, module, "module") \ macro(module, module, "module") \
@ -232,6 +237,7 @@
macro(month, month, "month") \ macro(month, month, "month") \
macro(multiline, multiline, "multiline") \ macro(multiline, multiline, "multiline") \
macro(name, name, "name") \ macro(name, name, "name") \
macro(nan, nan, "nan") \
macro(NaN, NaN, "NaN") \ macro(NaN, NaN, "NaN") \
macro(NegativeInfinity, NegativeInfinity, "-Infinity") \ macro(NegativeInfinity, NegativeInfinity, "-Infinity") \
macro(new, new_, "new") \ macro(new, new_, "new") \
@ -271,9 +277,10 @@
macro(parseInt, parseInt, "parseInt") \ macro(parseInt, parseInt, "parseInt") \
macro(pattern, pattern, "pattern") \ macro(pattern, pattern, "pattern") \
macro(pending, pending, "pending") \ macro(pending, pending, "pending") \
macro(percentSign, percentSign, "percentSign") \
macro(PluralRules, PluralRules, "PluralRules") \ macro(PluralRules, PluralRules, "PluralRules") \
macro(PluralRulesSelect, PluralRulesSelect, "Intl_PluralRules_Select") \ macro(PluralRulesSelect, PluralRulesSelect, "Intl_PluralRules_Select") \
macro(public, public_, "public") \ macro(plusSign, plusSign, "plusSign") \
macro(preventExtensions, preventExtensions, "preventExtensions") \ macro(preventExtensions, preventExtensions, "preventExtensions") \
macro(private, private_, "private") \ macro(private, private_, "private") \
macro(promise, promise, "promise") \ macro(promise, promise, "promise") \
@ -282,6 +289,7 @@
macro(proto, proto, "__proto__") \ macro(proto, proto, "__proto__") \
macro(prototype, prototype, "prototype") \ macro(prototype, prototype, "prototype") \
macro(proxy, proxy, "proxy") \ macro(proxy, proxy, "proxy") \
macro(public, public_, "public") \
macro(raw, raw, "raw") \ macro(raw, raw, "raw") \
macro(reason, reason, "reason") \ macro(reason, reason, "reason") \
macro(RegExpFlagsGetter, RegExpFlagsGetter, "RegExpFlagsGetter") \ macro(RegExpFlagsGetter, RegExpFlagsGetter, "RegExpFlagsGetter") \

View file

@ -3580,6 +3580,10 @@ nsCSSFrameConstructor::FindHTMLData(Element* aElement,
return nullptr; return nullptr;
} }
if (aTag == nsGkAtoms::details && !HTMLDetailsElement::IsDetailsEnabled()) {
return nullptr;
}
static const FrameConstructionDataByTag sHTMLData[] = { static const FrameConstructionDataByTag sHTMLData[] = {
SIMPLE_TAG_CHAIN(img, nsCSSFrameConstructor::FindImgData), SIMPLE_TAG_CHAIN(img, nsCSSFrameConstructor::FindImgData),
SIMPLE_TAG_CHAIN(mozgeneratedcontentimage, SIMPLE_TAG_CHAIN(mozgeneratedcontentimage,
@ -5791,7 +5795,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
// ::before and ::after); we always want to create "internal" anonymous // ::before and ::after); we always want to create "internal" anonymous
// content. // content.
auto* details = HTMLDetailsElement::FromContentOrNull(parent); auto* details = HTMLDetailsElement::FromContentOrNull(parent);
if (details && !details->Open() && if (details && details->IsDetailsEnabled() && !details->Open() &&
(!aContent->IsRootOfNativeAnonymousSubtree() || (!aContent->IsRootOfNativeAnonymousSubtree() ||
aContent->IsGeneratedContentContainerForBefore() || aContent->IsGeneratedContentContainerForBefore() ||
aContent->IsGeneratedContentContainerForAfter())) { aContent->IsGeneratedContentContainerForAfter())) {
@ -5959,7 +5963,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
} }
FrameConstructionItem* item = nullptr; FrameConstructionItem* item = nullptr;
if (details && details->Open()) { if (details && details->IsDetailsEnabled() && details->Open()) {
auto* summary = HTMLSummaryElement::FromContentOrNull(aContent); auto* summary = HTMLSummaryElement::FromContentOrNull(aContent);
if (summary && summary->IsMainSummary()) { if (summary && summary->IsMainSummary()) {
// If details is open, the main summary needs to be rendered as if it is // If details is open, the main summary needs to be rendered as if it is

View file

@ -606,19 +606,19 @@ pref(layout.css.grid.enabled,true) load 1225376.html
pref(layout.css.grid.enabled,true) load 1225592.html pref(layout.css.grid.enabled,true) load 1225592.html
load 1229437-1.html load 1229437-1.html
load 1229437-2.html load 1229437-2.html
load details-containing-only-text.html pref(dom.details_element.enabled,true) load details-containing-only-text.html
load details-display-none-summary-1.html pref(dom.details_element.enabled,true) load details-display-none-summary-1.html
load details-display-none-summary-2.html pref(dom.details_element.enabled,true) load details-display-none-summary-2.html
load details-display-none-summary-3.html pref(dom.details_element.enabled,true) load details-display-none-summary-3.html
load details-open-overflow-auto.html pref(dom.details_element.enabled,true) load details-open-overflow-auto.html
load details-open-overflow-hidden.html pref(dom.details_element.enabled,true) load details-open-overflow-hidden.html
load details-three-columns.html pref(dom.details_element.enabled,true) load details-three-columns.html
load first-letter-638937-1.html load first-letter-638937-1.html
load first-letter-638937-2.html load first-letter-638937-2.html
load flex-nested-abspos-1.html load flex-nested-abspos-1.html
pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(0-100) load font-inflation-762332.html # bug 762332 pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(0-100) load font-inflation-762332.html # bug 762332
load outline-on-frameset.xhtml load outline-on-frameset.xhtml
load summary-position-out-of-flow.html pref(dom.details_element.enabled,true) load summary-position-out-of-flow.html
load text-overflow-bug666751-1.html load text-overflow-bug666751-1.html
load text-overflow-bug666751-2.html load text-overflow-bug666751-2.html
load text-overflow-bug670564.xhtml load text-overflow-bug670564.xhtml

View file

@ -1891,10 +1891,12 @@ nsContainerFrame::RenumberFrameAndDescendants(int32_t* aOrdinal,
} }
// Do not renumber list for summary elements. // Do not renumber list for summary elements.
HTMLSummaryElement* summary = if (HTMLDetailsElement::IsDetailsEnabled()) {
HTMLSummaryElement::FromContent(kid->GetContent()); HTMLSummaryElement* summary =
if (summary && summary->IsMainSummary()) { HTMLSummaryElement::FromContent(kid->GetContent());
return false; if (summary && summary->IsMainSummary()) {
return false;
}
} }
bool kidRenumberedABullet = false; bool kidRenumberedABullet = false;

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<body>
<div>
<p>This is the details.</p>
</div>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<body>
<div>
<div>Summary</div>
<p>This is the details.</p>
</div>
</body>
</html>

View file

@ -1,3 +1,10 @@
default-preferences pref(dom.details_element.enabled,true)
# Disable <details> and <summary>
pref(dom.details_element.enabled,false) == single-summary.html disabled-single-summary-ref.html
pref(dom.details_element.enabled,false) == open-single-summary.html disabled-single-summary-ref.html
pref(dom.details_element.enabled,false) == no-summary.html disabled-no-summary-ref.html
# Basic <summary> handling # Basic <summary> handling
== multiple-summary.html single-summary.html == multiple-summary.html single-summary.html
== open-multiple-summary.html open-multiple-summary-ref.html == open-multiple-summary.html open-multiple-summary-ref.html

View file

@ -0,0 +1,16 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>CSS Masking: Test clip-path property and circle function on circle 021</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
</head>
<body>
<p>The test passes if there is a green circle.</p>
<div style="width: 600px; height: 600px; background-color: green; clip-path: circle();"></div>
</body>
</html>

View file

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>CSS Masking: Test clip-path property and circle function on circle 021</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
<link rel="help" href="http://www.w3.org/TR/css-masking-1/#clipping-paths">
<link rel="help" href="http://www.w3.org/TR/css-masking-1/#propdef-clip-path">
<link rel="match" href="clip-path-circle-021-ref.html">
<meta name="assert" content="The clip-path property takes the basic shape circle() with large reference box and percentage radius.">
</head>
<body>
<p>The test passes if there is a green circle.</p>
<div style="width: 600px; height: 600px; background-color: green; clip-path: circle(50%);"></div>
</body>
</html>

View file

@ -38,6 +38,7 @@ default-preferences pref(layout.css.clip-path-shapes.enabled,true)
== clip-path-circle-018.html clip-path-circle-010-ref.html == clip-path-circle-018.html clip-path-circle-010-ref.html
== clip-path-circle-019.html clip-path-circle-002-ref.html == clip-path-circle-019.html clip-path-circle-002-ref.html
== clip-path-circle-020.html clip-path-circle-002-ref.html == clip-path-circle-020.html clip-path-circle-002-ref.html
== clip-path-circle-021.html clip-path-circle-021-ref.html
== clip-path-ellipse-001.html clip-path-ellipse-001-ref.html == clip-path-ellipse-001.html clip-path-ellipse-001-ref.html
== clip-path-ellipse-002.html clip-path-ellipse-001-ref.html == clip-path-ellipse-002.html clip-path-ellipse-001-ref.html

View file

@ -305,6 +305,7 @@ CSS_KEY(hebrew, hebrew)
CSS_KEY(help, help) CSS_KEY(help, help)
CSS_KEY(hidden, hidden) CSS_KEY(hidden, hidden)
CSS_KEY(hide, hide) CSS_KEY(hide, hide)
CSS_KEY(high-quality, high_quality)
CSS_KEY(highlight, highlight) CSS_KEY(highlight, highlight)
CSS_KEY(highlighttext, highlighttext) CSS_KEY(highlighttext, highlighttext)
CSS_KEY(historical-forms, historical_forms) CSS_KEY(historical-forms, historical_forms)
@ -450,6 +451,7 @@ CSS_KEY(pc, pc)
CSS_KEY(perspective, perspective) CSS_KEY(perspective, perspective)
CSS_KEY(petite-caps, petite_caps) CSS_KEY(petite-caps, petite_caps)
CSS_KEY(physical, physical) CSS_KEY(physical, physical)
CSS_KEY(pixelated, pixelated)
CSS_KEY(plaintext, plaintext) CSS_KEY(plaintext, plaintext)
CSS_KEY(pointer, pointer) CSS_KEY(pointer, pointer)
CSS_KEY(polygon, polygon) CSS_KEY(polygon, polygon)

View file

@ -2398,8 +2398,11 @@ const KTableEntry nsCSSProps::kFilterFunctionKTable[] = {
const KTableEntry nsCSSProps::kImageRenderingKTable[] = { const KTableEntry nsCSSProps::kImageRenderingKTable[] = {
{ eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO }, { eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO },
{ eCSSKeyword_high_quality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY },
{ eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED }, { eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED },
{ eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY }, { eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY },
{ eCSSKeyword_pixelated, NS_STYLE_IMAGE_RENDERING_CRISPEDGES },
{ eCSSKeyword_smooth, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED },
{ eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES }, { eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES },
{ eCSSKeyword_UNKNOWN, -1 } { eCSSKeyword_UNKNOWN, -1 }
}; };

View file

@ -121,6 +121,11 @@ nsLayoutStylesheetCache::UASheet()
StyleSheet* StyleSheet*
nsLayoutStylesheetCache::HTMLSheet() nsLayoutStylesheetCache::HTMLSheet()
{ {
if (!mHTMLSheet) {
LoadSheetURL("resource://gre-resources/html.css",
&mHTMLSheet, eAgentSheetFeatures, eCrash);
}
return mHTMLSheet; return mHTMLSheet;
} }
@ -316,8 +321,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache(StyleBackendType aType)
// per-profile, since they're profile-invariant. // per-profile, since they're profile-invariant.
LoadSheetURL("resource://gre-resources/counterstyles.css", LoadSheetURL("resource://gre-resources/counterstyles.css",
&mCounterStylesSheet, eAgentSheetFeatures, eCrash); &mCounterStylesSheet, eAgentSheetFeatures, eCrash);
LoadSheetURL("resource://gre-resources/html.css",
&mHTMLSheet, eAgentSheetFeatures, eCrash);
LoadSheetURL("chrome://global/content/minimal-xul.css", LoadSheetURL("chrome://global/content/minimal-xul.css",
&mMinimalXULSheet, eAgentSheetFeatures, eCrash); &mMinimalXULSheet, eAgentSheetFeatures, eCrash);
LoadSheetURL("resource://gre-resources/quirk.css", LoadSheetURL("resource://gre-resources/quirk.css",
@ -378,6 +381,8 @@ nsLayoutStylesheetCache::For(StyleBackendType aType)
// "layout.css.example-pref.enabled"); // "layout.css.example-pref.enabled");
Preferences::RegisterCallback(&DependentPrefChanged, Preferences::RegisterCallback(&DependentPrefChanged,
"layout.css.grid.enabled"); "layout.css.grid.enabled");
Preferences::RegisterCallback(&DependentPrefChanged,
"dom.details_element.enabled");
} }
return cache; return cache;
@ -549,6 +554,7 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData)
gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr); gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr);
INVALIDATE(mUASheet); // for layout.css.grid.enabled INVALIDATE(mUASheet); // for layout.css.grid.enabled
INVALIDATE(mHTMLSheet); // for dom.details_element.enabled
#undef INVALIDATE #undef INVALIDATE
} }

View file

@ -12,6 +12,7 @@
#include "mozilla/gfx/PathHelpers.h" #include "mozilla/gfx/PathHelpers.h"
#include "nsCSSRendering.h" #include "nsCSSRendering.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsMathUtils.h"
#include "nsRenderingContext.h" #include "nsRenderingContext.h"
#include "nsRuleNode.h" #include "nsRuleNode.h"
@ -135,8 +136,6 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates(); const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates();
MOZ_ASSERT(coords.Length() == 1, "wrong number of arguments"); MOZ_ASSERT(coords.Length() == 1, "wrong number of arguments");
float referenceLength = sqrt((aRefBox.width * aRefBox.width +
aRefBox.height * aRefBox.height) / 2.0);
nscoord r = 0; nscoord r = 0;
if (coords[0].GetUnit() == eStyleUnit_Enumerated) { if (coords[0].GetUnit() == eStyleUnit_Enumerated) {
nscoord horizontal, vertical; nscoord horizontal, vertical;
@ -150,7 +149,12 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
r = horizontal < vertical ? horizontal : vertical; r = horizontal < vertical ? horizontal : vertical;
} }
} else { } else {
r = nsRuleNode::ComputeCoordPercentCalc(coords[0], referenceLength); // We resolve percent <shape-radius> value for circle() as defined here:
// https://drafts.csswg.org/css-shapes/#funcdef-circle
const double sqrt2 = std::sqrt(2.0);
double referenceLength = NS_hypot(aRefBox.width, aRefBox.height) / sqrt2;
r = nsRuleNode::ComputeCoordPercentCalc(coords[0],
NSToCoordRound(referenceLength));
} }
nscoord appUnitsPerDevPixel = nscoord appUnitsPerDevPixel =

View file

@ -5106,6 +5106,9 @@ pref("dom.audiochannel.mutedByDefault", false);
// HTML <dialog> element // HTML <dialog> element
pref("dom.dialog_element.enabled", false); pref("dom.dialog_element.enabled", false);
// Enable <details> and <summary> tags.
pref("dom.details_element.enabled", true);
// Secure Element API // Secure Element API
#ifdef MOZ_SECUREELEMENT #ifdef MOZ_SECUREELEMENT
pref("dom.secureelement.enabled", false); pref("dom.secureelement.enabled", false);

View file

@ -0,0 +1,3 @@
[details.html]
type: testharness
prefs: [dom.details_element.enabled:true]

View file

@ -0,0 +1,3 @@
[toggleEvent.html]
type: testharness
prefs: [dom.details_element.enabled:true]