This commit is contained in:
Tim Taubert 2013-02-04 20:12:29 +01:00
Родитель 5255de6e51 cac98f3d35
Коммит fd4f1bf01b
15 изменённых файлов: 96 добавлений и 39 удалений

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

@ -1425,7 +1425,9 @@
// If we just created a new tab that loads the default
// newtab url, swap in a preloaded page if possible.
if (aURI == BROWSER_NEW_TAB_URL) {
// Do nothing if we're a private window.
if (aURI == BROWSER_NEW_TAB_URL &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
gBrowserNewTabPreloader.newTab(t);
}

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

@ -1452,7 +1452,9 @@ let SessionStoreInternal = {
let newTab = aTab == aWindow.gBrowser.selectedTab ?
aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab}) :
aWindow.gBrowser.addTab();
this.restoreHistoryPrecursor(aWindow, [newTab], [tabState], 0, 0, 0);
this.restoreHistoryPrecursor(aWindow, [newTab], [tabState], 0, 0, 0,
true /* Load this tab right away. */);
return newTab;
},
@ -1674,13 +1676,6 @@ let SessionStoreInternal = {
let lastWindow = this._getMostRecentBrowserWindow();
let canUseLastWindow = lastWindow &&
!lastWindow.__SS_lastSessionWindowID;
let lastSessionFocusedWindow = null;
this.windowToFocus = lastWindow;
// move the last focused window to the start of the array so that we
// minimize window movement (see bug 669272)
lastSessionState.windows.unshift(
lastSessionState.windows.splice(lastSessionState.selectedWindow - 1, 1)[0]);
// Restore into windows or open new ones as needed.
for (let i = 0; i < lastSessionState.windows.length; i++) {
@ -1718,18 +1713,9 @@ let SessionStoreInternal = {
// weirdness but we will still merge other extData.
// Bug 588217 should make this go away by merging the group data.
this.restoreWindow(windowToUse, { windows: [winState] }, canOverwriteTabs, true);
if (i == 0)
lastSessionFocusedWindow = windowToUse;
// if we overwrote the tabs for our last focused window, we should
// give focus to the window that had it in the previous session
if (canOverwriteTabs && windowToUse == lastWindow)
this.windowToFocus = lastSessionFocusedWindow;
}
else {
let win = this._openWindowWithState({ windows: [winState] });
if (i == 0)
lastSessionFocusedWindow = win;
this._openWindowWithState({ windows: [winState] });
}
}
@ -2652,17 +2638,17 @@ let SessionStoreInternal = {
var winData;
if (!root.selectedWindow || root.selectedWindow > root.windows.length) {
root.selectedWindow = 0;
} else {
// put the selected window at the beginning of the array to ensure that
// it gets restored first
root.windows.unshift(root.windows.splice(root.selectedWindow - 1, 1)[0]);
}
// open new windows for all further window entries of a multi-window session
// (unless they don't contain any tab data)
for (var w = 1; w < root.windows.length; w++) {
winData = root.windows[w];
if (winData && winData.tabs && winData.tabs[0]) {
var window = this._openWindowWithState({ windows: [winData] });
if (w == root.selectedWindow - 1) {
this.windowToFocus = window;
}
}
}
winData = root.windows[0];
@ -2888,9 +2874,13 @@ let SessionStoreInternal = {
* Index of the next tab to check readyness for
* @param aCount
* Counter for number of times delaying b/c browser or history aren't ready
* @param aRestoreImmediately
* Flag to indicate whether the given set of tabs aTabs should be
* restored/loaded immediately even if restore_on_demand = true
*/
restoreHistoryPrecursor:
function ssi_restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab, aIx, aCount) {
function ssi_restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab,
aIx, aCount, aRestoreImmediately = false) {
var tabbrowser = aWindow.gBrowser;
// make sure that all browsers and their histories are available
@ -2904,7 +2894,8 @@ let SessionStoreInternal = {
catch (ex) { // in case browser or history aren't ready yet
if (aCount < 10) {
var restoreHistoryFunc = function(self) {
self.restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab, aIx, aCount + 1);
self.restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab,
aIx, aCount + 1, aRestoreImmediately);
}
aWindow.setTimeout(restoreHistoryFunc, 100, this);
return;
@ -3003,7 +2994,8 @@ let SessionStoreInternal = {
// identifiers.
var idMap = { used: {} };
var docIdentMap = {};
this.restoreHistory(aWindow, aTabs, aTabData, idMap, docIdentMap);
this.restoreHistory(aWindow, aTabs, aTabData, idMap, docIdentMap,
aRestoreImmediately);
},
/**
@ -3016,9 +3008,13 @@ let SessionStoreInternal = {
* Array of tab data
* @param aIdMap
* Hash for ensuring unique frame IDs
* @param aRestoreImmediately
* Flag to indicate whether the given set of tabs aTabs should be
* restored/loaded immediately even if restore_on_demand = true
*/
restoreHistory:
function ssi_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap) {
function ssi_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately) {
var _this = this;
// if the tab got removed before being completely restored, then skip it
while (aTabs.length > 0 && !(this._canRestoreTabHistory(aTabs[0]))) {
@ -3085,12 +3081,13 @@ let SessionStoreInternal = {
// Restore the history in the next tab
aWindow.setTimeout(function(){
_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap);
_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately);
}, 0);
// This could cause us to ignore MAX_CONCURRENT_TAB_RESTORES a bit, but
// it ensures each window will have its selected tab loaded.
if (aWindow.gBrowser.selectedBrowser == browser) {
if (aRestoreImmediately || aWindow.gBrowser.selectedBrowser == browser) {
this.restoreTab(tab);
}
else {

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

@ -783,6 +783,14 @@ function MarkupContainer(aMarkupView, aNode)
this.markup.navigate(this);
}.bind(this), false);
if (this.editor.summaryElt) {
this.editor.summaryElt.addEventListener("click", function(evt) {
this.markup.navigate(this);
this.markup.expandNode(this.node);
}.bind(this), false);
this.codeBox.appendChild(this.editor.summaryElt);
}
if (this.editor.closeElt) {
this.editor.closeElt.addEventListener("mousedown", function(evt) {
this.markup.navigate(this);
@ -823,9 +831,15 @@ MarkupContainer.prototype = {
if (aValue) {
this.expander.setAttribute("expanded", "");
this.children.setAttribute("expanded", "");
if (this.editor.summaryElt) {
this.editor.summaryElt.setAttribute("expanded", "");
}
} else {
this.expander.removeAttribute("expanded");
this.children.removeAttribute("expanded");
if (this.editor.summaryElt) {
this.editor.summaryElt.removeAttribute("expanded");
}
}
},
@ -987,11 +1001,17 @@ function ElementEditor(aContainer, aNode)
this.tag = null;
this.attrList = null;
this.newAttr = null;
this.summaryElt = null;
this.closeElt = null;
// Create the main editor
this.template("element", this);
if (this.node.firstChild || this.node.textContent.length > 0) {
// Create the summary placeholder
this.template("elementContentSummary", this);
}
// Create the closing tag
this.template("elementClose", this);

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

@ -20,6 +20,14 @@ ul.children:not([expanded]) {
height: 1ex;
}
.summary {
cursor: pointer;
}
.summary[expanded] {
display: none;
}
#root {
margin-right: 80px;
}

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

@ -32,6 +32,8 @@
<span>&lt;!--</span><pre save="${value}" style="display:inline-block;" tabindex="0"></pre><span>--&gt;</span>
</span>
<span id="template-elementContentSummary" save="${summaryElt}" class="summary"></span>
<span id="template-elementClose" save="${closeElt}">&lt;/<span save="${closeTag}" class="tagname devtools-theme-tagname"></span>&gt;</span>
</div>
<div id="previewbar" class="disabled">

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

@ -879,7 +879,7 @@ this.CssRuleView = function CssRuleView(aDoc, aStore)
this.store = aStore;
this.element = this.doc.createElementNS(XUL_NS, "vbox");
this.element.setAttribute("tabindex", "0");
this.element.classList.add("ruleview");
this.element.className = "ruleview devtools-monospace";
this.element.flex = 1;
this._boundCopy = this._onCopy.bind(this);

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

@ -6,6 +6,7 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://browser/content/devtools/styleinspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/csshtmltree.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % inspectorDTD SYSTEM "chrome://browser/locale/devtools/styleinspector.dtd">
@ -40,7 +41,7 @@
</script>
<!-- The output from #templateRoot (below) is inserted here. -->
<div id="root"></div>
<div id="root" class="devtools-monospace"></div>
<!-- When no properties are found the following block is displayed. -->
<div id="noResults" hidden="">
@ -48,7 +49,7 @@
</div>
<!-- The output from #templateProperty (below) is appended here. -->
<table id="propertyContainer">
<table id="propertyContainer" class="devtools-monospace">
</table>
<xul:hbox id="footer">

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

@ -5,6 +5,8 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://browser/content/devtools/styleinspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/csshtmltree.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % inspectorDTD SYSTEM "chrome://browser/locale/devtools/styleinspector.dtd">
%inspectorDTD;

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

@ -5,9 +5,13 @@
/* Font for code */
.devtools-monospace {
:root {
font: message-box;
}
.devtools-monospace {
font-family: monospace;
font-size: 85%;
}
/* Toolbar and Toolbar items */

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

@ -270,6 +270,10 @@
border-left: 2px solid transparent;
}
.ruleview-property > * {
vertical-align: middle;
}
.ruleview-property[dirty] {
border-left-color: #68E268;
}

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

@ -7,8 +7,11 @@
/* Font for code */
.devtools-monospace {
:root {
font: message-box;
}
.devtools-monospace {
font-family: monospace;
}

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

@ -272,6 +272,10 @@
border-left: 2px solid transparent;
}
.ruleview-property > * {
vertical-align: middle;
}
.ruleview-property[dirty] {
border-left-color: #68E268;
}

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

@ -5,8 +5,11 @@
/* Font for code */
.devtools-monospace {
:root {
font: message-box;
}
.devtools-monospace {
font-family: monospace;
}

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

@ -272,6 +272,10 @@
border-left: 2px solid transparent;
}
.ruleview-property > * {
vertical-align: middle;
}
.ruleview-property[dirty] {
border-left-color: #68E268;
}

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

@ -59,11 +59,14 @@ LightweightThemeConsumer.prototype = {
},
destroy: function () {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.removeObserver(this, "lightweight-theme-styling-update");
if (!PrivateBrowsingUtils.isWindowPrivate(this._win)) {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.removeObserver(this, "lightweight-theme-styling-update");
this._win.removeEventListener("resize", this);
}
this._win.removeEventListener("resize", this);
this._win = this._doc = null;
},