This commit is contained in:
Ehsan Akhgari 2008-10-26 01:19:03 +03:30
Родитель ff2d2e91e0 4c4f101e6a
Коммит a52f7a990f
18 изменённых файлов: 122 добавлений и 186 удалений

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

@ -3598,6 +3598,7 @@ var XULBrowserWindow = {
startTime: 0, startTime: 0,
statusText: "", statusText: "",
lastURI: null, lastURI: null,
isBusy: false,
statusTimeoutInEffect: false, statusTimeoutInEffect: false,
@ -3736,6 +3737,8 @@ var XULBrowserWindow = {
aRequest && aWebProgress.DOMWindow == content) aRequest && aWebProgress.DOMWindow == content)
this.startDocumentLoad(aRequest); this.startDocumentLoad(aRequest);
this.isBusy = true;
if (this.throbberElement) { if (this.throbberElement) {
// Turn the throbber on. // Turn the throbber on.
this.throbberElement.setAttribute("busy", "true"); this.throbberElement.setAttribute("busy", "true");
@ -3807,6 +3810,8 @@ var XULBrowserWindow = {
this.isImage.setAttribute('disabled', 'true'); this.isImage.setAttribute('disabled', 'true');
} }
this.isBusy = false;
// Turn the progress meter and throbber off. // Turn the progress meter and throbber off.
gProgressCollapseTimer = window.setTimeout(function () { gProgressCollapseTimer = window.setTimeout(function () {
gProgressMeterPanel.collapsed = true; gProgressMeterPanel.collapsed = true;

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

@ -272,11 +272,7 @@
defaultmode="icons"> defaultmode="icons">
<!-- Menu --> <!-- Menu -->
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true" <toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
#ifdef XP_MACOSX
defaultset="menubar-items" defaultset="menubar-items"
#else
defaultset="menubar-items,spring,throbber-box"
#endif
mode="icons" iconsize="small" defaulticonsize="small" mode="icons" iconsize="small" defaulticonsize="small"
context="toolbar-context-menu"> context="toolbar-context-menu">
<toolbaritem id="menubar-items" align="center"> <toolbaritem id="menubar-items" align="center">
@ -417,9 +413,9 @@
label="&printButton.label;" command="cmd_print" label="&printButton.label;" command="cmd_print"
tooltiptext="&printButton.tooltip;"/> tooltiptext="&printButton.tooltip;"/>
<toolbaritem id="throbber-box" title="&throbberItem.title;" align="center" pack="center" <toolbaritem id="navigator-throbber" title="&throbberItem.title;" align="center" pack="center"
mousethrough="always"> mousethrough="always">
<button id="navigator-throbber" disabled="true"/> <image/>
</toolbaritem> </toolbaritem>
<toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksItem.title;"> <toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksItem.title;">
@ -483,7 +479,7 @@
fullscreentoolbar="true" mode="icons" iconsize="large" fullscreentoolbar="true" mode="icons" iconsize="large"
customizable="true" customizable="true"
#ifdef XP_MACOSX #ifdef XP_MACOSX
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,throbber-box" defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container"
#else #else
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls" defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls"
#endif #endif

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

@ -1021,8 +1021,7 @@
// Get the first tab all hooked up with a title listener and popup blocking listener. // Get the first tab all hooked up with a title listener and popup blocking listener.
this.mCurrentBrowser.addEventListener("DOMTitleChanged", this.onTitleChanged, true); this.mCurrentBrowser.addEventListener("DOMTitleChanged", this.onTitleChanged, true);
var throbberElement = document.getElementById("navigator-throbber"); if (XULBrowserWindow.isBusy) {
if (throbberElement && throbberElement.hasAttribute("busy")) {
this.mCurrentTab.setAttribute("busy", "true"); this.mCurrentTab.setAttribute("busy", "true");
this.mIsBusy = true; this.mIsBusy = true;
this.setTabTitleLoading(this.mCurrentTab); this.setTabTitleLoading(this.mCurrentTab);

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

@ -72,14 +72,13 @@
<method name="handleRevert"> <method name="handleRevert">
<body><![CDATA[ <body><![CDATA[
var throbberElement = document.getElementById("navigator-throbber");
var isScrolling = this.popupOpen; var isScrolling = this.popupOpen;
gBrowser.userTypedValue = null; gBrowser.userTypedValue = null;
// don't revert to last valid url unless page is NOT loading // don't revert to last valid url unless page is NOT loading
// and user is NOT key-scrolling through autocomplete list // and user is NOT key-scrolling through autocomplete list
if ((!throbberElement || !throbberElement.hasAttribute("busy")) && !isScrolling) { if (!XULBrowserWindow.isBusy && !isScrolling) {
URLBarSetURI(); URLBarSetURI();
// If the value isn't empty and the urlbar has focus, select the value. // If the value isn't empty and the urlbar has focus, select the value.

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

@ -40,14 +40,6 @@
* } * }
*/ */
/*
* Eliminate the throbber and its annoying movement:
*
* #throbber-box {
* display: none !important;
* }
*/
/* /*
* For more examples see http://www.mozilla.org/unix/customizing.html * For more examples see http://www.mozilla.org/unix/customizing.html
*/ */

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

@ -1156,13 +1156,9 @@ statusbarpanel#statusbar-display {
/* Throbber */ /* Throbber */
#navigator-throbber { #navigator-throbber {
-moz-appearance: none; width: 16px;
-moz-user-focus: ignore; min-height: 16px;
margin: 0 !important; margin: 0 3px;
border: none !important;
padding: 0px !important;
min-width: 0;
background-color: transparent;
list-style-image: url("chrome://global/skin/icons/notloading_16.png"); list-style-image: url("chrome://global/skin/icons/notloading_16.png");
} }
@ -1170,20 +1166,6 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://global/skin/icons/loading_16.png"); list-style-image: url("chrome://global/skin/icons/loading_16.png");
} }
#navigator-throbber > hbox {
border-top: 0px;
border-bottom: 0px;
padding-bottom: 1px;
}
toolbar[mode="text"] #navigator-throbber,
toolbar[iconsize="small"] #navigator-throbber {
list-style-image: url("chrome://global/skin/icons/notloading_16.png");
}
toolbar[mode="text"] #navigator-throbber[busy="true"],
toolbar[iconsize="small"] #navigator-throbber[busy="true"] {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
tabpanels { tabpanels {
-moz-appearance: none; -moz-appearance: none;

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

@ -1492,35 +1492,16 @@ sidebarheader > .tabs-closebutton > .toolbarbutton-text {
/* ----- THROBBER ----- */ /* ----- THROBBER ----- */
#navigator-throbber { #navigator-throbber {
-moz-appearance: none; width: 17px;
-moz-user-focus: ignore; min-height: 16px;
-moz-box-pack: center; margin: 0 4px;
margin: 0px 4px !important;
border: none !important;
padding: 0;
min-width: 0;
background-color: transparent;
height: 16px;
width: 17px;
}
/* XXXmano: hack until we figure out why the throbber uses a button instead
of a toolbarbutton */
#navigator-throbber .button-text {
display: none;
margin: 0 !important;
} }
#navigator-throbber[busy="true"] { #navigator-throbber[busy="true"] {
list-style-image: url("chrome://global/skin/icons/loading_16.png"); list-style-image: url("chrome://global/skin/icons/loading_16.png");
} }
toolbar[iconsize="small"] #navigator-throbber[busy="true"], #wrapper-navigator-throbber > #navigator-throbber {
toolbar[mode="text"] #navigator-throbber[busy="true"] {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
#wrapper-throbber-box > #throbber-box > #navigator-throbber {
list-style-image: url("chrome://global/skin/icons/notloading_16.png"); list-style-image: url("chrome://global/skin/icons/notloading_16.png");
} }

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

@ -1292,13 +1292,9 @@ statusbarpanel#statusbar-display {
/* ::::: throbber ::::: */ /* ::::: throbber ::::: */
#navigator-throbber { #navigator-throbber {
-moz-appearance: none; width: 16px;
-moz-user-focus: ignore; min-height: 16px;
margin: 0 !important; margin: 0 3px;
border: none !important;
padding: 0px !important;
min-width: 0;
background-color: transparent;
list-style-image: url("chrome://global/skin/icons/notloading_16.png"); list-style-image: url("chrome://global/skin/icons/notloading_16.png");
} }
@ -1306,23 +1302,6 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://global/skin/icons/loading_16.png"); list-style-image: url("chrome://global/skin/icons/loading_16.png");
} }
/* the default settings for the throbber hbox is too tall for vista menus */
#navigator-throbber > hbox {
border-top: 0px;
border-bottom: 0px;
padding-bottom: 1px;
-moz-margin-end: 1px;
}
toolbar[iconsize="small"] #navigator-throbber,
toolbar[mode="text"] #navigator-throbber {
list-style-image: url("chrome://global/skin/icons/notloading_16.png");
}
toolbar[iconsize="small"] #navigator-throbber[busy="true"],
toolbar[mode="text"] #navigator-throbber[busy="true"] {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
/* Tabstrip */ /* Tabstrip */
.tabbrowser-tabs { .tabbrowser-tabs {
-moz-appearance: -moz-win-browsertabbar-toolbox; -moz-appearance: -moz-win-browsertabbar-toolbox;

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

@ -1178,13 +1178,17 @@ nsresult
nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify) PRBool aNotify)
{ {
PRBool contentEditable = PR_FALSE;
PRInt32 contentEditableChange;
if (aNameSpaceID == kNameSpaceID_None) {
contentEditable = PR_TRUE;
contentEditableChange = GetContentEditableValue() == eTrue ? -1 : 0;
}
// Check for event handlers // Check for event handlers
if (aNameSpaceID == kNameSpaceID_None) { if (aNameSpaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::contenteditable) { if (nsContentUtils::IsEventAttributeName(aAttribute, EventNameType_HTML)) {
ChangeEditableState(GetContentEditableValue() == eTrue ? -1 : 0);
}
else if (nsContentUtils::IsEventAttributeName(aAttribute,
EventNameType_HTML)) {
nsCOMPtr<nsIEventListenerManager> manager; nsCOMPtr<nsIEventListenerManager> manager;
GetListenerManager(PR_FALSE, getter_AddRefs(manager)); GetListenerManager(PR_FALSE, getter_AddRefs(manager));
@ -1194,8 +1198,15 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
} }
} }
return nsGenericHTMLElementBase::UnsetAttr(aNameSpaceID, aAttribute, nsresult rv = nsGenericHTMLElementBase::UnsetAttr(aNameSpaceID, aAttribute,
aNotify); aNotify);
NS_ENSURE_SUCCESS(rv, rv);
if (contentEditable) {
ChangeEditableState(contentEditableChange);
}
return NS_OK;
} }
already_AddRefed<nsIURI> already_AddRefed<nsIURI>

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

