Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Sep 15, 2016
2 parents bffd125 + 587a718 commit be26e90
Show file tree
Hide file tree
Showing 258 changed files with 2,860 additions and 3,439 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'

[source.vendored-sources]
directory = '@top_srcdir@/third_party/rust'
13 changes: 10 additions & 3 deletions accessible/base/EventTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,16 @@ EventTree::Mutated(AccMutationEvent* aEv)
// discard those subtree mutations as we are no longer interested in them.
UniquePtr<EventTree>* node = &mFirst;
while (*node) {
if ((*node)->mContainer == aEv->mAccessible) {
*node = Move((*node)->mNext);
break;
Accessible* cntr = (*node)->mContainer;
while (cntr != mContainer) {
if (cntr == aEv->mAccessible) {
*node = Move((*node)->mNext);
break;
}
cntr = cntr->Parent();
}
if (cntr == aEv->mAccessible) {
continue;
}
node = &(*node)->mNext;
}
Expand Down
34 changes: 16 additions & 18 deletions accessible/tests/mochitest/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function eventQueue(aEventType)
if (matchIdx == -1 || eventSeq.length > 0)
matchIdx = scnIdx;

// Report everythign is ok.
// Report everything is ok.
for (var idx = 0; idx < eventSeq.length; idx++) {
var checker = eventSeq[idx];

Expand All @@ -346,16 +346,16 @@ function eventQueue(aEventType)
"' succeed. ";

if (checker.unexpected) {
ok(true, msg + `There's no unexpected '${typeStr}' event.`);
}
else {
if (checker.todo) {
todo(false, "Event " + typeStr + " event is still missing");
todo(false, `Todo event '${typeStr}' was caught`);
}
else {
ok(true, msg + "There's no unexpected " + typeStr + " event.");
ok(true, `${msg} Event '${typeStr}' was handled.`);
}
}
else {
ok(true, msg + "Event " + typeStr + " was handled.");
}
}
}
}
Expand All @@ -378,15 +378,13 @@ function eventQueue(aEventType)
ok(false, msg + "Dupe " + typeStr + " event.");

if (checker.unexpected) {
if (checker.todo) {
todo(checker.wasCaught,
"Event " + typeStr + " event is still missing");
}
else if (checker.wasCaught) {
if (checker.wasCaught) {
ok(false, msg + "There's unexpected " + typeStr + " event.");
}
} else if (!checker.wasCaught) {
ok(false, msg + typeStr + " event was missed.");
}
else if (!checker.wasCaught) {
var rf = checker.todo ? todo : ok;
rf(false, `${msg} '${typeStr} event is missed.`);
}
}
}
Expand Down Expand Up @@ -596,6 +594,7 @@ function eventQueue(aEventType)

while (aEventSeq.idx < aEventSeq.length &&
(aEventSeq[aEventSeq.idx].unexpected ||
aEventSeq[aEventSeq.idx].todo ||
aEventSeq[aEventSeq.idx].async ||
aEventSeq[aEventSeq.idx].wasCaught > 0)) {
aEventSeq.idx++;
Expand All @@ -612,7 +611,8 @@ function eventQueue(aEventType)
// Check if we have unhandled async (can be anywhere in the sequance) or
// sync expcected events yet.
for (var idx = 0; idx < aEventSeq.length; idx++) {
if (!aEventSeq[idx].unexpected && !aEventSeq[idx].wasCaught)
if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
!aEventSeq[idx].wasCaught)
return true;
}

Expand All @@ -636,7 +636,7 @@ function eventQueue(aEventType)
for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
var eventSeq = this.mScenarios[scnIdx];
for (var idx = 0; idx < eventSeq.length; idx++) {
if (eventSeq[idx].unexpected)
if (eventSeq[idx].unexpected || eventSeq[idx].todo)
return false;
}
}
Expand All @@ -648,7 +648,7 @@ function eventQueue(aEventType)
function eventQueue_isUnexpectedEventsScenario(aScenario)
{
for (var idx = 0; idx < aScenario.length; idx++) {
if (!aScenario[idx].unexpected)
if (!aScenario[idx].unexpected && !aScenario[idx].todo)
break;
}

Expand Down Expand Up @@ -1686,8 +1686,6 @@ function todo_invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
{
this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
aTargetFuncArg, true);

this.unexpected = true;
this.todo = true;
}

Expand Down
44 changes: 44 additions & 0 deletions accessible/tests/mochitest/events/test_coalescence.html
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,41 @@
};
}

