зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to tracemonkey.
This commit is contained in:
Коммит
e98175be6f
|
@ -248,6 +248,15 @@ function nextTest() {
|
|||
}
|
||||
|
||||
function test() {
|
||||
var osString = Cc["@mozilla.org/xre/app-info;1"].
|
||||
getService(Ci.nsIXULRuntime).OS;
|
||||
|
||||
// XXX bug 496277: this test fails on linux for some reason
|
||||
if (osString == "Linux") {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
nextTest();
|
||||
|
|
|
@ -707,10 +707,10 @@ jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating,
|
|||
JSRuntime *rt = JS_GetRuntime(cx);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook (getter_AddRefs(hook));
|
||||
|
||||
if (creating) {
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook(getter_AddRefs(hook));
|
||||
|
||||
/* a script is being created */
|
||||
if (!hook) {
|
||||
/* nobody cares, just exit */
|
||||
|
@ -736,12 +736,15 @@ jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating,
|
|||
static_cast<jsdIScript *>(JSD_GetScriptPrivate(jsdscript));
|
||||
if (!jsdis)
|
||||
return;
|
||||
|
||||
|
||||
jsdis->Invalidate();
|
||||
if (!hook)
|
||||
return;
|
||||
|
||||
|
||||
if (gGCStatus == JSGC_END) {
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook(getter_AddRefs(hook));
|
||||
if (!hook)
|
||||
return;
|
||||
|
||||
/* if GC *isn't* running, we can tell the user about the script
|
||||
* delete now. */
|
||||
#ifdef CAUTIOUS_SCRIPTHOOK
|
||||
|
|
|
@ -164,9 +164,21 @@ function checkClipRegionForFrame(fid, id, rects) {
|
|||
}
|
||||
|
||||
function runTests2() {
|
||||
var p = document.getElementById("p1");
|
||||
if (p.getClipRegionRectEdge(0, 0) == p.getClipRegionRectEdge(0, 2)) {
|
||||
// plugin hasn't been updated yet. wait.
|
||||
function check(id, doc) {
|
||||
var p = (doc || document).getElementById(id);
|
||||
if (p.getClipRegionRectEdge(0, 0) ==
|
||||
p.getClipRegionRectEdge(0, 2))
|
||||
throw id;
|
||||
}
|
||||
|
||||
try {
|
||||
check("p1");
|
||||
check("p2");
|
||||
check("p3");
|
||||
check("p4");
|
||||
check("p5", f1.contentDocument);
|
||||
} catch (id) {
|
||||
// One or more plugins haven't been updated yet. Wait.
|
||||
setTimeout(runTests2, 100);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,5 @@ pref("app.update.url.details", "http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/r
|
|||
// Release notes URL
|
||||
pref("app.releaseNotesURL", "http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/%VERSION%/releasenotes/");
|
||||
|
||||
pref("browser.search.param.yahoo-fr", "moz2");
|
||||
pref("browser.search.param.yahoo-fr-cjkt", "moz2");
|
||||
pref("browser.search.param.yahoo-f-CN", "D3_g");
|
||||
pref("browser.search.param.yahoo-fr", "moz35");
|
||||
pref("browser.search.param.yahoo-fr-cjkt", "moz35");
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* Darin Fisher <darin@meer.net>
|
||||
* Boris Zbarsky <bzbarsky@mit.edu>
|
||||
* Jeff Walden <jwalden+code@mit.edu>
|
||||
* Serge Gautherie <sgautherie.bz@free.fr>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -45,8 +46,9 @@
|
|||
*/
|
||||
|
||||
var _quit = false;
|
||||
var _fail = false;
|
||||
var _passed = true;
|
||||
var _tests_pending = 0;
|
||||
var _passedChecks = 0, _falsePassedChecks = 0;
|
||||
|
||||
// Disable automatic network detection, so tests work correctly when
|
||||
// not connected to a network.
|
||||
|
@ -88,7 +90,8 @@ function _do_main() {
|
|||
if (_quit)
|
||||
return;
|
||||
|
||||
dump("*** running event loop\n");
|
||||
dump("TEST-INFO | (xpcshell/head.js) | running event loop\n");
|
||||
|
||||
var thr = Components.classes["@mozilla.org/thread-manager;1"]
|
||||
.getService().currentThread;
|
||||
|
||||
|
@ -100,7 +103,7 @@ function _do_main() {
|
|||
}
|
||||
|
||||
function _do_quit() {
|
||||
dump("*** exiting\n");
|
||||
dump("TEST-INFO | (xpcshell/head.js) | exiting test\n");
|
||||
|
||||
_quit = true;
|
||||
}
|
||||
|
@ -112,14 +115,23 @@ function _execute_test() {
|
|||
do_test_finished();
|
||||
_do_main();
|
||||
} catch (e) {
|
||||
_fail = true;
|
||||
dump(e + "\n");
|
||||
_passed = false;
|
||||
// Print exception, but not do_throw() result.
|
||||
// Hopefully, this won't mask other NS_ERROR_ABORTs.
|
||||
if (!_quit || e != Components.results.NS_ERROR_ABORT)
|
||||
dump("TEST-UNEXPECTED-FAIL | (xpcshell/head.js) | " + e + "\n");
|
||||
}
|
||||
|
||||
if (_fail)
|
||||
dump("*** FAIL ***\n");
|
||||
if (!_passed)
|
||||
return;
|
||||
|
||||
var truePassedChecks = _passedChecks - _falsePassedChecks;
|
||||
if (truePassedChecks > 0)
|
||||
dump("TEST-PASS | (xpcshell/head.js) | " + truePassedChecks + " (+ " +
|
||||
_falsePassedChecks + ") check(s) passed\n");
|
||||
else
|
||||
dump("*** PASS ***\n");
|
||||
// ToDo: switch to TEST-UNEXPECTED-FAIL when all tests have been updated. (Bug 496443)
|
||||
dump("TEST-INFO | (xpcshell/head.js) | No (+ " + _falsePassedChecks + ") checks actually run\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,50 +147,73 @@ function do_timeout(delay, expr) {
|
|||
function do_throw(text, stack) {
|
||||
if (!stack)
|
||||
stack = Components.stack.caller;
|
||||
_fail = true;
|
||||
_do_quit();
|
||||
dump("*** TEST-UNEXPECTED-FAIL | " + stack.filename + " | " + text + "\n");
|
||||
|
||||
_passed = false;
|
||||
dump("TEST-UNEXPECTED-FAIL | " + stack.filename + " | " + text +
|
||||
" - See following stack:\n");
|
||||
var frame = Components.stack;
|
||||
while (frame != null) {
|
||||
dump(frame + "\n");
|
||||
frame = frame.caller;
|
||||
}
|
||||
|
||||
_do_quit();
|
||||
throw Components.results.NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
function do_check_neq(left, right, stack) {
|
||||
if (!stack)
|
||||
stack = Components.stack.caller;
|
||||
|
||||
var text = left + " != " + right;
|
||||
if (left == right)
|
||||
do_throw(left + " != " + right, stack);
|
||||
do_throw(text, stack);
|
||||
else {
|
||||
++_passedChecks;
|
||||
dump("TEST-PASS | " + stack.filename + " | [" + stack.name + " : " +
|
||||
stack.lineNumber + "] " + text + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
function do_check_eq(left, right, stack) {
|
||||
if (!stack)
|
||||
stack = Components.stack.caller;
|
||||
|
||||
var text = left + " == " + right;
|
||||
if (left != right)
|
||||
do_throw(left + " == " + right, stack);
|
||||
do_throw(text, stack);
|
||||
else {
|
||||
++_passedChecks;
|
||||
dump("TEST-PASS | " + stack.filename + " | [" + stack.name + " : " +
|
||||
stack.lineNumber + "] " + text + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
function do_check_true(condition, stack) {
|
||||
if (!stack)
|
||||
stack = Components.stack.caller;
|
||||
|
||||
do_check_eq(condition, true, stack);
|
||||
}
|
||||
|
||||
function do_check_false(condition, stack) {
|
||||
if (!stack)
|
||||
stack = Components.stack.caller;
|
||||
|
||||
do_check_eq(condition, false, stack);
|
||||
}
|
||||
|
||||
function do_test_pending() {
|
||||
dump("*** test pending\n");
|
||||
_tests_pending++;
|
||||
++_tests_pending;
|
||||
|
||||
dump("TEST-INFO | (xpcshell/head.js) | test " + _tests_pending +
|
||||
" pending\n");
|
||||
}
|
||||
|
||||
function do_test_finished() {
|
||||
dump("*** test finished\n");
|
||||
dump("TEST-INFO | (xpcshell/head.js) | test " + _tests_pending +
|
||||
" finished\n");
|
||||
|
||||
if (--_tests_pending == 0)
|
||||
_do_quit();
|
||||
}
|
||||
|
@ -199,18 +234,21 @@ function do_get_file(path, allowNonexistent) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!allowNonexistent) {
|
||||
if (!lf.exists()) {
|
||||
print(lf.path + " doesn't exist\n");
|
||||
}
|
||||
do_check_true(lf.exists());
|
||||
if (!allowNonexistent && !lf.exists()) {
|
||||
// Not using do_throw(): caller will continue.
|
||||
_passed = false;
|
||||
var stack = Components.stack.caller;
|
||||
dump("TEST-UNEXPECTED-FAIL | " + stack.filename + " | [" +
|
||||
stack.name + " : " + stack.lineNumber + "] " + lf.path +
|
||||
" does not exist\n");
|
||||
}
|
||||
|
||||
return lf;
|
||||
}
|
||||
catch(ex) {
|
||||
catch (ex) {
|
||||
do_throw(ex.toString(), Components.stack.caller);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -223,6 +261,8 @@ function do_load_module(path) {
|
|||
var lf = do_get_file(path);
|
||||
const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
|
||||
do_check_true(Components.manager instanceof nsIComponentRegistrar);
|
||||
// Previous do_check_true() is not a test check.
|
||||
++_falsePassedChecks;
|
||||
Components.manager.autoRegister(lf);
|
||||
}
|
||||
|
||||
|
@ -242,8 +282,9 @@ function do_parse_document(aPath, aType) {
|
|||
break;
|
||||
|
||||
default:
|
||||
throw new Error("do_parse_document requires content-type of " +
|
||||
"application/xhtml+xml, application/xml, or text/xml.");
|
||||
do_throw("type: expected application/xhtml+xml, application/xml or text/xml," +
|
||||
" got '" + aType + "'",
|
||||
Components.stack.caller);
|
||||
}
|
||||
|
||||
var lf = do_get_file(aPath);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Serge Gautherie <sgautherie.bz@free.fr>
|
||||
# Ted Mielczarek <ted.mielczarek@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
|
@ -36,7 +37,7 @@
|
|||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
import sys, os, os.path, logging
|
||||
import re, sys, os, os.path, logging
|
||||
import tempfile
|
||||
from glob import glob
|
||||
from optparse import OptionParser
|
||||
|
@ -214,7 +215,7 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
|
|||
# not sure what else to do here...
|
||||
return True
|
||||
|
||||
if proc.returncode != 0 or (stdout is not None and stdout.find("*** PASS") == -1):
|
||||
if proc.returncode != 0 or (stdout is not None and re.search("^TEST-UNEXPECTED-FAIL", stdout, re.MULTILINE)):
|
||||
print """TEST-UNEXPECTED-FAIL | %s | test failed (with xpcshell return code: %d), see following log:
|
||||
>>>>>>>
|
||||
%s
|
||||
|
@ -222,7 +223,7 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
|
|||
checkForCrashes(testdir, symbolsPath, testName=test)
|
||||
success = False
|
||||
else:
|
||||
print "TEST-PASS | %s | all tests passed" % test
|
||||
print "TEST-PASS | %s | test passed" % test
|
||||
|
||||
leakReport = processLeakLog(leakLogFile)
|
||||
|
||||
|
|
|
@ -2901,6 +2901,18 @@ nsNavHistoryQueryResultNode::OnPageExpired(nsIURI* aURI, PRTime aVisitTime,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryQueryResultNode::OnItemAdded(PRInt64 aItemId,
|
||||
PRInt64 aFolder,
|
||||
PRInt32 aIndex)
|
||||
{
|
||||
nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
|
||||
PRUint16 itemType;
|
||||
nsresult rv = bookmarks->GetItemType(aItemId, &itemType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return OnItemAdded(aItemId, aFolder, aIndex, itemType);
|
||||
}
|
||||
|
||||
// nsNavHistoryQueryResultNode bookmark observers
|
||||
//
|
||||
|
@ -2909,8 +2921,10 @@ nsNavHistoryQueryResultNode::OnPageExpired(nsIURI* aURI, PRTime aVisitTime,
|
|||
// the bookmark system.
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryQueryResultNode::OnItemAdded(PRInt64 aItemId, PRInt64 aFolder,
|
||||
PRInt32 aIndex)
|
||||
nsNavHistoryQueryResultNode::OnItemAdded(PRInt64 aItemId,
|
||||
PRInt64 aFolder,
|
||||
PRInt32 aIndex,
|
||||
PRUint16 aItemType)
|
||||
{
|
||||
if (mLiveUpdate == QUERYUPDATE_COMPLEX_WITH_BOOKMARKS)
|
||||
return Refresh();
|
||||
|
@ -3423,12 +3437,27 @@ nsNavHistoryFolderResultNode::OnEndUpdateBatch()
|
|||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
||||
PRInt64 aFolder,
|
||||
PRInt32 aIndex)
|
||||
{
|
||||
nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
|
||||
PRUint16 itemType;
|
||||
nsresult rv = bookmarks->GetItemType(aItemId, &itemType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return OnItemAdded(aItemId, aFolder, aIndex, itemType);
|
||||
}
|
||||
|
||||
|
||||
// nsNavHistoryFolderResultNode::OnItemAdded (nsINavBookmarkObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
||||
PRInt64 aParentFolder,
|
||||
PRInt32 aIndex)
|
||||
PRInt32 aIndex,
|
||||
PRUint16 aItemType)
|
||||
{
|
||||
NS_ASSERTION(aParentFolder == mItemId, "Got wrong bookmark update");
|
||||
|
||||
|
@ -3437,7 +3466,16 @@ nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
|||
if (aIndex < 0) {
|
||||
NS_NOTREACHED("Invalid index for item adding: <0");
|
||||
aIndex = 0;
|
||||
} else if (aIndex > mChildren.Count()) {
|
||||
}
|
||||
else if (aIndex > mChildren.Count()) {
|
||||
PRBool excludeItems = (mResult && mResult->mRootNode->mOptions->ExcludeItems()) ||
|
||||
(mParent && mParent->mOptions->ExcludeItems()) ||
|
||||
mOptions->ExcludeItems();
|
||||
if (excludeItems &&
|
||||
(aItemType == nsINavBookmarksService::TYPE_BOOKMARK ||
|
||||
aItemType == nsINavBookmarksService::TYPE_SEPARATOR))
|
||||
return NS_OK;
|
||||
|
||||
NS_NOTREACHED("Invalid index for item adding: greater than count");
|
||||
aIndex = mChildren.Count();
|
||||
}
|
||||
|
@ -3445,14 +3483,12 @@ nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
|||
nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRUint16 itemType;
|
||||
nsresult rv = bookmarks->GetItemType(aItemId, &itemType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv;
|
||||
|
||||
// check for query URIs, which are bookmarks, but treated as containers
|
||||
// in results and views.
|
||||
PRBool isQuery = PR_FALSE;
|
||||
if (itemType == nsINavBookmarksService::TYPE_BOOKMARK) {
|
||||
if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) {
|
||||
nsCOMPtr<nsIURI> itemURI;
|
||||
rv = bookmarks->GetBookmarkURI(aItemId, getter_AddRefs(itemURI));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -3462,7 +3498,7 @@ nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
|||
isQuery = IsQueryURI(itemURISpec);
|
||||
}
|
||||
|
||||
if (itemType != nsINavBookmarksService::TYPE_FOLDER &&
|
||||
if (aItemType != nsINavBookmarksService::TYPE_FOLDER &&
|
||||
!isQuery && mOptions->ExcludeItems()) {
|
||||
// don't update items when we aren't displaying them, but we still need
|
||||
// to adjust bookmark indices to account for the insertion
|
||||
|
@ -3477,7 +3513,7 @@ nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
|||
ReindexRange(aIndex, PR_INT32_MAX, 1);
|
||||
|
||||
nsRefPtr<nsNavHistoryResultNode> node;
|
||||
if (itemType == nsINavBookmarksService::TYPE_BOOKMARK) {
|
||||
if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) {
|
||||
nsNavHistory* history = nsNavHistory::GetHistoryService();
|
||||
NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY);
|
||||
rv = history->BookmarkIdToResultNode(aItemId, mOptions, getter_AddRefs(node));
|
||||
|
@ -3486,19 +3522,19 @@ nsNavHistoryFolderResultNode::OnItemAdded(PRInt64 aItemId,
|
|||
if (mResult && node->IsQuery())
|
||||
node->GetAsQuery()->mBatchInProgress = mResult->mBatchInProgress;
|
||||
}
|
||||
else if (itemType == nsINavBookmarksService::TYPE_FOLDER ||
|
||||
itemType == nsINavBookmarksService::TYPE_DYNAMIC_CONTAINER) {
|
||||
else if (aItemType == nsINavBookmarksService::TYPE_FOLDER ||
|
||||
aItemType == nsINavBookmarksService::TYPE_DYNAMIC_CONTAINER) {
|
||||
rv = bookmarks->ResultNodeForContainer(aItemId, mOptions, getter_AddRefs(node));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
else if (itemType == nsINavBookmarksService::TYPE_SEPARATOR) {
|
||||
else if (aItemType == nsINavBookmarksService::TYPE_SEPARATOR) {
|
||||
node = new nsNavHistorySeparatorResultNode();
|
||||
NS_ENSURE_TRUE(node, NS_ERROR_OUT_OF_MEMORY);
|
||||
node->mItemId = aItemId;
|
||||
}
|
||||
node->mBookmarkIndex = aIndex;
|
||||
|
||||
if (itemType == nsINavBookmarksService::TYPE_SEPARATOR ||
|
||||
if (aItemType == nsINavBookmarksService::TYPE_SEPARATOR ||
|
||||
GetSortType() == nsINavHistoryQueryOptions::SORT_BY_NONE) {
|
||||
// insert at natural bookmarks position
|
||||
return InsertChildAt(node, aIndex);
|
||||
|
@ -3521,7 +3557,8 @@ nsNavHistoryFolderResultNode::OnBeforeItemRemoved(PRInt64 aItemId)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryFolderResultNode::OnItemRemoved(PRInt64 aItemId,
|
||||
PRInt64 aParentFolder, PRInt32 aIndex)
|
||||
PRInt64 aParentFolder,
|
||||
PRInt32 aIndex)
|
||||
{
|
||||
// We only care about notifications when a child changes. When the deleted
|
||||
// item is us, our parent should also be registered and will remove us from
|
||||
|
@ -3529,19 +3566,26 @@ nsNavHistoryFolderResultNode::OnItemRemoved(PRInt64 aItemId,
|
|||
if (mItemId == aItemId)
|
||||
return NS_OK;
|
||||
|
||||
NS_ASSERTION(aParentFolder == mItemId, "Got wrong bookmark update");
|
||||
|
||||
PRBool excludeItems = (mResult && mResult->mRootNode->mOptions->ExcludeItems()) ||
|
||||
(mParent && mParent->mOptions->ExcludeItems()) ||
|
||||
mOptions->ExcludeItems();
|
||||
|
||||
// don't trust the index from the bookmark service, find it ourselves. The
|
||||
// sorting could be different, or the bookmark services indices and ours might
|
||||
// be out of sync somehow.
|
||||
PRUint32 index;
|
||||
nsNavHistoryResultNode* node = FindChildById(aItemId, &index);
|
||||
if (!node) {
|
||||
if (excludeItems)
|
||||
return NS_OK;
|
||||
|
||||
NS_NOTREACHED("Removing item we don't have");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_ASSERTION(aParentFolder == mItemId, "Got wrong bookmark update");
|
||||
|
||||
if ((node->IsURI() || node->IsSeparator()) && mOptions->ExcludeItems()) {
|
||||
if ((node->IsURI() || node->IsSeparator()) && excludeItems) {
|
||||
// don't update items when we aren't displaying them, but we do need to
|
||||
// adjust everybody's bookmark indices to account for the removal
|
||||
ReindexRange(aIndex, PR_INT32_MAX, -1);
|
||||
|
@ -4199,10 +4243,18 @@ nsNavHistoryResult::OnItemAdded(PRInt64 aItemId,
|
|||
PRInt64 aFolder,
|
||||
PRInt32 aIndex)
|
||||
{
|
||||
nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRUint16 itemType;
|
||||
nsresult rv = bookmarks->GetItemType(aItemId, &itemType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
ENUMERATE_BOOKMARK_FOLDER_OBSERVERS(aFolder,
|
||||
OnItemAdded(aItemId, aFolder, aIndex));
|
||||
ENUMERATE_HISTORY_OBSERVERS(OnItemAdded(aItemId, aFolder, aIndex));
|
||||
ENUMERATE_ALL_BOOKMARKS_OBSERVERS(OnItemAdded(aItemId, aFolder, aIndex));
|
||||
OnItemAdded(aItemId, aFolder, aIndex, itemType));
|
||||
ENUMERATE_HISTORY_OBSERVERS(OnItemAdded(aItemId, aFolder, aIndex, itemType));
|
||||
ENUMERATE_ALL_BOOKMARKS_OBSERVERS(OnItemAdded(aItemId, aFolder, aIndex,
|
||||
itemType));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -4241,23 +4293,19 @@ nsNavHistoryResult::OnItemChanged(PRInt64 aItemId,
|
|||
PRBool aIsAnnotationProperty,
|
||||
const nsACString &aValue)
|
||||
{
|
||||
nsNavBookmarks* bookmarkService = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarkService, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
ENUMERATE_ALL_BOOKMARKS_OBSERVERS(
|
||||
OnItemChanged(aItemId, aProperty, aIsAnnotationProperty, aValue));
|
||||
|
||||
PRUint16 itemType;
|
||||
nsresult rv = bookmarkService->GetItemType(aItemId, &itemType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Note: folder-nodes set their own bookmark observer only once they're
|
||||
// opened, meaning we cannot optimize this code path for changes done to
|
||||
// folder-nodes.
|
||||
|
||||
nsNavBookmarks* bookmarkService = nsNavBookmarks::GetBookmarksService();
|
||||
NS_ENSURE_TRUE(bookmarkService, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// Find the changed items under the folders list
|
||||
PRInt64 folderId;
|
||||
rv = bookmarkService->GetFolderIdForItem(aItemId, &folderId);
|
||||
nsresult rv = bookmarkService->GetFolderIdForItem(aItemId, &folderId);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
FolderObserverList* list = BookmarkFolderObserversForId(folderId, PR_FALSE);
|
||||
|
@ -4268,11 +4316,13 @@ nsNavHistoryResult::OnItemChanged(PRInt64 aItemId,
|
|||
nsRefPtr<nsNavHistoryFolderResultNode> folder = list->ElementAt(i);
|
||||
if (folder) {
|
||||
PRUint32 nodeIndex;
|
||||
nsRefPtr<nsNavHistoryResultNode> node = folder->FindChildById(aItemId, &nodeIndex);
|
||||
nsRefPtr<nsNavHistoryResultNode> node =
|
||||
folder->FindChildById(aItemId, &nodeIndex);
|
||||
// if ExcludeItems is true we don't update non visible items
|
||||
PRBool excludeItems = (mRootNode->mOptions->ExcludeItems()) ||
|
||||
folder->mOptions->ExcludeItems();
|
||||
if (node &&
|
||||
(!folder->mOptions->ExcludeItems() ||
|
||||
!(node->IsURI() || node->IsSeparator())) &&
|
||||
(!excludeItems || !(node->IsURI() || node->IsSeparator())) &&
|
||||
folder->StartIncrementalUpdate()) {
|
||||
node->OnItemChanged(aItemId, aProperty, aIsAnnotationProperty, aValue);
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ private:
|
|||
NS_DECL_NSINAVBOOKMARKOBSERVER \
|
||||
NS_IMETHOD OnVisit(nsIURI* aURI, PRInt64 aVisitId, PRTime aTime, \
|
||||
PRInt64 aSessionId, PRInt64 aReferringId, \
|
||||
PRUint32 aTransitionType, PRUint32* aAdded); \
|
||||
PRUint32 aTransitionType, PRUint32* aAdded); \
|
||||
NS_IMETHOD OnTitleChanged(nsIURI* aURI, const nsAString& aPageTitle); \
|
||||
NS_IMETHOD OnBeforeDeleteURI(nsIURI *aURI); \
|
||||
NS_IMETHOD OnDeleteURI(nsIURI *aURI); \
|
||||
|
@ -107,6 +107,9 @@ private:
|
|||
NS_IMETHOD OnPageExpired(nsIURI* aURI, PRTime aVisitTime, \
|
||||
PRBool aWholeEntry);
|
||||
|
||||
#define NS_DECL_EXTENDED_BOOKMARK_OBSERVER \
|
||||
NS_IMETHOD OnItemAdded(PRInt64 aItemId, PRInt64 aFolder, \
|
||||
PRInt32 aIndex, PRUint16 aItemType);
|
||||
|
||||
// nsNavHistoryResult
|
||||
//
|
||||
|
@ -717,6 +720,7 @@ public:
|
|||
virtual nsresult OpenContainer();
|
||||
|
||||
NS_DECL_BOOKMARK_HISTORY_OBSERVER
|
||||
NS_DECL_EXTENDED_BOOKMARK_OBSERVER
|
||||
virtual void OnRemoving();
|
||||
|
||||
public:
|
||||
|
@ -790,9 +794,9 @@ public:
|
|||
// the bookmark observers. This is called from the result's actual observer
|
||||
// and it knows all observers are FolderResultNodes
|
||||
NS_DECL_NSINAVBOOKMARKOBSERVER
|
||||
NS_DECL_EXTENDED_BOOKMARK_OBSERVER
|
||||
|
||||
virtual void OnRemoving();
|
||||
|
||||
public:
|
||||
|
||||
// this indicates whether the folder contents are valid, they don't go away
|
||||
|
|
|
@ -513,6 +513,11 @@
|
|||
var currentTime = Math.round(this.video.currentTime * 1000); // in ms
|
||||
var duration = Math.round(this.video.duration * 1000); // in ms
|
||||
|
||||
// If playing/seeking after the video ended, we won't get a "play"
|
||||
// event, so update the button state here.
|
||||
if (!this.video.paused)
|
||||
this.setPlayButtonState(false);
|
||||
|
||||
this.timeUpdateCount++;
|
||||
// Whether we show the statusFader sometimes depends
|
||||
// on whether we've seen more than one timeupdate
|
||||
|
|
|
@ -51,4 +51,6 @@ function run_test()
|
|||
do_check_false(cr.enabled);
|
||||
// ensure that double-disabling doesn't error
|
||||
cr.enabled = false;
|
||||
// leave it enabled at the end in case of shutdown crashes
|
||||
cr.enabled = true;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,12 @@ MozQWidget::MozQWidget(nsWindow *receiver, QWidget *parent,
|
|||
setAttribute(Qt::WA_QuitOnClose, false);
|
||||
}
|
||||
|
||||
MozQWidget::~MozQWidget()
|
||||
{
|
||||
if (mReceiver)
|
||||
mReceiver->QWidgetDestroyed();
|
||||
}
|
||||
|
||||
bool MozQWidget::event(QEvent *e)
|
||||
{
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
|
|
@ -14,6 +14,8 @@ public:
|
|||
MozQWidget(nsWindow* receiver, QWidget *parent,
|
||||
const char *name, int f);
|
||||
|
||||
~MozQWidget();
|
||||
|
||||
/**
|
||||
* Mozilla helper.
|
||||
*/
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
#include "qx11info_x11.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <execinfo.h>
|
||||
|
||||
#include "mozqwidget.h"
|
||||
|
@ -316,6 +318,7 @@ nsWindow::Destroy(void)
|
|||
mMozQWidget->deleteLater();
|
||||
}
|
||||
|
||||
mMozQWidget = nsnull;
|
||||
mDrawingArea = nsnull;
|
||||
|
||||
OnDestroy();
|
||||
|
@ -1968,6 +1971,12 @@ nsWindow::ConvertBorderStyles(nsBorderStyle aStyle)
|
|||
return w;
|
||||
}
|
||||
|
||||
void nsWindow::QWidgetDestroyed()
|
||||
{
|
||||
mDrawingArea = nsnull;
|
||||
mMozQWidget = nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::MakeFullScreen(PRBool aFullScreen)
|
||||
{
|
||||
|
|
|
@ -208,6 +208,8 @@ public:
|
|||
void LoseFocus();
|
||||
qint32 ConvertBorderStyles(nsBorderStyle aStyle);
|
||||
|
||||
void QWidgetDestroyed();
|
||||
|
||||
|
||||
/***** from CommonWidget *****/
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче