Merge cedar onto mozilla-central

This commit is contained in:
Ehsan Akhgari 2011-03-23 12:07:34 -04:00
Родитель 7a74f6a5b4 0693a76bcb
Коммит 35edf79ace
9 изменённых файлов: 77 добавлений и 123 удалений

Просмотреть файл

@ -25,6 +25,7 @@
<script type="application/javascript"
src="../relations.js" />
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
@ -60,8 +61,7 @@
}
};
tabBrowser.addProgressListener(progressListener,
Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
tabBrowser.addProgressListener(progressListener);
tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
}
@ -79,7 +79,7 @@
testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]);
testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]);
SimpleTest.finish()
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -24,6 +24,7 @@
<script type="application/javascript"
src="../role.js" />
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
@ -60,8 +61,7 @@
}
}
};
tabBrowser.addProgressListener(progressListener,
Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
tabBrowser.addProgressListener(progressListener);
// Test XUL and HTML documents.
tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
@ -206,7 +206,7 @@
testAccessibleTree(tabBrowser.mTabBox.tabpanels, tabboxAccTree);
SimpleTest.finish()
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -171,6 +171,9 @@ var StarUI = {
_anchorElement: aAnchorElement,
_position: aPosition,
observe: function (aSubject, aTopic, aData) {
//XXX We just caused localstore.rdf to be re-applied (bug 640158)
retrieveToolbarIconsizesFromTheme();
this._self._overlayLoading = false;
this._self._overlayLoaded = true;
this._self._doShowEditBookmarkPanel(this._itemId, this._anchorElement,

Просмотреть файл

@ -1396,6 +1396,7 @@ function prepareForStartup() {
// initialize observers and listeners
// and give C++ access to gBrowser
gBrowser.init();
XULBrowserWindow.init();
window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(nsIWebNavigation)
@ -1438,7 +1439,7 @@ function prepareForStartup() {
}
// hook up UI through progress listener
gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
gBrowser.addProgressListener(window.XULBrowserWindow);
gBrowser.addTabsProgressListener(window.TabsProgressListener);
// setup our common DOMLinkAdded listener
@ -3351,12 +3352,10 @@ const BrowserSearch = {
if (!submission)
return;
if (useNewTab) {
gBrowser.loadOneTab(submission.uri.spec, {
postData: submission.postData,
relatedToCurrent: true});
} else
loadURI(submission.uri.spec, null, submission.postData, false);
openLinkIn(submission.uri.spec,
useNewTab ? "tab" : "current",
{ postData: submission.postData,
relatedToCurrent: true });
},
/**
@ -4256,14 +4255,10 @@ var XULBrowserWindow = {
}
}
else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
if (aWebProgress.DOMWindow == content) {
if (aRequest)
this.endDocumentLoad(aRequest, aStatus);
if (!gBrowser.mTabbedMode && !gBrowser.getIcon())
gBrowser.useDefaultIcon(gBrowser.selectedTab);
}
}
if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK &&
aWebProgress.DOMWindow == content &&
aRequest)
this.endDocumentLoad(aRequest, aStatus);
// This (thanks to the filter) is a network stop or the last
// request stop outside of loading the document, stop throbbers
@ -4399,9 +4394,6 @@ var XULBrowserWindow = {
this.reloadCommand.removeAttribute("disabled");
}
if (!gBrowser.mTabbedMode && aWebProgress.isLoadingDocument)
gBrowser.setIcon(gBrowser.selectedTab, null);
if (gURLBar) {
// Strip off "wyciwyg://" and passwords for the location bar
let uri = aLocationURI;

Просмотреть файл

@ -134,13 +134,10 @@
[]
</field>
<field name="mTabListeners">
new Array()
[]
</field>
<field name="mTabFilters">
new Array()
</field>
<field name="mTabbedMode">
false
[]
</field>
<field name="mIsBusy">
false
@ -1064,47 +1061,6 @@
</body>
</method>
<method name="enterTabbedMode">
<body>
<![CDATA[
if (this.mTabbedMode)
return;
this.mTabbedMode = true; // Welcome to multi-tabbed mode.
if (XULBrowserWindow.isBusy) {
this.mCurrentTab.setAttribute("busy", "true");
this.mIsBusy = true;
this.setTabTitleLoading(this.mCurrentTab);
} else {
this.setIcon(this.mCurrentTab, this.mCurrentBrowser.mIconURL);
}
var filter;
if (this.mTabFilters.length > 0) {
// Use the filter hooked up in our addProgressListener
filter = this.mTabFilters[0];
} else {
// create a filter and hook it up to our first browser
filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Components.interfaces.nsIWebProgress);
this.mTabFilters[0] = filter;
this.mCurrentBrowser.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
}
// Remove all our progress listeners from the active browser's filter.
this.mProgressListeners.forEach(filter.removeProgressListener, filter);
// Wire up a progress listener to our filter.
const listener = this.mTabProgressListener(this.mCurrentTab,
this.mCurrentBrowser,
false);
filter.addProgressListener(listener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
this.mTabListeners[0] = listener;
]]>
</body>
</method>
<method name="loadOneTab">
<parameter name="aURI"/>
<parameter name="aReferrerURI"/>
@ -1228,8 +1184,6 @@
this._browsers = null; // invalidate cache
this.enterTabbedMode();
// if we're adding tabs, we're past interrupt mode, ditch the owner
if (this.mCurrentTab.owner)
this.mCurrentTab.owner = null;
@ -1866,38 +1820,18 @@
<method name="addProgressListener">
<parameter name="aListener"/>
<parameter name="aMask"/>
<body>
<![CDATA[
NS_ASSERT(arguments.length == 1,
"gBrowser.addProgressListener was called with a second argument, " +
"which is not supported. See bug 608628.");
if (!this.mAddProgressListenerWasCalled) {
this.mAddProgressListenerWasCalled = true;
this.tabContainer.updateVisibility();
}
if (this.mProgressListeners.length == 1) {
// If we are adding a 2nd progress listener, we need to enter tabbed mode
// because the browser status filter can only handle one progress listener.
// In tabbed mode, mTabProgressListener is used which will iterate over all listeners.
this.enterTabbedMode();
}
this.mProgressListeners.push(aListener);
if (!this.mTabbedMode) {
// If someone does this:
// addProgressListener, removeProgressListener, addProgressListener
// don't create a new filter; reuse the existing filter.
if (this.mTabFilters.length == 0) {
// hook a filter up to our first browser
const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Components.interfaces.nsIWebProgress);
this.mTabFilters[0] = filter;
this.mCurrentBrowser.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
}
// Directly hook the listener up to the filter for better performance
this.mTabFilters[0].addProgressListener(aListener, aMask);
}
]]>
</body>
</method>
@ -1908,10 +1842,6 @@
<![CDATA[
this.mProgressListeners =
this.mProgressListeners.filter(function (l) l != aListener);
if (!this.mTabbedMode)
// Don't forget to remove it from the filter we hooked it up to
this.mTabFilters[0].removeProgressListener(aListener);
]]>
</body>
</method>
@ -1919,7 +1849,6 @@
<method name="addTabsProgressListener">
<parameter name="aListener"/>
<body>
this.enterTabbedMode();
this.mTabsProgressListeners.push(aListener);
</body>
</method>
@ -2489,9 +2418,33 @@
this.mCurrentBrowser.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
this.mCurrentBrowser.droppedLinkHandler = handleDroppedLink;
this.updateWindowResizers();
// Hook up the event listeners to the first browser
var tabListener = this.mTabProgressListener(this.mCurrentTab, this.mCurrentBrowser, true);
const nsIWebProgress = Components.interfaces.nsIWebProgress;
const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(nsIWebProgress);
filter.addProgressListener(tabListener, nsIWebProgress.NOTIFY_ALL);
this.mTabListeners[0] = tabListener;
this.mTabFilters[0] = filter;
this.init();
]]>
</constructor>
<method name="init">
<body><![CDATA[
if (!this._initialProgressListenerAdded) {
this._initialProgressListenerAdded = true;
try {
this.webProgress.addProgressListener(this.mTabFilters[0], Components.interfaces.nsIWebProgress.NOTIFY_ALL);
} catch (e) {
// The binding was constructed too early, need to try this again later. See bug 463384.
this._initialProgressListenerAdded = false;
}
}
]]></body>
</method>
<destructor>
<![CDATA[
for (var i = 0; i < this.mTabListeners.length; ++i) {
@ -2511,6 +2464,13 @@
</destructor>
<!-- Deprecated stuff, implemented for backwards compatibility. -->
<method name="enterTabbedMode">
<body>
Application.console.log("enterTabbedMode is an obsolete method and " +
"will be removed in a future release.");
</body>
</method>
<field name="mTabbedMode" readonly="true">true</field>
<method name="setStripVisibilityTo">
<parameter name="aShow"/>
<body>
@ -2767,9 +2727,6 @@
this._container.collapsed = !val;
if (val)
this.tabbrowser.enterTabbedMode();
document.getElementById("menu_closeWindow").hidden = !val;
document.getElementById("menu_close").setAttribute("label",
this.tabbrowser.mStringBundle.getString(val ? "tabs.closeTab" : "tabs.close"));

Просмотреть файл

@ -1143,19 +1143,20 @@
<handlers>
<handler event="mouseover"><![CDATA[
if (this.getAttribute("active") != "true" &&
this.getAttribute("disabled") != "true") {
if (this.getAttribute("active") != "true") {
this.setAttribute("active", "true");
let event = document.createEvent("Events");
event.initEvent("DOMMenuItemActive", true, false);
this.dispatchEvent(event);
let self = this;
setTimeout(function () {
if (self.getAttribute("active") == "true")
self.menu.open = true;
}, this._menuDelay);
if (this.getAttribute("disabled") != "true") {
let self = this;
setTimeout(function () {
if (self.getAttribute("active") == "true")
self.menu.open = true;
}, this._menuDelay);
}
}
]]></handler>

Просмотреть файл

@ -1389,6 +1389,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
-moz-appearance: menubar;
color: -moz-menubartext;
box-shadow: 0 -1px 0 rgba(0,0,0,.1) inset;
}
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme):-moz-system-metric(menubar-drag) {

Просмотреть файл

@ -1552,8 +1552,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-size: -moz-calc(100% - 2px) -moz-calc(100% - 2px);
background-repeat: no-repeat;
margin: 0;
padding: 0;
-moz-border-image: url(tabbrowser/tab.png) 6 3 4 / 6px 3px 4px repeat stretch;
padding: 2px 0 4px;
-moz-border-image: url(tabbrowser/tab.png) 4 3 0 / 4px 3px 0 repeat stretch;
border-radius: 7px 7px 0 0;
}

Просмотреть файл

@ -110,24 +110,24 @@
<!-- =================== nsIAutoCompleteInput =================== -->
<field name="popup"><![CDATA[
// Wrap in an anonymous function so that the var statements don't
// create properties on 'this'.
(function (that) {
var popup = null;
var popupId = that.getAttribute("autocompletepopup");
// Wrap in a block so that the let statements don't
// create properties on 'this' (bug 635252).
{
let popup = null;
let popupId = this.getAttribute("autocompletepopup");
if (popupId)
popup = document.getElementById(popupId);
if (!popup) {
popup = document.createElement("panel");
popup.setAttribute("type", "autocomplete");
popup.setAttribute("noautofocus", "true");
var popupset = document.getAnonymousElementByAttribute(that, "anonid", "popupset");
let popupset = document.getAnonymousElementByAttribute(this, "anonid", "popupset");
popupset.appendChild(popup);
}
popup.mInput = that;
return popup;
})(this);
popup.mInput = this;
popup;
}
]]></field>
<property name="controller" onget="return this.mController;" readonly="true"/>