/**
* Insert text nodes under direct and grand children, and then hide
* their container by means of aria-owns.
*
* Markup:
* <div id="t7_moveplace" aria-owns="t7_c"></div>
* <div id="t7_c">
* <div id="t7_c_directchild">ha</div>
* <div><div id="t7_c_grandchild">ha</div></div>
* </div>
*/
function test7()
{
this.eventSeq = [
new todo_invokerChecker(EVENT_HIDE, getNode('t7_c')),
new invokerChecker(EVENT_SHOW, getNode('t7_c')),
new invokerChecker(EVENT_REORDER, getNode('t7')),
new unexpectedInvokerChecker(EVENT_REORDER, getNode('t7_c_directchild')),
new unexpectedInvokerChecker(EVENT_REORDER, getNode('t7_c_grandchild')),
new unexpectedInvokerChecker(EVENT_SHOW, () => getNode('t7_c_directchild').firstChild),
new unexpectedInvokerChecker(EVENT_SHOW, () => getNode('t7_c_grandchild').firstChild)
];

this.invoke = function test7_invoke()
{
getNode('t7_c_directchild').textContent = 'ha';
getNode('t7_c_grandchild').textContent = 'ha';
getNode('t7_moveplace').setAttribute('aria-owns', 't7_c');
};

this.getID = function test7_getID() {
return "Show child accessibles and then hide their container";
};
}

////////////////////////////////////////////////////////////////////////////
// Do tests.

Expand Down Expand Up @@ -519,6 +554,7 @@
gQueue.push(new test4());
gQueue.push(new test5());
gQueue.push(new test6());
gQueue.push(new test7());

gQueue.invoke(); // Will call SimpleTest.finish();
}
Expand Down Expand Up @@ -612,5 +648,13 @@

<div id="t6">
</div>

<div id="t7">
<div id="t7_moveplace"></div>
<div id="t7_c">
<div><div id="t7_c_grandchild"></div></div>
<div id="t7_c_directchild"></div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@
const gBaseURL = "https://example.com/browser/browser/base/content/test/general/";

add_task(function *() {
let tab = gBrowser.addTab();
let browser = gBrowser.getBrowserForTab(tab);
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, gBaseURL + "subtst_contextmenu.html");

gBrowser.selectedTab = tab;
yield promiseTabLoadEvent(tab, gBaseURL + "subtst_contextmenu.html");

let popupShownPromise = promiseWaitForEvent(window, "popupshown", true);
let contextMenu = document.getElementById("contentAreaContextMenu");

// Get the point of the element with the page menu (test-pagemenu) and
// synthesize a right mouse click there.
let eventDetails = { type : "contextmenu", button : 2 };
let rect = browser.contentWindow.document.getElementById("test-pagemenu").getBoundingClientRect();
EventUtils.synthesizeMouse(browser, rect.x + rect.width / 2, rect.y + rect.height / 2, eventDetails, window);

let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouse("#test-pagemenu", 5, 5, { type : "contextmenu", button : 2 }, tab.linkedBrowser);
let event = yield popupShownPromise;

let contextMenu = document.getElementById("contentAreaContextMenu");
checkMenu(contextMenu);

let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
contextMenu.hidePopup();
gBrowser.removeCurrentTab();
yield popupHiddenPromise;

yield BrowserTestUtils.removeTab(tab);
});