@ -122,6 +122,7 @@ _TEST_FILES = test_bug589.html \
test_bug441930.html \ test_bug441930.html \
test_bug442801.html \ test_bug442801.html \
test_bug448166.html \ test_bug448166.html \
test_bug460568.html \
$(NULL) $(NULL)
libs:: $(_TEST_FILES) libs:: $(_TEST_FILES)

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

@ -0,0 +1,77 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=460568
-->
<head>
<title>Test for Bug 460568</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=460568">Mozilla Bug 460568</a>
<p id="display"><a href="" id="anchor">a[href]</a></p>
<div id="editor">
<a href="" id="anchorInEditor">a[href] in editor</a>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 460568 **/
function runTest()
{
var editor = document.getElementById("editor");
var anchor = document.getElementById("anchor");
var anchorInEditor = document.getElementById("anchorInEditor");
var focused;
anchorInEditor.onfocus = function() { focused = true; };
focused = false;
anchor.focus();
editor.setAttribute("contenteditable", "true");
anchorInEditor.focus();
is(focused, false, "focus moved to element in contenteditable=true");
focused = false;
anchor.focus();
editor.setAttribute("contenteditable", "false");
anchorInEditor.focus();
is(focused, true, "focus didn't move to element in contenteditable=false");
focused = false;
anchor.focus();
editor.setAttribute("contenteditable", "true");
anchorInEditor.focus();
is(focused, false, "focus moved to element in contenteditable=true");
focused = false;
anchor.focus();
editor.removeAttribute("contenteditable");
anchorInEditor.focus();
is(focused, true, "focus didn't move to element in contenteditable removed element");
focused = false;
anchor.focus();
editor.contentEditable = true;
anchorInEditor.focus();
is(focused, false, "focus moved to element in contenteditable=true by property");
focused = false;
anchor.focus();
editor.contentEditable = false;
anchorInEditor.focus();
is(focused, true, "focus didn't move to element in contenteditable=false by property");
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
addLoadEvent(SimpleTest.finish);
</script>
</pre>
</body>
</html>

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

@ -173,22 +173,6 @@ var JSONModule = {
const maybeHarmful = /[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/; const maybeHarmful = /[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/;
const jsonStrings = /"(\\.|[^"\\\n\r])*"/g; const jsonStrings = /"(\\.|[^"\\\n\r])*"/g;
const openEndedString = /"(\\.|[^"\\\n\r])*$/;
const maxStringLength = 1 << 16;
// process the string in several slices when it's too big in order
// to prevent script stack space quote exhaustion (cf. bug 450633)
while (aString.length > maxStringLength) {
let slice = aString.substr(0, maxStringLength).replace(jsonStrings, "");
aString = aString.substr(maxStringLength);
if (openEndedString.test(slice)) {
slice = slice.replace(openEndedString, "");
aString = '"' + aString;
}
if (maybeHarmful.test(slice))
return false;
}
return !maybeHarmful.test(aString.replace(jsonStrings, "")); return !maybeHarmful.test(aString.replace(jsonStrings, ""));
} }
}; };

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

