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

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

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

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

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

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

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

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

@ -1156,13 +1156,9 @@ statusbarpanel#statusbar-display {
/* Throbber */
#navigator-throbber {
-moz-appearance: none;
-moz-user-focus: ignore;
margin: 0 !important;
border: none !important;
padding: 0px !important;
min-width: 0;
background-color: transparent;
width: 16px;
min-height: 16px;
margin: 0 3px;
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");
}
#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 {
-moz-appearance: none;

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

@ -1492,35 +1492,16 @@ sidebarheader > .tabs-closebutton > .toolbarbutton-text {
/* ----- THROBBER ----- */
#navigator-throbber {
-moz-appearance: none;
-moz-user-focus: ignore;
-moz-box-pack: center;
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;
width: 17px;
min-height: 16px;
margin: 0 4px;
}
#navigator-throbber[busy="true"] {
list-style-image: url("chrome://global/skin/icons/loading_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");
}
#wrapper-throbber-box > #throbber-box > #navigator-throbber {
#wrapper-navigator-throbber > #navigator-throbber {
list-style-image: url("chrome://global/skin/icons/notloading_16.png");
}

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

@ -1292,13 +1292,9 @@ statusbarpanel#statusbar-display {
/* ::::: throbber ::::: */
#navigator-throbber {
-moz-appearance: none;
-moz-user-focus: ignore;
margin: 0 !important;
border: none !important;
padding: 0px !important;
min-width: 0;
background-color: transparent;
width: 16px;
min-height: 16px;
margin: 0 3px;
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");
}
/* 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 */
.tabbrowser-tabs {
-moz-appearance: -moz-win-browsertabbar-toolbox;

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

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

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

@ -122,6 +122,7 @@ _TEST_FILES = test_bug589.html \
test_bug441930.html \
test_bug442801.html \
test_bug448166.html \
test_bug460568.html \
$(NULL)
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 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, ""));
}
};

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

@ -128,11 +128,4 @@ function run_test() {
do_check_false(JSONModule.isMostlyHarmless('(function() { alert("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"/>
<toolbaritem id="search-box"
align="center" pack="center">
<label value="&searchtab.label;" accesskey="&searchtab.accesskey;"
control="findText"/>
<textbox id="findText" type="search" oncommand="doFind();"/>
<textbox id="findText" type="search" emptytext="&search.emptytext;"
oncommand="doFind();"/>
</toolbaritem>
</toolbar>
</toolbox>
@ -234,10 +233,8 @@
</vbox>
<vbox id="help-search-sidebar" hidden="true" flex="1">
<sidebarheader align="center">
<label id="help-search-sidebar-header" flex="1" crop="end" value="&searchtab.label;"/>
<toolbarbutton id="search-sidebar-closebutton"
tooltiptext="&searchClose.tooltip;"
oncommand="hideSearchSidebar();"/>
<label id="help-search-sidebar-header" flex="1" crop="end"
value="&searchHeader.label;"/>
</sidebarheader>
<tree id="help-search-tree" class="focusring"
flex="1" hidecolumnpicker="true"

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

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

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

@ -107,10 +107,6 @@
/* Set the minimum sidebar width so the help contents aren't squeezed together.*/
#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"] {
display: none;
}

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

@ -59,7 +59,6 @@
border: 0px !important;
}
/* Hide labels for the toolbar because we really don't need them what with the
tooltips */
#HelpToolbar .toolbarbutton-text {
@ -69,22 +68,6 @@
/* Set the minimum sidebar width so the help contents aren't squeezed together.*/
#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: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); }
@ -150,28 +133,6 @@
-moz-image-region: rect(72px, 14px, 96px, 0px);
}
#helpsidebar-splitter {
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.*/
#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 ----- */
#help-back-button {