Bug 885242 - Part 2 - Simplify markup in browser.xul, do some cleanup elsewhere. r=mbrubeck

--HG--
extra : rebase_source : f1b1fc712c47db5116d046a0be8b93483442b82a
This commit is contained in:
Jonathan Wilde 2013-07-17 23:05:40 -07:00
Родитель ecdc0252b1
Коммит 3a33f9029c
3 изменённых файлов: 46 добавлений и 50 удалений

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

@ -9,6 +9,8 @@ const kProgressMarginStart = 30;
const kProgressMarginEnd = 70;
const WebProgress = {
get _identityBox() { return document.getElementById("identity-box"); },
_progressActive: false,
init: function init() {
@ -75,8 +77,7 @@ const WebProgress = {
}
if (aTab == Browser.selectedTab) {
let identityBox = document.getElementById("identity-box-inner");
identityBox.className = aTab._identityState;
this._identityBox.className = aTab._identityState;
}
},
@ -214,13 +215,11 @@ const WebProgress = {
},
_onTabSelect: function(aEvent) {
let identityBox = document.getElementById("identity-box-inner");
let tab = Browser.getTabFromChrome(aEvent.originalTarget);
identityBox.className = tab._identityState || "";
this._identityBox.className = tab._identityState || "";
},
_onUrlBarInput: function(aEvent) {
let identityBox = document.getElementById("identity-box-inner");
Browser.selectedTab._identityState = identityBox.className = "";
Browser.selectedTab._identityState = this._identityBox.className = "";
},
};

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

@ -249,7 +249,7 @@
<html:div id="overlay-plus" class="overlay-button"
observes="cmd_back"></html:div>
<!-- Navbar -->
<!-- Navigation bar -->
<appbar id="navbar" mousethrough="never" observes="bcast_windowState">
<hbox id="progress-container" layer="true">
<hbox id="progress-control" />
@ -261,40 +261,41 @@
<hbox id="urlbar-autocomplete" observes="bcast_windowState"/>
</scrollbox>
<!-- Main Toolbar -->
<toolbar id="toolbar" observes="bcast_windowState" flex="1">
<!-- Main toolbar -->
<toolbar id="toolbar" flex="1">
<observes element="bcast_windowState" attribute="*"/>
<observes element="bcast_urlbarState" attribute="*"/>
<toolbarbutton id="back-button" class="appbar-primary" command="cmd_back"/>
<toolbarbutton id="forward-button" class="appbar-primary" command="cmd_forward"/>
<toolbarbutton id="back-button" class="appbar-primary"
command="cmd_back"/>
<toolbarbutton id="forward-button" class="appbar-primary"
command="cmd_forward"/>
<hbox id="urlbar-container" flex="1" observes="bcast_urlbarState">
<hbox id="urlbar" flex="1">
<box id="identity-box" role="button">
<hbox id="identity-box-inner" align="center" mousethrough="always">
<image id="identity-icon"/>
</hbox>
</box>
<hbox id="urlbar" flex="1" observes="bcast_urlbarState">
<box id="identity-box" align="center" role="button">
<image id="identity-icon"/>
</box>
<textbox id="urlbar-edit"
type="url"
class="uri-element"
autocompletesearch="history"
autocompletepopup="urlbar-autocomplete"
completeselectedindex="true"
placeholder="&urlbar.emptytext;"
flex="1"/>
</hbox>
<textbox id="urlbar-edit" type="url" flex="1"
autocompletesearch="history"
autocompletepopup="urlbar-autocomplete"
completeselectedindex="true"
placeholder="&urlbar.emptytext;"/>
<toolbarbutton id="reload-button" oncommand="CommandUpdater.doCommand(event.shiftKey ? 'cmd_forceReload' : 'cmd_reload');"/>
<toolbarbutton id="reload-button" oncommand="
CommandUpdater.doCommand(event.shiftKey ? 'cmd_forceReload'
: 'cmd_reload');"/>
<toolbarbutton id="stop-button" command="cmd_stop"/>
</hbox>
<toolbarbutton id="download-button" class="appbar-secondary" oncommand="Appbar.onDownloadButton()"/>
<toolbarbutton id="star-button" class="appbar-primary" type="checkbox" oncommand="Appbar.onStarButton()"/>
<toolbarbutton id="pin-button" class="appbar-primary" type="checkbox" oncommand="Appbar.onPinButton()"/>
<toolbarbutton id="menu-button" class="appbar-primary" oncommand="Appbar.onMenuButton(event)"/>
<toolbarbutton id="download-button" class="appbar-secondary"
oncommand="Appbar.onDownloadButton()"/>
<toolbarbutton id="star-button" class="appbar-primary" type="checkbox"
oncommand="Appbar.onStarButton()"/>
<toolbarbutton id="pin-button" class="appbar-primary" type="checkbox"
oncommand="Appbar.onPinButton()"/>
<toolbarbutton id="menu-button" class="appbar-primary"
oncommand="Appbar.onMenuButton(event)"/>
</toolbar>
</vbox>
</appbar>
@ -351,12 +352,14 @@
</vbox>
<!-- Find bar -->
<appbar id="findbar" class="window-width findbar-box" orient="horizontal" pack="start">
<textbox id="findbar-textbox" class="search-bar findbar-item" oncommand="FindHelperUI.search(this.value)" oninput="FindHelperUI.updateCommands(this.value);" type="search"/>
<button class="findbar-item previous-button" command="cmd_findPrevious"/>
<button class="findbar-item next-button" command="cmd_findNext"/>
<appbar id="findbar" class="window-width" pack="start">
<textbox id="findbar-textbox" type="search"
oncommand="FindHelperUI.search(this.value)"
oninput="FindHelperUI.updateCommands(this.value); "/>
<button class="previous-button" command="cmd_findPrevious"/>
<button class="next-button" command="cmd_findNext"/>
<spacer flex="1"/>
<button id="findbar-close" class="findbar-item close-button" command="cmd_findClose"/>
<button id="findbar-close" class="close-button" command="cmd_findClose"/>
</appbar>
<!-- Context button bar -->

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

