Skip to content

Commit

Permalink
Merge m-c to autoland, a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 8DYKNuMdzFd
  • Loading branch information
KWierso committed Jan 10, 2017
2 parents 8672342 + 4f9d590 commit 5b20fb2
Show file tree
Hide file tree
Showing 47 changed files with 13,753 additions and 13,336 deletions.
2 changes: 1 addition & 1 deletion accessible/html/HTMLListAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class HTMLLIAccessible : public HyperTextAccessibleWrap
virtual ~HTMLLIAccessible() { }

private:
RefPtr<HTMLListBulletAccessible> mBullet;
HTMLListBulletAccessible* mBullet;
};


Expand Down
2 changes: 1 addition & 1 deletion build/moz.configure/init.configure
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def mozconfig_options(mozconfig, automation, help):
log.error('%s directly or indirectly includes an in-tree '
'mozconfig.', mozconfig['path'])
log.error('In-tree mozconfigs make strong assumptions about '
'and are only meant to be used by Mozilla'
'and are only meant to be used by Mozilla '
'automation.')
die("Please don't use them.")
helper = __sandbox__._helper
Expand Down
9 changes: 5 additions & 4 deletions dom/base/nsFocusManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1900,14 +1900,15 @@ nsFocusManager::Focus(nsPIDOMWindowOuter* aWindow,

aWindow->SetFocusedNode(aContent, focusMethod);

// if the focused element changed, scroll it into view
if (aContent && aFocusChanged) {
ScrollIntoView(presShell, aContent, aFlags);
}

bool sendFocusEvent =
aContent && aContent->IsInComposedDoc() && !IsNonFocusableRoot(aContent);
nsPresContext* presContext = presShell->GetPresContext();
if (sendFocusEvent) {
// if the focused element changed, scroll it into view
if (aFocusChanged)
ScrollIntoView(presShell, aContent, aFlags);

NotifyFocusStateChange(aContent, aWindow->ShouldShowFocusRing(), true);

// if this is an object/plug-in/remote browser, focus its widget. Note that we might
Expand Down
1 change: 1 addition & 0 deletions dom/tests/mochitest/general/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ subsuite = clipboard
[test_domWindowUtils_scrollbarSize.html]
[test_domWindowUtils_scrollXY.html]
[test_donottrack.html]
[test_focus_scrollchildframe.html]
[test_focus_legend_noparent.html]
[test_focusrings.xul]
skip-if = toolkit == 'android' #TIMED_OUT
Expand Down
24 changes: 24 additions & 0 deletions dom/tests/mochitest/general/test_focus_scrollchildframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Tests for for-of loops</title>
<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 onload="doTest()">
<p id="display"></p>
<div id="content" style="display: none"></div>
<script>
function doTest() {
document.getElementById("button").focus();
is(window.scrollY, 0, "Scrolled position initially 0");
synthesizeKey("VK_TAB", { }),
ok(window.scrollY > 200, "Scrolled child frame into view");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
</script>
<button id="button">B</button><br><iframe style="margin-top:10000px;height:400px"></iframe>
</body>
</html>
Binary file added image/test/mochitest/blue.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions image/test/mochitest/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ support-files =
animationPolling.js
bad.jpg
big.png
blue.gif
blue.png
bug399925.gif
bug468160.sjs
Expand Down Expand Up @@ -80,6 +81,7 @@ support-files =
transparent.gif
transparent.png
over.png
webcam-simulacrum.sjs
6M-pixels.png
12M-pixels-1.png
12M-pixels-2.png
Expand Down Expand Up @@ -151,5 +153,6 @@ skip-if = os == 'android'
disabled = bug 1295501
[test_undisplayed_iframe.html]
skip-if = os == 'android'
[test_webcam.html]
[test_xultree_animation.xhtml]
skip-if = os == 'android'
68 changes: 68 additions & 0 deletions image/test/mochitest/test_webcam.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=641748
webcam-simulacrum.mgif is a hand-edited file containing red.gif and blue.gif,
concatenated together with the relevant headers for
multipart/x-mixed-replace. Specifically, with the headers in
webcam-simulacrum.mjpg^headers^, the web browser will get the following:
HTTP 200 OK
Content-Type: multipart/x-mixed-replace;boundary=BOUNDARYOMG
\-\-BOUNDARYOMG\r\n
Content-Type: image/gif\r\n
\r\n
<contents of red.gif> (no newline)
\-\-BOUNDARYOMG\r\n
Content-Type: image/gif\r\n
\r\n
<contents of blue.gif> (no newline)
\-\-BOUNDARYOMG\-\-\r\n
(The boundary is arbitrary, and just has to be defined as something that
won't be in the text of the contents themselves. \-\-$(boundary)\r\n means
"Here is the beginning of a boundary," and \-\-$(boundary)\-\- means "All done
sending you parts.")
-->
<head>
<title>Test for Bug 641748 - WebCam Simulacrum</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="imgutils.js"></script>
<script type="application/javascript" src="animationPolling.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=641748">
Mozilla Bug 641748: GIF decoder doesn't support multipart/x-mixed-replace
</a>
<p id="display"></p>

<div id="content">
<div id="referenceDiv" style="height: 100px; width: 100px;
display: none; background: #0018ff;"></div>
<div id="animatedImage">
<img id="animatedGif" src="webcam-simulacrum.sjs" style="display: none; height: 100px; width: 100px;">
<div id="text-descr"></div>
</div>
<div id="debug" style="display:none">
</div>
</div>
<pre id="test">
<script type="text/javascript;version=1.8">
const FAILURE_TIMEOUT = 60000; // Fail early after 60 seconds

function main()
{
var animTest = new AnimationTest(20, FAILURE_TIMEOUT, 'referenceDiv',
'animatedGif', 'debug');
animTest.beginTest();
}

window.onload = main;
</script>
</pre>
</body>
</html>
51 changes: 51 additions & 0 deletions image/test/mochitest/webcam-simulacrum.sjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/

var counter = 2;
var frames = ['red.gif', 'blue.gif'];
var timer = Components.classes["@mozilla.org/timer;1"];
var partTimer = timer.createInstance(Components.interfaces.nsITimer);

function getFileAsInputStream(aFilename) {
var file = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("CurWorkD", Components.interfaces.nsIFile);

file.append("tests");
file.append("image");
file.append("test");
file.append("mochitest");
file.append(aFilename);

var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1']
.createInstance(Components.interfaces.nsIFileInputStream);
fileStream.init(file, 1, 0, false);
return fileStream;
}

function handleRequest(request, response)
{
response.setHeader("Content-Type",
"multipart/x-mixed-replace;boundary=BOUNDARYOMG", false);
response.setHeader("Cache-Control", "no-cache", false);
response.setStatusLine(request.httpVersion, 200, "OK");
response.processAsync();
response.write("--BOUNDARYOMG\r\n");
while (frames.length > 0) {
sendNextPart(response);
}
response.write("--BOUNDARYOMG--\r\n");
response.finish();
}

function sendNextPart(response) {
var nextPartHead = "Content-Type: image/gif\r\n\r\n";
var inputStream = getFileAsInputStream(frames.shift());
response.bodyOutputStream.write(nextPartHead, nextPartHead.length);
response.bodyOutputStream.writeFrom(inputStream, inputStream.available());
inputStream.close();
// Toss in the boundary, so the browser can know this part is complete
response.write("--BOUNDARYOMG\r\n");
}

24 changes: 0 additions & 24 deletions image/test/reftest/gif/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,3 @@ skip == test_bug641198.html animation2a-finalframe.gif # Disabled; see bug 1120

# Bug 1234077
== truncated-framerect.html truncated-framerect-ref.html

# webcam-simulacrum.mgif is a hand-edited file containing red.gif and blue.gif,
# concatenated together with the relevant headers for
# multipart/x-mixed-replace. Specifically, with the headers in
# webcam-simulacrum.mjpg^headers^, the web browser will get the following:
#
# HTTP 200 OK
# Content-Type: multipart/x-mixed-replace;boundary=BOUNDARYOMG
#
# --BOUNDARYOMG\r\n
# Content-Type: image/gif\r\n
# \r\n
# <contents of red.gif> (no newline)
# --BOUNDARYOMG\r\n
# Content-Type: image/gif\r\n
# \r\n
# <contents of blue.gif> (no newline)
# --BOUNDARYOMG--\r\n
#
# (The boundary is arbitrary, and just has to be defined as something that
# won't be in the text of the contents themselves. --$(boundary)\r\n means
# "Here is the beginning of a boundary," and --$(boundary)-- means "All done
# sending you parts.")
HTTP == webcam.html blue.gif
Binary file removed image/test/reftest/gif/webcam-simulacrum.mgif
Binary file not shown.
3 changes: 0 additions & 3 deletions image/test/reftest/gif/webcam-simulacrum.mgif^headers^

This file was deleted.

5 changes: 0 additions & 5 deletions image/test/reftest/gif/webcam.html

This file was deleted.

4 changes: 2 additions & 2 deletions js/public/GCAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing)
if (thing.mayBeOwnedByOtherRuntime())
return;

JS::shadow::Runtime* rt = detail::GetGCThingRuntime(thing.unsafeAsUIntPtr());
JS::shadow::Runtime* rt = detail::GetCellRuntime(thing.asCell());
MOZ_DIAGNOSTIC_ASSERT(rt->allowGCBarriers());

if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing))
JS::IncrementalReferenceBarrier(thing);
else if (JS::GCThingIsMarkedGray(thing))
else if (!thing.mayBeOwnedByOtherRuntime() && js::gc::detail::CellIsMarkedGray(thing.asCell()))
JS::UnmarkGrayGCThingRecursively(thing);
}

