Merge m-c -> e10s.

This commit is contained in:
Dan Witte 2010-08-21 10:21:06 -07:00
commit 886f18b404
16 changed files with 132 additions and 122 deletions

View File

@ -512,6 +512,7 @@
disabled="true"/>
#endif
<menu id="historyUndoMenu"
class="recentlyClosedTabsMenu"
label="&historyUndoMenu.label;"
disabled="true">
<menupopup id="historyUndoPopup"
@ -521,6 +522,7 @@
onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoSubmenu();"/>
</menu>
<menu id="historyUndoWindowMenu"
class="recentlyClosedWindowsMenu"
label="&historyUndoWindowMenu.label;"
disabled="true">
<menupopup id="historyUndoWindowPopup"

View File

@ -576,13 +576,13 @@ HistoryMenu.prototype = {
toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() {
// enable/disable the Recently Closed Tabs sub menu
var undoPopup = document.getElementById("historyUndoPopup");
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
// no restorable tabs, so disable menu
if (this._ss.getClosedTabCount(window) == 0)
undoPopup.parentNode.setAttribute("disabled", true);
undoMenu.setAttribute("disabled", true);
else
undoPopup.parentNode.removeAttribute("disabled");
undoMenu.removeAttribute("disabled");
},
/**
@ -603,7 +603,8 @@ HistoryMenu.prototype = {
* Populate when the history menu is opened
*/
populateUndoSubmenu: function PHM_populateUndoSubmenu() {
var undoPopup = document.getElementById("historyUndoPopup");
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
var undoPopup = undoMenu.firstChild;
// remove existing menu items
while (undoPopup.hasChildNodes())
@ -611,12 +612,12 @@ HistoryMenu.prototype = {
// no restorable tabs, so make sure menu is disabled, and return
if (this._ss.getClosedTabCount(window) == 0) {
undoPopup.parentNode.setAttribute("disabled", true);
undoMenu.setAttribute("disabled", true);
return;
}
// enable menu
undoPopup.parentNode.removeAttribute("disabled");
undoMenu.removeAttribute("disabled");
// populate menu
var undoItems = eval("(" + this._ss.getClosedTabData(window) + ")");
@ -661,20 +662,21 @@ HistoryMenu.prototype = {
toggleRecentlyClosedWindows: function PHM_toggleRecentlyClosedWindows() {
// enable/disable the Recently Closed Windows sub menu
let undoPopup = document.getElementById("historyUndoWindowPopup");
var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
// no restorable windows, so disable menu
if (this._ss.getClosedWindowCount() == 0)
undoPopup.parentNode.setAttribute("disabled", true);
undoMenu.setAttribute("disabled", true);
else
undoPopup.parentNode.removeAttribute("disabled");
undoMenu.removeAttribute("disabled");
},
/**
* Populate when the history menu is opened
*/
populateUndoWindowSubmenu: function PHM_populateUndoWindowSubmenu() {
let undoPopup = document.getElementById("historyUndoWindowPopup");
let undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
let undoPopup = undoMenu.firstChild;
let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
let menuLabelStringSingleTab =
gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
@ -685,12 +687,12 @@ HistoryMenu.prototype = {
// no restorable windows, so make sure menu is disabled, and return
if (this._ss.getClosedWindowCount() == 0) {
undoPopup.parentNode.setAttribute("disabled", true);
undoMenu.setAttribute("disabled", true);
return;
}
// enable menu
undoPopup.parentNode.removeAttribute("disabled");
undoMenu.removeAttribute("disabled");
// populate menu
let undoItems = JSON.parse(this._ss.getClosedWindowData());

View File

@ -2604,11 +2604,6 @@ function BrowserOnClick(event) {
);
}
}
else if (/^about:privatebrowsing/.test(errorDoc.documentURI)) {
if (ot == errorDoc.getElementById("startPrivateBrowsing")) {
gPrivateBrowsingUI.toggleMode();
}
}
}
/**

View File

@ -521,7 +521,7 @@
<hbox flex="1"
class="split-menuitem">
<menuitem id="appmenu_print"
class="menuitem-iconic"
class="menuitem-iconic split-menuitem-item"
flex="1"
label="&printCmd.label;"
command="cmd_print"/>
@ -579,52 +579,53 @@
</vbox>
<vbox id="appmenuSecondaryPane">
<hbox class="split-menuitem">
<menuitem id="appmenu_BookmarkItem"
class="menuitem-iconic"
<menuitem id="appmenu_bookmarks"
class="menuitem-iconic split-menuitem-item"
flex="1"
label="&bookmarksMenu.label;"
command="Browser:ShowAllBookmarks"/>
<menu id="appmenuBookmarkMenu"
<menu id="appmenu_bookmarksMenu"
class="split-menuitem-menu">
<menupopup id="appmenuBookmarkMenu_popup"
<menupopup id="appmenu_bookmarksMenupopup"
placespopup="true"
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event);"
onclick="BookmarksEventHandler.onClick(event);"
onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
if (!this.parentNode._placesView)new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');
this.appendChild(document.getElementById('appmenuBookmarkMenu_unsorted_seperator'));
this.appendChild(document.getElementById('appmenuBookmarkMenu_unsorted-menuitem'));"
if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');
this.appendChild(document.getElementById('appmenu_unsortedBookmarks_seperator'));
this.appendChild(document.getElementById('appmenu_unsortedBookmarks'));"
tooltip="bhTooltip"
popupsinherittooltip="true">
<menuseparator id="appmenuBookmarkMenu_unsorted_seperator"/>
<menuitem id="appmenuBookmarkMenu_unsorted-menuitem"
<menuseparator id="appmenu_unsortedBookmarks_seperator"/>
<menuitem id="appmenu_unsortedBookmarks"
label="&appMenuUnsorted.label;"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
class="menuitem-iconic"/>
<menuitem id="appmenuBookmarkMenu_organize_bookmarks"
<menuitem id="appmenu_organizeBookmarks"
label="&organizeBookmarks.label;"
key="manBookmarkKb"
command="Browser:ShowAllBookmarks"
context=""/>
<menuseparator/>
<menuitem id="appmenuBookmarkThisPage"
<menuitem id="appmenu_bookmarkThisPage"
class="menuitem-iconic"
label="&bookmarkThisPageCmd.label;"
command="Browser:AddBookmarkAs"
key="addBookmarkAsKb"/>
<menuitem id="subscribeToPageMenuitem"
<menuitem id="appmenu_subscribeToPage"
class="menuitem-iconic"
label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
disabled="true"/>
<menu id="subscribeToPageMenupopup"
<menu id="appmenu_subscribeToPageMenu"
class="menu-iconic"
label="&subscribeToPageMenupopup.label;"
hidden="true">
<menupopup id="subscribeToPageSubmenuMenupopup"
<menupopup id="appmenu_subscribeToPageMenupopup"
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
@ -634,18 +635,19 @@
</menu>
</hbox>
<hbox class="split-menuitem">
<menuitem id="appmenu_HistoryItem"
class="menuitem-iconic"
<menuitem id="appmenu_history"
class="menuitem-iconic split-menuitem-item"
flex="1"
label="&historyMenu.label;"
command="Browser:ShowAllHistory"/>
<menu id="appmenu_history"
<menu id="appmenu_historyMenu"
class="split-menuitem-menu">
<menupopup id="appmenu_history_popup"
<menupopup id="appmenu_historyMenupopup"
placespopup="true"
oncommand="this.parentNode._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
onpopupshowing="if (!this.parentNode._placesView) new HistoryMenu(event);"
onpopupshowing="if (!this.parentNode._placesView)
new HistoryMenu(event);"
tooltip="bhTooltip"
popupsinherittooltip="true">
<menuitem id="appmenu_showAllHistory"
@ -658,17 +660,19 @@
key="key_sanitize"
command="Tools:Sanitize"/>
<menuseparator class="hide-if-empty-places-result"/>
<menu id="historyUndoMenu"
<menu id="appmenu_recentlyClosedTabsMenu"
class="recentlyClosedTabsMenu"
label="&historyUndoMenu.label;"
disabled="true">
<menupopup id="historyUndoPopup"
onpopupshowing="_placesView.populateUndoSubmenu();"/>
<menupopup id="appmenu_recentlyClosedTabsMenupopup"
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoSubmenu();"/>
</menu>
<menu id="historyUndoWindowMenu"
<menu id="appmenu_recentlyClosedWindowsMenu"
class="recentlyClosedWindowsMenu"
label="&historyUndoWindowMenu.label;"
disabled="true">
<menupopup id="historyUndoPopup"
onpopupshowing="_placesView.populateUndoWindowSubmenu();"/>
<menupopup id="appmenu_recentlyClosedWindowsMenupopup"
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoWindowSubmenu();"/>
</menu>
<menuseparator/>
</menupopup>
@ -691,7 +695,7 @@
<menu class="split-menuitem-menu"
label="&preferencesCmd.label;">
<menupopup id="appmenu_customizeMenu"
onpopupshowing="onViewToolbarsPopupShowing(event, (document.getElementById('appmenuToggleStatusbar')));">
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleStatusbar'));">
<menuitem id="appmenu_preferences"
#ifdef XP_UNIX
label="&preferencesCmdUnix.label;"
@ -700,12 +704,12 @@
#endif
oncommand="openPreferences();"/>
<menuseparator/>
<menuitem id="appmenuToggleStatusbar"
<menuitem id="appmenu_toggleStatusbar"
type="checkbox"
command="cmd_toggleTaskbar"
observes="toggle_taskbar"/>
<menuseparator/>
<menuitem id="appmenuToggleTabs"
<menuitem id="appmenu_toggleTabsOnTop"
label="&viewTabsOnTop.label;"
type="checkbox"
command="cmd_ToggleTabsOnTop"/>
@ -716,23 +720,23 @@
</menu>
</hbox>
<hbox class="split-menuitem">
<menuitem id="appmenu_helpItem"
<menuitem id="appmenu_help"
class="split-menuitem-item"
flex="1"
label="&helpMenu.label;"
oncommand="openHelpLink('firefox-help')"/>
<menu id="appmenu_about_menu"
class="split-menuitem-menu">
<menupopup>
<menu class="split-menuitem-menu">
<menupopup id="appmenu_helpMenupopup">
<menuitem id="appmenu_openHelp"
label="&helpMenu.label;"
oncommand="openHelpLink('firefox-help')"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="appmenu_help_getting_started"
<menuitem id="appmenu_gettingStarted"
label="&appMenuGettingStarted.label;"
oncommand="gBrowser.selectedTab = gBrowser.addTab('http://www.mozilla.com/firefox/central/');"
oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
onclick="checkForMiddleClick(this, event);"/>
<menuseparator/>
<menuitem id="appmenu_help_about"
<menuitem id="appmenu_about"
label="&aboutProduct.label;"
oncommand="openAboutDialog();"/>
</menupopup>

View File

@ -146,6 +146,7 @@ _BROWSER_FILES = \
browser_ctrlTab.js \
browser_discovery.js \
browser_drag.js \
browser_duplicateIDs.js \
browser_gestureSupport.js \
browser_getshortcutoruri.js \
browser_hide_removing.js \

View File

@ -0,0 +1,8 @@
function test() {
var ids = {};
Array.forEach(document.querySelectorAll("[id]"), function (node) {
var id = node.id;
ok(!(id in ids), id + " should be unique");
ids[id] = null;
});
}

View File

@ -114,6 +114,10 @@
if (moreInfoLink)
moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
}, false);
function togglePrivateBrowsing() {
mainWindow.gPrivateBrowsingUI.toggleMode();
}
]]></script>
</head>
@ -145,9 +149,10 @@
<!-- Start Private Browsing -->
<div id="startPrivateBrowsingDesc" class="showNormal">
<button id="startPrivateBrowsing"
<button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="startPrivateBrowsing" label="&privatebrowsingpage.startPrivateBrowsing.label;"
accesskey="&privatebrowsingpage.startPrivateBrowsing.accesskey;"
>&privatebrowsingpage.startPrivateBrowsing.label;</button>
oncommand="togglePrivateBrowsing();"/>
</div>
<!-- Footer -->

View File

@ -170,12 +170,12 @@ be temporary, and you can try again later.</li>
<!ENTITY securityOverride.getMeOutOfHereButton "Get me out of here!">
<!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
<!-- LOCALIZATION NOTE (securityOverride.warningText) - Do not translate the
contents of the <xul:button> tags. The only language content is the label= field,
which uses strings already defined above. The button is included here (instead of
netError.xhtml) because it exposes functionality specific to firefox. -->
<!-- LOCALIZATION NOTE (securityOverride.warningContent) - Do not translate the
contents of the <button> tags. It uses strings already defined above. The
button is included here (instead of netError.xhtml) because it exposes
functionality specific to firefox. -->
<!ENTITY securityOverride.warningText "
<!ENTITY securityOverride.warningContent "
<p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
<button id='getMeOutOfHereButton'>&securityOverride.getMeOutOfHereButton;</button>

View File

@ -251,7 +251,7 @@ statusbarpanel#statusbar-display {
font-style: italic;
}
#appmenu_BookmarkItem {
#appmenu_bookmarks {
list-style-image: url("chrome://browser/skin/places/bookmark.png");
-moz-image-region: rect(0px 48px 16px 32px);
}
@ -260,7 +260,7 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://browser/skin/Privacy-16.png");
}
#appmenuBookmarkMenu_unsorted-menuitem {
#appmenu_unsortedBookmarks {
list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
}
@ -268,13 +268,13 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric-16.png");
}
#appmenu-button #subscribeToPageMenuitem:not([disabled]),
#appmenu-button #subscribeToPageMenupopup:not([hidden]) {
#appmenu_subscribeToPage:not([disabled]),
#appmenu_subscribeToPageMenu {
list-style-image: url("chrome://browser/skin/feeds/feed-icons-16.png");
-moz-image-region: rect(0px 16px 16px 0px);
}
#appmenuBookmarkThisPage {
#appmenu_bookmarkThisPage {
list-style-image: url("chrome://browser/skin/places/bookmark.png");
-moz-image-region: rect(0 16px 16px 0);
}

View File

@ -294,6 +294,7 @@ class Automation(object):
# Open database and create table
permDB = sqlite3.connect(os.path.join(profileDir, "permissions.sqlite"))
cursor = permDB.cursor();
# SQL copied from nsPermissionManager.cpp
cursor.execute("""CREATE TABLE moz_hosts (
id INTEGER PRIMARY KEY,
host TEXT,

View File

@ -142,11 +142,12 @@ run_for_side_effects := \
include $(TOPSRCDIR)/.mozconfig.mk
ifndef MOZ_OBJDIR
MOZ_OBJDIR = obj-$(CONFIG_GUESS)
endif
ifdef MOZ_BUILD_PROJECTS
ifndef MOZ_OBJDIR
$(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
endif
ifdef MOZ_CURRENT_PROJECT
OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
@ -158,13 +159,8 @@ endif
else # MOZ_BUILD_PROJECTS
ifdef MOZ_OBJDIR
OBJDIR = $(MOZ_OBJDIR)
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
else
OBJDIR := $(TOPSRCDIR)
MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
endif
OBJDIR = $(MOZ_OBJDIR)
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
endif # MOZ_BUILD_PROJECTS

View File

@ -18,7 +18,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=535043
<textarea maxlength="-1"></textarea>
<textarea maxlength="0"></textarea>
<textarea maxlength="2"></textarea>
<textarea maxlength="257"></textarea>
</div>
<pre id="test">
<script type="text/javascript">
@ -27,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=535043
function checkTextArea(textArea) {
textArea.value = '';
textArea.focus();
for (var j = 0; j < 259; j++) {
for (var j = 0; j < 3; j++) {
synthesizeKey('x', {});
}
var htmlMaxLength = textArea.getAttribute('maxlength');
@ -45,7 +44,7 @@ function checkTextArea(textArea) {
'maxlength in DOM does not match provided value');
}
if (textArea.maxLength == -1) {
is(textArea.value.length, 259,
is(textArea.value.length, 3,
'textarea with maxLength -1 should have no length limit');
} else {
is(textArea.value.length, textArea.maxLength, 'textarea has maxLength ' +
@ -60,7 +59,7 @@ SimpleTest.waitForFocus(function() {
}
textArea = textAreas[0];
testNums = [-42, -1, 0, 2, 257];
testNums = [-42, -1, 0, 2];
for (var i = 0; i < testNums.length; i++) {
textArea.removeAttribute('maxlength');
@ -80,7 +79,12 @@ SimpleTest.waitForFocus(function() {
textArea.setAttribute('maxlength', testNums[i]);
checkTextArea(textArea);
}
SimpleTest.finish();
});
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>

View File

@ -369,7 +369,7 @@
error types. -->
<div id="securityOverrideDiv">
<a id="securityOverrideLink" href="javascript:showSecuritySection();" >&securityOverride.linkText;</a>
<div id="securityOverrideContent" style="display: none;">&securityOverride.warningText;</div>
<div id="securityOverrideContent" style="display: none;">&securityOverride.warningContent;</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
should go into netError.dtd -->
<!ENTITY securityOverride.linkText "Or you can add an exception…">
<!ENTITY securityOverride.warningText "
<!ENTITY securityOverride.warningContent "
<p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
<p>If you still wish to add an exception for this site, you can do so in your advanced encryption settings.</p>
">

View File

@ -343,6 +343,8 @@ nsPermissionManager::CreateTable()
if (NS_FAILED(rv)) return rv;
// create the table
// SQL also lives in automation.py.in. If you change this SQL change that
// one too.
return mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
"CREATE TABLE moz_hosts ("
" id INTEGER PRIMARY KEY"

View File

@ -225,49 +225,40 @@
this._stopSmoothScroll();
// Positive amountToScroll makes us scroll right (elements fly left), negative scrolls left.
var round;
if (amountToScroll < 0) {
this._isScrolling = -1;
round = Math.floor;
} else {
this._isScrolling = 1;
round = Math.ceil;
}
this._isScrolling = amountToScroll < 0 ? -1 : 1;
const FRAME_LENGTH = 60;
function processFrame(self, scrollAmounts, off) {
var distance = scrollAmounts.shift();
// Skip frames if we aren't getting the desired frame rate.
if (off > 0) {
for (var i = Math.round(off / FRAME_LENGTH); i > 0; i--)
distance += scrollAmounts.shift() || 0;
}
self.scrollByPixels(distance);
if (!scrollAmounts.length)
self._stopSmoothScroll();
}
// amountToScroll: total distance to scroll
// scrollAmount: distance to move during the particular effect frame (60ms)
var scrollAmount, scrollAmounts = [];
if (amountToScroll > 2 || amountToScroll < -2) {
scrollAmount = round(amountToScroll * 0.2);
scrollAmounts.push(scrollAmount, scrollAmount, scrollAmount);
amountToScroll -= 3 * scrollAmount;
}
while (this._isScrolling < 0 && amountToScroll < 0 ||
this._isScrolling > 0 && amountToScroll > 0) {
amountToScroll -= (scrollAmount = round(amountToScroll * 0.5));
scrollAmounts.push(scrollAmount);
}
this._smoothScrollTimer = setInterval(processFrame, FRAME_LENGTH, this, scrollAmounts);
processFrame(this, scrollAmounts, 0);
this._scrollAnim.start(amountToScroll);
]]></body>
</method>
<field name="_scrollAnim"><![CDATA[({
scrollbox: this,
start: function scrollAnim_start(distance) {
this.distance = distance;
this.startPos = this.scrollbox.scrollPosition;
this.duration = Math.min(1000, Math.round(50 * Math.sqrt(Math.abs(distance))));
this.startTime = window.mozAnimationStartTime;
window.addEventListener("MozBeforePaint", this, false);
window.mozRequestAnimationFrame();
},
stop: function scrollAnim_stop() {
window.removeEventListener("MozBeforePaint", this, false);
},
handleEvent: function scrollAnim_handleEvent(event) {
const timePassed = event.timeStamp - this.startTime;
const pos = timePassed >= this.duration ? 1 :
1 - Math.pow(1 - timePassed / this.duration, 2);
this.scrollbox.scrollPosition = this.startPos + (this.distance * pos);
if (pos == 1)
this.scrollbox._stopSmoothScroll();
else
window.mozRequestAnimationFrame();
}
})]]></field>
<method name="scrollByIndex">
<parameter name="index"/>
<parameter name="aSmoothScroll"/>
@ -393,13 +384,12 @@
1: scrolling right
-1: scrolling left -->
<field name="_isScrolling">0</field>
<field name="_smoothScrollTimer">0</field>
<field name="_prevMouseScrolls">[null, null]</field>
<method name="_stopSmoothScroll">
<body><![CDATA[
if (this._isScrolling) {
clearInterval(this._smoothScrollTimer);
this._scrollAnim.stop();
this._isScrolling = 0;
this._scrollTarget = null;
}