Bug 1016582 - pin new back/fwd/refresh/stop/star group at the top of the context menu, r=jaws

--HG--
extra : rebase_source : 26b6555b405e247daab91317ac9bed284fb7fb63
This commit is contained in:
Gijs Kruitbosch 2014-05-29 12:08:32 +01:00
parent a53cdb2cf0
commit f607020b0a
4 changed files with 48 additions and 46 deletions

View File

@ -3,6 +3,37 @@
# 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/.
<menugroup id="context-navigation">
<menuitem id="context-back"
class="menuitem-iconic"
tooltiptext="&backButton.tooltip;"
aria-label="&backCmd.label;"
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-forward"
class="menuitem-iconic"
tooltiptext="&forwardButton.tooltip;"
aria-label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-reload"
class="menuitem-iconic"
tooltiptext="&reloadButton.tooltip;"
aria-label="&reloadCmd.label;"
oncommand="gContextMenu.reload(event);"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-stop"
class="menuitem-iconic"
tooltiptext="&stopButton.tooltip;"
aria-label="&stopCmd.label;"
command="Browser:Stop"/>
<menuitem id="context-bookmarkpage"
class="menuitem-iconic"
tooltiptext="&bookmarkPageCmd2.label;"
aria-label="&bookmarkPageCmd2.label;"
oncommand="gContextMenu.bookmarkThisPage();"/>
</menugroup>
<menuseparator id="context-sep-navigation"/>
<menuseparator id="page-menu-separator"/>
<menuitem id="spell-no-suggestions"
disabled="true"
@ -219,37 +250,6 @@
accesskey="&hidePluginCmd.accesskey;"
oncommand="gContextMenu.hidePlugin();"/>
<menuseparator id="context-sep-ctp"/>
<menugroup id="context-navigation">
<menuitem id="context-back"
class="menuitem-iconic"
tooltiptext="&backButton.tooltip;"
aria-label="&backCmd.label;"
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-forward"
class="menuitem-iconic"
tooltiptext="&forwardButton.tooltip;"
aria-label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-reload"
class="menuitem-iconic"
tooltiptext="&reloadButton.tooltip;"
aria-label="&reloadCmd.label;"
oncommand="gContextMenu.reload(event);"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-stop"
class="menuitem-iconic"
tooltiptext="&stopButton.tooltip;"
aria-label="&stopCmd.label;"
command="Browser:Stop"/>
<menuitem id="context-bookmarkpage"
class="menuitem-iconic"
tooltiptext="&bookmarkPageCmd2.label;"
aria-label="&bookmarkPageCmd2.label;"
oncommand="gContextMenu.bookmarkThisPage();"/>
</menugroup>
<menuseparator id="context-sep-navigation"/>
<menuitem id="context-sharepage"
label="&sharePageCmd.label;"
accesskey="&sharePageCmd.accesskey;"

View File

@ -312,7 +312,7 @@
oncommand="BrowserFullScreen();"/>
</menupopup>
<menupopup id="contentAreaContextMenu" pagemenu="start"
<menupopup id="contentAreaContextMenu" pagemenu="#page-menu-separator"
onpopupshowing="if (event.target != this)
return true;
gContextMenu = new nsContextMenu(this, event.shiftKey);

View File

@ -449,7 +449,13 @@ function runTest(testNum) {
case 19:
// Context menu for element with assigned content context menu
checkContextMenu(["+Plain item", {type: "", icon: "", checked: false, disabled: false},
checkContextMenu(["context-navigation", null,
["context-back", false,
"context-forward", false,
"context-reload", true,
"context-bookmarkpage", true], null,
"---", null,
"+Plain item", {type: "", icon: "", checked: false, disabled: false},
"+Disabled item", {type: "", icon: "", checked: false, disabled: true},
"+Item w/ textContent", {type: "", icon: "", checked: false, disabled: false},
"---", null,
@ -469,12 +475,6 @@ function runTest(testNum) {
"---", null,
"+Checkbox", {type: "checkbox", icon: "", checked: false, disabled: false}], null,
"---", null,
"context-navigation", null,
["context-back", false,
"context-forward", false,
"context-reload", true,
"context-bookmarkpage", true], null,
"---", null,
"context-savepage", true,
"---", null,
"context-viewbgimage", false,
@ -501,14 +501,14 @@ function runTest(testNum) {
case 20:
// Context menu for DOM Fullscreen mode (NOTE: this is *NOT* on an img)
checkContextMenu(["context-leave-dom-fullscreen", true,
"---", null,
"context-navigation", null,
checkContextMenu(["context-navigation", null,
["context-back", false,
"context-forward", false,
"context-reload", true,
"context-bookmarkpage", true], null,
"---", null,
"context-leave-dom-fullscreen", true,
"---", null,
"context-savepage", true,
"---", null,
"context-viewbgimage", false,
@ -694,15 +694,15 @@ function runTest(testNum) {
case 27:
// Context menu for click-to-play blocked plugin
checkContextMenu(["context-ctp-play", true,
"context-ctp-hide", true,
"---", null,
"context-navigation", null,
checkContextMenu(["context-navigation", null,
["context-back", false,
"context-forward", false,
"context-reload", true,
"context-bookmarkpage", true], null,
"---", null,
"context-ctp-play", true,
"context-ctp-hide", true,
"---", null,
"context-savepage", true,
"---", null,
"context-viewbgimage", false,

View File

@ -54,6 +54,8 @@ PageMenu.prototype = {
if (pos == "start") {
insertionPoint.insertBefore(fragment,
insertionPoint.firstChild);
} else if (pos.startsWith("#")) {
insertionPoint.insertBefore(fragment, insertionPoint.querySelector(pos));
} else {
insertionPoint.appendChild(fragment);
}