Expand Down
33 changes: 21 additions & 12 deletions js/public/HeapAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,6 @@ GetGCThingMarkBitmap(const uintptr_t addr)
return reinterpret_cast<uintptr_t*>(bmap_addr);
}

static MOZ_ALWAYS_INLINE JS::shadow::Runtime*
GetGCThingRuntime(const uintptr_t addr)
{
MOZ_ASSERT(addr);
const uintptr_t rt_addr = (addr & ~ChunkMask) | ChunkRuntimeOffset;
return *reinterpret_cast<JS::shadow::Runtime**>(rt_addr);
}

static MOZ_ALWAYS_INLINE void
GetGCThingMarkWordAndMask(const uintptr_t addr, uint32_t color,
uintptr_t** wordp, uintptr_t* maskp)
Expand All @@ -310,16 +302,35 @@ GetGCThingZone(const uintptr_t addr)

}

static MOZ_ALWAYS_INLINE JS::shadow::Runtime*
GetCellRuntime(const Cell* cell)
{
MOZ_ASSERT(cell);
const uintptr_t addr = uintptr_t(cell);
const uintptr_t rt_addr = (addr & ~ChunkMask) | ChunkRuntimeOffset;
return *reinterpret_cast<JS::shadow::Runtime**>(rt_addr);
}