@ -330,12 +330,6 @@ documenttab[selected] .documenttab-selection {
overflow: hidden;
}
/* helperapp (save-as) popup */
#helperapp-target {
font-size: @font_small@ !important;
}
/* overlay buttons */
.overlay-button {
@ -517,7 +511,7 @@ documenttab[selected] .documenttab-selection {
}
/* URL bar */
#urlbar-container {
#urlbar {
border: @metro_border_thick@ solid @urlbar_border_color@;
margin: 0 @toolbar_horizontal_spacing@;
padding: 0;
@ -525,7 +519,7 @@ documenttab[selected] .documenttab-selection {
overflow: hidden;
}
#urlbar-container[mode="edit"] {
#urlbar[mode="edit"] {
border-color: @metro_orange@;
}
@ -536,11 +530,11 @@ documenttab[selected] .documenttab-selection {
list-style-image: url("chrome://browser/skin/images/identity-icons-generic.png");
}
#identity-box-inner.verifiedDomain > #identity-icon {
#identity-box.verifiedDomain > #identity-icon {
list-style-image: url("chrome://browser/skin/images/identity-icons-https.png");
}
#identity-box-inner.verifiedIdentity > #identity-icon {
#identity-box.verifiedIdentity > #identity-icon {
list-style-image: url("chrome://browser/skin/images/identity-icons-https-ev.png");
}
@ -574,9 +568,9 @@ documenttab[selected] .documenttab-selection {
list-style-image: url(chrome://browser/skin/images/appbar-stop.png);
}
#toolbar[mode="loading"] > #urlbar-container > #reload-button,
#toolbar:-moz-any([mode="edit"], [mode="view"]) > #urlbar-container > #stop-button,
#toolbar[viewstate="snapped"] > #urlbar-container ~ toolbarbutton {
#urlbar[mode="loading"] > #reload-button,
#urlbar:-moz-any([mode="edit"], [mode="view"]) > #stop-button,
#toolbar[viewstate="snapped"] > #urlbar ~ toolbarbutton {
visibility: collapse;
}