author | Boris Zbarsky <bzbarsky@mit.edu> |
Mon, 05 Nov 2012 11:54:37 -0500 | |
changeset 112316 | 004a0714ba52dad0c7e0d82fd4b8f1f77d375f76 |
parent 112315 | 9a13c51926cd2b73f6e98652b96b922330f30e7d |
child 112317 | 0b02a816de33c0ddec3f4104a93904df6a8d567a |
push id | 23812 |
push user | emorley@mozilla.com |
push date | Tue, 06 Nov 2012 14:01:34 +0000 |
treeherder | mozilla-central@f4aeed115e54 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 807222 |
milestone | 19.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/devtools/webconsole/test/browser_webconsole_completion.js +++ b/browser/devtools/webconsole/test/browser_webconsole_completion.js @@ -45,24 +45,23 @@ function testCompletion(hud) { jsterm.complete(jsterm.COMPLETE_FORWARD, testNext); yield; is(input.value, "document", "'docu' tab completion"); is(input.selectionStart, 8, "start selection is alright"); is(input.selectionEnd, 8, "end selection is alright"); is(jsterm.completeNode.value.replace(/ /g, ""), "", "'docu' completed"); - // Test typing 'window.Ob' and press tab. Just 'window.O' is - // ambiguous: could be window.Object, window.Option, etc. - input.value = "window.Ob"; - input.setSelectionRange(9, 9); + // Test typing 'window.O' and press tab. + input.value = "window.O"; + input.setSelectionRange(8, 8); jsterm.complete(jsterm.COMPLETE_FORWARD, testNext); yield; - is(input.value, "window.Object", "'window.Ob' tab completion"); + is(input.value, "window.Object", "'window.O' tab completion"); // Test typing 'document.getElem'. input.value = "document.getElem"; input.setSelectionRange(16, 16); jsterm.complete(jsterm.COMPLETE_FORWARD, testNext); yield; is(input.value, "document.getElem", "'document.getElem' completion");
--- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5607,58 +5607,22 @@ nsWindowSH::GetProperty(nsIXPConnectWrap obj = JS_ObjectToOuterObject(cx, obj); *vp = OBJECT_TO_JSVAL(obj); return NS_SUCCESS_I_DID_SOMETHING; } return NS_OK; } -struct ResolveGlobalNameClosure -{ - JSContext* cx; - JSObject* obj; - bool* retval; -}; - -static PLDHashOperator -ResolveGlobalName(const nsAString& aName, void* aClosure) -{ - ResolveGlobalNameClosure* closure = - static_cast<ResolveGlobalNameClosure*>(aClosure); - JS::Value dummy; - bool ok = JS_LookupUCProperty(closure->cx, closure->obj, - aName.BeginReading(), aName.Length(), - &dummy); - if (!ok) { - *closure->retval = false; - return PL_DHASH_STOP; - } - return PL_DHASH_NEXT; -} - NS_IMETHODIMP nsWindowSH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, bool *_retval) { if (!ObjectIsNativeWrapper(cx, obj)) { *_retval = JS_EnumerateStandardClasses(cx, obj); - if (!*_retval) { - return NS_OK; - } - - // Now resolve everything from the namespace manager - nsScriptNameSpaceManager *nameSpaceManager = - nsJSRuntime::GetNameSpaceManager(); - if (!nameSpaceManager) { - NS_ERROR("Can't get namespace manager."); - return NS_ERROR_UNEXPECTED; - } - ResolveGlobalNameClosure closure = { cx, obj, _retval }; - nameSpaceManager->EnumerateGlobalNames(ResolveGlobalName, &closure); } return NS_OK; } static nsDOMConstructorFunc FindConstructorFunc(const nsDOMClassInfoData *aDOMClassInfoData) {
--- a/dom/base/nsScriptNameSpaceManager.cpp +++ b/dom/base/nsScriptNameSpaceManager.cpp @@ -797,39 +797,16 @@ nsScriptNameSpaceManager::RegisterDefine if (s->mType == nsGlobalNameStruct::eTypeNotInitialized) { s->mType = nsGlobalNameStruct::eTypeNewDOMBinding; } s->mDefineDOMInterface = aDefineDOMInterface; s->mPrefEnabled = aPrefEnabled; } } -struct GlobalNameClosure -{ - nsScriptNameSpaceManager::GlobalNameEnumerator enumerator; - void* closure; -}; - -static PLDHashOperator -EnumerateGlobalName(PLDHashTable*, PLDHashEntryHdr *hdr, uint32_t, - void* aClosure) -{ - GlobalNameMapEntry *entry = static_cast<GlobalNameMapEntry *>(hdr); - GlobalNameClosure* closure = static_cast<GlobalNameClosure*>(aClosure); - return closure->enumerator(entry->mKey, closure->closure); -} - -void -nsScriptNameSpaceManager::EnumerateGlobalNames(GlobalNameEnumerator aEnumerator, - void* aClosure) -{ - GlobalNameClosure closure = { aEnumerator, aClosure }; - PL_DHashTableEnumerate(&mGlobalNames, EnumerateGlobalName, &closure); -} - static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, nsMallocSizeOfFun aMallocSizeOf, void *aArg) { GlobalNameMapEntry* entry = static_cast<GlobalNameMapEntry*>(aHdr); return entry->SizeOfExcludingThis(aMallocSizeOf); }
--- a/dom/base/nsScriptNameSpaceManager.h +++ b/dom/base/nsScriptNameSpaceManager.h @@ -138,22 +138,16 @@ public: const nsCID *aConstructorCID); nsGlobalNameStruct* GetConstructorProto(const nsGlobalNameStruct* aStruct); void RegisterDefineDOMInterface(const nsAFlatString& aName, mozilla::dom::DefineInterface aDefineDOMInterface, mozilla::dom::PrefEnabled aPrefEnabled); - typedef PLDHashOperator - (* GlobalNameEnumerator)(const nsAString& aGlobalName, void* aClosure); - - void EnumerateGlobalNames(GlobalNameEnumerator aEnumerator, - void* aClosure); - size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf); private: // Adds a new entry to the hash and returns the nsGlobalNameStruct // that aKey will be mapped to. If mType in the returned // nsGlobalNameStruct is != eTypeNotInitialized, an entry for aKey // already existed. nsGlobalNameStruct *AddToHash(PLDHashTable *aTable, const nsAString *aKey,
--- a/dom/base/test/Makefile.in +++ b/dom/base/test/Makefile.in @@ -12,17 +12,16 @@ include $(DEPTH)/config/autoconf.mk MOCHITEST_FILES = \ test_domrequest.html \ test_gsp-standards.html \ test_gsp-quirks.html \ test_gsp-qualified.html \ test_nondomexception.html \ test_screen_orientation.html \ - test_window_enumeration.html \ $(NULL) MOCHITEST_CHROME_FILES = \ test_bug715041.xul \ test_bug715041_removal.xul \ $(NULL) include $(topsrcdir)/config/rules.mk
deleted file mode 100644 --- a/dom/base/test/test_window_enumeration.html +++ /dev/null @@ -1,33 +0,0 @@ -<!DOCTYPE HTML> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=807222 ---> -<head> - <meta charset="utf-8"> - <title>Test for Bug 807222</title> - <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.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=807222">Mozilla Bug 807222</a> -<p id="display"></p> -<div id="content" style="display: none"> - -</div> -<pre id="test"> -<script type="application/javascript"> - -/** Test for Bug 807222 **/ -var expectedProps = [ "Image", "Audio", "Option", "USSDReceivedEvent", - "PerformanceTiming", "CSS2Properties", "SVGElement" ]; -var actualProps = Object.getOwnPropertyNames(window); - -for (var i = 0; i < expectedProps.length; ++i) { - isnot(actualProps.indexOf(expectedProps[i]), -1, - "getOwnPropertyNames should include " + expectedProps[i]); -} -</script> -</pre> -</body> -</html>