static MOZ_ALWAYS_INLINE bool
CellIsMarkedGray(const Cell* cell)
{
MOZ_ASSERT(cell);
MOZ_ASSERT(!js::gc::IsInsideNursery(cell));
if (js::gc::IsInsideNursery(cell))
return false;

uintptr_t* word, mask;
js::gc::detail::GetGCThingMarkWordAndMask(uintptr_t(cell), js::gc::GRAY, &word, &mask);
return *word & mask;
}

static MOZ_ALWAYS_INLINE bool
CellIsMarkedGrayIfKnown(const Cell* cell)
{
MOZ_ASSERT(cell);
auto rt = js::gc::detail::GetCellRuntime(cell);
return rt->areGCGrayBitsValid() && CellIsMarkedGray(cell);
}

} /* namespace detail */

MOZ_ALWAYS_INLINE bool
Expand Down Expand Up @@ -359,11 +370,9 @@ GetObjectZone(JSObject* obj);
static MOZ_ALWAYS_INLINE bool
GCThingIsMarkedGray(GCCellPtr thing)
{
if (js::gc::IsInsideNursery(thing.asCell()))
return false;
if (thing.mayBeOwnedByOtherRuntime())
return false;
return js::gc::detail::CellIsMarkedGray(thing.asCell());
return js::gc::detail::CellIsMarkedGrayIfKnown(thing.asCell());
}