function checkItems(menuitem, arr)
Expand Down
14 changes: 7 additions & 7 deletions devtools/shared/heapsnapshot/HeapSnapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "js/UbiNodeDominatorTree.h"
#include "js/UbiNodeShortestPaths.h"
#include "mozilla/Attributes.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/devtools/AutoMemMap.h"
#include "mozilla/devtools/CoreDump.pb.h"
#include "mozilla/devtools/DeserializedNode.h"
Expand Down Expand Up @@ -62,9 +62,9 @@ using JS::ubi::ShortestPaths;
MallocSizeOf
GetCurrentThreadDebuggerMallocSizeOf()
{
auto ccrt = CycleCollectedJSRuntime::Get();
MOZ_ASSERT(ccrt);
auto cx = ccrt->Context();
auto ccjscx = CycleCollectedJSContext::Get();
MOZ_ASSERT(ccjscx);
auto cx = ccjscx->Context();
MOZ_ASSERT(cx);
auto mallocSizeOf = JS::dbg::GetDebuggerMallocSizeOf(cx);
MOZ_ASSERT(mallocSizeOf);
Expand Down Expand Up @@ -555,9 +555,9 @@ HeapSnapshot::ComputeDominatorTree(ErrorResult& rv)
{
Maybe<JS::ubi::DominatorTree> maybeTree;
{
auto ccrt = CycleCollectedJSRuntime::Get();
MOZ_ASSERT(ccrt);
auto cx = ccrt->Context();
auto ccjscx = CycleCollectedJSContext::Get();
MOZ_ASSERT(ccjscx);
auto cx = ccjscx->Context();
MOZ_ASSERT(cx);
JS::AutoCheckCannotGC nogc(cx);
maybeTree = JS::ubi::DominatorTree::Create(cx, nogc, getRoot());
Expand Down
4 changes: 2 additions & 2 deletions devtools/shared/heapsnapshot/tests/gtest/DevTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "gmock/gmock.h"
#include "mozilla/devtools/HeapSnapshot.h"
#include "mozilla/dom/ChromeUtils.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/Move.h"
#include "js/Principals.h"
#include "js/UbiNode.h"
Expand Down Expand Up @@ -60,7 +60,7 @@ struct DevTools : public ::testing::Test {
}

JSContext* getContext() {
return CycleCollectedJSRuntime::Get()->Context();
return CycleCollectedJSContext::Get()->Context();
}

static void reportError(JSContext* cx, const char* message, JSErrorReport* report) {
Expand Down
4 changes: 2 additions & 2 deletions dom/animation/Animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1335,14 +1335,14 @@ Animation::GetRenderedDocument() const
void
Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
{
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();

if (aSyncNotifyFlag == SyncNotifyFlag::Sync) {
DoFinishNotificationImmediately();
} else if (!mFinishNotificationTask.IsPending()) {
RefPtr<nsRunnableMethod<Animation>> runnable =
NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
runtime->DispatchToMicroTask(do_AddRef(runnable));
context->DispatchToMicroTask(do_AddRef(runnable));
mFinishNotificationTask = runnable.forget();
}
}
Expand Down
2 changes: 1 addition & 1 deletion dom/asmjscache/AsmJSCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "jsfriendapi.h"
#include "mozilla/Assertions.h"
#include "mozilla/CondVar.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/dom/asmjscache/PAsmJSCacheEntryChild.h"
#include "mozilla/dom/asmjscache/PAsmJSCacheEntryParent.h"
#include "mozilla/dom/ContentChild.h"
Expand Down
6 changes: 3 additions & 3 deletions dom/base/ScriptSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/ThreadLocal.h"
#include "mozilla/Assertions.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/CycleCollectedJSContext.h"

#include "jsapi.h"
#include "xpcpublic.h"
Expand Down Expand Up @@ -289,14 +289,14 @@ namespace danger {
JSContext*
GetJSContext()
{
return CycleCollectedJSRuntime::Get()->Context();
return CycleCollectedJSContext::Get()->Context();
}
} // namespace danger

JS::RootingContext*
RootingCx()
{
return CycleCollectedJSRuntime::Get()->RootingCx();
return CycleCollectedJSContext::Get()->RootingCx();
}

AutoJSAPI::AutoJSAPI()
Expand Down
8 changes: 4 additions & 4 deletions dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5197,16 +5197,16 @@ nsContentUtils::AddScriptRunner(nsIRunnable* aRunnable) {
void
nsContentUtils::RunInStableState(already_AddRefed<nsIRunnable> aRunnable)
{
MOZ_ASSERT(CycleCollectedJSRuntime::Get(), "Must be on a script thread!");
CycleCollectedJSRuntime::Get()->RunInStableState(Move(aRunnable));
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
CycleCollectedJSContext::Get()->RunInStableState(Move(aRunnable));
}

/* static */
void
nsContentUtils::RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable)
{
MOZ_ASSERT(CycleCollectedJSRuntime::Get(), "Must be on a script thread!");
CycleCollectedJSRuntime::Get()->RunInMetastableState(Move(aRunnable));
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
CycleCollectedJSContext::Get()->RunInMetastableState(Move(aRunnable));
}

void
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsDOMClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1717,15 +1717,15 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
JS::MutableHandle<JS::PropertyDescriptor> desc)
{
if (id == XPCJSRuntime::Get()->GetStringID(XPCJSRuntime::IDX_COMPONENTS)) {
if (id == XPCJSContext::Get()->GetStringID(XPCJSContext::IDX_COMPONENTS)) {
return LookupComponentsShim(cx, obj, aWin->AsInner(), desc);
}

#ifdef USE_CONTROLLERS_SHIM
// Note: We use |obj| rather than |aWin| to get the principal here, because
// this is called during Window setup when the Document isn't necessarily
// hooked up yet.
if (id == XPCJSRuntime::Get()->GetStringID(XPCJSRuntime::IDX_CONTROLLERS) &&
if (id == XPCJSContext::Get()->GetStringID(XPCJSContext::IDX_CONTROLLERS) &&
!xpc::IsXrayWrapper(obj) &&
!nsContentUtils::IsSystemPrincipal(nsContentUtils::ObjectPrincipal(obj)))
{
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFrameMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsIDOMClassInfo.h"
#include "xpcpublic.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/IntentionalCrash.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
Expand Down
Loading

0 comments on commit be26e90

Please sign in to comment.