@ -128,11 +128,4 @@ function run_test() {
do_check_false(JSONModule.isMostlyHarmless('(function() { alert("P0wn3d!"); })()')); do_check_false(JSONModule.isMostlyHarmless('(function() { alert("P0wn3d!"); })()'));
do_check_false(JSONModule.isMostlyHarmless('{ get a() { return "P0wn3d!"; } }')); do_check_false(JSONModule.isMostlyHarmless('{ get a() { return "P0wn3d!"; } }'));
// this string shouldn't cause a "script stack space quota is exhausted" error
let bigString = " ";
while (bigString.length < (1 << 22))
bigString += bigString;
do_check_eq(JSONModule.fromString(toJSONString(bigString)), bigString);
} }

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

@ -182,9 +182,8 @@
<toolbarspring flex="1"/> <toolbarspring flex="1"/>
<toolbaritem id="search-box" <toolbaritem id="search-box"
align="center" pack="center"> align="center" pack="center">
<label value="&searchtab.label;" accesskey="&searchtab.accesskey;" <textbox id="findText" type="search" emptytext="&search.emptytext;"
control="findText"/> oncommand="doFind();"/>
<textbox id="findText" type="search" oncommand="doFind();"/>
</toolbaritem> </toolbaritem>
</toolbar> </toolbar>
</toolbox> </toolbox>
@ -234,10 +233,8 @@
</vbox> </vbox>
<vbox id="help-search-sidebar" hidden="true" flex="1"> <vbox id="help-search-sidebar" hidden="true" flex="1">
<sidebarheader align="center"> <sidebarheader align="center">
<label id="help-search-sidebar-header" flex="1" crop="end" value="&searchtab.label;"/> <label id="help-search-sidebar-header" flex="1" crop="end"
<toolbarbutton id="search-sidebar-closebutton" value="&searchHeader.label;"/>
tooltiptext="&searchClose.tooltip;"
oncommand="hideSearchSidebar();"/>
</sidebarheader> </sidebarheader>
<tree id="help-search-tree" class="focusring" <tree id="help-search-tree" class="focusring"
flex="1" hidecolumnpicker="true" flex="1" hidecolumnpicker="true"

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