extern JS_PUBLIC_API(JS::TraceKind)
Expand Down
13 changes: 4 additions & 9 deletions js/public/RootingAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,8 @@ ObjectIsTenured(const Heap<JSObject*>& obj)
static MOZ_ALWAYS_INLINE bool
ObjectIsMarkedGray(JSObject* obj)
{
/*
* GC things residing in the nursery cannot be gray: they have no mark bits.
* All live objects in the nursery are moved to tenured at the beginning of
* each GC slice, so the gray marker never sees nursery things.
*/
if (js::gc::IsInsideNursery(reinterpret_cast<js::gc::Cell*>(obj)))
return false;
return js::gc::detail::CellIsMarkedGray(reinterpret_cast<js::gc::Cell*>(obj));
auto cell = reinterpret_cast<js::gc::Cell*>(obj);
return js::gc::detail::CellIsMarkedGrayIfKnown(cell);
}

static MOZ_ALWAYS_INLINE bool
Expand All @@ -328,7 +322,8 @@ ObjectIsMarkedGray(const JS::Heap<JSObject*>& obj)
static MOZ_ALWAYS_INLINE bool
ScriptIsMarkedGray(JSScript* script)
{
return js::gc::detail::CellIsMarkedGray(reinterpret_cast<js::gc::Cell*>(script));
auto cell = reinterpret_cast<js::gc::Cell*>(script);
return js::gc::detail::CellIsMarkedGrayIfKnown(cell);
}

static MOZ_ALWAYS_INLINE bool
Expand Down
26 changes: 26 additions & 0 deletions js/public/TrackedOptimizationInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ namespace JS {
\
_(InlineCache_OptimizedStub) \
\
_(NewArray_TemplateObject) \
_(NewArray_SharedCache) \
_(NewArray_Call) \
\
_(NewObject_TemplateObject) \
_(NewObject_SharedCache) \
_(NewObject_Call) \
\
_(Compare_SpecializedTypes) \
_(Compare_Bitwise) \
_(Compare_SpecializedOnBaselineTypes) \
_(Compare_SharedCache) \
_(Compare_Call) \
\
_(Call_Inline)


Expand Down Expand Up @@ -120,6 +134,18 @@ namespace JS {
_(UnknownSimdProperty) \
_(NotModuleNamespace) \
_(UnknownProperty) \
_(NoTemplateObject) \
_(TemplateObjectIsUnboxedWithoutInlineElements) \
_(TemplateObjectIsPlainObjectWithDynamicSlots) \
_(LengthTooBig) \
_(SpeculationOnInputTypesFailed) \
_(RelationalCompare) \
_(OperandTypeNotBitwiseComparable) \
_(OperandMaybeEmulatesUndefined) \
_(LoosyUndefinedNullCompare) \
_(LoosyInt32BooleanCompare) \
_(CallsValueOf) \
_(StrictCompare) \
\
_(ICOptStub_GenericSuccess) \
\
Expand Down
Loading

0 comments on commit 5b20fb2

Please sign in to comment.