diff --git a/accessible/src/base/Statistics.h b/accessible/src/base/Statistics.h index 06e4d0a03b7..cccfbfe5171 100644 --- a/accessible/src/base/Statistics.h +++ b/accessible/src/base/Statistics.h @@ -49,6 +49,18 @@ namespace statistics { inline void A11yInitialized() { Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED, true); } + /** + * Report that ISimpleDOM* has been used. + */ + inline void ISimpleDOMUsed() + { Telemetry::Accumulate(Telemetry::ISIMPLE_DOM_USAGE, 1); } + + /** + * Report that IAccessibleTable has been used. + */ + inline void IAccessibleTableUsed() + { Telemetry::Accumulate(Telemetry::IACCESSIBLE_TABLE_USAGE, 1); } + } // namespace statistics } // namespace a11y } // namespace mozilla diff --git a/accessible/src/msaa/CAccessibleTable.cpp b/accessible/src/msaa/CAccessibleTable.cpp index 12bc95417bc..25a8466efe6 100644 --- a/accessible/src/msaa/CAccessibleTable.cpp +++ b/accessible/src/msaa/CAccessibleTable.cpp @@ -49,10 +49,13 @@ #include "nsIWinAccessNode.h" #include "nsAccessNodeWrap.h" #include "nsWinUtils.h" +#include "Statistics.h" #include "nsCOMPtr.h" #include "nsString.h" +using namespace mozilla::a11y; + #define CANT_QUERY_ASSERTION_MSG \ "Subclass of CAccessibleTable doesn't implement nsIAccessibleTable"\ @@ -64,6 +67,7 @@ CAccessibleTable::QueryInterface(REFIID iid, void** ppv) *ppv = NULL; if (IID_IAccessibleTable == iid) { + statistics::IAccessibleTableUsed(); *ppv = static_cast(this); (reinterpret_cast(*ppv))->AddRef(); return S_OK; diff --git a/accessible/src/msaa/nsAccessNodeWrap.cpp b/accessible/src/msaa/nsAccessNodeWrap.cpp index 27ffcdec0cb..0b39c974105 100644 --- a/accessible/src/msaa/nsAccessNodeWrap.cpp +++ b/accessible/src/msaa/nsAccessNodeWrap.cpp @@ -46,6 +46,7 @@ #include "nsCoreUtils.h" #include "nsRootAccessible.h" #include "nsWinUtils.h" +#include "Statistics.h" #include "nsAttrName.h" #include "nsIDocument.h" @@ -59,6 +60,7 @@ #include "mozilla/Preferences.h" using namespace mozilla; +using namespace mozilla::a11y; /// the accessible library and cached methods HINSTANCE nsAccessNodeWrap::gmAccLib = nsnull; @@ -120,11 +122,14 @@ STDMETHODIMP nsAccessNodeWrap::QueryInterface(REFIID iid, void** ppv) { *ppv = nsnull; - if (IID_IUnknown == iid || IID_ISimpleDOMNode == iid) + if (IID_IUnknown == iid) { *ppv = static_cast(this); - - if (nsnull == *ppv) + } else if (IID_ISimpleDOMNode == iid) { + statistics::ISimpleDOMUsed(); + *ppv = static_cast(this); + } else { return E_NOINTERFACE; //iid not supported. + } (reinterpret_cast(*ppv))->AddRef(); return S_OK; diff --git a/accessible/src/msaa/nsDocAccessibleWrap.cpp b/accessible/src/msaa/nsDocAccessibleWrap.cpp index d4069a9d387..e6bd3440632 100644 --- a/accessible/src/msaa/nsDocAccessibleWrap.cpp +++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp @@ -43,6 +43,7 @@ #include "nsIAccessibilityService.h" #include "nsRootAccessible.h" #include "nsWinUtils.h" +#include "Statistics.h" #include "nsIDocShell.h" #include "nsIDocShellTreeNode.h" @@ -54,6 +55,8 @@ #include "nsIViewManager.h" #include "nsIWebNavigation.h" +using namespace mozilla::a11y; + /* For documentation of the accessibility architecture, * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html */ @@ -91,12 +94,11 @@ STDMETHODIMP nsDocAccessibleWrap::QueryInterface(REFIID iid, void** ppv) { *ppv = NULL; - if (IID_ISimpleDOMDocument == iid) - *ppv = static_cast(this); - - if (NULL == *ppv) + if (IID_ISimpleDOMDocument != iid) return nsHyperTextAccessibleWrap::QueryInterface(iid, ppv); - + + statistics::ISimpleDOMUsed(); + *ppv = static_cast(this); (reinterpret_cast(*ppv))->AddRef(); return S_OK; } diff --git a/accessible/src/msaa/nsTextAccessibleWrap.cpp b/accessible/src/msaa/nsTextAccessibleWrap.cpp index 0480ca3cfa5..887661c5778 100644 --- a/accessible/src/msaa/nsTextAccessibleWrap.cpp +++ b/accessible/src/msaa/nsTextAccessibleWrap.cpp @@ -41,6 +41,7 @@ #include "nsCoreUtils.h" #include "nsDocAccessible.h" +#include "Statistics.h" #include "nsIFrame.h" #include "nsFontMetrics.h" #include "nsPresContext.h" @@ -48,6 +49,8 @@ #include "gfxFont.h" +using namespace mozilla::a11y; + //////////////////////////////////////////////////////////////////////////////// // nsTextAccessibleWrap Accessible //////////////////////////////////////////////////////////////////////////////// @@ -72,11 +75,14 @@ STDMETHODIMP nsTextAccessibleWrap::QueryInterface(REFIID iid, void** ppv) { *ppv = nsnull; - if (IID_IUnknown == iid || IID_ISimpleDOMText == iid) + if (IID_IUnknown == iid) { *ppv = static_cast(this); - - if (nsnull == *ppv) + } else if (IID_ISimpleDOMText == iid) { + statistics::ISimpleDOMUsed(); + *ppv = static_cast(this); + } else { return nsAccessibleWrap::QueryInterface(iid, ppv); + } (reinterpret_cast(*ppv))->AddRef(); return S_OK; diff --git a/configure.in b/configure.in index 8b47883d5a7..d40b9500020 100644 --- a/configure.in +++ b/configure.in @@ -5930,12 +5930,6 @@ fi dnl ======================================================== dnl Installer dnl ======================================================== -case "$target_os" in - aix*|solaris*|linux*|mingw*|os2*) - MOZ_INSTALLER=1 - ;; -esac - MOZ_ARG_DISABLE_BOOL(installer, [ --disable-installer Disable building of installer], MOZ_INSTALLER=, diff --git a/docshell/test/navigation/test_bug13871.html b/docshell/test/navigation/test_bug13871.html index 6e8534e2985..9ff0b9bb553 100644 --- a/docshell/test/navigation/test_bug13871.html +++ b/docshell/test/navigation/test_bug13871.html @@ -27,14 +27,10 @@ window.onload = function () { window3.close(); xpcCleanupWindows(); - SpecialPowers.setBoolPref("dom.block_multiple_popups", gBlockMultiplePopups); SimpleTest.finish(); }, 4); } -var gBlockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); -SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window0", "width=10,height=10"); var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window1", "width=10,height=10"); var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window2", "width=10,height=10"); diff --git a/docshell/test/navigation/test_bug270414.html b/docshell/test/navigation/test_bug270414.html index 81128095622..98dcf42f8df 100644 --- a/docshell/test/navigation/test_bug270414.html +++ b/docshell/test/navigation/test_bug270414.html @@ -9,9 +9,6 @@ iframe { width: 90%; height: 50px; } "); -} - -/** - * window.open followed by w.open with w being the first popup. - */ -function test2() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount > 1) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 1, "Only one popup appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * window.open followed by w.open with w being the first popup and the second popup being actually a tab. - */ -function test3() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount > 1) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 1, "Only one popup appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * window.open and .click() on the element opening the window. - */ -function test4() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - gBrowser.addEventListener("DOMPopupBlocked", function() { - gBrowser.removeEventListener("DOMPopupBlocked", arguments.callee, true); - - ok(true, "The popup has been blocked"); - - cleanUp(); - nextOrFinish(); - }, true); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * Two window.open from the chrome. - */ -function test5() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - window.open("data:text/html,foo", '', 'foo'); - window.open("data:text/html,foo", '', 'foo'); -} - -/** - * Two window.open with the pref being disabled. - */ -function test6() -{ - prefs.setBoolPref("dom.block_multiple_popups", false); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} diff --git a/dom/tests/mochitest/bugs/test_bug346659.html b/dom/tests/mochitest/bugs/test_bug346659.html index 612bc11fdcb..d8ff23e76a9 100644 --- a/dom/tests/mochitest/bugs/test_bug346659.html +++ b/dom/tests/mochitest/bugs/test_bug346659.html @@ -28,9 +28,6 @@ SimpleTest.waitForExplicitFinish(); var wins = []; -var gBlockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); -SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - function r(base, tail) { return base.replace(/\/[^\/]*$/, "/" + tail); } @@ -156,7 +153,6 @@ function handleTestEnd() { setTimeout(startThirdBatch, 0); } } else if (!--numTestsSet3) { - SpecialPowers.setBoolPref("dom.block_multiple_popups", gBlockMultiplePopups); SimpleTest.finish(); } } diff --git a/dom/tests/mochitest/bugs/test_bug406375.html b/dom/tests/mochitest/bugs/test_bug406375.html index 0ee13c08147..cfade43c57a 100644 --- a/dom/tests/mochitest/bugs/test_bug406375.html +++ b/dom/tests/mochitest/bugs/test_bug406375.html @@ -23,13 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=406375 SimpleTest.waitForExplicitFinish(); function runTest() { - var blockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); - SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - window.showModalDialog("file_bug406375.html"); ok(true, "This test should not hang"); - - SpecialPowers.setBoolPref("dom.block_multiple_popups", blockMultiplePopups); SimpleTest.finish(); } diff --git a/dom/tests/mochitest/bugs/test_bug61098.html b/dom/tests/mochitest/bugs/test_bug61098.html index bdcd7b0d907..b1c3952880c 100644 --- a/dom/tests/mochitest/bugs/test_bug61098.html +++ b/dom/tests/mochitest/bugs/test_bug61098.html @@ -242,9 +242,6 @@ var expectedState; function runtests() { - var blockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); - SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - registerMockPromptService(); enableDialogLoopBlocking(); @@ -351,8 +348,6 @@ function runtests() mockPromptFactoryRegisterer.unregister(); mockPromptServiceRegisterer.unregister(); - SpecialPowers.setBoolPref("dom.block_multiple_popups", blockMultiplePopups); - SimpleTest.finish(); } diff --git a/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul b/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul index 00c553efceb..d2e42165126 100644 --- a/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul +++ b/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul @@ -4,7 +4,7 @@ - @@ -12,9 +12,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662519 Mozilla Bug 662519 - Mozilla Bug 675574 - @@ -23,93 +20,35 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662519 /** Test for Bug 662519 **/ - let Cc = Components.classes; - let Ci = Components.interfaces; - SimpleTest.waitForExplicitFinish(); // We have to enable dom.disable_open_during_load which is disabled // by the test harness. - let prefs = Cc["@mozilla.org/preferences-service;1"] - .getService(Ci.nsIPrefBranch); - let gLastDomLoadValue = prefs.getBoolPref("dom.disable_open_during_load"); - let gMultiplePopupsPref = prefs.getBoolPref("dom.block_multiple_popups"); - + let prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + var gLastDomLoadValue = prefs.getBoolPref("dom.disable_open_during_load"); prefs.setBoolPref("dom.disable_open_during_load", true); - prefs.setBoolPref("dom.block_multiple_popups", true); - function test1() { - let w = window.open("data:text/html,foobar", "", "width=200,height=200"); - ok(w, "The window object shouldn't be null"); + let w = window.open("data:text/html,foobar", "", "width=200,height=200"); + ok(w, "The window object shouldn't be null"); + + SimpleTest.waitForFocus(function() { + w.close(); + ok(true, "The popup appeared"); SimpleTest.waitForFocus(function() { - w.close(); - ok(true, "The popup appeared"); + let w = window.open("data:text/html,foobar", "", "width=200,height=200"); + ok(w, "The window object shouldn't be null"); SimpleTest.waitForFocus(function() { - let w = window.open("data:text/html,foobar", "", "width=200,height=200"); - ok(w, "The window object shouldn't be null"); + w.close(); - SimpleTest.waitForFocus(function() { - w.close(); - - ok(true, "The popup appeared"); - test2(); - }, w, false); - }); - }, w, false); - } - - function test2() { - let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Ci.nsIWindowWatcher); - - let gPopupsCount = 0; - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - - // Clean-up and finish. - let windowEnumerator = wm.getEnumerator(null); - - while (windowEnumerator.hasMoreElements()) { - let win = windowEnumerator.getNext(); - - // Close all windows except ourself. - if (win != window && !win.closed) { - win.close(); - } - } - - prefs.setBoolPref("dom.block_multiple_popups", gMultiplePopupsPref); + ok(true, "The popup appeared"); prefs.setBoolPref("dom.disable_open_during_load", gLastDomLoadValue); SimpleTest.finish(); - }); - }); - }); - }); + }, w, false); }); - - EventUtils.synthesizeMouseAtCenter(document.getElementsByTagName('button')[0], {}); - } - - SimpleTest.waitForFocus(test1); + }, w, false); ]]> diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index 0005e81d417..44b3f143db2 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -87,7 +87,7 @@ static void OutputMessage(const std::string &aString, int aLevel) { } #else if (aLevel >= sGfxLogLevel) { - printf(aString.c_str()); + printf("%s", aString.c_str()); } #endif } diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index 94b8442d20d..3f63bb78906 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -1,3 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla SpiderMonkey JavaScript code. + * + * The Initial Developer of the Original Code is + * the Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2011 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Chris Leary + * + * 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 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + #include "LifoAlloc.h" #include diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index feed4526ea1..ddab0aef85a 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -14,18 +14,19 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is Mozilla SpiderMonkey JavaScript 1.9 code, released - * June 12, 2009. + * The Original Code is Mozilla SpiderMonkey JavaScript code. * * The Initial Developer of the Original Code is - * the Mozilla Corporation. + * the Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2011 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Chris Leary + * Chris Leary * * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index 75f0e2c398e..8328cecf004 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -292,3 +292,32 @@ BEGIN_TEST(testDebugger_singleStepThrow) return JSTRAP_CONTINUE; } END_TEST(testDebugger_singleStepThrow) + +BEGIN_TEST(testDebugger_emptyObjectPropertyIterator) +{ + JSObject *obj = JS_NewObject(cx, NULL, NULL, NULL); + JSScopeProperty *prop = NULL; + CHECK(!JS_PropertyIterator(obj, &prop)); + CHECK(!prop); + + return true; +} +END_TEST(testDebugger_emptyObjectPropertyIterator) + +BEGIN_TEST(testDebugger_nonEmptyObjectPropertyIterator) +{ + jsval v; + EVAL("({a: 15})", &v); + JSObject *obj = JSVAL_TO_OBJECT(v); + JSScopeProperty *prop = NULL; + CHECK(JS_PropertyIterator(obj, &prop)); + JSPropertyDesc desc; + CHECK(JS_GetPropertyDesc(cx, obj, prop, &desc)); + CHECK_EQUAL(JSVAL_IS_INT(desc.value), true); + CHECK_EQUAL(JSVAL_TO_INT(desc.value), 15); + CHECK(!JS_PropertyIterator(obj, &prop)); + CHECK(!prop); + + return true; +} +END_TEST(testDebugger_nonEmptyObjectPropertyIterator) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 4191f41e4ef..535c1ef582f 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -847,14 +847,14 @@ JS_PropertyIterator(JSObject *obj, JSScopeProperty **iteratorp) /* The caller passes null in *iteratorp to get things started. */ shape = (Shape *) *iteratorp; - if (!shape) { + if (!shape) shape = obj->lastProperty(); - } else { + else shape = shape->previous(); - if (!shape->previous()) { - JS_ASSERT(JSID_IS_EMPTY(shape->propid)); - shape = NULL; - } + + if (!shape->previous()) { + JS_ASSERT(JSID_IS_EMPTY(shape->propid)); + shape = NULL; } return *iteratorp = reinterpret_cast(const_cast(shape)); diff --git a/layout/xul/base/src/nsResizerFrame.cpp b/layout/xul/base/src/nsResizerFrame.cpp index 298d326f458..9199036f8f4 100644 --- a/layout/xul/base/src/nsResizerFrame.cpp +++ b/layout/xul/base/src/nsResizerFrame.cpp @@ -123,23 +123,27 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, } mMouseDownRect = rect.ToNearestPixels(aPresContext->AppUnitsPerDevPixel()); + doDefault = PR_FALSE; } else { + // If there is no window, then resizing isn't allowed. + if (!window) + break; + + doDefault = PR_FALSE; + // ask the widget implementation to begin a resize drag if it can Direction direction = GetDirection(); nsresult rv = aEvent->widget->BeginResizeDrag(aEvent, direction.mHorizontal, direction.mVertical); - if (rv == NS_ERROR_NOT_IMPLEMENTED && window) { - // if there's no native resize support, we need to do window - // resizing ourselves - window->GetPositionAndSize(&mMouseDownRect.x, &mMouseDownRect.y, - &mMouseDownRect.width, &mMouseDownRect.height); - } - else { - // for native drags, don't set the fields below - doDefault = PR_FALSE; - break; - } + // for native drags, don't set the fields below + if (rv != NS_ERROR_NOT_IMPLEMENTED) + break; + + // if there's no native resize support, we need to do window + // resizing ourselves + window->GetPositionAndSize(&mMouseDownRect.x, &mMouseDownRect.y, + &mMouseDownRect.width, &mMouseDownRect.height); } // we're tracking @@ -149,8 +153,6 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, mMouseDownPoint = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset(); nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED); - - doDefault = PR_FALSE; } } break; @@ -358,7 +360,7 @@ nsResizerFrame::GetContentToResize(nsIPresShell* aPresShell, nsIBaseWindow** aWi // don't allow resizers in content shells, except for the viewport // scrollbar which doesn't have a parent nsIContent* nonNativeAnon = mContent->FindFirstNonNativeAnonymous(); - if (nonNativeAnon && !nonNativeAnon->GetParent()) { + if (!nonNativeAnon || nonNativeAnon->GetParent()) { return nsnull; } } diff --git a/layout/xul/base/test/Makefile.in b/layout/xul/base/test/Makefile.in index 954d00d9bfa..1fe3f355b9a 100644 --- a/layout/xul/base/test/Makefile.in +++ b/layout/xul/base/test/Makefile.in @@ -55,7 +55,9 @@ _CHROME_FILES = test_bug381167.xhtml \ $(NULL) ifneq (mobile,$(MOZ_BUILD_APP)) -_TEST_FILES += test_resizer.xul \ +_TEST_FILES = test_resizer_incontent.xul + +_CHROME_FILES += test_resizer.xul \ window_resizer.xul \ window_resizer_element.xul \ $(NULL) diff --git a/layout/xul/base/test/test_bug511075.html b/layout/xul/base/test/test_bug511075.html index 3fadb53ce9b..313d140a370 100644 --- a/layout/xul/base/test/test_bug511075.html +++ b/layout/xul/base/test/test_bug511075.html @@ -68,6 +68,7 @@ var tests = [ synthesizeMouse(scroller, x, y, { type: "mouseup" }, window); }, function() { + scroller.onscroll = null; ok(true, "Clicking the scrollbar should scroll"); finish(); } diff --git a/layout/xul/base/test/test_resizer.xul b/layout/xul/base/test/test_resizer.xul index 56402a3ed2d..6feed51e7e7 100644 --- a/layout/xul/base/test/test_resizer.xul +++ b/layout/xul/base/test/test_resizer.xul @@ -1,14 +1,13 @@ - - + - + + + + diff --git a/layout/xul/base/test/window_resizer.xul b/layout/xul/base/test/window_resizer.xul index 3d61107e995..4e349d125ca 100644 --- a/layout/xul/base/test/window_resizer.xul +++ b/layout/xul/base/test/window_resizer.xul @@ -2,7 +2,7 @@ - + diff --git a/layout/xul/base/test/window_resizer_element.xul b/layout/xul/base/test/window_resizer_element.xul index 69c547b8030..24f772b52ec 100644 --- a/layout/xul/base/test/window_resizer_element.xul +++ b/layout/xul/base/test/window_resizer_element.xul @@ -1,7 +1,7 @@ - + diff --git a/toolkit/content/widgets/tabbox.xml b/toolkit/content/widgets/tabbox.xml index a53f5d73025..40ea9e4a6dc 100644 --- a/toolkit/content/widgets/tabbox.xml +++ b/toolkit/content/widgets/tabbox.xml @@ -477,16 +477,19 @@ aNewTab.focus(); } else if (this.getAttribute("setfocus") != "false") { - document.commandDispatcher.advanceFocusIntoSubtree(this.tabbox.selectedPanel); - + let selectedPanel = this.tabbox.selectedPanel; + document.commandDispatcher.advanceFocusIntoSubtree(selectedPanel); + // Make sure that the focus doesn't move outside the tabbox if (this.tabbox) { try { let el = document.commandDispatcher.focusedElement; - while (el && el != this.tabbox) + while (el && el != this.tabbox.tabpanels) { + if (el == this.tabbox || el == selectedPanel) + return; el = el.parentNode; - if (el != this.tabbox) - aNewTab.focus(); + } + aNewTab.focus(); } catch(e) { } }