@ -22,9 +22,8 @@
<!ENTITY printButton.tooltip "Print this page"> <!ENTITY printButton.tooltip "Print this page">
<!ENTITY closeWindow.commandkey "W"> <!ENTITY closeWindow.commandkey "W">
<!ENTITY searchtab.label "Search"> <!ENTITY search.emptytext "Search">
<!ENTITY searchtab.accesskey "S"> <!ENTITY searchHeader.label "Search results">
<!ENTITY searchClose.tooltip "Close search results">
<!ENTITY toctab.label "Contents"> <!ENTITY toctab.label "Contents">
<!ENTITY toctab.accesskey "C"> <!ENTITY toctab.accesskey "C">

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

@ -107,10 +107,6 @@
/* Set the minimum sidebar width so the help contents aren't squeezed together.*/ /* Set the minimum sidebar width so the help contents aren't squeezed together.*/
#help-sidebar { min-width: 15em; width: 20em; max-width: 25em; } #help-sidebar { min-width: 15em; width: 20em; max-width: 25em; }
#search-sidebar-closebutton {
list-style-image: url("moz-icon://stock/gtk-close?size=menu");
}
#context-copy[disabled="true"] { #context-copy[disabled="true"] {
display: none; display: none;
} }

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

@ -59,7 +59,6 @@
border: 0px !important; border: 0px !important;
} }
/* Hide labels for the toolbar because we really don't need them what with the /* Hide labels for the toolbar because we really don't need them what with the
tooltips */ tooltips */
#HelpToolbar .toolbarbutton-text { #HelpToolbar .toolbarbutton-text {
@ -69,22 +68,6 @@
/* Set the minimum sidebar width so the help contents aren't squeezed together.*/ /* Set the minimum sidebar width so the help contents aren't squeezed together.*/
#help-sidebar { min-width: 15em; width: 20em; max-width: 25em; } #help-sidebar { min-width: 15em; width: 20em; max-width: 25em; }
#search-sidebar-closebutton {
-moz-binding: url(chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image);
list-style-image: url("chrome://global/skin/icons/closetab.png");
padding-right: 4px;
margin: 0;
border: 0;
}
#search-sidebar-closebutton:hover {
list-style-image: url("chrome://global/skin/icons/closetab-hover.png");
}
#search-sidebar-closebutton:hover:active {
list-style-image: url("chrome://global/skin/icons/closetab-active.png");
}
#help-back-button { -moz-image-region: rect(0px 24px 24px 0px); } #help-back-button { -moz-image-region: rect(0px 24px 24px 0px); }
#help-back-button:not([disabled="true"]):hover { -moz-image-region: rect(24px 24px 48px 0px); } #help-back-button:not([disabled="true"]):hover { -moz-image-region: rect(24px 24px 48px 0px); }
#help-back-button[disabled="true"] { -moz-image-region: rect(48px 24px 72px 0px); } #help-back-button[disabled="true"] { -moz-image-region: rect(48px 24px 72px 0px); }
@ -150,28 +133,6 @@
-moz-image-region: rect(72px, 14px, 96px, 0px); -moz-image-region: rect(72px, 14px, 96px, 0px);
} }
#helpsidebar-splitter { #helpsidebar-splitter {
border-right: 1px solid #bebebe; border-right: 1px solid #bebebe;
} }
#helpsidebar-box toolbarbutton {
background-image: url("chrome://global/skin/icons/white-gray-gradient.gif");
background-repeat: repeat-x;
background-position: bottom right;
background-color: rgb(246, 246, 246);
border-bottom: 1px solid #b3b3b3;
border-right: 1px solid #bebebe;
margin: 0px;
text-align: left;
color: #505050;
}
#helpsidebar-box toolbarbutton[selected="true"] {
color: #000;
}
#helpsidebar-box tree {
margin: 0px !important;
padding: 0px !important;
}

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

@ -64,22 +64,6 @@
/* Set the minimum sidebar width so the help contents aren't squeezed together.*/ /* Set the minimum sidebar width so the help contents aren't squeezed together.*/
#help-sidebar { min-width: 15em; width: 20em; max-width: 25em; } #help-sidebar { min-width: 15em; width: 20em; max-width: 25em; }
#search-sidebar-closebutton {
border: 1px solid transparent;
padding: 3px 2px 4px 2px !important;
list-style-image: url("chrome://global/skin/icons/close.png");
-moz-appearance: none;
-moz-image-region: rect(0px, 14px, 14px, 0px);
}
#search-sidebar-closebutton:hover {
-moz-image-region: rect(0px, 28px, 14px, 14px);
}
#search-sidebar-closebutton:hover:active {
-moz-image-region: rect(0px, 42px, 14px, 28px);
}
/* ----- BACK BUTTON ----- */ /* ----- BACK BUTTON ----- */
#help-back-button { #help-back-button {