Merge autoland to mozilla-central. a=merge

This commit is contained in:
Daniel Varga 2020-01-31 05:56:02 +02:00
commit 65dc08165d
39 changed files with 986 additions and 422 deletions

View File

@ -27,7 +27,7 @@
command="Browser:Stop"/>
<menuitem id="context-bookmarkpage"
class="menuitem-iconic"
data-l10n-id="main-context-menu-bookmark-page"
data-l10n-id="main-context-menu-bookmark-add"
oncommand="gContextMenu.bookmarkThisPage();"/>
</menugroup>
<menuseparator id="context-sep-navigation"/>

View File

@ -48,7 +48,8 @@ var FullZoom = {
// Initialization & Destruction
init: function FullZoom_init() {
gBrowser.addEventListener("ZoomChangeUsingMouseWheel", this);
gBrowser.addEventListener("DoZoomEnlargeBy10", this);
gBrowser.addEventListener("DoZoomReduceBy10", this);
// Register ourselves with the service so we know when our pref changes.
this._cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
@ -83,7 +84,8 @@ var FullZoom = {
destroy: function FullZoom_destroy() {
Services.prefs.removeObserver("browser.zoom.", this);
this._cps2.removeObserverForName(this.name, this);
gBrowser.removeEventListener("ZoomChangeUsingMouseWheel", this);
gBrowser.removeEventListener("DoZoomEnlargeBy10", this);
gBrowser.removeEventListener("DoZoomReduceBy10", this);
},
// Event Handlers
@ -92,10 +94,11 @@ var FullZoom = {
handleEvent: function FullZoom_handleEvent(event) {
switch (event.type) {
case "ZoomChangeUsingMouseWheel":
let browser = this._getTargetedBrowser(event);
this._ignorePendingZoomAccesses(browser);
this._applyZoomToPref(browser);
case "DoZoomEnlargeBy10":
this.changeZoomBy(this._getTargetedBrowser(event), 0.1);
break;
case "DoZoomReduceBy10":
this.changeZoomBy(this._getTargetedBrowser(event), -0.1);
break;
}
},
@ -357,6 +360,35 @@ var FullZoom = {
}
},
/**
* If browser in reader mode sends message to reader in order to increase font size,
* Otherwise enlarges the zoom level of the page in the current browser.
* This function is not async like reduce/enlarge, because it is invoked by our
* event handler. This means that the call to _applyZoomToPref is not awaited and
* will happen asynchronously.
*/
changeZoomBy(aBrowser, aValue) {
if (aBrowser.currentURI.spec.startsWith("about:reader")) {
const message = aValue > 0 ? "Reader::ZoomIn" : "Reader:ZoomOut";
aBrowser.messageManager.sendAsyncMessage(message);
return;
} else if (this._isPDFViewer(aBrowser)) {
const message = aValue > 0 ? "PDFJS::ZoomIn" : "PDFJS:ZoomOut";
aBrowser.messageManager.sendAsyncMessage(message);
return;
}
let zoom = ZoomManager.getZoomForBrowser(aBrowser);
zoom += aValue;
if (zoom < ZoomManager.MIN) {
zoom = ZoomManager.MIN;
} else if (zoom > ZoomManager.MAX) {
zoom = ZoomManager.MAX;
}
ZoomManager.setZoomForBrowser(aBrowser, zoom);
this._ignorePendingZoomAccesses(aBrowser);
this._applyZoomToPref(aBrowser);
},
/**
* Sets the zoom level for the given browser to the given floating
* point value, where 1 is the default zoom level.
@ -536,7 +568,7 @@ var FullZoom = {
/**
* Returns the browser that the supplied zoom event is associated with.
* @param event The ZoomChangeUsingMouseWheel event.
* @param event The zoom event.
* @return The associated browser element, if one exists, otherwise null.
*/
_getTargetedBrowser: function FullZoom__getTargetedBrowser(event) {
@ -560,7 +592,7 @@ var FullZoom = {
return target.ownerGlobal.docShell.chromeEventHandler;
}
throw new Error("Unexpected ZoomChangeUsingMouseWheel event source");
throw new Error("Unexpected zoom event source");
},
/**

View File

@ -1396,29 +1396,6 @@ var BookmarkingUI = {
: this.STATUS_UNSTARRED;
},
get _starredTooltip() {
delete this._starredTooltip;
return (this._starredTooltip = this._getFormattedTooltip(
"starButtonOn.tooltip2"
));
},
get _unstarredTooltip() {
delete this._unstarredTooltip;
return (this._unstarredTooltip = this._getFormattedTooltip(
"starButtonOff.tooltip2"
));
},
_getFormattedTooltip(strId) {
let args = [];
let shortcut = document.getElementById(this.BOOKMARK_BUTTON_SHORTCUT);
if (shortcut) {
args.push(ShortcutUtils.prettifyShortcut(shortcut));
}
return gNavigatorBundle.getFormattedString(strId, args);
},
onPopupShowing: function BUI_onPopupShowing(event) {
// Don't handle events for submenus.
if (event.target != event.currentTarget) {
@ -1692,17 +1669,23 @@ var BookmarkingUI = {
}
}
// Update the tooltip for elements that require it.
for (let element of [
this.star,
document.getElementById("context-bookmarkpage"),
]) {
element.setAttribute(
"tooltiptext",
starred ? this._starredTooltip : this._unstarredTooltip
);
if (!this.star) {
// The BOOKMARK_BUTTON_SHORTCUT exists only in browser.xhtml.
// If we're not in this context, let's return early.
return;
}
// Update the tooltip for elements that require it.
let shortcut = document.getElementById(this.BOOKMARK_BUTTON_SHORTCUT);
let l10nArgs = {
shortcut: ShortcutUtils.prettifyShortcut(shortcut),
};
document.l10n.setAttributes(
this.star,
starred ? "urlbar-star-edit-bookmark" : "urlbar-star-add-bookmark",
l10nArgs
);
Services.obs.notifyObservers(
null,
"bookmark-icon-updated",
@ -1717,40 +1700,84 @@ var BookmarkingUI = {
updateBookmarkPageMenuItem: function BUI_updateBookmarkPageMenuItem(
forceReset
) {
if (!this.stringbundleset) {
// We are loaded in a non-browser context, like the sidebar.
let menuItem = document.getElementById("menu_bookmarkThisPage");
// Check if the menu item exists.
if (!menuItem) {
// If not, we are loaded in a non-browser context, like the sidebar.
return;
}
// Check if we're loaded in browser.xhtml.
if (!document.location.href.includes("browser.xhtml")) {
// If not, set the (disabled) item to the default value and exit.
document.l10n.setAttributes(menuItem, "menu-bookmark-this-page");
return;
}
let isStarred = !forceReset && this._itemGuids.size > 0;
let label = this.stringbundleset.getAttribute(
isStarred ? "string-editthisbookmark" : "string-bookmarkthispage"
);
// Define the l10n id which will be used to localize elements
// that only require a label using the menubar.ftl messages.
let menuItemL10nId = isStarred
? "menu-bookmark-edit"
: "menu-bookmark-this-page";
// Localize the menubar item.
document.l10n.setAttributes(menuItem, menuItemL10nId);
let panelMenuToolbarButton = document.getElementById(
"panelMenuBookmarkThisPage"
);
// If we don't have the panelMenuToolbarButton, we can exit early.
if (!panelMenuToolbarButton) {
// We don't have the star UI or context menu (e.g. we're the hidden
// window). So we just set the bookmarks menu item label and exit.
document
.getElementById("menu_bookmarkThisPage")
.setAttribute("label", label);
return;
}
for (let element of [
document.getElementById("menu_bookmarkThisPage"),
document.getElementById("context-bookmarkpage"),
panelMenuToolbarButton,
]) {
element.setAttribute("label", label);
// Localize the item in the bookmarks panel view using the l10n id from menubar.ftl.
document.l10n.setAttributes(panelMenuToolbarButton, menuItemL10nId);
// Localize the context menu item element.
let contextItem = document.getElementById("context-bookmarkpage");
let shortcutElem = document.getElementById(this.BOOKMARK_BUTTON_SHORTCUT);
if (shortcutElem) {
let shortcut = ShortcutUtils.prettifyShortcut(shortcutElem);
let contextItemL10nId = isStarred
? "main-context-menu-bookmark-change-with-shortcut"
: "main-context-menu-bookmark-add-with-shortcut";
let l10nArgs = { shortcut };
document.l10n.setAttributes(contextItem, contextItemL10nId, l10nArgs);
} else {
let contextItemL10nId = isStarred
? "main-context-menu-bookmark-change"
: "main-context-menu-bookmark-add";
document.l10n.setAttributes(contextItem, contextItemL10nId);
}
// Update the title and the starred state for the page action panel.
PageActions.actionForID(PageActions.ACTION_ID_BOOKMARK).setTitle(
label,
window
);
// Fetch the label attribute value of the message and
// apply it on the star title.
//
// Note: This should be updated once bug 1608198 is fixed.
this._latestMenuItemL10nId = menuItemL10nId;
document.l10n.formatMessages([{ id: menuItemL10nId }]).then(l10n => {
// It's possible for this promise to be scheduled multiple times.
// In such a case, we'd like to avoid setting the title if there's
// a newer l10n id pending to be set.
if (this._latestMenuItemL10nId != menuItemL10nId) {
return;
}
// We assume that menuItemL10nId has a single attribute.
let label = l10n[0].attributes[0].value;
// Update the title and the starred state for the page action panel.
PageActions.actionForID(PageActions.ACTION_ID_BOOKMARK).setTitle(
label,
window
);
});
this._updateStar();
},

View File

@ -9,9 +9,7 @@
#endif
#endif
<stringbundleset id="stringbundleset"
string-bookmarkthispage="&bookmarkThisPageCmd.label;"
string-editthisbookmark="&editThisBookmarkCmd.label;">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
</stringbundleset>
@ -110,10 +108,10 @@
#endif
#ifdef XP_MACOSX
<command id="minimizeWindow"
label="&minimizeWindow.label;"
data-l10n-id="window-minimize-command"
oncommand="window.minimize();" />
<command id="zoomWindow"
label="&zoomWindow.label;"
data-l10n-id="window-zoom-command"
oncommand="zoomWindow();" />
#endif
</commandset>
@ -122,15 +120,15 @@
<keyset id="mainKeyset">
<key id="key_newNavigator"
key="&newNavigatorCmd.key;"
data-l10n-id="window-new-shortcut"
command="cmd_newNavigator"
modifiers="accel" reserved="true"/>
<key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel"
<key id="key_newNavigatorTab" data-l10n-id="tab-new-shortcut" modifiers="accel"
command="cmd_newNavigatorTabNoEvent" reserved="true"/>
<key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
<key id="focusURLBar" data-l10n-id="location-open-shortcut" command="Browser:OpenLocation"
modifiers="accel"/>
#ifndef XP_MACOSX
<key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
<key id="focusURLBar2" data-l10n-id="location-open-shortcut-alt" command="Browser:OpenLocation"
modifiers="alt"/>
#endif
@ -151,26 +149,31 @@
# is a fundamental keybinding and we are maintaining a XP binding so that it is easy
# for people to switch to Linux.
#
<key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
<key id="key_search" data-l10n-id="search-focus-shortcut" command="Tools:Search" modifiers="accel"/>
<key id="key_search2"
#ifdef XP_MACOSX
<key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
#endif
#ifdef XP_WIN
<key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
#endif
#ifdef XP_GNOME
<key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
<key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
data-l10n-id="find-shortcut"
modifiers="accel,alt"
#else
<key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
data-l10n-id="search-focus-shortcut-alt"
modifiers="accel"
#endif
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
<key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
<key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
<key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel" reserved="true"/>
<key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/>
<key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/>
command="Tools:Search"/>
<key id="key_openDownloads"
data-l10n-id="downloads-shortcut"
#ifdef XP_GNOME
modifiers="accel,shift"
#else
modifiers="accel"
#endif
command="Tools:Downloads"/>
<key id="key_openAddons" data-l10n-id="addons-shortcut" command="Tools:Addons" modifiers="accel,shift"/>
<key id="openFileKb" data-l10n-id="file-open-shortcut" command="Browser:OpenFile" modifiers="accel"/>
<key id="key_savePage" data-l10n-id="save-page-shortcut" command="Browser:SavePage" modifiers="accel"/>
<key id="printKb" data-l10n-id="print-shortcut" command="cmd_print" modifiers="accel"/>
<key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true"/>
<key id="key_closeWindow" data-l10n-id="close-shortcut" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/>
<key id="key_toggleMute" data-l10n-id="mute-toggle-shortcut" command="cmd_toggleMute" modifiers="control"/>
<key id="key_undo"
data-l10n-id="text-action-undo-shortcut"
modifiers="accel"/>
@ -205,65 +208,65 @@
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
#endif
#ifdef XP_UNIX
<key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
<key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
<key id="goBackKb2" data-l10n-id="nav-back-shortcut-alt" command="Browser:Back" modifiers="accel"/>
<key id="goForwardKb2" data-l10n-id="nav-fwd-shortcut-alt" command="Browser:Forward" modifiers="accel"/>
#endif
<key id="goHome" keycode="VK_HOME" oncommand="BrowserHome();" modifiers="alt"/>
<key keycode="VK_F5" command="Browser:Reload"/>
#ifndef XP_MACOSX
<key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
<key id="showAllHistoryKb" data-l10n-id="history-show-all-shortcut" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
<key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
#else
<key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,control"/>
<key id="key_fullScreen_old" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
<key id="key_fullScreen" data-l10n-id="full-screen-shortcut" command="View:FullScreen" modifiers="accel,control"/>
<key id="key_fullScreen_old" data-l10n-id="full-screen-shortcut" command="View:FullScreen" modifiers="accel,shift"/>
<key keycode="VK_F11" command="View:FullScreen"/>
#endif
<key id="key_toggleReaderMode"
data-l10n-id="reader-mode-toggle-shortcut"
command="View:ReaderView"
#ifndef XP_WIN
<key id="key_toggleReaderMode" key="&toggleReaderMode.key;" command="View:ReaderView" modifiers="accel,alt" disabled="true"/>
#else
<key id="key_toggleReaderMode" keycode="&toggleReaderMode.win.keycode;" command="View:ReaderView" disabled="true"/>
modifiers="accel,alt"
#endif
disabled="true"/>
#ifndef XP_MACOSX
<key id="key_togglePictureInPicture" key="&togglePictureInPicture.key;" command="View:PictureInPicture" modifiers="accel,shift"/>
<key key="&togglePictureInPicture.key2;" command="View:PictureInPicture" modifiers="accel,shift"/>
<key id="key_togglePictureInPicture" data-l10n-id="picture-in-picture-toggle-shortcut" command="View:PictureInPicture" modifiers="accel,shift"/>
<key data-l10n-id="picture-in-picture-toggle-shortcut-alt" command="View:PictureInPicture" modifiers="accel,shift"/>
#endif
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift" id="key_reload_skip_cache"/>
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
<key data-l10n-id="nav-reload-shortcut" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key data-l10n-id="nav-reload-shortcut" command="Browser:ReloadSkipCache" modifiers="accel,shift" id="key_reload_skip_cache"/>
<key id="key_viewSource" data-l10n-id="page-source-shortcut" command="View:PageSource" modifiers="accel"/>
#ifdef XP_MACOSX
<key id="key_viewSourceSafari" key="&pageSourceCmd.SafariCommandKey;" command="View:PageSource" modifiers="accel,alt"/>
<key id="key_viewSourceSafari" data-l10n-id="page-source-shortcut-safari" command="View:PageSource" modifiers="accel,alt"/>
#endif
<key id="key_viewInfo" key="&pageInfoCmd.commandkey;" command="View:PageInfo" modifiers="accel"/>
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
<key id="key_viewInfo" data-l10n-id="page-info-shortcut" command="View:PageInfo" modifiers="accel"/>
<key id="key_find" data-l10n-id="find-shortcut" command="cmd_find" modifiers="accel"/>
<key id="key_findAgain" data-l10n-id="search-find-again-shortcut" command="cmd_findAgain" modifiers="accel"/>
<key id="key_findPrevious" data-l10n-id="search-find-again-shortcut" command="cmd_findPrevious" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
<key id="key_findSelection" data-l10n-id="search-find-selection-shortcut" command="cmd_findSelection" modifiers="accel"/>
#endif
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
<key data-l10n-id="search-find-again-shortcut-alt" command="cmd_findAgain"/>
<key data-l10n-id="search-find-again-shortcut-alt" command="cmd_findPrevious" modifiers="shift"/>
<key id="addBookmarkAsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
<key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueCurrentPages);" modifiers="accel,shift"/>
# Accel+Shift+A-F are reserved on GTK
#ifndef MOZ_WIDGET_GTK
<key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
#else
<key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
#endif
<key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" oncommand="SidebarUI.toggle('viewBookmarksSidebar');" modifiers="accel"/>
<key id="addBookmarkAsKb" data-l10n-id="bookmark-this-page-shortcut" command="Browser:AddBookmarkAs" modifiers="accel"/>
<key id="bookmarkAllTabsKb" data-l10n-id="bookmark-this-page-shortcut" oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueCurrentPages);" modifiers="accel,shift"/>
<key id="manBookmarkKb" data-l10n-id="bookmark-show-all-shortcut" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
<key id="viewBookmarksSidebarKb"
data-l10n-id="bookmark-show-sidebar-shortcut"
modifiers="accel"
oncommand="SidebarUI.toggle('viewBookmarksSidebar');"/>
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
#ifdef XP_MACOSX
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" command="Browser:Stop"/>
<key id="key_stop_mac" modifiers="accel" data-l10n-id="nav-stop-shortcut" command="Browser:Stop"/>
#endif
<key id="key_gotoHistory"
key="&historySidebarCmd.commandKey;"
data-l10n-id="history-sidebar-shortcut"
#ifdef XP_MACOSX
modifiers="accel,shift"
#else
@ -271,25 +274,25 @@
#endif
oncommand="SidebarUI.toggle('viewHistorySidebar');"/>
<key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
<key key="&fullZoomReduceCmd.commandkey2;" command="cmd_fullZoomReduce" modifiers="accel"/>
<key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;" command="cmd_fullZoomReset" modifiers="accel"/>
<key key="&fullZoomResetCmd.commandkey2;" command="cmd_fullZoomReset" modifiers="accel"/>
<key id="key_fullZoomReduce" data-l10n-id="full-zoom-reduce-shortcut" command="cmd_fullZoomReduce" modifiers="accel"/>
<key data-l10n-id="full-zoom-reduce-shortcut-alt" command="cmd_fullZoomReduce" modifiers="accel"/>
<key id="key_fullZoomEnlarge" data-l10n-id="full-zoom-enlarge-shortcut" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key data-l10n-id="full-zoom-enlarge-shortcut-alt" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key data-l10n-id="full-zoom-enlarge-shortcut-alt2" command="cmd_fullZoomEnlarge" modifiers="accel"/>
<key id="key_fullZoomReset" data-l10n-id="full-zoom-reset-shortcut" command="cmd_fullZoomReset" modifiers="accel"/>
<key data-l10n-id="full-zoom-reset-shortcut-alt" command="cmd_fullZoomReset" modifiers="accel"/>
<key id="key_showAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
<key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
<key id="key_switchTextDirection" data-l10n-id="bidi-switch-direction-shortcut" command="cmd_switchTextDirection" modifiers="accel,shift" />
<key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;"
<key id="key_privatebrowsing" command="Tools:PrivateBrowsing" data-l10n-id="private-browsing-shortcut"
modifiers="accel,shift" reserved="true"/>
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
#endif
<key id="key_quitApplication" key="&quitApplicationCmd.key;"
<key id="key_quitApplication" data-l10n-id="quit-app-shortcut"
#ifdef XP_WIN
modifiers="accel,shift"
#else
@ -303,8 +306,8 @@
#endif
reserved="true"/>
<key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
<key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
<key id="key_undoCloseTab" command="History:UndoCloseTab" data-l10n-id="tab-new-shortcut" modifiers="accel,shift"/>
<key id="key_undoCloseWindow" command="History:UndoCloseWindow" data-l10n-id="window-new-shortcut" modifiers="accel,shift"/>
#ifdef XP_GNOME
#define NUM_SELECT_TAB_MODIFIER alt
@ -348,22 +351,22 @@
#ifdef XP_MACOSX
<key id="key_minimizeWindow"
command="minimizeWindow"
key="&minimizeWindow.key;"
data-l10n-id="window-minimize-shortcut"
modifiers="accel"/>
<key id="key_openHelpMac"
oncommand="openHelpLink('firefox-osxkey');"
key="&helpMac.commandkey;"
data-l10n-id="help-shortcut"
modifiers="accel"/>
<!-- These are used to build the Application menu -->
<key id="key_preferencesCmdMac"
key="&preferencesCmdMac.commandkey;"
data-l10n-id="preferences-shortcut"
reserved="true"
modifiers="accel"/>
<key id="key_hideThisAppCmdMac"
key="&hideThisAppCmdMac2.commandkey;"
data-l10n-id="hide-app-shortcut"
modifiers="accel"/>
<key id="key_hideOtherAppsCmdMac"
key="&hideOtherAppsCmdMac.commandkey;"
data-l10n-id="hide-other-apps-shortcut"
modifiers="accel,alt"/>
#endif
</keyset>

View File

@ -62,6 +62,7 @@
<link rel="localization" href="toolkit/global/textActions.ftl"/>
<link rel="localization" href="browser/browser.ftl"/>
<link rel="localization" href="browser/browserContext.ftl"/>
<link rel="localization" href="browser/browserSets.ftl"/>
<link rel="localization" href="browser/menubar.ftl"/>
<link rel="localization" href="browser/protectionsPanel.ftl"/>
<link rel="localization" href="browser/appmenu.ftl"/>

View File

@ -14,6 +14,7 @@
<html:link rel="localization" href="branding/brand.ftl"/>
<html:link rel="localization" href="browser/branding/sync-brand.ftl"/>
<html:link rel="localization" href="toolkit/global/textActions.ftl"/>
<html:link rel="localization" href="browser/browserSets.ftl"/>
<html:link rel="localization" href="browser/menubar.ftl"/>
</linkset>

View File

@ -5,15 +5,13 @@
// Bug 624734 - Star UI has no tooltip until bookmarked page is visited
function finishTest() {
is(
document.getElementById("context-bookmarkpage").getAttribute("tooltiptext"),
BookmarkingUI._unstarredTooltip,
"Context menu should have the unstarred tooltip text"
);
is(
BookmarkingUI.star.getAttribute("tooltiptext"),
BookmarkingUI._unstarredTooltip,
"Star icon should have the unstarred tooltip text"
let elem = document.getElementById("context-bookmarkpage");
let l10n = document.l10n.getAttributes(elem);
ok(
[
"main-context-menu-bookmark-add",
"main-context-menu-bookmark-add-with-shortcut",
].includes(l10n.id)
);
gBrowser.removeCurrentTab();

View File

@ -44,6 +44,7 @@
<linkset>
<html:link rel="localization" href="toolkit/global/textActions.ftl"/>
<html:link rel="localization" href="browser/browserSets.ftl"/>
</linkset>
<script src="chrome://browser/content/places/places.js"/>
@ -129,11 +130,11 @@
#endif
#ifdef XP_UNIX
<key id="placesKey_goBackKb2"
key="&goBackCmd.commandKey;"
data-l10n-id="nav-back-shortcut-alt"
command="OrganizerCommand:Back"
modifiers="accel"/>
<key id="placesKey_goForwardKb2"
key="&goForwardCmd.commandKey;"
data-l10n-id="nav-fwd-shortcut-alt"
command="OrganizerCommand:Forward"
modifiers="accel"/>
#endif

View File

@ -119,6 +119,16 @@ urlbar-midi-blocked =
urlbar-install-blocked =
.tooltiptext = You have blocked add-on installation for this website.
# Variables
# $shortcut (String) - A keyboard shortcut for the edit bookmark command.
urlbar-star-edit-bookmark =
.tooltiptext = Edit this bookmark ({ $shortcut })
# Variables
# $shortcut (String) - A keyboard shortcut for the add bookmark command.
urlbar-star-add-bookmark =
.tooltiptext = Bookmark this page ({ $shortcut })
## Page Action Context Menu
page-action-add-to-urlbar =

View File

@ -68,9 +68,29 @@ toolbar-button-page-save =
## Simple menu items
main-context-menu-bookmark-page =
main-context-menu-bookmark-add =
.aria-label = Bookmark This Page
.accesskey = m
.tooltiptext = Bookmark this page
# Variables
# $shortcut (String) - A keyboard shortcut for the add bookmark command.
main-context-menu-bookmark-add-with-shortcut =
.aria-label = Bookmark This Page
.accesskey = m
.tooltiptext = Bookmark this page ({ $shortcut })
main-context-menu-bookmark-change =
.aria-label = Edit This Bookmark
.accesskey = m
.tooltiptext = Edit this bookmark
# Variables
# $shortcut (String) - A keyboard shortcut for the edit bookmark command.
main-context-menu-bookmark-change-with-shortcut =
.aria-label = Edit This Bookmark
.accesskey = m
.tooltiptext = Edit this bookmark ({ $shortcut })
main-context-menu-open-link =
.label = Open Link

View File

@ -0,0 +1,203 @@
# 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/.
window-minimize-command =
.label = Minimize
window-zoom-command =
.label = Zoom
window-new-shortcut =
.key = N
window-minimize-shortcut =
.key = M
close-shortcut =
.key = W
tab-new-shortcut =
.key = T
location-open-shortcut =
.key = L
location-open-shortcut-alt =
.key = D
search-focus-shortcut =
.key = K
# This shortcut is used in two contexts:
# - web search
# - find in page
find-shortcut =
.key = F
search-find-again-shortcut =
.key = G
search-find-again-shortcut-alt =
.keycode = VK_F3
search-find-selection-shortcut =
.key = E
# Verify what shortcut for that operation
# are recommended by the Human Interface Guidelines
# of each platform for your locale.
search-focus-shortcut-alt =
.key = { PLATFORM() ->
[linux] J
*[other] E
}
# Verify what shortcut for that operation
# are recommended by the Human Interface Guidelines
# of each platform for your locale.
downloads-shortcut =
.key = { PLATFORM() ->
[linux] Y
*[other] J
}
addons-shortcut =
.key = A
file-open-shortcut =
.key = O
save-page-shortcut =
.key = S
page-source-shortcut =
.key = U
# This should match the Option+Command keyboard shortcut letter that Safari
# and Chrome use for "View Source" on macOS. `page-source-shortcut` above
# is Firefox's official keyboard shortcut shown in the GUI.
# Safari variant is an alias provided for the convenience of Safari and Chrome
# users on macOS. See bug 1398988.
page-source-shortcut-safari =
.key = U
page-info-shortcut =
.key = I
print-shortcut =
.key = P
mute-toggle-shortcut =
.key = M
nav-back-shortcut-alt =
.key = [
nav-fwd-shortcut-alt =
.key = ]
nav-reload-shortcut =
.key = R
# Shortcut available only on macOS.
nav-stop-shortcut =
.key = .
history-show-all-shortcut =
.key = H
history-sidebar-shortcut =
.key = H
full-screen-shortcut =
.key = F
# Verify what shortcut for that operation
# are recommended by the Human Interface Guidelines
# of each platform for your locale.
reader-mode-toggle-shortcut =
.key = { PLATFORM() ->
[windows] VK_F9
*[other] R
}
picture-in-picture-toggle-shortcut =
.key = ]
# Pick the key that is commonly present
# in your locale keyboards above the
# `picture-in-picture-toggle-shortcut` key.
picture-in-picture-toggle-shortcut-alt =
.key = {"}"}
bookmark-this-page-shortcut =
.key = D
# Verify what shortcut for that operation
# are recommended by the Human Interface Guidelines
# of each platform for your locale.
bookmark-show-all-shortcut =
.key = { PLATFORM() ->
[linux] O
*[other] B
}
# Verify what shortcut for that operation
# are recommended by the Human Interface Guidelines
# of each platform for your locale.
bookmark-show-sidebar-shortcut =
.key = B
## All `-alt*` messages are alternative acceleration keys for zoom.
## If shift key is needed with your locale popular keyboard for them,
## you can use these alternative items. Otherwise, their values should be empty.
full-zoom-reduce-shortcut =
.key = -
# If in keyboard layouts popular for your locale you need to use the shift key
# to access the original shortcuts, the following shortcuts can be used.
# Otherwise their values should remain empty.
full-zoom-reduce-shortcut-alt =
.key = {""}
full-zoom-enlarge-shortcut =
.key = +
full-zoom-enlarge-shortcut-alt =
.key = =
full-zoom-enlarge-shortcut-alt2 =
.key = {""}
full-zoom-reset-shortcut =
.key = 0
full-zoom-reset-shortcut-alt =
.key = {""}
##
bidi-switch-direction-shortcut =
.key = X
private-browsing-shortcut =
.key = P
## The shortcuts below are for Mac specific
## global menu.
quit-app-shortcut =
.key = Q
help-shortcut =
.key = ?
preferences-shortcut =
.key = ,
hide-app-shortcut =
.key = H
hide-other-apps-shortcut =
.key = H

View File

@ -167,6 +167,10 @@ menu-bookmarks-menu =
.accesskey = B
menu-bookmarks-show-all =
.label = Show All Bookmarks
menu-bookmark-this-page =
.label = Bookmark This Page
menu-bookmark-edit =
.label = Edit This Bookmark
menu-bookmarks-all-tabs =
.label = Bookmark All Tabs…
menu-bookmarks-toolbar =

View File

@ -2,24 +2,16 @@
- 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/. -->
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize">
<!ENTITY zoomWindow.label "Zoom">
<!ENTITY aboutProduct2.label "About &brandShorterName;">
<!ENTITY aboutProduct2.accesskey "A">
<!ENTITY helpMac.commandkey "?">
<!ENTITY preferencesCmdMac.label "Preferences…">
<!ENTITY preferencesCmdMac.commandkey ",">
<!ENTITY servicesMenuMac.label "Services">
<!ENTITY hideThisAppCmdMac2.label "Hide &brandShorterName;">
<!ENTITY hideThisAppCmdMac2.commandkey "H">
<!ENTITY hideOtherAppsCmdMac.label "Hide Others">
<!ENTITY hideOtherAppsCmdMac.commandkey "H">
<!ENTITY showAllAppsCmdMac.label "Show All">

View File

@ -26,11 +26,8 @@ in "Search through tabs". -->
<!ENTITY allTabsMenu.searchTabs.label "Search Tabs">
<!ENTITY tabCmd.label "New Tab">
<!ENTITY tabCmd.commandkey "t">
<!ENTITY openFileCmd.label "Open File…">
<!ENTITY openFileCmd.commandkey "o">
<!ENTITY printCmd.label "Print…">
<!ENTITY printCmd.commandkey "p">
<!ENTITY taskManagerCmd.label "Task Manager">
@ -48,22 +45,7 @@ this container is a toolbar. This avoids double-speaking. -->
<!ENTITY personalbar.accessibleLabel "Bookmarks">
<!ENTITY bookmarksToolbarItem.label "Bookmarks Toolbar Items">
<!ENTITY pageSourceCmd.commandkey "u">
<!-- LOCALIZATION NOTE (pageSourceCmd.SafariCommandKey should match the
Option+Command keyboard shortcut letter that Safari and Chrome use for "View
Source" on macOS. pageSourceCmd.commandkey above is Firefox's official keyboard
shortcut shown in the GUI. SafariCommandKey is an alias provided for the
convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY pageSourceCmd.SafariCommandKey "u">
<!ENTITY pageInfoCmd.commandkey "i">
<!ENTITY fullScreenCmd.label "Full Screen">
<!ENTITY fullScreenCmd.macCommandKey "f">
<!ENTITY toggleReaderMode.key "R">
<!ENTITY toggleReaderMode.win.keycode "VK_F9">
<!ENTITY togglePictureInPicture.key2 "}">
<!ENTITY togglePictureInPicture.key "]"> <!-- } is above this key on many keyboards -->
<!ENTITY fullScreenMinimize.tooltip "Minimize">
<!ENTITY fullScreenRestore.tooltip "Restore">
@ -116,15 +98,10 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY pointerlockWarning.afterDomain.label "has control of your pointer. Press Esc to take back control.">
<!ENTITY pointerlockWarning.generic.label "This document has control of your pointer. Press Esc to take back control.">
<!ENTITY bookmarkThisPageCmd.label "Bookmark This Page">
<!ENTITY editThisBookmarkCmd.label "Edit This Bookmark">
<!ENTITY bookmarkThisPageCmd.commandkey "d">
<!ENTITY showAllBookmarks2.label "Show All Bookmarks">
<!ENTITY recentBookmarks.label "Recently Bookmarked">
<!ENTITY bookmarksToolbarChevron.tooltip "Show more bookmarks">
<!ENTITY stopCmd.macCommandKey ".">
<!ENTITY goEndCap.tooltip "Go to the address in the Location Bar">
<!ENTITY printButton.label "Print">
<!ENTITY printButton.tooltip "Print this page">
@ -143,7 +120,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY homeButton.defaultPage.tooltip "&brandShortName; Home Page">
<!ENTITY bookmarksButton.label "Bookmarks">
<!ENTITY bookmarksCmd.commandkey "b">
<!ENTITY bookmarksSubview.label "Bookmarks">
<!ENTITY bookmarksMenuButton2.label "Bookmarks Menu">
@ -158,22 +134,13 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY addBookmarksMenu.label "Add Bookmarks Menu to Toolbar">
<!ENTITY removeBookmarksMenu.label "Remove Bookmarks Menu from Toolbar">
<!-- LOCALIZATION NOTE (bookmarksGtkCmd.commandkey): This command
- key should not contain the letters A-F, since these are reserved
- shortcut keys on Linux. -->
<!ENTITY bookmarksGtkCmd.commandkey "o">
<!ENTITY historyButton.label "History">
<!ENTITY historySidebarCmd.commandKey "h">
<!ENTITY downloads.label "Downloads">
<!-- LOCALIZATION NOTE (libraryDownloads.label): This label is similar to
- downloads.label, but used in the Library panel. -->
<!ENTITY libraryDownloads.label "Downloads">
<!ENTITY downloads.commandkey "j">
<!ENTITY downloadsUnix.commandkey "y">
<!ENTITY addons.label "Add-ons">
<!ENTITY addons.commandkey "A">
<!ENTITY webDeveloperMenu.label "Web Developer">
@ -181,7 +148,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY manageUserContext.label "Manage Containers">
<!ENTITY manageUserContext.accesskey "O">
<!ENTITY newNavigatorCmd.label "New Window">
<!ENTITY newNavigatorCmd.key "N">
<!ENTITY newPrivateWindow.label "New Private Window">
<!ENTITY editMenu.label "Edit">
@ -189,8 +155,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY preferencesCmdUnix.label "Preferences">
<!ENTITY logins.label "Logins and Passwords">
<!ENTITY privateBrowsingCmd.commandkey "P">
<!ENTITY viewCustomizeToolbar.label "Customize…">
<!ENTITY viewCustomizeToolbar.accesskey "C">
<!ENTITY overflowCustomizeToolbar.label "Customize Toolbar…">
@ -201,8 +165,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!-- LOCALIZATION NOTE (historyUndoWindowMenu): see bug 394759 -->
<!ENTITY historyUndoWindowMenu.label "Recently Closed Windows">
<!ENTITY showAllHistoryCmd.commandkey "H">
<!ENTITY appMenuHistory.showAll.label "Show All History">
<!ENTITY appMenuHistory.clearRecent.label "Clear Recent History…">
<!ENTITY appMenuHistory.restoreSession.label "Restore Previous Session">
@ -278,37 +240,11 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
secondary commands. -->
<!ENTITY moreMenu.label "More">
<!ENTITY openCmd.commandkey "l">
<!ENTITY urlbar.placeholder2 "Search or enter address">
<!ENTITY urlbar.accesskey "d">
<!-- LOCALIZATION NOTE (urlbar.extension.label): Used to indicate that a selected autocomplete entry is provided by an extension. -->
<!ENTITY urlbar.extension.label "Extension:">
<!ENTITY urlbar.switchToTab.label "Switch to tab:">
<!--
Comment duplicated from browser-sets.inc:
Search Command Key Logic works like this:
Unix: Ctrl+J (0.8, 0.9 support)
Ctrl+K (cross platform binding)
Mac: Cmd+K (cross platform binding)
Cmd+Opt+F (platform convention)
Win: Ctrl+K (cross platform binding)
Ctrl+E (IE compat)
We support Ctrl+K on all platforms now and advertise it in the menu since it is
our standard - it is a "safe" choice since it is near no harmful keys like "W" as
"E" is. People mourning the loss of Ctrl+K for emacs compat can switch their GTK
system setting to use emacs emulation, and we should respect it. Focus-Search-Box
is a fundamental keybinding and we are maintaining a XP binding so that it is easy
for people to switch to Linux.
-->
<!ENTITY searchFocus.commandkey "k">
<!ENTITY searchFocus.commandkey2 "e">
<!ENTITY searchFocusUnix.commandkey "j">
<!ENTITY contentSearchSubmit.tooltip "Submit search">
<!-- LOCALIZATION NOTE (searchInput.placeholder):
@ -318,7 +254,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY openLinkCmdInTab.accesskey "T">
<!ENTITY reloadCmd.commandkey "r">
<!ENTITY pageAction.copyLink.label "Copy Link">
<!-- LOCALIZATION NOTE(pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
@ -328,24 +263,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY pocketMenuitem.label "View Pocket List">
<!ENTITY emailPageCmd.label "Email Link…">
<!-- alternate for content area context menu -->
<!ENTITY savePageCmd.commandkey "s">
<!-- LOCALIZATION NOTE :
fullZoomEnlargeCmd.commandkey3, fullZoomReduceCmd.commandkey2 and
fullZoomResetCmd.commandkey2 are alternative acceleration keys for zoom.
If shift key is needed with your locale popular keyboard for them,
you can use these alternative items. Otherwise, their values should be empty. -->
<!ENTITY fullZoomEnlargeCmd.commandkey "+">
<!ENTITY fullZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
<!ENTITY fullZoomEnlargeCmd.commandkey3 "">
<!ENTITY fullZoomReduceCmd.commandkey "-">
<!ENTITY fullZoomReduceCmd.commandkey2 "">
<!ENTITY fullZoomResetCmd.commandkey "0">
<!ENTITY fullZoomResetCmd.commandkey2 "">
<!ENTITY fullZoom.label "Zoom">
@ -355,16 +272,9 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY quitApplicationCmdWin2.label "Exit">
<!ENTITY quitApplicationCmdWin2.accesskey "x">
<!ENTITY quitApplicationCmdWin2.tooltip "Exit &brandShorterName;">
<!ENTITY goBackCmd.commandKey "[">
<!ENTITY goForwardCmd.commandKey "]">
<!ENTITY quitApplicationCmd.label "Quit">
<!ENTITY quitApplicationCmd.accesskey "Q">
<!ENTITY quitApplicationCmdMac2.label "Quit &brandShorterName;">
<!ENTITY quitApplicationCmd.key "Q">
<!ENTITY closeCmd.key "W">
<!ENTITY toggleMuteCmd.key "M">
<!ENTITY allowPopups.accesskey "p">
<!-- On Windows we use the term "Options" to describe settings, but
@ -375,13 +285,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY editPopupSettings.accesskey "E">
<!ENTITY dontShowMessage.accesskey "D">
<!ENTITY bidiSwitchTextDirectionItem.commandkey "X">
<!ENTITY findOnCmd.label "Find in This Page…">
<!ENTITY findOnCmd.commandkey "f">
<!ENTITY findAgainCmd.commandkey "g">
<!ENTITY findAgainCmd.commandkey2 "VK_F3">
<!ENTITY findSelectionCmd.commandkey "e">
<!ENTITY spellAddDictionaries.label "Add Dictionaries…">
<!ENTITY spellAddDictionaries.accesskey "A">

View File

@ -387,9 +387,6 @@ refreshBlocked.redirectLabel=%S prevented this page from automatically redirecti
# LOCALIZATION NOTE (bookmarksMenuButton.tooltip):
# %S is the keyboard shortcut for "Show All Bookmarks"
bookmarksMenuButton.tooltip=Show your bookmarks (%S)
# Star button
starButtonOn.tooltip2=Edit this bookmark (%S)
starButtonOff.tooltip2=Bookmark this page (%S)
# Downloads button tooltip
# LOCALIZATION NOTE (downloads.tooltip):

View File

@ -7,13 +7,8 @@
<?xml-stylesheet href="resource://devtools/client/shared/components/NotificationBox.css" type="text/css"?>
<?xml-stylesheet href="resource://devtools/client/framework/components/DebugTargetErrorPage.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
%toolboxDTD;
<!ENTITY % globalKeysDTD SYSTEM "chrome://global/locale/globalKeys.dtd">
%globalKeysDTD;
]>
<!DOCTYPE window>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
csp="default-src chrome: resource:; img-src chrome: resource: data:; object-src 'none'">

View File

@ -44,16 +44,12 @@ toggleComment.commandkey=/
# conjunction with accel (Command on Mac or Ctrl on other platforms) to reduce
# indentation level in CodeMirror. However, its default value also used by
# the Toolbox to switch between tools so we disable it.
#
# DO NOT translate this key without proper synchronization with toolbox.dtd.
indentLess.commandkey=[
# LOCALIZATION NOTE (indentMore.commandkey): This is the key to use in
# conjunction with accel (Command on Mac or Ctrl on other platforms) to increase
# indentation level in CodeMirror. However, its default value also used by
# the Toolbox to switch between tools
#
# DO NOT translate this key without proper synchronization with toolbox.dtd.
indentMore.commandkey=]
# LOCALIZATION NOTE (moveLineUp.commandkey): This is the combination of keys

View File

@ -1,9 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- LOCALIZATION NOTE : FILE This file contains the Toolbox strings -->
<!-- LOCALIZATION NOTE : FILE Do not translate key -->
<!ENTITY closeCmd.key "W">
<!ENTITY toggleToolbox.key "I">

View File

@ -871,7 +871,7 @@ function promiseRDMZoom(ui, browser, zoom) {
const zoomComplete = BrowserTestUtils.waitForEvent(
browser,
"PostFullZoomChange"
"FullZoomResolutionStable"
);
ZoomManager.setZoomForBrowser(browser, zoom);

View File

@ -2,5 +2,5 @@
- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M190.368 150.591c0.157 0.009 0.079 0.003 0 0zm-57.874-28.933c0.158 0.008 0.079 0.003 0 0zm346.228 44.674c-10.445-25.123-31.6-52.248-48.211-60.82 13.52 26.5 21.345 53.093 24.335 72.935 0 0.04 0.015 0.136 0.047 0.4-27.175-67.732-73.254-95.047-110.886-154.512-1.9-3.008-3.805-6.022-5.661-9.2a73.237 73.237 0 0 1-2.646-4.972 43.757 43.757 0 0 1-3.585-9.5 0.625 0.625 0 0 0-0.546-0.644 0.8 0.8 0 0 0-0.451 0c-0.033 0.011-0.084 0.051-0.119 0.065-0.053 0.02-0.12 0.069-0.176 0.095 0.026-0.036 0.083-0.117 0.1-0.135-53.437 31.3-75.587 86.093-81.282 120.97a128.057 128.057 0 0 0-47.624 12.153 6.144 6.144 0 0 0-3.041 7.63 6.034 6.034 0 0 0 8.192 3.525 116.175 116.175 0 0 1 41.481-10.826c0.468-0.033 0.937-0.062 1.405-0.1a117.624 117.624 0 0 1 5.932-0.211 120.831 120.831 0 0 1 34.491 4.777c0.654 0.192 1.295 0.414 1.946 0.616a120.15 120.15 0 0 1 5.539 1.842 121.852 121.852 0 0 1 3.992 1.564c1.074 0.434 2.148 0.868 3.206 1.331a118.453 118.453 0 0 1 4.9 2.307c0.743 0.368 1.485 0.735 2.217 1.117a120.535 120.535 0 0 1 4.675 2.587 107.785 107.785 0 0 1 2.952 1.776 123.018 123.018 0 0 1 42.028 43.477c-12.833-9.015-35.81-17.918-57.947-14.068 86.441 43.214 63.234 192.027-56.545 186.408a106.7 106.7 0 0 1-31.271-6.031 132.461 132.461 0 0 1-7.059-2.886c-1.356-0.618-2.711-1.243-4.051-1.935-29.349-15.168-53.583-43.833-56.611-78.643 0 0 11.093-41.335 79.433-41.335 7.388 0 28.508-20.614 28.9-26.593-0.09-1.953-41.917-18.59-58.223-34.656-8.714-8.585-12.851-12.723-16.514-15.829a71.7 71.7 0 0 0-6.225-4.7 111.335 111.335 0 0 1-0.675-58.733c-24.687 11.242-43.89 29.011-57.849 44.7h-0.111c-9.528-12.067-8.855-51.873-8.312-60.184-0.114-0.516-7.107 3.63-8.024 4.254a175.21 175.21 0 0 0-23.486 20.12 210.5 210.5 0 0 0-22.443 26.913c0 0.012-0.007 0.025-0.011 0.037 0-0.012 0.007-0.025 0.011-0.038a202.837 202.837 0 0 0-32.244 72.81c-0.058 0.265-2.29 10.054-3.92 22.147a265.794 265.794 0 0 0-0.769 5.651c-0.558 3.636-0.992 7.6-1.42 13.767-0.019 0.239-0.031 0.474-0.048 0.712a591.152 591.152 0 0 0-0.481 7.995c0 0.411-0.025 0.816-0.025 1.227 0 132.709 107.6 240.29 240.324 240.29 118.865 0 217.559-86.288 236.882-199.63 0.407-3.075 0.732-6.168 1.092-9.27 4.777-41.21-0.53-84.525-15.588-120.747zm-164.068 72.1z" fill="#20123a"/>
<path fill="context-fill #20123a" d="M190.368 150.591c0.157 0.009 0.079 0.003 0 0zm-57.874-28.933c0.158 0.008 0.079 0.003 0 0zm346.228 44.674c-10.445-25.123-31.6-52.248-48.211-60.82 13.52 26.5 21.345 53.093 24.335 72.935 0 0.04 0.015 0.136 0.047 0.4-27.175-67.732-73.254-95.047-110.886-154.512-1.9-3.008-3.805-6.022-5.661-9.2a73.237 73.237 0 0 1-2.646-4.972 43.757 43.757 0 0 1-3.585-9.5 0.625 0.625 0 0 0-0.546-0.644 0.8 0.8 0 0 0-0.451 0c-0.033 0.011-0.084 0.051-0.119 0.065-0.053 0.02-0.12 0.069-0.176 0.095 0.026-0.036 0.083-0.117 0.1-0.135-53.437 31.3-75.587 86.093-81.282 120.97a128.057 128.057 0 0 0-47.624 12.153 6.144 6.144 0 0 0-3.041 7.63 6.034 6.034 0 0 0 8.192 3.525 116.175 116.175 0 0 1 41.481-10.826c0.468-0.033 0.937-0.062 1.405-0.1a117.624 117.624 0 0 1 5.932-0.211 120.831 120.831 0 0 1 34.491 4.777c0.654 0.192 1.295 0.414 1.946 0.616a120.15 120.15 0 0 1 5.539 1.842 121.852 121.852 0 0 1 3.992 1.564c1.074 0.434 2.148 0.868 3.206 1.331a118.453 118.453 0 0 1 4.9 2.307c0.743 0.368 1.485 0.735 2.217 1.117a120.535 120.535 0 0 1 4.675 2.587 107.785 107.785 0 0 1 2.952 1.776 123.018 123.018 0 0 1 42.028 43.477c-12.833-9.015-35.81-17.918-57.947-14.068 86.441 43.214 63.234 192.027-56.545 186.408a106.7 106.7 0 0 1-31.271-6.031 132.461 132.461 0 0 1-7.059-2.886c-1.356-0.618-2.711-1.243-4.051-1.935-29.349-15.168-53.583-43.833-56.611-78.643 0 0 11.093-41.335 79.433-41.335 7.388 0 28.508-20.614 28.9-26.593-0.09-1.953-41.917-18.59-58.223-34.656-8.714-8.585-12.851-12.723-16.514-15.829a71.7 71.7 0 0 0-6.225-4.7 111.335 111.335 0 0 1-0.675-58.733c-24.687 11.242-43.89 29.011-57.849 44.7h-0.111c-9.528-12.067-8.855-51.873-8.312-60.184-0.114-0.516-7.107 3.63-8.024 4.254a175.21 175.21 0 0 0-23.486 20.12 210.5 210.5 0 0 0-22.443 26.913c0 0.012-0.007 0.025-0.011 0.037 0-0.012 0.007-0.025 0.011-0.038a202.837 202.837 0 0 0-32.244 72.81c-0.058 0.265-2.29 10.054-3.92 22.147a265.794 265.794 0 0 0-0.769 5.651c-0.558 3.636-0.992 7.6-1.42 13.767-0.019 0.239-0.031 0.474-0.048 0.712a591.152 591.152 0 0 0-0.481 7.995c0 0.411-0.025 0.816-0.025 1.227 0 132.709 107.6 240.29 240.324 240.29 118.865 0 217.559-86.288 236.882-199.63 0.407-3.075 0.732-6.168 1.092-9.27 4.777-41.21-0.53-84.525-15.588-120.747zm-164.068 72.1z" />
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -389,12 +389,9 @@ void Animation::UpdatePlaybackRate(double aPlaybackRate) {
// moving. Once we get a start time etc. we'll update the playback rate
// then.
//
// All we need to do is update observers so that, e.g. DevTools, report the
// right information.
//
// First we need to update the relevance however since we might have become
// current or stopped being current.
UpdateRelevance();
// However we still need to update the relevance and effect set as well as
// notifying observers.
UpdateEffect(PostRestyleMode::Never);
if (IsRelevant()) {
MutationObservers::NotifyAnimationChanged(this);
}

View File

@ -26,7 +26,6 @@
#include "mozilla/dom/FrameLoaderBinding.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/dom/UIEvent.h"
#include "mozilla/dom/UIEventBinding.h"
#include "mozilla/dom/UserActivation.h"
@ -2223,44 +2222,18 @@ nsresult EventStateManager::GetContentViewer(nsIContentViewer** aCv) {
return NS_OK;
}
nsresult EventStateManager::ChangeTextSize(int32_t change) {
nsCOMPtr<nsIContentViewer> cv;
nsresult rv = GetContentViewer(getter_AddRefs(cv));
NS_ENSURE_SUCCESS(rv, rv);
nsresult EventStateManager::ChangeZoom(int32_t change) {
MOZ_ASSERT(change == 1 || change == -1, "Can only change by +/- 10%.");
if (cv) {
float textzoom;
float zoomMin = ((float)StaticPrefs::zoom_minPercent()) / 100;
float zoomMax = ((float)StaticPrefs::zoom_maxPercent()) / 100;
cv->GetTextZoom(&textzoom);
textzoom += ((float)change) / 10;
if (textzoom < zoomMin)
textzoom = zoomMin;
else if (textzoom > zoomMax)
textzoom = zoomMax;
cv->SetTextZoom(textzoom);
}
return NS_OK;
}
nsresult EventStateManager::ChangeFullZoom(int32_t change) {
nsCOMPtr<nsIContentViewer> cv;
nsresult rv = GetContentViewer(getter_AddRefs(cv));
NS_ENSURE_SUCCESS(rv, rv);
if (cv) {
float fullzoom;
float zoomMin = ((float)StaticPrefs::zoom_minPercent()) / 100;
float zoomMax = ((float)StaticPrefs::zoom_maxPercent()) / 100;
cv->GetFullZoom(&fullzoom);
fullzoom += ((float)change) / 10;
if (fullzoom < zoomMin)
fullzoom = zoomMin;
else if (fullzoom > zoomMax)
fullzoom = zoomMax;
cv->SetFullZoom(fullzoom);
}
// Send the zoom change as a chrome event so it will be handled
// by the front end actors in the same way as other zoom actions.
// This excludes documents hosted in non-browser containers, like
// in a WebExtension.
nsContentUtils::DispatchChromeEvent(
mDocument, ToSupports(mDocument),
(change == 1 ? NS_LITERAL_STRING("DoZoomEnlargeBy10")
: NS_LITERAL_STRING("DoZoomReduceBy10")),
CanBubble::eYes, Cancelable::eYes);
return NS_OK;
}
@ -2281,19 +2254,14 @@ void EventStateManager::DoScrollHistory(int32_t direction) {
void EventStateManager::DoScrollZoom(nsIFrame* aTargetFrame,
int32_t adjustment) {
// Exclude form controls and content in chrome docshells.
// Exclude content in chrome docshells.
nsIContent* content = aTargetFrame->GetContent();
if (content && !nsContentUtils::IsInChromeDocshell(content->OwnerDoc())) {
// positive adjustment to decrease zoom, negative to increase
int32_t change = (adjustment > 0) ? -1 : 1;
EnsureDocument(mPresContext);
if (Preferences::GetBool("browser.zoom.full") ||
content->OwnerDoc()->IsSyntheticDocument()) {
ChangeFullZoom(change);
} else {
ChangeTextSize(change);
}
ChangeZoom(change);
nsContentUtils::DispatchChromeEvent(
mDocument, ToSupports(mDocument),
NS_LITERAL_STRING("ZoomChangeUsingMouseWheel"), CanBubble::eYes,
@ -3136,8 +3104,8 @@ void EventStateManager::PostHandleKeyboardEvent(
switch (aKeyboardEvent->mKeyNameIndex) {
case KEY_NAME_INDEX_ZoomIn:
case KEY_NAME_INDEX_ZoomOut:
ChangeFullZoom(
aKeyboardEvent->mKeyNameIndex == KEY_NAME_INDEX_ZoomIn ? 1 : -1);
ChangeZoom(aKeyboardEvent->mKeyNameIndex == KEY_NAME_INDEX_ZoomIn ? 1
: -1);
aStatus = nsEventStatus_eConsumeNoDefault;
break;
default:

View File

@ -926,8 +926,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
void DoScrollHistory(int32_t direction);
void DoScrollZoom(nsIFrame* aTargetFrame, int32_t adjustment);
nsresult GetContentViewer(nsIContentViewer** aCv);
nsresult ChangeTextSize(int32_t change);
nsresult ChangeFullZoom(int32_t change);
nsresult ChangeZoom(int32_t change);
/**
* DeltaAccumulator class manages delta values for dispatching DOMMouseScroll

View File

@ -17,28 +17,25 @@
<select id="select"><option></option></select>
<script>
function testControl(id) {
return new Promise(function(resolve) {
var initialZoom = SpecialPowers.getFullZoom(window);
var element = document.getElementById(id);
element.onwheel = function() {
window.requestAnimationFrame(function() {
setTimeout(function() {
isnot(SpecialPowers.getFullZoom(window), initialZoom,
"Should have zoomed");
SpecialPowers.setFullZoom(window, initialZoom);
setTimeout(resolve);
});
});
}
async function testControl(id) {
var initialZoom = SpecialPowers.getFullZoom(window);
var element = document.getElementById(id);
let event = {
deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaY: 3,
ctrlKey: true
};
synthesizeWheel(element, 5, 5, event);
});
const zoomHasHappened = SimpleTest.promiseWaitForCondition(() => {
const zoom = SpecialPowers.getFullZoom(window);
return (zoom != initialZoom);
}, id + ": wheel event changed the zoom.");
let event = {
deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaY: 3,
ctrlKey: true
};
synthesizeWheel(element, 5, 5, event);
await zoomHasHappened;
isnot(SpecialPowers.getFullZoom(window), initialZoom, id + ": should have zoomed");
SpecialPowers.setFullZoom(window, initialZoom);
}
async function test() {

View File

@ -4548,13 +4548,28 @@ void AsyncPanZoomController::NotifyLayersUpdated(
RepaintUpdateType contentRepaintType = RepaintUpdateType::eNone;
bool viewportUpdated = false;
if (Metrics().GetLayoutViewport().Size() !=
aLayerMetrics.GetLayoutViewport().Size()) {
needContentRepaint = true;
viewportUpdated = true;
}
if (viewportUpdated || scrollOffsetUpdated) {
Metrics().SetLayoutViewport(aLayerMetrics.GetLayoutViewport());
// We usually don't entertain viewport updates on the same transaction as
// a composition bounds update, but we make an exception for Android
// to avoid the composition bounds and the viewport diverging during
// orientation changes and dynamic toolbar transitions.
// TODO: Do this on all platforms.
bool entertainViewportUpdates =
FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Width(),
Metrics().GetCompositionBounds().Width()) &&
FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Height(),
Metrics().GetCompositionBounds().Height());
#if defined(MOZ_WIDGET_ANDROID)
entertainViewportUpdates = true;
#endif
if (entertainViewportUpdates) {
if (Metrics().GetLayoutViewport().Size() !=
aLayerMetrics.GetLayoutViewport().Size()) {
needContentRepaint = true;
viewportUpdated = true;
}
if (viewportUpdated || scrollOffsetUpdated) {
Metrics().SetLayoutViewport(aLayerMetrics.GetLayoutViewport());
}
}
#if defined(MOZ_WIDGET_ANDROID)

View File

@ -86,13 +86,6 @@ class mozJSComponentLoader final {
friend class XPCJSRuntime;
JSObject* CompilationScope(JSContext* aCx) {
if (mLoaderGlobal) {
return mLoaderGlobal;
}
return GetSharedGlobal(aCx);
}
private:
static mozilla::StaticRefPtr<mozJSComponentLoader> sSelf;

View File

@ -1 +1 @@
# Cubeb Audio Remoting Prototype
# Cubeb Audio Remoting Prototype

View File

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The audioipc-2 git repository is: https://github.com/djg/audioipc-2.git
The git commit ID used was 86d49ddfca8b016a4b60b0b3fef76052194b8aa3 (2020-01-25 20:43:03 +1300)
The git commit ID used was bc369ec35d2e40544c5273beb935e23d3fe60e04 (2020-01-30 21:25:48 +0100)

View File

@ -242,7 +242,7 @@ impl ServerStreamCallbacks {
frames
}
_ => {
error!("Unexpected message {:?} during data_callback", r);
debug!("Unexpected message {:?} during data_callback", r);
// TODO: Return a CUBEB_ERROR result here once
// https://github.com/kinetiknz/cubeb/issues/553 is
// fixed.
@ -334,6 +334,18 @@ impl rpc::Server for CubebServer {
}
}
// Debugging for BMO 1594216/1612044.
macro_rules! try_stream {
($self:expr, $stm_tok:expr) => {
if $self.streams.contains($stm_tok) {
&mut $self.streams[$stm_tok]
} else {
error!("{}:{}:{} - Stream({}): invalid token", file!(), line!(), column!(), $stm_tok);
return error(cubeb::Error::invalid_parameter());
}
};
}
impl CubebServer {
pub fn new(handle: current_thread::Handle) -> Self {
CubebServer {
@ -407,54 +419,60 @@ impl CubebServer {
.unwrap_or_else(|_| error(cubeb::Error::error())),
ServerMessage::StreamDestroy(stm_tok) => {
self.streams.remove(stm_tok);
if self.streams.contains(stm_tok) {
debug!("Unregistering stream {:?}", stm_tok);
self.streams.remove(stm_tok);
} else {
// Debugging for BMO 1594216/1612044.
error!("StreamDestroy({}): invalid token", stm_tok);
return error(cubeb::Error::invalid_parameter());
}
ClientMessage::StreamDestroyed
}
ServerMessage::StreamStart(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamStart(stm_tok) => try_stream!(self, stm_tok)
.stream
.start()
.map(|_| ClientMessage::StreamStarted)
.unwrap_or_else(error),
ServerMessage::StreamStop(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamStop(stm_tok) => try_stream!(self, stm_tok)
.stream
.stop()
.map(|_| ClientMessage::StreamStopped)
.unwrap_or_else(error),
ServerMessage::StreamResetDefaultDevice(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamResetDefaultDevice(stm_tok) => try_stream!(self, stm_tok)
.stream
.reset_default_device()
.map(|_| ClientMessage::StreamDefaultDeviceReset)
.unwrap_or_else(error),
ServerMessage::StreamGetPosition(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamGetPosition(stm_tok) => try_stream!(self, stm_tok)
.stream
.position()
.map(ClientMessage::StreamPosition)
.unwrap_or_else(error),
ServerMessage::StreamGetLatency(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamGetLatency(stm_tok) => try_stream!(self, stm_tok)
.stream
.latency()
.map(ClientMessage::StreamLatency)
.unwrap_or_else(error),
ServerMessage::StreamSetVolume(stm_tok, volume) => self.streams[stm_tok]
ServerMessage::StreamSetVolume(stm_tok, volume) => try_stream!(self, stm_tok)
.stream
.set_volume(volume)
.map(|_| ClientMessage::StreamVolumeSet)
.unwrap_or_else(error),
ServerMessage::StreamGetCurrentDevice(stm_tok) => self.streams[stm_tok]
ServerMessage::StreamGetCurrentDevice(stm_tok) => try_stream!(self, stm_tok)
.stream
.current_device()
.map(|device| ClientMessage::StreamCurrentDevice(Device::from(device)))
.unwrap_or_else(error),
ServerMessage::StreamRegisterDeviceChangeCallback(stm_tok, enable) => self.streams
[stm_tok]
ServerMessage::StreamRegisterDeviceChangeCallback(stm_tok, enable) => try_stream!(self, stm_tok)
.stream
.register_device_changed_callback(if enable {
Some(device_change_cb_c)

View File

@ -152,6 +152,13 @@ DesktopAndCursorComposer::DesktopAndCursorComposer(
DesktopAndCursorComposer::~DesktopAndCursorComposer() = default;
std::unique_ptr<DesktopAndCursorComposer>
DesktopAndCursorComposer::CreateWithoutMouseCursorMonitor(
std::unique_ptr<DesktopCapturer> desktop_capturer) {
return std::unique_ptr<DesktopAndCursorComposer>(
new DesktopAndCursorComposer(desktop_capturer.release(), nullptr));
}
void DesktopAndCursorComposer::Start(DesktopCapturer::Callback* callback) {
callback_ = callback;
if (mouse_monitor_)
@ -201,15 +208,6 @@ void DesktopAndCursorComposer::OnMouseCursor(MouseCursor* cursor) {
cursor_.reset(cursor);
}
void DesktopAndCursorComposer::OnMouseCursorPosition(
MouseCursorMonitor::CursorState state,
const DesktopVector& position) {
if (!use_desktop_relative_cursor_position_) {
cursor_state_ = state;
cursor_position_ = position;
}
}
void DesktopAndCursorComposer::OnMouseCursorPosition(
const DesktopVector& position) {
if (use_desktop_relative_cursor_position_) {

View File

@ -29,7 +29,7 @@ class DesktopAndCursorComposer : public DesktopCapturer,
public DesktopCapturer::Callback,
public MouseCursorMonitor::Callback {
public:
// Creates a new blender that captures mouse cursor using |mouse_monitor| and
// Creates a new comp that captures mouse cursor using |mouse_monitor| and
// renders it into the frames generated by |desktop_capturer|. If
// |mouse_monitor| is NULL the frames are passed unmodified. Takes ownership
// of both arguments.
@ -45,6 +45,12 @@ class DesktopAndCursorComposer : public DesktopCapturer,
~DesktopAndCursorComposer() override;
// Creates a new composer that relies on an external source for cursor shape
// and position information via the MouseCursorMonitor::Callback interface.
static std::unique_ptr<DesktopAndCursorComposer>
CreateWithoutMouseCursorMonitor(
std::unique_ptr<DesktopCapturer> desktop_capturer);
// DesktopCapturer interface.
void Start(DesktopCapturer::Callback* callback) override;
void SetSharedMemoryFactory(
@ -53,6 +59,12 @@ class DesktopAndCursorComposer : public DesktopCapturer,
void SetExcludedWindow(WindowId window) override;
bool FocusOnSelectedSource() override;
// MouseCursorMonitor::Callback interface.
void OnMouseCursor(MouseCursor* cursor) override;
void OnMouseCursorPosition(webrtc::MouseCursorMonitor::CursorState,
const webrtc::DesktopVector&) override {};
void OnMouseCursorPosition(const DesktopVector& position) override;
private:
// Allows test cases to use a fake MouseCursorMonitor implementation.
friend class DesktopAndCursorComposerTest<true>;
@ -68,12 +80,6 @@ class DesktopAndCursorComposer : public DesktopCapturer,
void OnCaptureResult(DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame> frame) override;
// MouseCursorMonitor::Callback interface.
void OnMouseCursor(MouseCursor* cursor) override;
void OnMouseCursorPosition(MouseCursorMonitor::CursorState state,
const DesktopVector& position) override;
void OnMouseCursorPosition(const DesktopVector& position) override;
const std::unique_ptr<DesktopCapturer> desktop_capturer_;
const std::unique_ptr<MouseCursorMonitor> mouse_monitor_;
// This is a temporary flag to decide how to use the |mouse_monitor_|.

View File

@ -54,13 +54,12 @@ class MouseCursorMonitor {
// relative to the |window| specified in the constructor.
// Deprecated: use the following overload instead.
virtual void OnMouseCursorPosition(CursorState state,
const DesktopVector& position) = 0;
const DesktopVector& position) {}
// Called in response to Capture(). |position| indicates cursor absolute
// position on the system in fullscreen coordinate, i.e. the top-left
// monitor always starts from (0, 0).
// TODO(zijiehe): Ensure all implementations return the absolute position.
// TODO(zijiehe): Make this function pure virtual after Chromium changes.
// TODO(zijiehe): Current this overload works correctly only when capturing
// mouse cursor against fullscreen.
virtual void OnMouseCursorPosition(const DesktopVector& position) {}

View File

@ -31,9 +31,7 @@ class MouseCursorMonitorTest : public testing::Test,
cursor_image_.reset(cursor_image);
}
void OnMouseCursorPosition(MouseCursorMonitor::CursorState state,
const DesktopVector& position) override {
state_ = state;
void OnMouseCursorPosition(const DesktopVector& position) override {
position_ = position;
position_received_ = true;
}

View File

@ -0,0 +1,363 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from, TERM_REFERENCE, MESSAGE_REFERENCE, VARIABLE_REFERENCE
from fluent.migrate import COPY_PATTERN, REPLACE, COPY
def migrate(ctx):
"""Bug 1608022 - Migrate browser-sets to Fluent, part {index}."""
ctx.add_transforms(
'browser/browser/browser.ftl',
'browser/browser/browser.ftl',
[
FTL.Message(
id=FTL.Identifier("urlbar-star-edit-bookmark"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOn.tooltip2",
{
"%1$S": VARIABLE_REFERENCE("shortcut")
},
normalize_printf=True
)
)
]
),
FTL.Message(
id=FTL.Identifier("urlbar-star-add-bookmark"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOff.tooltip2",
{
"%1$S": VARIABLE_REFERENCE("shortcut")
},
normalize_printf=True
)
)
]
),
]
)
ctx.add_transforms(
'browser/browser/browserContext.ftl',
'browser/browser/browserContext.ftl',
[
FTL.Message(
id=FTL.Identifier("main-context-menu-bookmark-add"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("aria-label"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.aria-label",
)
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.accesskey",
)
),
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOff.tooltip2",
{
" (%1$S)": FTL.TextElement("")
},
trim=True,
normalize_printf=True
)
),
]
),
FTL.Message(
id=FTL.Identifier("main-context-menu-bookmark-add-with-shortcut"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("aria-label"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.aria-label",
)
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.accesskey",
)
),
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOff.tooltip2",
{
"%1$S": VARIABLE_REFERENCE("shortcut")
},
normalize_printf=True
)
),
]
),
FTL.Message(
id=FTL.Identifier("main-context-menu-bookmark-change"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("aria-label"),
value=COPY(
"browser/chrome/browser/browser.dtd",
"editThisBookmarkCmd.label",
)
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.accesskey",
)
),
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOn.tooltip2",
{
" (%1$S)": FTL.TextElement("")
},
trim=True,
normalize_printf=True
)
),
]
),
FTL.Message(
id=FTL.Identifier("main-context-menu-bookmark-change-with-shortcut"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("aria-label"),
value=COPY(
"browser/chrome/browser/browser.dtd",
"editThisBookmarkCmd.label",
)
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY_PATTERN(
"browser/browser/browserContext.ftl",
"main-context-menu-bookmark-page.accesskey",
)
),
FTL.Attribute(
id=FTL.Identifier("tooltiptext"),
value=REPLACE(
"browser/chrome/browser/browser.properties",
"starButtonOn.tooltip2",
{
"%1$S": VARIABLE_REFERENCE("shortcut")
},
normalize_printf=True
)
),
]
),
]
)
ctx.add_transforms(
'browser/browser/menubar.ftl',
'browser/browser/menubar.ftl',
transforms_from(
"""
menu-bookmark-this-page =
.label = { COPY(from_path, "bookmarkThisPageCmd.label") }
menu-bookmark-edit =
.label = { COPY(from_path, "editThisBookmarkCmd.label") }
""", from_path="browser/chrome/browser/browser.dtd")
)
ctx.add_transforms(
'browser/browser/browserSets.ftl',
'browser/browser/browserSets.ftl',
transforms_from(
"""
window-minimize-command =
.label = { COPY(baseMenuOverlay_path, "minimizeWindow.label") }
window-zoom-command =
.label = { COPY(baseMenuOverlay_path, "zoomWindow.label") }
window-new-shortcut =
.key = { COPY(browser_path, "newNavigatorCmd.key") }
window-minimize-shortcut =
.key = { COPY(baseMenuOverlay_path, "minimizeWindow.key") }
close-shortcut =
.key = { COPY(browser_path, "closeCmd.key") }
tab-new-shortcut =
.key = { COPY(browser_path, "tabCmd.commandkey") }
location-open-shortcut =
.key = { COPY(browser_path, "openCmd.commandkey") }
location-open-shortcut-alt =
.key = { COPY(browser_path, "urlbar.accesskey") }
search-focus-shortcut =
.key = { COPY(browser_path, "searchFocus.commandkey") }
find-shortcut =
.key = { COPY(browser_path, "findOnCmd.commandkey") }
search-find-again-shortcut =
.key = { COPY(browser_path, "findAgainCmd.commandkey") }
search-find-again-shortcut-alt =
.keycode = { COPY(browser_path, "findAgainCmd.commandkey2") }
search-find-selection-shortcut =
.key = { COPY(browser_path, "findSelectionCmd.commandkey") }
search-focus-shortcut-alt =
.key = { PLATFORM() ->
[linux] { COPY(browser_path, "searchFocusUnix.commandkey") }
*[other] { COPY(browser_path, "searchFocus.commandkey2") }
}
downloads-shortcut =
.key = { PLATFORM() ->
[linux] { COPY(browser_path, "downloadsUnix.commandkey") }
*[other] { COPY(browser_path, "downloads.commandkey") }
}
addons-shortcut =
.key = { COPY(browser_path, "addons.commandkey") }
file-open-shortcut =
.key = { COPY(browser_path, "openFileCmd.commandkey") }
save-page-shortcut =
.key = { COPY(browser_path, "savePageCmd.commandkey") }
page-source-shortcut =
.key = { COPY(browser_path, "pageSourceCmd.commandkey") }
page-source-shortcut-safari =
.key = { COPY(browser_path, "pageSourceCmd.SafariCommandKey") }
page-info-shortcut =
.key = { COPY(browser_path, "pageInfoCmd.commandkey") }
print-shortcut =
.key = { COPY(browser_path, "printCmd.commandkey") }
mute-toggle-shortcut =
.key = { COPY(browser_path, "toggleMuteCmd.key") }
nav-back-shortcut-alt =
.key = { COPY(browser_path, "goBackCmd.commandKey") }
nav-fwd-shortcut-alt =
.key = { COPY(browser_path, "goForwardCmd.commandKey") }
nav-reload-shortcut =
.key = { COPY(browser_path, "reloadCmd.commandkey") }
nav-stop-shortcut =
.key = { COPY(browser_path, "stopCmd.macCommandKey") }
history-show-all-shortcut =
.key = { COPY(browser_path, "showAllHistoryCmd.commandkey") }
history-sidebar-shortcut =
.key = { COPY(browser_path, "historySidebarCmd.commandKey") }
full-screen-shortcut =
.key = { COPY(browser_path, "fullScreenCmd.macCommandKey") }
reader-mode-toggle-shortcut =
.key = { PLATFORM() ->
[windows] { COPY(browser_path, "toggleReaderMode.win.keycode") }
*[other] { COPY(browser_path, "toggleReaderMode.key") }
}
picture-in-picture-toggle-shortcut =
.key = { COPY(browser_path, "togglePictureInPicture.key") }
picture-in-picture-toggle-shortcut-alt =
.key = { "}" }
bookmark-this-page-shortcut =
.key = { COPY(browser_path, "bookmarkThisPageCmd.commandkey") }
bookmark-show-all-shortcut =
.key = { PLATFORM() ->
[linux] { COPY(browser_path, "bookmarksGtkCmd.commandkey") }
*[other] { COPY(browser_path, "bookmarksWinCmd.commandkey") }
}
bookmark-show-sidebar-shortcut =
.key = { COPY(browser_path, "bookmarksCmd.commandkey") }
full-zoom-reduce-shortcut =
.key = { COPY(browser_path, "fullZoomReduceCmd.commandkey") }
full-zoom-reduce-shortcut-alt =
.key = { COPY(browser_path, "fullZoomReduceCmd.commandkey2") }
full-zoom-enlarge-shortcut =
.key = { COPY(browser_path, "fullZoomEnlargeCmd.commandkey") }
full-zoom-enlarge-shortcut-alt =
.key = { COPY(browser_path, "fullZoomEnlargeCmd.commandkey2") }
full-zoom-enlarge-shortcut-alt2 =
.key = { COPY(browser_path, "fullZoomEnlargeCmd.commandkey3") }
full-zoom-reset-shortcut =
.key = { COPY(browser_path, "fullZoomResetCmd.commandkey") }
full-zoom-reset-shortcut-alt =
.key = { COPY(browser_path, "fullZoomResetCmd.commandkey2") }
bidi-switch-direction-shortcut =
.key = { COPY(browser_path, "bidiSwitchTextDirectionItem.commandkey") }
private-browsing-shortcut =
.key = { COPY(browser_path, "privateBrowsingCmd.commandkey") }
quit-app-shortcut =
.key = { COPY(browser_path, "quitApplicationCmd.key") }
help-shortcut =
.key = { COPY(baseMenuOverlay_path, "helpMac.commandkey") }
preferences-shortcut =
.key = { COPY(baseMenuOverlay_path, "preferencesCmdMac.commandkey") }
hide-app-shortcut =
.key = { COPY(baseMenuOverlay_path, "hideThisAppCmdMac2.commandkey") }
hide-other-apps-shortcut =
.key = { COPY(baseMenuOverlay_path, "hideOtherAppsCmdMac.commandkey") }
""", baseMenuOverlay_path="browser/chrome/browser/baseMenuOverlay.dtd",
browser_path="browser/chrome/browser/browser.dtd")
)

View File

@ -195,8 +195,20 @@ test(t => {
animation.finish();
animation.playbackRate = 0;
animation.currentTime = 200 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), []);
}, 'Does not return animations with zero playback rate in after phase');
test(t => {
const div = createDiv(t);
const effect = new KeyframeEffect(div, {}, 225);
const animation = new Animation(effect, new DocumentTimeline());
animation.reverse();
animation.pause();
animation.playbackRate = -1;;
animation.updatePlaybackRate(1);
assert_array_equals(div.getAnimations(), []);
}, 'Does not return an animation that has recently been made not current by setting the playback rate');
test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);

View File

@ -27,12 +27,12 @@ class ZoomChild extends JSWindowActorChild {
}
set fullZoom(value) {
this._cache.fullZoom = value;
this._cache.fullZoom = Number(value.toFixed(2));
this._markupViewer.fullZoom = value;
}
set textZoom(value) {
this._cache.textZoom = value;
this._cache.textZoom = Number(value.toFixed(2));
this._markupViewer.textZoom = value;
}
@ -75,12 +75,18 @@ class ZoomChild extends JSWindowActorChild {
}
handleEvent(event) {
if (event.type == "ZoomChangeUsingMouseWheel") {
this.sendAsyncMessage("ZoomChangeUsingMouseWheel", {});
// Send do zoom events to our parent as messages, to be re-dispatched.
if (event.type == "DoZoomEnlargeBy10") {
this.sendAsyncMessage("DoZoomEnlargeBy10", {});
return;
}
// Only handle this event for top-level content.
if (event.type == "DoZoomReduceBy10") {
this.sendAsyncMessage("DoZoomReduceBy10", {});
return;
}
// Only handle remaining events for top-level content.
if (this.browsingContext != this.browsingContext.top) {
return;
}
@ -92,8 +98,6 @@ class ZoomChild extends JSWindowActorChild {
if (this._resolutionBeforeFullZoomChange == 0) {
this._resolutionBeforeFullZoomChange = this.contentWindow.windowUtils.getResolution();
}
this.sendAsyncMessage("PreFullZoomChange", {});
return;
}
@ -114,7 +118,7 @@ class ZoomChild extends JSWindowActorChild {
this._resolutionBeforeFullZoomChange = 0;
}
this.sendAsyncMessage("PostFullZoomChange", {});
this.sendAsyncMessage("FullZoomResolutionStable", {});
return;
}

View File

@ -15,14 +15,22 @@ class ZoomParent extends JSWindowActorParent {
let document = browser.ownerGlobal.document;
switch (message.name) {
case "PreFullZoomChange": {
let event = document.createEvent("Events");
event.initEvent("PreFullZoomChange", true, false);
browser.dispatchEvent(event);
break;
}
/**
* We respond to three types of messages:
* 1) "Do" messages. These are requests from the ZoomChild that represent
* action requests from the platform code. We send matching events on
* to the frontend FullZoom actor that will take the requested action.
* 2) ZoomChange messages. These are messages from the ZoomChild that
* changes have been made to the zoom by the platform code. We create
* events for other listeners so that they can also update state.
* These messages will not be sent by the ZoomChild if the zoom change
* originated in the ZoomParent actor.
* 3) FullZoomResolutionStable. This is received after zoom is applied to
* a Responsive Design Mode frame and it has reached a stable
* resolution. We fire an event that is used by tests.
**/
switch (message.name) {
case "FullZoomChange": {
browser._fullZoom = message.data.value;
let event = document.createEvent("Events");
@ -31,9 +39,9 @@ class ZoomParent extends JSWindowActorParent {
break;
}
case "PostFullZoomChange": {
case "FullZoomResolutionStable": {
let event = document.createEvent("Events");
event.initEvent("PostFullZoomChange", true, false);
event.initEvent("FullZoomResolutionStable", true, false);
browser.dispatchEvent(event);
break;
}
@ -46,9 +54,16 @@ class ZoomParent extends JSWindowActorParent {
break;
}
case "ZoomChangeUsingMouseWheel": {
case "DoZoomEnlargeBy10": {
let event = document.createEvent("Events");
event.initEvent("ZoomChangeUsingMouseWheel", true, false);
event.initEvent("DoZoomEnlargeBy10", true, false);
browser.dispatchEvent(event);
break;
}
case "DoZoomReduceBy10": {
let event = document.createEvent("Events");
event.initEvent("DoZoomReduceBy10", true, false);
browser.dispatchEvent(event);
break;
}

View File

@ -223,7 +223,7 @@ add_task(async function e10sLostKeys() {
let initialValue = findBar._findField.value;
await EventUtils.synthesizeAndWaitKey(
"f",
"F",
{ accelKey: true },
window,
null,

View File

@ -377,7 +377,14 @@ let ACTORS = {
PreFullZoomChange: {},
FullZoomChange: {},
TextZoomChange: {},
ZoomChangeUsingMouseWheel: {},
DoZoomEnlargeBy10: {
capture: true,
mozSystemGroup: true,
},
DoZoomReduceBy10: {
capture: true,
mozSystemGroup: true,
},
mozupdatedremoteframedimensions: {
capture: true,
mozSystemGroup: true,