mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Merge inbound to m-c a=merge
This commit is contained in:
commit
9749648a79
@ -707,6 +707,7 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
|
||||
{}, {recipient});
|
||||
},
|
||||
|
||||
// Used to executeScript, insertCSS and removeCSS.
|
||||
_execute: function(tabId, details, kind, method) {
|
||||
let tab = tabId !== null ? TabManager.getTab(tabId) : TabManager.activeTab;
|
||||
let mm = tab.linkedBrowser.messageManager;
|
||||
@ -714,6 +715,7 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
|
||||
let options = {
|
||||
js: [],
|
||||
css: [],
|
||||
remove_css: method == "removeCSS",
|
||||
};
|
||||
|
||||
// We require a `code` or a `file` property, but we can't accept both.
|
||||
@ -773,6 +775,10 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
|
||||
return self.tabs._execute(tabId, details, "css", "insertCSS");
|
||||
},
|
||||
|
||||
removeCSS: function(tabId, details) {
|
||||
return self.tabs._execute(tabId, details, "css", "removeCSS");
|
||||
},
|
||||
|
||||
connect: function(tabId, connectInfo) {
|
||||
let tab = TabManager.getTab(tabId);
|
||||
let mm = tab.linkedBrowser.messageManager;
|
||||
|
@ -866,6 +866,33 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "removeCSS",
|
||||
"type": "function",
|
||||
"description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
|
||||
"async": "callback",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "tabId",
|
||||
"minimum": 0,
|
||||
"optional": true,
|
||||
"description": "The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window."
|
||||
},
|
||||
{
|
||||
"$ref": "extensionTypes.InjectDetails",
|
||||
"name": "details",
|
||||
"description": "Details of the CSS text to remove."
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"name": "callback",
|
||||
"optional": true,
|
||||
"description": "Called when all the CSS has been removed.",
|
||||
"parameters": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setZoom",
|
||||
"type": "function",
|
||||
|
@ -53,6 +53,7 @@ support-files =
|
||||
[browser_ext_tabs_executeScript_runAt.js]
|
||||
[browser_ext_tabs_getCurrent.js]
|
||||
[browser_ext_tabs_insertCSS.js]
|
||||
[browser_ext_tabs_removeCSS.js]
|
||||
[browser_ext_tabs_move.js]
|
||||
[browser_ext_tabs_move_window.js]
|
||||
[browser_ext_tabs_move_window_multiple.js]
|
||||
|
@ -0,0 +1,103 @@
|
||||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
"use strict";
|
||||
|
||||
add_task(function* testExecuteScript() {
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://mochi.test:8888/", true);
|
||||
|
||||
function background() {
|
||||
let promises = [
|
||||
// Insert CSS file.
|
||||
{
|
||||
background: "transparent",
|
||||
foreground: "rgb(0, 113, 4)",
|
||||
promise: () => {
|
||||
return browser.tabs.insertCSS({
|
||||
file: "file2.css",
|
||||
});
|
||||
},
|
||||
},
|
||||
// Insert CSS code.
|
||||
{
|
||||
background: "rgb(42, 42, 42)",
|
||||
foreground: "rgb(0, 113, 4)",
|
||||
promise: () => {
|
||||
return browser.tabs.insertCSS({
|
||||
code: "* { background: rgb(42, 42, 42) }",
|
||||
});
|
||||
},
|
||||
},
|
||||
// Remove CSS code again.
|
||||
{
|
||||
background: "transparent",
|
||||
foreground: "rgb(0, 113, 4)",
|
||||
promise: () => {
|
||||
return browser.tabs.removeCSS({
|
||||
code: "* { background: rgb(42, 42, 42) }",
|
||||
});
|
||||
},
|
||||
},
|
||||
// Remove CSS file again.
|
||||
{
|
||||
background: "transparent",
|
||||
foreground: "rgb(0, 0, 0)",
|
||||
promise: () => {
|
||||
return browser.tabs.removeCSS({
|
||||
file: "file2.css",
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
function checkCSS() {
|
||||
let computedStyle = window.getComputedStyle(document.body);
|
||||
return [computedStyle.backgroundColor, computedStyle.color];
|
||||
}
|
||||
|
||||
function next() {
|
||||
if (!promises.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
let {promise, background, foreground} = promises.shift();
|
||||
return promise().then(result => {
|
||||
browser.test.assertEq(undefined, result, "Expected callback result");
|
||||
|
||||
return browser.tabs.executeScript({
|
||||
code: `(${checkCSS})()`,
|
||||
});
|
||||
}).then(result => {
|
||||
browser.test.assertEq(background, result[0], "Expected background color");
|
||||
browser.test.assertEq(foreground, result[1], "Expected foreground color");
|
||||
return next();
|
||||
});
|
||||
}
|
||||
|
||||
next().then(() => {
|
||||
browser.test.notifyPass("removeCSS");
|
||||
}).catch(e => {
|
||||
browser.test.fail(`Error: ${e} :: ${e.stack}`);
|
||||
browser.test.notifyFailure("removeCSS");
|
||||
});
|
||||
}
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"permissions": ["http://mochi.test/"],
|
||||
},
|
||||
|
||||
background,
|
||||
|
||||
files: {
|
||||
"file2.css": "* { color: rgb(0, 113, 4) }",
|
||||
},
|
||||
});
|
||||
|
||||
yield extension.startup();
|
||||
|
||||
yield extension.awaitFinish("removeCSS");
|
||||
|
||||
yield extension.unload();
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
});
|
@ -159,7 +159,6 @@ def old_configure_options(*options):
|
||||
'--enable-address-sanitizer',
|
||||
'--enable-alsa',
|
||||
'--enable-android-omx',
|
||||
'--enable-android-resource-constrained',
|
||||
'--enable-approximate-location',
|
||||
'--enable-b2g-bt',
|
||||
'--enable-b2g-camera',
|
||||
|
8
config/external/nss/Makefile.in
vendored
8
config/external/nss/Makefile.in
vendored
@ -245,7 +245,7 @@ ifdef MOZ_NO_WLZDEFS
|
||||
DEFAULT_GMAKE_FLAGS += ZDEFS_FLAG=
|
||||
endif
|
||||
ifdef MOZ_CFLAGS_NSS
|
||||
XCFLAGS += $(filter-out -W%,$(CFLAGS))
|
||||
NSS_XCFLAGS += $(filter-out -W%,$(CFLAGS))
|
||||
DEFAULT_GMAKE_FLAGS += DARWIN_DYLIB_VERSIONS='-compatibility_version 1 -current_version 1 $(LDFLAGS)'
|
||||
endif
|
||||
ifeq (1_1,$(CLANG_CL)_$(MOZ_ASAN))
|
||||
@ -268,18 +268,18 @@ DEFAULT_GMAKE_FLAGS += MAKE_OBJDIR='$$(INSTALL) -D $$(OBJDIR)'
|
||||
DEFAULT_GMAKE_FLAGS += TARGETS='$$(LIBRARY) $$(SHARED_LIBRARY) $$(PROGRAM)'
|
||||
|
||||
ifdef MOZ_FOLD_LIBS_FLAGS
|
||||
XCFLAGS += $(MOZ_FOLD_LIBS_FLAGS)
|
||||
NSS_XCFLAGS += $(MOZ_FOLD_LIBS_FLAGS)
|
||||
endif
|
||||
|
||||
# Pass on the MSVC target arch from the main build system.
|
||||
# Note this is case- and switch-character sensitive, while
|
||||
# the MSVC option is not.
|
||||
ifeq (WINNT,$(OS_TARGET))
|
||||
XCFLAGS += $(filter -arch:%,$(CFLAGS))
|
||||
NSS_XCFLAGS += $(filter -arch:%,$(CFLAGS))
|
||||
endif
|
||||
|
||||
# Export accumulated XCFLAGS to modify nss defaults.
|
||||
DEFAULT_GMAKE_FLAGS += XCFLAGS='$(XCFLAGS)'
|
||||
DEFAULT_GMAKE_FLAGS += XCFLAGS='$(NSS_XCFLAGS)'
|
||||
|
||||
NSS_SRCDIR = $(topsrcdir)
|
||||
|
||||
|
@ -6,6 +6,7 @@ support-files =
|
||||
head.js
|
||||
html_content-type-test-page.html
|
||||
html_content-type-without-cache-test-page.html
|
||||
html_cors-test-page.html
|
||||
html_custom-get-page.html
|
||||
html_single-get-page.html
|
||||
html_cyrillic-test-page.html
|
||||
@ -73,6 +74,7 @@ subsuite = clipboard
|
||||
[browser_net_copy_as_curl.js]
|
||||
subsuite = clipboard
|
||||
skip-if = e10s # Bug 1091596
|
||||
[browser_net_cors_requests.js]
|
||||
[browser_net_cyrillic-01.js]
|
||||
[browser_net_cyrillic-02.js]
|
||||
[browser_net_details-no-duplicated-content.js]
|
||||
|
29
devtools/client/netmonitor/test/browser_net_cors_requests.js
Normal file
29
devtools/client/netmonitor/test/browser_net_cors_requests.js
Normal file
@ -0,0 +1,29 @@
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test that CORS preflight requests are displayed by network monitor
|
||||
*/
|
||||
|
||||
add_task(function* () {
|
||||
let [, debuggee, monitor] = yield initNetMonitor(CORS_URL);
|
||||
let { RequestsMenu } = monitor.panelWin.NetMonitorView;
|
||||
RequestsMenu.lazyUpdate = false;
|
||||
|
||||
info("Performing a CORS request");
|
||||
let url = "http://test1.example.com" + CORS_SJS_PATH;
|
||||
debuggee.performRequests(url, "triggering/preflight", "post-data");
|
||||
|
||||
info("Waiting until the requests appear in netmonitor");
|
||||
yield waitForNetworkEvents(monitor, 1, 1);
|
||||
|
||||
info("Checking the preflight and flight methods");
|
||||
["OPTIONS", "POST"].forEach((method, i) => {
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(i), method, url);
|
||||
});
|
||||
|
||||
yield teardown(monitor);
|
||||
finish();
|
||||
});
|
@ -42,6 +42,7 @@ const STATISTICS_URL = EXAMPLE_URL + "html_statistics-test-page.html";
|
||||
const CURL_URL = EXAMPLE_URL + "html_copy-as-curl.html";
|
||||
const CURL_UTILS_URL = EXAMPLE_URL + "html_curl-utils.html";
|
||||
const SEND_BEACON_URL = EXAMPLE_URL + "html_send-beacon.html";
|
||||
const CORS_URL = EXAMPLE_URL + "html_cors-test-page.html";
|
||||
|
||||
const SIMPLE_SJS = EXAMPLE_URL + "sjs_simple-test-server.sjs";
|
||||
const CONTENT_TYPE_SJS = EXAMPLE_URL + "sjs_content-type-test-server.sjs";
|
||||
|
31
devtools/client/netmonitor/test/html_cors-test-page.html
Normal file
31
devtools/client/netmonitor/test/html_cors-test-page.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<title>Network Monitor test page</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>POST with CORS test page</p>
|
||||
|
||||
<script type="text/javascript">
|
||||
function post(url, contentType, postData) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.setRequestHeader("Content-Type", contentType);
|
||||
xhr.send(postData);
|
||||
}
|
||||
|
||||
function performRequests(url, contentType, postData) {
|
||||
post(url, contentType, postData);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -9,6 +9,7 @@ function handleRequest(request, response) {
|
||||
response.setHeader("Expires", "0");
|
||||
|
||||
response.setHeader("Access-Control-Allow-Origin", "*", false);
|
||||
response.setHeader("Access-Control-Allow-Headers", "content-type", false);
|
||||
|
||||
response.setHeader("Content-Type", "text/plain; charset=utf-8", false);
|
||||
|
||||
|
@ -5596,7 +5596,7 @@ nsDocShell::InitWindow(nativeWindow aParentNativeWindow,
|
||||
int32_t aWidth, int32_t aHeight)
|
||||
{
|
||||
SetParentWidget(aParentWidget);
|
||||
SetPositionAndSize(aX, aY, aWidth, aHeight, false);
|
||||
SetPositionAndSize(aX, aY, aWidth, aHeight, 0);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -5842,7 +5842,8 @@ nsDocShell::SetSize(int32_t aWidth, int32_t aHeight, bool aRepaint)
|
||||
{
|
||||
int32_t x = 0, y = 0;
|
||||
GetPosition(&x, &y);
|
||||
return SetPositionAndSize(x, y, aWidth, aHeight, aRepaint);
|
||||
return SetPositionAndSize(x, y, aWidth, aHeight,
|
||||
aRepaint ? nsIBaseWindow::eRepaint : 0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -5853,7 +5854,7 @@ nsDocShell::GetSize(int32_t* aWidth, int32_t* aHeight)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetPositionAndSize(int32_t aX, int32_t aY, int32_t aWidth,
|
||||
int32_t aHeight, bool aFRepaint)
|
||||
int32_t aHeight, uint32_t aFlags)
|
||||
{
|
||||
mBounds.x = aX;
|
||||
mBounds.y = aY;
|
||||
@ -5863,8 +5864,11 @@ nsDocShell::SetPositionAndSize(int32_t aX, int32_t aY, int32_t aWidth,
|
||||
// Hold strong ref, since SetBounds can make us null out mContentViewer
|
||||
nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
|
||||
if (viewer) {
|
||||
uint32_t cvflags = (aFlags & nsIBaseWindow::eDelayResize) ?
|
||||
nsIContentViewer::eDelayResize : 0;
|
||||
// XXX Border figured in here or is that handled elsewhere?
|
||||
NS_ENSURE_SUCCESS(viewer->SetBounds(mBounds), NS_ERROR_FAILURE);
|
||||
nsresult rv = viewer->SetBoundsWithFlags(mBounds, cvflags);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -5878,7 +5882,7 @@ nsDocShell::GetPositionAndSize(int32_t* aX, int32_t* aY, int32_t* aWidth,
|
||||
// ensure size is up-to-date if window has changed resolution
|
||||
LayoutDeviceIntRect r;
|
||||
mParentWidget->GetClientBounds(r);
|
||||
SetPositionAndSize(mBounds.x, mBounds.y, r.width, r.height, false);
|
||||
SetPositionAndSize(mBounds.x, mBounds.y, r.width, r.height, 0);
|
||||
}
|
||||
|
||||
// We should really consider just getting this information from
|
||||
|
@ -104,6 +104,12 @@ interface nsIContentViewer : nsISupports
|
||||
|
||||
[noscript] void getBounds(in nsIntRectRef aBounds);
|
||||
[noscript] void setBounds([const] in nsIntRectRef aBounds);
|
||||
/**
|
||||
* The 'aFlags' argument to setBoundsWithFlags is a set of these bits.
|
||||
*/
|
||||
const unsigned long eDelayResize = 1;
|
||||
[noscript] void setBoundsWithFlags([const] in nsIntRectRef aBounds,
|
||||
in unsigned long aFlags);
|
||||
|
||||
/**
|
||||
* The previous content viewer, which has been |close|d but not
|
||||
|
@ -2338,7 +2338,8 @@ nsFrameLoader::UpdateBaseWindowPositionAndSize(nsSubDocumentFrame *aIFrame)
|
||||
|
||||
ScreenIntSize size = aIFrame->GetSubdocumentSize();
|
||||
|
||||
baseWindow->SetPositionAndSize(x, y, size.width, size.height, false);
|
||||
baseWindow->SetPositionAndSize(x, y, size.width, size.height,
|
||||
nsIBaseWindow::eDelayResize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2383,13 +2383,6 @@ mozilla::dom::StartupJSEnvironment()
|
||||
sExpensiveCollectorPokes = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ReportAllJSExceptionsPrefChangedCallback(const char* aPrefName, void* aClosure)
|
||||
{
|
||||
bool reportAll = Preferences::GetBool(aPrefName, false);
|
||||
nsContentUtils::XPConnect()->SetReportAllJSExceptions(reportAll);
|
||||
}
|
||||
|
||||
static void
|
||||
SetMemoryHighWaterMarkPrefChangedCallback(const char* aPrefName, void* aClosure)
|
||||
{
|
||||
@ -2543,9 +2536,6 @@ nsJSContext::EnsureStatics()
|
||||
JS::SetAsmJSCacheOps(sRuntime, &asmJSCacheOps);
|
||||
|
||||
// Set these global xpconnect options...
|
||||
Preferences::RegisterCallbackAndCall(ReportAllJSExceptionsPrefChangedCallback,
|
||||
"dom.report_all_js_exceptions");
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryHighWaterMarkPrefChangedCallback,
|
||||
"javascript.options.mem.high_water_mark");
|
||||
|
||||
|
@ -425,7 +425,6 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
// attributes and children).
|
||||
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
AutoJSContext cx;
|
||||
nsresult rv;
|
||||
|
||||
nsNodeInfoManager *nodeInfoManager = aNewNodeInfoManager;
|
||||
@ -564,6 +563,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
}
|
||||
|
||||
if (aReparentScope) {
|
||||
AutoJSContext cx;
|
||||
JS::Rooted<JSObject*> wrapper(cx);
|
||||
if ((wrapper = aNode->GetWrapper())) {
|
||||
MOZ_ASSERT(IsDOMObject(wrapper));
|
||||
|
@ -112,8 +112,6 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
|
||||
switch (ext) {
|
||||
// In alphabetical order
|
||||
// EXT_
|
||||
case WebGLExtensionID::EXT_color_buffer_half_float:
|
||||
return WebGLExtensionColorBufferHalfFloat::IsSupported(this);
|
||||
case WebGLExtensionID::EXT_texture_filter_anisotropic:
|
||||
return gl->IsExtensionSupported(gl::GLContext::EXT_texture_filter_anisotropic);
|
||||
|
||||
@ -122,8 +120,6 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
|
||||
return gl->IsSupported(gl::GLFeature::texture_float_linear);
|
||||
|
||||
// WEBGL_
|
||||
case WebGLExtensionID::WEBGL_color_buffer_float:
|
||||
return WebGLExtensionColorBufferFloat::IsSupported(this);
|
||||
case WebGLExtensionID::WEBGL_compressed_texture_atc:
|
||||
return gl->IsExtensionSupported(gl::GLContext::AMD_compressed_ATC_texture);
|
||||
case WebGLExtensionID::WEBGL_compressed_texture_etc1:
|
||||
@ -171,6 +167,8 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
|
||||
// EXT_
|
||||
case WebGLExtensionID::EXT_blend_minmax:
|
||||
return WebGLExtensionBlendMinMax::IsSupported(this);
|
||||
case WebGLExtensionID::EXT_color_buffer_half_float:
|
||||
return WebGLExtensionColorBufferHalfFloat::IsSupported(this);
|
||||
case WebGLExtensionID::EXT_frag_depth:
|
||||
return WebGLExtensionFragDepth::IsSupported(this);
|
||||
case WebGLExtensionID::EXT_shader_texture_lod:
|
||||
@ -194,6 +192,8 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
|
||||
return true;
|
||||
|
||||
// WEBGL_
|
||||
case WebGLExtensionID::WEBGL_color_buffer_float:
|
||||
return WebGLExtensionColorBufferFloat::IsSupported(this);
|
||||
case WebGLExtensionID::WEBGL_depth_texture:
|
||||
// WEBGL_depth_texture supports DEPTH_STENCIL textures
|
||||
if (!gl->IsSupported(gl::GLFeature::packed_depth_stencil))
|
||||
|
@ -1,21 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
function EnsureExt(name, shouldBe = true) {
|
||||
var c = document.createElement('canvas');
|
||||
var gl = c.getContext('experimental-webgl');
|
||||
function EnsureExt(extName, shouldHave=true) {
|
||||
EnsureExtFor('webgl', extName, shouldHave);
|
||||
EnsureExtFor('webgl2', extName, shouldHave);
|
||||
}
|
||||
|
||||
if (shouldBe) {
|
||||
ok(gl.getExtension(name), 'Should have extension ' + name + '.');
|
||||
function EnsureExtFor(contextType, extName, shouldHave=true) {
|
||||
var c = document.createElement('canvas');
|
||||
var gl = c.getContext(contextType);
|
||||
|
||||
if (!gl) {
|
||||
todo(false, 'Failed to create context: ' + contextType);
|
||||
return;
|
||||
}
|
||||
|
||||
var ext = gl.getExtension(extName);
|
||||
var haveText = ' have ' + contextType + ' extension ' + extName + '.';
|
||||
if (shouldHave) {
|
||||
ok(ext, 'Should' + haveText);
|
||||
} else {
|
||||
ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
|
||||
ok(!ext, 'Should not' + haveText);
|
||||
}
|
||||
}
|
||||
|
||||
function EnsureDraftExt(name, shouldBe = true) {
|
||||
function Lastly_WithDraftExtsEnabled(func) {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var fnEnsure = function() {
|
||||
EnsureExt(name, shouldBe);
|
||||
func();
|
||||
SimpleTest.finish();
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('ANGLE_instanced_arrays');
|
||||
EnsureExtFor('webgl', 'ANGLE_instanced_arrays');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_blend_minmax');
|
||||
EnsureExtFor('webgl', 'EXT_blend_minmax');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_color_buffer_half_float');
|
||||
EnsureExtFor('webgl', 'EXT_color_buffer_half_float');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,9 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureDraftExt('EXT_disjoint_timer_query');
|
||||
Lastly_WithDraftExtsEnabled(function() {
|
||||
EnsureExt('EXT_disjoint_timer_query');
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_frag_depth');
|
||||
EnsureExtFor('webgl', 'EXT_frag_depth');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_sRGB');
|
||||
EnsureExtFor('webgl', 'EXT_sRGB');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('EXT_shader_texture_lod');
|
||||
EnsureExtFor('webgl', 'EXT_shader_texture_lod');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('OES_standard_derivatives');
|
||||
EnsureExtFor('webgl', 'OES_standard_derivatives');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_color_buffer_float');
|
||||
EnsureExtFor('webgl', 'WEBGL_color_buffer_float');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,9 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureDraftExt('WEBGL_compressed_texture_es3');
|
||||
Lastly_WithDraftExtsEnabled(function() {
|
||||
EnsureExt('WEBGL_compressed_texture_es3');
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_depth_texture');
|
||||
EnsureExtFor('webgl', 'WEBGL_depth_texture');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
EnsureExt('WEBGL_draw_buffers');
|
||||
EnsureExtFor('webgl', 'WEBGL_draw_buffers');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -4,71 +4,106 @@
|
||||
<meta charset='utf-8'/>
|
||||
<script src='/tests/SimpleTest/SimpleTest.js'></script>
|
||||
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
|
||||
<script src='ensure-ext.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
|
||||
var c = document.createElement('canvas');
|
||||
var gl = c.getContext('experimental-webgl');
|
||||
var ENSURE = 'ENSURE'; // Works on all test machines.
|
||||
var FORBID = 'FORBID'; // Should not work on any test machine.
|
||||
var MACHINE_SPECIFIC = 'MACHINE_SPECIFIC';
|
||||
|
||||
function ensureExt(name) {
|
||||
ok(gl.getExtension(name), 'Should have extension ' + name + '.');
|
||||
var defaultExts = [
|
||||
// Ratified
|
||||
['ANGLE_instanced_arrays' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['EXT_blend_minmax' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['EXT_frag_depth' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['EXT_shader_texture_lod' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['EXT_texture_filter_anisotropic', [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
['OES_element_index_uint' , [ENSURE , FORBID ]],
|
||||
['OES_standard_derivatives' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['OES_texture_float' , [ENSURE , FORBID ]],
|
||||
['OES_texture_float_linear' , [ENSURE , ENSURE ]],
|
||||
['OES_texture_half_float' , [ENSURE , FORBID ]],
|
||||
['OES_texture_half_float_linear' , [ENSURE , FORBID ]],
|
||||
['OES_vertex_array_object' , [ENSURE , FORBID ]],
|
||||
['WEBGL_compressed_texture_s3tc' , [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
// ['WEBGL_debug_renderer_info' , [FORBID , FORBID ]], // Complicated!
|
||||
['WEBGL_debug_shaders' , [FORBID , FORBID ]],
|
||||
['WEBGL_depth_texture' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['WEBGL_draw_buffers' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['WEBGL_lose_context' , [ENSURE , ENSURE ]],
|
||||
|
||||
// Community Approved
|
||||
['EXT_color_buffer_float' , [FORBID , ENSURE ]],
|
||||
['EXT_color_buffer_half_float' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['EXT_sRGB' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['WEBGL_color_buffer_float' , [MACHINE_SPECIFIC, FORBID ]],
|
||||
['WEBGL_compressed_texture_atc' , [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
['WEBGL_compressed_texture_etc1' , [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
['WEBGL_compressed_texture_pvrtc', [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
];
|
||||
|
||||
var draftExts = [
|
||||
['EXT_disjoint_timer_query' , [MACHINE_SPECIFIC, MACHINE_SPECIFIC]], // TODO: Actually Community Approved now.
|
||||
['WEBGL_compressed_texture_es3', [MACHINE_SPECIFIC, MACHINE_SPECIFIC]],
|
||||
];
|
||||
|
||||
var nonImplementedExts = [
|
||||
'OES_fbo_render_mipmap',
|
||||
'WEBGL_compressed_texture_astc',
|
||||
'WEBGL_security_sensitive_resources',
|
||||
'WEBGL_shared_resources',
|
||||
];
|
||||
|
||||
////////////////////
|
||||
|
||||
function TestExtFor(contextType, extName, status) {
|
||||
switch (status) {
|
||||
case ENSURE:
|
||||
EnsureExtFor(contextType, extName);
|
||||
break;
|
||||
|
||||
case FORBID:
|
||||
EnsureExtFor(contextType, extName, false);
|
||||
break;
|
||||
|
||||
case MACHINE_SPECIFIC:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function ensureNoExt(name) {
|
||||
ok(!gl.getExtension(name), 'Should not have extension ' + name + '.');
|
||||
function TestExt(extName, statusArr) {
|
||||
TestExtFor('webgl', extName, statusArr[0]);
|
||||
TestExtFor('webgl2', extName, statusArr[1]);
|
||||
}
|
||||
|
||||
do {
|
||||
if (!gl)
|
||||
break;
|
||||
////////////////////
|
||||
|
||||
// These aren't all guaranteed, but they're common to all our test slaves.
|
||||
// If you're adding a slave config that is missing one of these, comment the line out
|
||||
// and split it into its own test.
|
||||
defaultExts.forEach(function(x) {
|
||||
var extName = x[0];
|
||||
var statusArr = x[1];
|
||||
TestExt(extName, statusArr);
|
||||
});
|
||||
|
||||
// Implemented. (commented out if not test-slave-universal)
|
||||
//ensureExt('ANGLE_instanced_arrays');
|
||||
//ensureExt('EXT_blend_minmax');
|
||||
//ensureExt('EXT_color_buffer_half_float');
|
||||
//ensureExt('EXT_frag_depth');
|
||||
//ensureExt('EXT_shader_texture_lod');
|
||||
//ensureExt('EXT_sRGB');
|
||||
//ensureExt('EXT_texture_filter_anisotropic');
|
||||
ensureExt('OES_element_index_uint');
|
||||
//ensureExt('OES_standard_derivatives');
|
||||
ensureExt('OES_texture_float');
|
||||
ensureExt('OES_texture_float_linear');
|
||||
ensureExt('OES_texture_half_float');
|
||||
ensureExt('OES_texture_half_float_linear');
|
||||
ensureExt('OES_vertex_array_object');
|
||||
//ensureExt('WEBGL_color_buffer_float');
|
||||
//ensureExt('WEBGL_compressed_texture_atc');
|
||||
//ensureExt('WEBGL_compressed_texture_es3');
|
||||
//ensureExt('WEBGL_compressed_texture_etc1');
|
||||
//ensureExt('WEBGL_compressed_texture_pvrtc');
|
||||
//ensureExt('WEBGL_compressed_texture_s3tc');
|
||||
//ensureExt('WEBGL_depth_texture');
|
||||
//ensureExt('WEBGL_draw_buffers');
|
||||
ensureExt('WEBGL_lose_context');
|
||||
nonImplementedExts.forEach(function(extName) {
|
||||
EnsureExt(extName, false);
|
||||
});
|
||||
|
||||
// Draft extensions, which should not be exposed by default.
|
||||
ensureNoExt('EXT_disjoint_timer_query');
|
||||
ensureNoExt('WEBGL_compressed_texture_es3');
|
||||
draftExts.forEach(function(x) {
|
||||
var extName = x[0];
|
||||
EnsureExt(extName, false);
|
||||
});
|
||||
|
||||
// Not implemented.
|
||||
ensureNoExt('EXT_color_buffer_float');
|
||||
ensureNoExt('OES_fbo_render_mipmap');
|
||||
ensureNoExt('WEBGL_compressed_texture_astc');
|
||||
ensureNoExt('WEBGL_security_sensitive_resources');
|
||||
ensureNoExt('WEBGL_shared_resources');
|
||||
|
||||
// Privileged
|
||||
//ensureExt('WEBGL_debug_renderer_info');
|
||||
//ensureExt('WEBGL_debug_shaders');
|
||||
} while (false);
|
||||
Lastly_WithDraftExtsEnabled(function() {
|
||||
draftExts.forEach(function(x) {
|
||||
var extName = x[0];
|
||||
var statusArr = x[1];
|
||||
TestExt(extName, statusArr);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -1537,7 +1537,8 @@ EventStateManager::FireContextClick()
|
||||
}
|
||||
else if (mGestureDownContent->IsAnyOfHTMLElements(nsGkAtoms::applet,
|
||||
nsGkAtoms::embed,
|
||||
nsGkAtoms::object)) {
|
||||
nsGkAtoms::object,
|
||||
nsGkAtoms::label)) {
|
||||
allowedToDispatch = false;
|
||||
}
|
||||
}
|
||||
@ -4400,6 +4401,9 @@ EventStateManager::SetPointerLock(nsIWidget* aWidget,
|
||||
// pre-pointerlock position, so that the synthetic mouse event reports
|
||||
// no movement.
|
||||
sLastRefPoint = mPreLockPoint;
|
||||
// Reset SynthCenteringPoint to invalid so that next time we start
|
||||
// locking pointer, it has its initial value.
|
||||
sSynthCenteringPoint = kInvalidRefPoint;
|
||||
if (aWidget) {
|
||||
aWidget->SynthesizeNativeMouseMove(
|
||||
mPreLockPoint + aWidget->WidgetToScreenOffset(), nullptr);
|
||||
|
@ -37,8 +37,10 @@ function doTest() {
|
||||
win.addEventListener("resize", function() {
|
||||
win.removeEventListener("resize", arguments.callee, false);
|
||||
|
||||
sbo.scrollBy(200, 0);
|
||||
setTimeout(function() { resize(); }, 0);
|
||||
setTimeout(function(){
|
||||
sbo.scrollBy(200, 0);
|
||||
resize();
|
||||
},0);
|
||||
}, false);
|
||||
|
||||
oldWidth = win.outerWidth;
|
||||
|
@ -124,7 +124,7 @@ HTMLFieldSetElement::MatchListedElements(nsIContent* aContent, int32_t aNamespac
|
||||
nsIAtom* aAtom, void* aData)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aContent);
|
||||
return formControl && formControl->GetType() != NS_FORM_LABEL;
|
||||
return formControl;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -63,7 +63,9 @@ HTMLFormControlsCollection::ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
// form.elements array
|
||||
//
|
||||
// NS_FORM_INPUT_IMAGE
|
||||
// NS_FORM_LABEL
|
||||
//
|
||||
// XXXbz maybe we should just check for that type here instead of the big
|
||||
// switch?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ HTMLLabelElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(HTMLLabelElement, nsGenericHTMLFormElement,
|
||||
NS_IMPL_ISUPPORTS_INHERITED(HTMLLabelElement, nsGenericHTMLElement,
|
||||
nsIDOMHTMLLabelElement)
|
||||
|
||||
// nsIDOMHTMLLabelElement
|
||||
@ -44,7 +44,9 @@ NS_IMPL_ELEMENT_CLONE(HTMLLabelElement)
|
||||
NS_IMETHODIMP
|
||||
HTMLLabelElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
RefPtr<nsIDOMHTMLFormElement> form = GetForm();
|
||||
form.forget(aForm);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -72,6 +74,23 @@ HTMLLabelElement::GetHtmlFor(nsAString& aHtmlFor)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
HTMLFormElement*
|
||||
HTMLLabelElement::GetForm() const
|
||||
{
|
||||
nsGenericHTMLElement* control = GetControl();
|
||||
if (!control) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Not all labeled things have a form association. Stick to the ones that do.
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryObject(control);
|
||||
if (!formControl) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<HTMLFormElement*>(formControl->GetFormElement());
|
||||
}
|
||||
|
||||
void
|
||||
HTMLLabelElement::Focus(ErrorResult& aError)
|
||||
{
|
||||
@ -208,18 +227,6 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLLabelElement::Reset()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLLabelElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLLabelElement::PerformAccesskey(bool aKeyCausesActivation,
|
||||
bool aIsTrustedEvent)
|
||||
|
@ -18,12 +18,12 @@ namespace mozilla {
|
||||
class EventChainPostVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLLabelElement final : public nsGenericHTMLFormElement,
|
||||
class HTMLLabelElement final : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLLabelElement
|
||||
{
|
||||
public:
|
||||
explicit HTMLLabelElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mHandlingEvent(false)
|
||||
{
|
||||
}
|
||||
@ -42,7 +42,7 @@ public:
|
||||
// nsIDOMHTMLLabelElement
|
||||
NS_DECL_NSIDOMHTMLLABELELEMENT
|
||||
|
||||
using nsGenericHTMLFormElement::GetForm;
|
||||
HTMLFormElement* GetForm() const;
|
||||
void GetHtmlFor(nsString& aHtmlFor)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::_for, aHtmlFor);
|
||||
@ -59,11 +59,6 @@ public:
|
||||
using nsGenericHTMLElement::Focus;
|
||||
virtual void Focus(mozilla::ErrorResult& aError) override;
|
||||
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return NS_FORM_LABEL; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
|
||||
virtual bool IsDisabled() const override { return false; }
|
||||
|
||||
// nsIContent
|
||||
|
@ -2301,7 +2301,6 @@ nsGenericHTMLFormElement::CanBeDisabled() const
|
||||
int32_t type = GetType();
|
||||
// It's easier to test the types that _cannot_ be disabled
|
||||
return
|
||||
type != NS_FORM_LABEL &&
|
||||
type != NS_FORM_OBJECT &&
|
||||
type != NS_FORM_OUTPUT;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ class HTMLFieldSetElement;
|
||||
|
||||
enum FormControlsTypes {
|
||||
NS_FORM_FIELDSET = 1,
|
||||
NS_FORM_LABEL,
|
||||
NS_FORM_OUTPUT,
|
||||
NS_FORM_SELECT,
|
||||
NS_FORM_TEXTAREA,
|
||||
@ -287,7 +286,6 @@ nsIFormControl::AllowDraggableChildren() const
|
||||
{
|
||||
uint32_t type = GetType();
|
||||
return type == NS_FORM_OBJECT ||
|
||||
type == NS_FORM_LABEL ||
|
||||
type == NS_FORM_FIELDSET ||
|
||||
type == NS_FORM_OUTPUT;
|
||||
}
|
||||
|
@ -452,8 +452,10 @@ for (var name of elementNames) {
|
||||
is(formsList[i].elements[j], elementsList[j],
|
||||
"The form should contain " + elementsList[j]);
|
||||
}
|
||||
is(elementsList[j].form, formsList[i],
|
||||
"The form owner should be the form associated to the list");
|
||||
if (name != 'label') {
|
||||
is(elementsList[j].form, formsList[i],
|
||||
"The form owner should be the form associated to the list");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=841466
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<script>
|
||||
/** Test for Bug 841466 **/
|
||||
var els = ['button', 'fieldset', 'input', 'keygen', 'label', 'object', 'output', 'select', 'textarea'];
|
||||
var els = ['button', 'fieldset', 'input', 'keygen', 'object', 'output', 'select', 'textarea'];
|
||||
var code = "try { is(foo, 'bar', 'expected value bar from expando on element ' + localName); } catch (e) { ok(false, String(e)); }";
|
||||
els.forEach(function(el) {
|
||||
var f = document.createElement("form");
|
||||
|
@ -1692,7 +1692,7 @@ TabChild::RecvUpdateDimensions(const CSSRect& rect, const CSSSize& size,
|
||||
// size from the content viewer when it computes a new CSS viewport.
|
||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
|
||||
baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
|
||||
true);
|
||||
nsIBaseWindow::eRepaint);
|
||||
|
||||
mPuppetWidget->Resize(screenRect.x + clientOffset.x + chromeDisp.x,
|
||||
screenRect.y + clientOffset.y + chromeDisp.y,
|
||||
@ -3102,7 +3102,7 @@ TabChild::RecvUIResolutionChanged(const float& aDpi, const double& aScale)
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
|
||||
baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
|
||||
true);
|
||||
nsIBaseWindow::eRepaint);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -878,7 +878,8 @@ TabParent::RecvSetDimensions(const uint32_t& aFlags,
|
||||
|
||||
if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION &&
|
||||
aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) {
|
||||
treeOwnerAsWin->SetPositionAndSize(x, y, cx, cy, true);
|
||||
treeOwnerAsWin->SetPositionAndSize(x, y, cx, cy,
|
||||
nsIBaseWindow::eRepaint);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1285,6 +1285,27 @@ MediaStreamGraphImpl::PrepareUpdatesToMainThreadState(bool aFinalUpdate)
|
||||
// We don't want to frequently update the main thread about timing update
|
||||
// when we are not running in realtime.
|
||||
if (aFinalUpdate || ShouldUpdateMainThread()) {
|
||||
// Strip updates that will be obsoleted below, so as to keep the length of
|
||||
// mStreamUpdates sane.
|
||||
size_t keptUpdateCount = 0;
|
||||
for (size_t i = 0; i < mStreamUpdates.Length(); ++i) {
|
||||
MediaStream* stream = mStreamUpdates[i].mStream;
|
||||
// RemoveStreamGraphThread() clears mStream in updates for
|
||||
// streams that are removed from the graph.
|
||||
MOZ_ASSERT(!stream || stream->GraphImpl() == this);
|
||||
if (!stream || stream->MainThreadNeedsUpdates()) {
|
||||
// Discard this update as it has either been cleared when the stream
|
||||
// was destroyed or there will be a newer update below.
|
||||
continue;
|
||||
}
|
||||
if (keptUpdateCount != i) {
|
||||
mStreamUpdates[keptUpdateCount] = Move(mStreamUpdates[i]);
|
||||
MOZ_ASSERT(!mStreamUpdates[i].mStream);
|
||||
}
|
||||
++keptUpdateCount;
|
||||
}
|
||||
mStreamUpdates.TruncateLength(keptUpdateCount);
|
||||
|
||||
mStreamUpdates.SetCapacity(mStreamUpdates.Length() + mStreams.Length() +
|
||||
mSuspendedStreams.Length());
|
||||
for (MediaStream* stream : AllStreams()) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "MFTDecoder.h"
|
||||
#include "DriverCrashGuard.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "gfxCrashReporterUtils.h"
|
||||
|
||||
const CLSID CLSID_VideoProcessorMFT =
|
||||
{
|
||||
@ -257,6 +258,8 @@ D3D9DXVA2Manager::Init(nsACString& aFailureReason)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ScopedGfxFeatureReporter reporter("DXVA2D3D9");
|
||||
|
||||
gfx::D3D9VideoCrashGuard crashGuard;
|
||||
if (crashGuard.Crashed()) {
|
||||
NS_WARNING("DXVA2D3D9 crash detected");
|
||||
@ -419,6 +422,9 @@ D3D9DXVA2Manager::Init(nsACString& aFailureReason)
|
||||
|
||||
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
|
||||
uint32_t(media::MediaDecoderBackend::WMFDXVA2D3D9));
|
||||
|
||||
reporter.SetSuccessful();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -603,6 +609,8 @@ D3D11DXVA2Manager::Init(nsACString& aFailureReason)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
ScopedGfxFeatureReporter reporter("DXVA2D3D11");
|
||||
|
||||
gfx::D3D11VideoCrashGuard crashGuard;
|
||||
if (crashGuard.Crashed()) {
|
||||
NS_WARNING("DXVA2D3D11 crash detected");
|
||||
@ -733,6 +741,9 @@ D3D11DXVA2Manager::Init(nsACString& aFailureReason)
|
||||
|
||||
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
|
||||
uint32_t(media::MediaDecoderBackend::WMFDXVA2D3D11));
|
||||
|
||||
reporter.SetSuccessful();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -117,11 +117,14 @@ MediaStreamAudioSourceNode::AttachToFirstTrack(const RefPtr<DOMMediaStream>& aMe
|
||||
nsTArray<RefPtr<AudioStreamTrack>> tracks;
|
||||
aMediaStream->GetAudioTracks(tracks);
|
||||
|
||||
if (tracks.IsEmpty()) {
|
||||
for (const RefPtr<AudioStreamTrack>& track : tracks) {
|
||||
if (track->Ended()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AttachToTrack(track);
|
||||
return;
|
||||
}
|
||||
|
||||
AttachToTrack(tracks[0]);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -52,12 +52,20 @@ Presentation::WrapObject(JSContext* aCx,
|
||||
void
|
||||
Presentation::SetDefaultRequest(PresentationRequest* aRequest)
|
||||
{
|
||||
if (IsInPresentedContent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mDefaultRequest = aRequest;
|
||||
}
|
||||
|
||||
already_AddRefed<PresentationRequest>
|
||||
Presentation::GetDefaultRequest() const
|
||||
{
|
||||
if (IsInPresentedContent()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<PresentationRequest> request = mDefaultRequest;
|
||||
return request.forget();
|
||||
}
|
||||
|
@ -54,6 +54,20 @@ function testConnectionAvailable() {
|
||||
});
|
||||
}
|
||||
|
||||
function testDefauleRequestIsNull() {
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
navigator.presentation.defaultRequest = new PresentationRequest("http://example.com");
|
||||
if (navigator.presentation.defaultRequest === null) {
|
||||
ok(true, "defaultRequest should be null.");
|
||||
aResolve();
|
||||
}
|
||||
else {
|
||||
ok(false, "defaultRequest should be null.");
|
||||
aReject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function testConnectionAvailableSameOriginInnerIframe() {
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
var iframe = document.createElement('iframe');
|
||||
@ -114,6 +128,7 @@ function testTerminateConnection() {
|
||||
}
|
||||
|
||||
testConnectionAvailable().
|
||||
then(testDefauleRequestIsNull).
|
||||
then(testConnectionAvailableSameOriginInnerIframe).
|
||||
then(testConnectionUnavailableDiffOriginInnerIframe).
|
||||
then(testConnectionReady).
|
||||
|
@ -108,6 +108,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
secondMove.mozMovementY = e.mozMovementY;
|
||||
parent.removeEventListener("mousemove", secondMoveChild);
|
||||
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
};
|
||||
|
||||
@ -118,21 +122,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("mozpointerlockerror", function () {
|
||||
document.exitFullscreen();
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e) {
|
||||
if (document.fullscreenElement === parent) {
|
||||
parent.mozRequestPointerLock();
|
||||
}
|
||||
else {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
parent.mozRequestPointerLock();
|
||||
});
|
||||
parent.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -40,6 +40,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
document.addEventListener("mozpointerlockchange", function (e) {
|
||||
if (document.mozPointerLockElement === div) {
|
||||
if (numberOfLocks === 2) {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
else {
|
||||
@ -49,18 +53,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e) {
|
||||
if (document.fullscreenElement === div) {
|
||||
div.mozRequestPointerLock();
|
||||
}
|
||||
else {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
console.log('started');
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
div.mozRequestPointerLock();
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -29,12 +29,11 @@
|
||||
, pointerUnLocked = false;
|
||||
|
||||
function start() {
|
||||
document.addEventListener("fullscreenchange", enteredFullscreen);
|
||||
addFullscreenChangeContinuation("enter", enteredFullscreen);
|
||||
div.requestFullscreen();
|
||||
}
|
||||
|
||||
function enteredFullscreen(e) {
|
||||
document.removeEventListener("fullscreenchange", enteredFullscreen);
|
||||
is(document.fullscreenElement, div, "Element #div should entered fullscreen");
|
||||
ok(!document.mozPointerLockElement, "Pointer shouldn't have been locked");
|
||||
document.addEventListener("mozpointerlockchange", lockedPointer);
|
||||
@ -45,7 +44,7 @@
|
||||
document.removeEventListener("mozpointerlockchange", lockedPointer);
|
||||
is(document.mozPointerLockElement, div, "Pointer should have been locked on #div");
|
||||
document.addEventListener("mozpointerlockchange", unlockedPointer);
|
||||
document.addEventListener("fullscreenchange", leavedFullscreen);
|
||||
addFullscreenChangeContinuation("exit", leavedFullscreen);
|
||||
SimpleTest.executeSoon(() => synthesizeKey("VK_ESCAPE", {}));
|
||||
}
|
||||
|
||||
@ -61,7 +60,6 @@
|
||||
}
|
||||
|
||||
function leavedFullscreen() {
|
||||
document.removeEventListener("fullscreenchange", leavedFullscreen);
|
||||
ok(!exitedFullscreen, "Shouldn't have exited fullscreen before");
|
||||
ok(!document.fullscreenElement, "Should have exited fullscreen now");
|
||||
exitedFullscreen = true;
|
||||
|
@ -65,6 +65,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
totalMovementY = divCenterHeight + ((divCenterHeight / 2) * 3);
|
||||
|
||||
div.removeEventListener("mousemove", secondMoveListener, false);
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
|
||||
@ -84,20 +89,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function() {
|
||||
if (document.fullscreenElement === div) {
|
||||
info("Got fullscreenchange for entering");
|
||||
div.mozRequestPointerLock();
|
||||
}
|
||||
else {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
info("Requesting fullscreen on parent");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
info("Got fullscreenchange for entering");
|
||||
div.mozRequestPointerLock();
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -41,21 +41,19 @@
|
||||
elemWasLocked = true;
|
||||
document.mozExitPointerLock();
|
||||
} else {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
ok(elemWasLocked, "Expected SVG elem to become locked.");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e) {
|
||||
if (document.fullscreenElement === elem) {
|
||||
elem.mozRequestPointerLock();
|
||||
} else {
|
||||
ok(elemWasLocked, "Expected SVG elem to become locked.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
elem = document.getElementById("svg-elem");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
elem.mozRequestPointerLock();
|
||||
});
|
||||
elem.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -83,35 +83,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
secondMove.mozMovementY = e.mozMovementY;
|
||||
|
||||
div.removeEventListener("mousemove", moveMouseAgain, false);
|
||||
document.exitFullscreen();
|
||||
};
|
||||
|
||||
function fullscreenchange() {
|
||||
if (document.fullscreenElement === div) {
|
||||
info("Got fullscreenchange for entering");
|
||||
var screenX = window.screenX;
|
||||
var screenY = window.screenY;
|
||||
if (screenX != 0 || screenY != 0) {
|
||||
todo(screenX == 0 && screenY == 0,
|
||||
"We should only receive fullscreenchange once we've finished fullscreen transition");
|
||||
setTimeout(fullscreenchange, 250);
|
||||
return;
|
||||
}
|
||||
info("Finish waiting for fullscreenchange");
|
||||
div.addEventListener("mousemove", moveMouse, false);
|
||||
synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
|
||||
}
|
||||
else {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("fullscreenchange", fullscreenchange, false);
|
||||
});
|
||||
document.exitFullscreen();
|
||||
};
|
||||
|
||||
function start() {
|
||||
info("Requesting fullscreen on parent");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
info("Got fullscreenchange for entering");
|
||||
div.addEventListener("mousemove", moveMouse, false);
|
||||
synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -49,30 +49,26 @@
|
||||
document.addEventListener("mozpointerlockchange", function (e) {
|
||||
if (document.mozPointerLockElement === parentDiv) {
|
||||
parentDivLocked = true;
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
pointerLocked = !!document.mozPointerLockElement;
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
});
|
||||
childDiv.requestFullscreen();
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function() {
|
||||
if (document.fullscreenElement === parentDiv) {
|
||||
if (parentDivFullScreen === true) {
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
parentDivFullScreen = true;
|
||||
parentDiv.mozRequestPointerLock();
|
||||
}
|
||||
}
|
||||
else if (document.fullscreenElement === childDiv) {
|
||||
pointerLocked = !!document.mozPointerLockElement;
|
||||
document.exitFullscreen();
|
||||
}
|
||||
else {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
parentDivFullScreen = true;
|
||||
parentDiv.mozRequestPointerLock();
|
||||
});
|
||||
parentDiv.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -52,24 +52,21 @@
|
||||
|
||||
document.addEventListener("mozpointerlockerror", function (e) {
|
||||
prefDisabled = true;
|
||||
document.exitFullscreen();
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e) {
|
||||
if (document.fullscreenElement === div) {
|
||||
SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
|
||||
true );
|
||||
div.mozRequestPointerLock();
|
||||
}
|
||||
else {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
|
||||
true );
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
|
||||
true );
|
||||
div.mozRequestPointerLock();
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -79,25 +79,23 @@
|
||||
} else {
|
||||
info("Got mozpointerlockchange for exiting");
|
||||
pointerUnlocked = true;
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function(e) {
|
||||
if (document.fullscreenElement === div) {
|
||||
info("Got fullscreenchange for entering");
|
||||
hasRequestPointerLock = "mozRequestPointerLock" in div;
|
||||
div.mozRequestPointerLock();
|
||||
} else {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
div = document.getElementById("div");
|
||||
info("Requesting fullscreen on parent");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
info("Got fullscreenchange for entering");
|
||||
hasRequestPointerLock = "mozRequestPointerLock" in div;
|
||||
div.mozRequestPointerLock();
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -51,7 +51,7 @@ function checkPointerLockElement(elem) {
|
||||
}
|
||||
|
||||
function start() {
|
||||
listenOneDocEvent("fullscreenchange", enteredFullscreen);
|
||||
addFullscreenChangeContinuation("enter", enteredFullscreen);
|
||||
document.documentElement.requestFullscreen();
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ function lockedPointerOnInner() {
|
||||
|
||||
function unlockedPointerFromInner() {
|
||||
checkPointerLockElement(null);
|
||||
listenOneDocEvent("fullscreenchange", exitedFullscreen);
|
||||
addFullscreenChangeContinuation("exit", exitedFullscreen);
|
||||
document.exitFullscreen();
|
||||
}
|
||||
|
||||
|
@ -171,6 +171,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
child.removeEventListener("mousemove", childMoveTest);
|
||||
SimpleTest.executeSoon(function () {
|
||||
info("Exit fullscreen");
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
});
|
||||
}
|
||||
@ -188,19 +193,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e) {
|
||||
if (document.fullscreenElement === parent) {
|
||||
info("Got fullscreenchange for entering");
|
||||
parent.mozRequestPointerLock();
|
||||
} else {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
info("Requesting fullscreen on parent");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
info("Got fullscreenchange for entering");
|
||||
parent.mozRequestPointerLock();
|
||||
});
|
||||
parent.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -82,6 +82,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
clientY: e.clientY
|
||||
};
|
||||
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
|
||||
@ -98,35 +103,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
}
|
||||
}, false);
|
||||
|
||||
function fullscreenchange() {
|
||||
var screenX = window.screenX;
|
||||
var screenY = window.screenY;
|
||||
if (document.fullscreenElement === div) {
|
||||
function start() {
|
||||
div = document.getElementById("div");
|
||||
info("Requesting fullscreen on parent");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
info("Got fullscreenchange for entering");
|
||||
if (screenX != 0 || screenY != 0) {
|
||||
todo(screenX == 0 && screenY == 0,
|
||||
"We should only receive fullscreenchange once we've finished fullscreen transition " +
|
||||
"window.screenX=" + screenX + " window.screenY=" + screenY);
|
||||
setTimeout(fullscreenchange, 250);
|
||||
return;
|
||||
}
|
||||
info("Finish waiting for fullscreenchange");
|
||||
synthesizeNativeMouseMove(div, 0, 0, () => {
|
||||
div.addEventListener("mousemove", moveUnlocked, false);
|
||||
divRect = div.getBoundingClientRect();
|
||||
synthesizeNativeMouseMove(div, divRect.width / 2, divRect.height / 2);
|
||||
});
|
||||
} else {
|
||||
info("Got fullscreenchange for exiting");
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
document.addEventListener("fullscreenchange", fullscreenchange, false);
|
||||
|
||||
function start() {
|
||||
div = document.getElementById("div");
|
||||
info("Requesting fullscreen on parent");
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -137,23 +137,20 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
|
||||
synthesizeMouseAtCenter(child, { type: "mousemove" }, window);
|
||||
}
|
||||
else {
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function() {
|
||||
if (document.fullscreenElement === parent) {
|
||||
parent.mozRequestPointerLock();
|
||||
}
|
||||
else {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
parent = document.getElementById("parent");
|
||||
child = document.getElementById("child");
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
parent.mozRequestPointerLock();
|
||||
});
|
||||
parent.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -48,20 +48,18 @@
|
||||
document.addEventListener("mozpointerlockchange", function (e) {
|
||||
if (document.mozPointerLockElement === div) {
|
||||
divPointerLock = true;
|
||||
addFullscreenChangeContinuation("exit", function() {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
document.exitFullscreen();
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.addEventListener("fullscreenchange", function() {
|
||||
if (document.fullscreenElement === div) {
|
||||
input.focus();
|
||||
} else {
|
||||
runTests();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}, false);
|
||||
|
||||
function start() {
|
||||
addFullscreenChangeContinuation("enter", function() {
|
||||
input.focus();
|
||||
});
|
||||
div.requestFullscreen();
|
||||
}
|
||||
</script>
|
||||
|
@ -22,4 +22,4 @@ support-files =
|
||||
|
||||
[test_pointerlock-api.html]
|
||||
tags = fullscreen
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. Linux/Win: Bug 931445
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || os == 'win' # B2G - window.open focus issues using fullscreen. Win: Bug 931445
|
||||
|
@ -1,62 +1,46 @@
|
||||
const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
// Get test filename for page being run in popup so errors are more useful
|
||||
var testName = location.pathname.split('/').pop();
|
||||
|
||||
// If we're running in a child window, shim things so it works the same
|
||||
// as if we were running stand-alone.
|
||||
if (window.opener) {
|
||||
// Get test filename for page being run in popup so errors are more useful
|
||||
var testName = location.pathname.split('/').pop();
|
||||
// Wrap test functions and pass to parent window
|
||||
window.ok = function(a, msg) {
|
||||
opener.ok(a, testName + ": " + msg);
|
||||
};
|
||||
|
||||
// Wrap test functions and pass to parent window
|
||||
window.ok = function(a, msg) {
|
||||
opener.ok(a, testName + ": " + msg);
|
||||
};
|
||||
window.is = function(a, b, msg) {
|
||||
opener.is(a, b, testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.is = function(a, b, msg) {
|
||||
opener.is(a, b, testName + ": " + msg);
|
||||
};
|
||||
window.isnot = function(a, b, msg) {
|
||||
opener.isnot(a, b, testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.isnot = function(a, b, msg) {
|
||||
opener.isnot(a, b, testName + ": " + msg);
|
||||
};
|
||||
window.todo = function(a, msg) {
|
||||
opener.todo(a, testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.todo = function(a, msg) {
|
||||
opener.todo(a, testName + ": " + msg);
|
||||
};
|
||||
window.todo_is = function(a, b, msg) {
|
||||
opener.todo_is(a, b, testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.todo_is = function(a, b, msg) {
|
||||
opener.todo_is(a, b, testName + ": " + msg);
|
||||
};
|
||||
window.todo_isnot = function(a, b, msg) {
|
||||
opener.todo_isnot(a, b, testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.todo_isnot = function(a, b, msg) {
|
||||
opener.todo_isnot(a, b, testName + ": " + msg);
|
||||
};
|
||||
window.info = function(msg) {
|
||||
opener.info(testName + ": " + msg);
|
||||
};
|
||||
|
||||
window.info = function(msg) {
|
||||
opener.info(testName + ": " + msg);
|
||||
};
|
||||
// Override bits of SimpleTest so test files work stand-alone
|
||||
var SimpleTest = SimpleTest || {};
|
||||
|
||||
// Override bits of SimpleTest so test files work stand-alone
|
||||
var SimpleTest = SimpleTest || {};
|
||||
SimpleTest.waitForExplicitFinish = function() {
|
||||
dump("[POINTERLOCK] Starting " + testName+ "\n");
|
||||
};
|
||||
|
||||
SimpleTest.waitForExplicitFinish = function() {
|
||||
dump("[POINTERLOCK] Starting " + testName+ "\n");
|
||||
};
|
||||
|
||||
SimpleTest.finish = function () {
|
||||
dump("[POINTERLOCK] Finishing " + testName+ "\n");
|
||||
opener.nextTest();
|
||||
};
|
||||
} else {
|
||||
// If we're not running in a child window, prefs need to get flipped here,
|
||||
// otherwise it was already done in the test runner parent.
|
||||
|
||||
// Ensure the full-screen api is enabled, and will be disabled on test exit.
|
||||
SpecialPowers.setBoolPref("full-screen-api.enabled", true);
|
||||
|
||||
// Disable the requirement for trusted contexts only, so the tests are easier to write.
|
||||
SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
|
||||
}
|
||||
SimpleTest.finish = function () {
|
||||
dump("[POINTERLOCK] Finishing " + testName+ "\n");
|
||||
opener.nextTest();
|
||||
};
|
||||
|
||||
addLoadEvent(function() {
|
||||
if (typeof start !== 'undefined') {
|
||||
@ -64,3 +48,73 @@ addLoadEvent(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Returns true if the window occupies the entire screen.
|
||||
// Note this only returns true once the transition from normal to
|
||||
// fullscreen mode is complete.
|
||||
function inFullscreenMode(win) {
|
||||
return win.innerWidth == win.screen.width &&
|
||||
win.innerHeight == win.screen.height;
|
||||
}
|
||||
|
||||
// Returns true if the window is in normal mode, i.e. non fullscreen mode.
|
||||
// Note this only returns true once the transition from fullscreen back to
|
||||
// normal mode is complete.
|
||||
function inNormalMode(win) {
|
||||
return win.innerWidth == win.normalSize.w &&
|
||||
win.innerHeight == win.normalSize.h;
|
||||
}
|
||||
|
||||
// Adds a listener that will be called once a fullscreen transition
|
||||
// is complete. When type==='enter', callback is called when we've
|
||||
// received a fullscreenchange event, and the fullscreen transition is
|
||||
// complete. When type==='exit', callback is called when we've
|
||||
// received a fullscreenchange event and the window dimensions match
|
||||
// the window dimensions when the window opened (so don't resize the
|
||||
// window while running your test!). inDoc is the document which
|
||||
// the listeners are added on, if absent, the listeners are added to
|
||||
// the current document.
|
||||
function addFullscreenChangeContinuation(type, callback, inDoc) {
|
||||
var doc = inDoc || document;
|
||||
var topWin = doc.defaultView.top;
|
||||
// Remember the window size in non-fullscreen mode.
|
||||
if (!topWin.normalSize) {
|
||||
topWin.normalSize = {
|
||||
w: window.innerWidth,
|
||||
h: window.innerHeight
|
||||
};
|
||||
}
|
||||
function checkCondition() {
|
||||
if (type == "enter") {
|
||||
return inFullscreenMode(topWin);
|
||||
} else if (type == "exit") {
|
||||
// If we just revert the state to a previous fullscreen state,
|
||||
// the window won't back to the normal mode. Hence we check
|
||||
// fullscreenElement first here. Note that we need to check
|
||||
// the fullscreen element of the outmost document here instead
|
||||
// of the current one.
|
||||
return topWin.document.fullscreenElement || inNormalMode(topWin);
|
||||
} else {
|
||||
throw "'type' must be either 'enter', or 'exit'.";
|
||||
}
|
||||
}
|
||||
function invokeCallback(event) {
|
||||
// Use async call after a paint to workaround unfinished fullscreen
|
||||
// change even when the window size has changed on Linux.
|
||||
requestAnimationFrame(() => setTimeout(() => callback(event), 0), 0);
|
||||
}
|
||||
function onFullscreenChange(event) {
|
||||
doc.removeEventListener("fullscreenchange", onFullscreenChange, false);
|
||||
if (checkCondition()) {
|
||||
invokeCallback(event);
|
||||
return;
|
||||
}
|
||||
function onResize() {
|
||||
if (checkCondition()) {
|
||||
topWin.removeEventListener("resize", onResize, false);
|
||||
invokeCallback(event);
|
||||
}
|
||||
}
|
||||
topWin.addEventListener("resize", onResize, false);
|
||||
}
|
||||
doc.addEventListener("fullscreenchange", onFullscreenChange, false);
|
||||
}
|
||||
|
@ -647,7 +647,7 @@ nsDocShellTreeOwner::GetSize(int32_t* aCX, int32_t* aCY)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShellTreeOwner::SetPositionAndSize(int32_t aX, int32_t aY, int32_t aCX,
|
||||
int32_t aCY, bool aRepaint)
|
||||
int32_t aCY, uint32_t aFlags)
|
||||
{
|
||||
nsCOMPtr<nsIEmbeddingSiteWindow> ownerWin = GetOwnerWin();
|
||||
if (ownerWin) {
|
||||
|
@ -1150,7 +1150,7 @@ nsWebBrowser::InitWindow(nativeWindow aParentNativeWindow,
|
||||
NS_ENSURE_SUCCESS(SetParentNativeWindow(aParentNativeWindow),
|
||||
NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_SUCCESS(SetPositionAndSize(aX, aY, aCX, aCY, false),
|
||||
NS_ENSURE_SUCCESS(SetPositionAndSize(aX, aY, aCX, aCY, 0),
|
||||
NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
@ -1325,7 +1325,7 @@ nsWebBrowser::SetPosition(int32_t aX, int32_t aY)
|
||||
|
||||
GetSize(&cx, &cy);
|
||||
|
||||
return SetPositionAndSize(aX, aY, cx, cy, false);
|
||||
return SetPositionAndSize(aX, aY, cx, cy, 0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1342,7 +1342,8 @@ nsWebBrowser::SetSize(int32_t aCX, int32_t aCY, bool aRepaint)
|
||||
|
||||
GetPosition(&x, &y);
|
||||
|
||||
return SetPositionAndSize(x, y, aCX, aCY, aRepaint);
|
||||
return SetPositionAndSize(x, y, aCX, aCY,
|
||||
aRepaint ? nsIBaseWindow::eRepaint : 0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1353,7 +1354,7 @@ nsWebBrowser::GetSize(int32_t* aCX, int32_t* aCY)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebBrowser::SetPositionAndSize(int32_t aX, int32_t aY,
|
||||
int32_t aCX, int32_t aCY, bool aRepaint)
|
||||
int32_t aCX, int32_t aCY, uint32_t aFlags)
|
||||
{
|
||||
if (!mDocShell) {
|
||||
mInitInfo->x = aX;
|
||||
@ -1369,12 +1370,13 @@ nsWebBrowser::SetPositionAndSize(int32_t aX, int32_t aY,
|
||||
// We also need to resize our widget then.
|
||||
if (mInternalWidget) {
|
||||
doc_x = doc_y = 0;
|
||||
NS_ENSURE_SUCCESS(mInternalWidget->Resize(aX, aY, aCX, aCY, aRepaint),
|
||||
NS_ENSURE_SUCCESS(mInternalWidget->Resize(aX, aY, aCX, aCY,
|
||||
!!(aFlags & nsIBaseWindow::eRepaint)),
|
||||
NS_ERROR_FAILURE);
|
||||
}
|
||||
// Now reposition/ resize the doc
|
||||
NS_ENSURE_SUCCESS(
|
||||
mDocShellAsWin->SetPositionAndSize(doc_x, doc_y, aCX, aCY, aRepaint),
|
||||
mDocShellAsWin->SetPositionAndSize(doc_x, doc_y, aCX, aCY, aFlags),
|
||||
NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
function* test(testDriver) {
|
||||
document.addEventListener('click', clicked, false);
|
||||
|
||||
// Ensure the pointer is inside the window
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 5, 5, nativeMouseMoveEventMsg(), testDriver);
|
||||
// mouse down, move it around, and release it near where it went down. this
|
||||
// should generate a click at the release point
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 5, 5, nativeMouseDownEventMsg(), testDriver);
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
{
|
||||
LayerComposite::SetLayerManager(aManager);
|
||||
mManager = aManager;
|
||||
mLastIntermediateSurface = nullptr;
|
||||
|
||||
for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
LayerComposite* child = l->AsLayerComposite();
|
||||
|
@ -1005,6 +1005,8 @@ CompositorOGL::DrawQuad(const Rect& aRect,
|
||||
return;
|
||||
}
|
||||
|
||||
MakeCurrent();
|
||||
|
||||
IntPoint offset = mCurrentRenderTarget->GetOrigin();
|
||||
IntSize size = mCurrentRenderTarget->GetSize();
|
||||
|
||||
|
@ -186,8 +186,7 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize,
|
||||
}
|
||||
|
||||
mImageSize = aImageSize;
|
||||
mOffset.MoveTo(aRect.x, aRect.y);
|
||||
mSize.SizeTo(aRect.width, aRect.height);
|
||||
mFrameRect = aRect;
|
||||
|
||||
mFormat = aFormat;
|
||||
mPaletteDepth = aPaletteDepth;
|
||||
@ -205,8 +204,7 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize,
|
||||
// Use the fallible allocator here. Paletted images always use 1 byte per
|
||||
// pixel, so calculating the amount of memory we need is straightforward.
|
||||
mPalettedImageData =
|
||||
static_cast<uint8_t*>(malloc(PaletteDataLength() +
|
||||
(mSize.width * mSize.height)));
|
||||
static_cast<uint8_t*>(malloc(PaletteDataLength() + mFrameRect.Area()));
|
||||
if (!mPalettedImageData) {
|
||||
NS_WARNING("malloc for paletted image data should succeed");
|
||||
}
|
||||
@ -214,17 +212,17 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize,
|
||||
} else {
|
||||
MOZ_ASSERT(!mImageSurface, "Called imgFrame::InitForDecoder() twice?");
|
||||
|
||||
mVBuf = AllocateBufferForImage(mSize, mFormat);
|
||||
mVBuf = AllocateBufferForImage(mFrameRect.Size(), mFormat);
|
||||
if (!mVBuf) {
|
||||
mAborted = true;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
if (mVBuf->OnHeap()) {
|
||||
int32_t stride = VolatileSurfaceStride(mSize, mFormat);
|
||||
int32_t stride = VolatileSurfaceStride(mFrameRect.Size(), mFormat);
|
||||
VolatileBufferPtr<uint8_t> ptr(mVBuf);
|
||||
memset(ptr, 0, stride * mSize.height);
|
||||
memset(ptr, 0, stride * mFrameRect.height);
|
||||
}
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mSize, mFormat);
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mFrameRect.Size(), mFormat);
|
||||
|
||||
if (!mImageSurface) {
|
||||
NS_WARNING("Failed to create VolatileDataSourceSurface");
|
||||
@ -252,8 +250,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
}
|
||||
|
||||
mImageSize = aSize;
|
||||
mOffset.MoveTo(0, 0);
|
||||
mSize.SizeTo(aSize.width, aSize.height);
|
||||
mFrameRect = IntRect(IntPoint(0, 0), aSize);
|
||||
|
||||
mFormat = aFormat;
|
||||
mPaletteDepth = 0;
|
||||
@ -268,25 +265,25 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
// get away with using volatile buffers.
|
||||
MOZ_ASSERT(!mImageSurface, "Called imgFrame::InitWithDrawable() twice?");
|
||||
|
||||
mVBuf = AllocateBufferForImage(mSize, mFormat);
|
||||
mVBuf = AllocateBufferForImage(mFrameRect.Size(), mFormat);
|
||||
if (!mVBuf) {
|
||||
mAborted = true;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
int32_t stride = VolatileSurfaceStride(mSize, mFormat);
|
||||
int32_t stride = VolatileSurfaceStride(mFrameRect.Size(), mFormat);
|
||||
VolatileBufferPtr<uint8_t> ptr(mVBuf);
|
||||
if (!ptr) {
|
||||
mAborted = true;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
if (mVBuf->OnHeap()) {
|
||||
memset(ptr, 0, stride * mSize.height);
|
||||
memset(ptr, 0, stride * mFrameRect.height);
|
||||
}
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mSize, mFormat);
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mFrameRect.Size(), mFormat);
|
||||
|
||||
target = gfxPlatform::GetPlatform()->
|
||||
CreateDrawTargetForData(ptr, mSize, stride, mFormat);
|
||||
CreateDrawTargetForData(ptr, mFrameRect.Size(), stride, mFormat);
|
||||
} else {
|
||||
// We can't use data surfaces for content, so we'll create an offscreen
|
||||
// surface instead. This means if someone later calls RawAccessRef(), we
|
||||
@ -295,7 +292,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
MOZ_ASSERT(!mOptSurface, "Called imgFrame::InitWithDrawable() twice?");
|
||||
|
||||
target = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenContentDrawTarget(mSize, mFormat);
|
||||
CreateOffscreenContentDrawTarget(mFrameRect.Size(), mFormat);
|
||||
}
|
||||
|
||||
if (!target || !target->IsValid()) {
|
||||
@ -304,11 +301,10 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
}
|
||||
|
||||
// Draw using the drawable the caller provided.
|
||||
nsIntRect imageRect(0, 0, mSize.width, mSize.height);
|
||||
RefPtr<gfxContext> ctx = gfxContext::ForDrawTarget(target);
|
||||
MOZ_ASSERT(ctx); // already checked the draw target above
|
||||
gfxUtils::DrawPixelSnapped(ctx, aDrawable, mSize,
|
||||
ImageRegion::Create(ThebesRect(imageRect)),
|
||||
MOZ_ASSERT(ctx); // Already checked the draw target above.
|
||||
gfxUtils::DrawPixelSnapped(ctx, aDrawable, mFrameRect.Size(),
|
||||
ImageRegion::Create(ThebesRect(mFrameRect)),
|
||||
mFormat, aFilter, aImageFlags);
|
||||
|
||||
if (canUseDataSurface && !mImageSurface) {
|
||||
@ -365,10 +361,10 @@ imgFrame::Optimize()
|
||||
/* Figure out if the entire image is a constant color */
|
||||
|
||||
if (gfxPrefs::ImageSingleColorOptimizationEnabled() &&
|
||||
mImageSurface->Stride() == mSize.width * 4) {
|
||||
mImageSurface->Stride() == mFrameRect.width * 4) {
|
||||
uint32_t* imgData = (uint32_t*) ((uint8_t*) mVBufPtr);
|
||||
uint32_t firstPixel = * (uint32_t*) imgData;
|
||||
uint32_t pixelCount = mSize.width * mSize.height + 1;
|
||||
uint32_t pixelCount = mFrameRect.Area() + 1;
|
||||
|
||||
while (--pixelCount && *imgData++ == firstPixel)
|
||||
;
|
||||
@ -407,13 +403,13 @@ imgFrame::Optimize()
|
||||
if (mFormat != SurfaceFormat::B8G8R8A8 &&
|
||||
optFormat == SurfaceFormat::R5G6B5_UINT16) {
|
||||
RefPtr<VolatileBuffer> buf =
|
||||
AllocateBufferForImage(mSize, optFormat);
|
||||
AllocateBufferForImage(mFrameRect.Size(), optFormat);
|
||||
if (!buf) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RefPtr<DataSourceSurface> surf =
|
||||
CreateLockedSurface(buf, mSize, optFormat);
|
||||
CreateLockedSurface(buf, mFrameRect.Size(), optFormat);
|
||||
if (!surf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -427,7 +423,7 @@ imgFrame::Optimize()
|
||||
RefPtr<DrawTarget> target =
|
||||
Factory::CreateDrawTargetForData(BackendType::CAIRO,
|
||||
mapping.mData,
|
||||
mSize,
|
||||
mFrameRect.Size(),
|
||||
mapping.mStride,
|
||||
optFormat);
|
||||
|
||||
@ -435,7 +431,7 @@ imgFrame::Optimize()
|
||||
gfxWarning() << "imgFrame::Optimize failed in CreateDrawTargetForData";
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
Rect rect(0, 0, mSize.width, mSize.height);
|
||||
Rect rect(0, 0, mFrameRect.width, mFrameRect.height);
|
||||
target->DrawSurface(mImageSurface, rect, rect);
|
||||
target->Flush();
|
||||
surf->Unmap();
|
||||
@ -546,7 +542,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding,
|
||||
gfxPoint paddingTopLeft(aPadding.left, aPadding.top);
|
||||
aRegion = aRegion.Intersect(available) - paddingTopLeft;
|
||||
aContext->Multiply(gfxMatrix::Translation(paddingTopLeft));
|
||||
aImageRect = gfxRect(0, 0, mSize.width, mSize.height);
|
||||
aImageRect = gfxRect(0, 0, mFrameRect.width, mFrameRect.height);
|
||||
|
||||
IntSize availableSize(mDecoded.width, mDecoded.height);
|
||||
return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, availableSize),
|
||||
@ -568,10 +564,10 @@ bool imgFrame::Draw(gfxContext* aContext, const ImageRegion& aRegion,
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
nsIntMargin padding(mOffset.y,
|
||||
mImageSize.width - (mOffset.x + mSize.width),
|
||||
mImageSize.height - (mOffset.y + mSize.height),
|
||||
mOffset.x);
|
||||
nsIntMargin padding(mFrameRect.y,
|
||||
mImageSize.width - mFrameRect.XMost(),
|
||||
mImageSize.height - mFrameRect.YMost(),
|
||||
mFrameRect.x);
|
||||
|
||||
bool doPadding = padding != nsIntMargin(0,0,0,0);
|
||||
bool doPartialDecode = !AreAllPixelsWritten();
|
||||
@ -630,10 +626,9 @@ imgFrame::ImageUpdatedInternal(const nsIntRect& aUpdateRect)
|
||||
|
||||
mDecoded.UnionRect(mDecoded, aUpdateRect);
|
||||
|
||||
// clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
|
||||
// you, gif decoder)
|
||||
nsIntRect boundsRect(mOffset, mSize);
|
||||
mDecoded.IntersectRect(mDecoded, boundsRect);
|
||||
// Clamp to the frame rect to ensure that decoder bugs don't result in a
|
||||
// decoded rect that extends outside the bounds of the frame rect.
|
||||
mDecoded.IntersectRect(mDecoded, mFrameRect);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -661,42 +656,17 @@ imgFrame::Finish(Opacity aFrameOpacity /* = Opacity::SOME_TRANSPARENCY */,
|
||||
mMonitor.NotifyAll();
|
||||
}
|
||||
|
||||
nsIntRect
|
||||
imgFrame::GetRect() const
|
||||
{
|
||||
return gfx::IntRect(mOffset, mSize);
|
||||
}
|
||||
|
||||
int32_t
|
||||
imgFrame::GetStride() const
|
||||
{
|
||||
mMonitor.AssertCurrentThreadOwns();
|
||||
|
||||
if (mImageSurface) {
|
||||
return mImageSurface->Stride();
|
||||
}
|
||||
|
||||
return VolatileSurfaceStride(mSize, mFormat);
|
||||
}
|
||||
|
||||
SurfaceFormat
|
||||
imgFrame::GetFormat() const
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
return mFormat;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
imgFrame::GetImageBytesPerRow() const
|
||||
{
|
||||
mMonitor.AssertCurrentThreadOwns();
|
||||
|
||||
if (mVBuf) {
|
||||
return mSize.width * BytesPerPixel(mFormat);
|
||||
return mFrameRect.width * BytesPerPixel(mFormat);
|
||||
}
|
||||
|
||||
if (mPaletteDepth) {
|
||||
return mSize.width;
|
||||
return mFrameRect.width;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -705,7 +675,7 @@ imgFrame::GetImageBytesPerRow() const
|
||||
uint32_t
|
||||
imgFrame::GetImageDataLength() const
|
||||
{
|
||||
return GetImageBytesPerRow() * mSize.height;
|
||||
return GetImageBytesPerRow() * mFrameRect.height;
|
||||
}
|
||||
|
||||
void
|
||||
@ -861,7 +831,7 @@ imgFrame::UnlockImageData()
|
||||
// allows DrawTargets to avoid blending when drawing known opaque images.
|
||||
if (mHasNoAlpha && mFormat == SurfaceFormat::B8G8R8A8 && mImageSurface) {
|
||||
mFormat = SurfaceFormat::B8G8R8X8;
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mSize, mFormat);
|
||||
mImageSurface = CreateLockedSurface(mVBuf, mFrameRect.Size(), mFormat);
|
||||
}
|
||||
|
||||
// Convert the data surface to a GPU surface or a single color if possible.
|
||||
@ -934,24 +904,7 @@ imgFrame::GetSurfaceInternal()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return CreateLockedSurface(mVBuf, mSize, mFormat);
|
||||
}
|
||||
|
||||
already_AddRefed<DrawTarget>
|
||||
imgFrame::GetDrawTarget()
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
uint8_t* data;
|
||||
uint32_t length;
|
||||
GetImageDataInternal(&data, &length);
|
||||
if (!data) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int32_t stride = GetStride();
|
||||
return gfxPlatform::GetPlatform()->
|
||||
CreateDrawTargetForData(data, mSize, stride, mFormat);
|
||||
return CreateLockedSurface(mVBuf, mFrameRect.Size(), mFormat);
|
||||
}
|
||||
|
||||
AnimationData
|
||||
@ -974,20 +927,6 @@ imgFrame::GetAnimationData() const
|
||||
mBlendMethod, mDisposalMethod, hasAlpha);
|
||||
}
|
||||
|
||||
ScalingData
|
||||
imgFrame::GetScalingData() const
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
MOZ_ASSERT(mLockCount > 0, "Image data should be locked");
|
||||
MOZ_ASSERT(!GetIsPaletted(), "GetScalingData can't handle paletted images");
|
||||
|
||||
uint8_t* data;
|
||||
uint32_t length;
|
||||
GetImageDataInternal(&data, &length);
|
||||
|
||||
return ScalingData(data, mSize, GetImageBytesPerRow(), mFormat);
|
||||
}
|
||||
|
||||
void
|
||||
imgFrame::Abort()
|
||||
{
|
||||
@ -1033,8 +972,7 @@ bool
|
||||
imgFrame::AreAllPixelsWritten() const
|
||||
{
|
||||
mMonitor.AssertCurrentThreadOwns();
|
||||
return mDecoded.IsEqualInterior(nsIntRect(mOffset.x, mOffset.y,
|
||||
mSize.width, mSize.height));
|
||||
return mDecoded.IsEqualInterior(mFrameRect);
|
||||
}
|
||||
|
||||
bool imgFrame::GetCompositingFailed() const
|
||||
|
@ -77,38 +77,14 @@ struct AnimationData
|
||||
bool mHasAlpha;
|
||||
};
|
||||
|
||||
/**
|
||||
* ScalingData contains all of the information necessary for performing
|
||||
* high-quality (CPU-based) scaling an imgFrame.
|
||||
*
|
||||
* It includes pointers to the raw image data of the underlying imgFrame, but
|
||||
* does not own that data. A RawAccessFrameRef for the underlying imgFrame must
|
||||
* outlive the ScalingData for it to remain valid.
|
||||
*/
|
||||
struct ScalingData
|
||||
{
|
||||
ScalingData(uint8_t* aRawData,
|
||||
gfx::IntSize aSize,
|
||||
uint32_t aBytesPerRow,
|
||||
gfx::SurfaceFormat aFormat)
|
||||
: mRawData(aRawData)
|
||||
, mSize(aSize)
|
||||
, mBytesPerRow(aBytesPerRow)
|
||||
, mFormat(aFormat)
|
||||
{ }
|
||||
|
||||
uint8_t* mRawData;
|
||||
gfx::IntSize mSize;
|
||||
uint32_t mBytesPerRow;
|
||||
gfx::SurfaceFormat mFormat;
|
||||
};
|
||||
|
||||
class imgFrame
|
||||
{
|
||||
typedef gfx::Color Color;
|
||||
typedef gfx::DataSourceSurface DataSourceSurface;
|
||||
typedef gfx::DrawTarget DrawTarget;
|
||||
typedef gfx::Filter Filter;
|
||||
typedef gfx::IntPoint IntPoint;
|
||||
typedef gfx::IntRect IntRect;
|
||||
typedef gfx::IntSize IntSize;
|
||||
typedef gfx::SourceSurface SourceSurface;
|
||||
typedef gfx::SurfaceFormat SurfaceFormat;
|
||||
@ -238,9 +214,9 @@ public:
|
||||
uint32_t GetBytesPerPixel() const { return GetIsPaletted() ? 1 : 4; }
|
||||
|
||||
IntSize GetImageSize() const { return mImageSize; }
|
||||
nsIntRect GetRect() const;
|
||||
IntSize GetSize() const { return mSize; }
|
||||
bool NeedsPadding() const { return mOffset != nsIntPoint(0, 0); }
|
||||
IntRect GetRect() const { return mFrameRect; }
|
||||
IntSize GetSize() const { return mFrameRect.Size(); }
|
||||
bool NeedsPadding() const { return mFrameRect.TopLeft() != IntPoint(0, 0); }
|
||||
void GetImageData(uint8_t** aData, uint32_t* length) const;
|
||||
uint8_t* GetImageData() const;
|
||||
|
||||
@ -249,15 +225,7 @@ public:
|
||||
uint32_t* GetPaletteData() const;
|
||||
uint8_t GetPaletteDepth() const { return mPaletteDepth; }
|
||||
|
||||
/**
|
||||
* Get the SurfaceFormat for this imgFrame.
|
||||
*
|
||||
* This should only be used for assertions.
|
||||
*/
|
||||
SurfaceFormat GetFormat() const;
|
||||
|
||||
AnimationData GetAnimationData() const;
|
||||
ScalingData GetScalingData() const;
|
||||
|
||||
bool GetCompositingFailed() const;
|
||||
void SetCompositingFailed(bool val);
|
||||
@ -268,7 +236,6 @@ public:
|
||||
bool IsSinglePixel() const;
|
||||
|
||||
already_AddRefed<SourceSurface> GetSurface();
|
||||
already_AddRefed<DrawTarget> GetDrawTarget();
|
||||
|
||||
void AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, size_t& aHeapSizeOut,
|
||||
size_t& aNonHeapSizeOut) const;
|
||||
@ -288,7 +255,6 @@ private: // methods
|
||||
void GetImageDataInternal(uint8_t** aData, uint32_t* length) const;
|
||||
uint32_t GetImageBytesPerRow() const;
|
||||
uint32_t GetImageDataLength() const;
|
||||
int32_t GetStride() const;
|
||||
already_AddRefed<SourceSurface> GetSurfaceInternal();
|
||||
|
||||
uint32_t PaletteDataLength() const
|
||||
@ -356,8 +322,7 @@ private: // data
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IntSize mImageSize;
|
||||
IntSize mSize;
|
||||
nsIntPoint mOffset;
|
||||
IntRect mFrameRect;
|
||||
|
||||
// The palette and image data for images that are paletted, since Cairo
|
||||
// doesn't support these images.
|
||||
@ -446,10 +411,10 @@ private:
|
||||
/**
|
||||
* A reference to an imgFrame that holds the imgFrame's surface in memory in a
|
||||
* format appropriate for access as raw data. If you have a RawAccessFrameRef
|
||||
* |ref| and |if (ref)| is true, then calls to GetImageData(), GetPaletteData(),
|
||||
* and GetDrawTarget() are guaranteed to succeed. This guarantee is stronger
|
||||
* than DrawableFrameRef, so everything that a valid DrawableFrameRef guarantees
|
||||
* is also guaranteed by a valid RawAccessFrameRef.
|
||||
* |ref| and |if (ref)| is true, then calls to GetImageData() and
|
||||
* GetPaletteData() are guaranteed to succeed. This guarantee is stronger than
|
||||
* DrawableFrameRef, so everything that a valid DrawableFrameRef guarantees is
|
||||
* also guaranteed by a valid RawAccessFrameRef.
|
||||
*
|
||||
* This may be considerably more expensive than is necessary just for drawing,
|
||||
* so only use this when you need to read or write the raw underlying image data
|
||||
|
@ -47,6 +47,11 @@ class AstName
|
||||
const char16_t* begin_;
|
||||
const char16_t* end_;
|
||||
public:
|
||||
template <size_t Length>
|
||||
explicit AstName(const char16_t (&str)[Length]) : begin_(str), end_(str + Length - 1) {
|
||||
MOZ_ASSERT(str[Length - 1] == MOZ_UTF16('\0'));
|
||||
}
|
||||
|
||||
AstName(const char16_t* begin, size_t length) : begin_(begin), end_(begin + length) {}
|
||||
AstName() : begin_(nullptr), end_(nullptr) {}
|
||||
const char16_t* begin() const { return begin_; }
|
||||
|
@ -140,6 +140,8 @@ AstDecodeGenerateName(AstDecodeContext& c, const AstName& prefix, uint32_t index
|
||||
}
|
||||
|
||||
AstVector<char16_t> result(c.lifo);
|
||||
if (!result.append(MOZ_UTF16('$')))
|
||||
return false;
|
||||
if (!result.append(prefix.begin(), prefix.length()))
|
||||
return false;
|
||||
|
||||
@ -232,7 +234,7 @@ AstDecodeCall(AstDecodeContext& c)
|
||||
const AstSig* sig = c.module().sigs()[sigIndex];
|
||||
|
||||
AstRef funcRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$func$"), 6), calleeIndex, &funcRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("func")), calleeIndex, &funcRef))
|
||||
return false;
|
||||
|
||||
AstExprVector args(c.lifo);
|
||||
@ -260,7 +262,7 @@ AstDecodeCallIndirect(AstDecodeContext& c)
|
||||
return false;
|
||||
|
||||
AstRef sigRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$type$"), 6), sigIndex, &sigRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("type")), sigIndex, &sigRef))
|
||||
return false;
|
||||
|
||||
if (sigIndex >= c.module().sigs().length())
|
||||
@ -302,7 +304,7 @@ AstDecodeCallImport(AstDecodeContext& c)
|
||||
AstImport* import = c.module().imports()[importIndex];
|
||||
AstSig* sig = c.module().sigs()[import->sig().index()];
|
||||
AstRef funcRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$import$"), 8), importIndex, &funcRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("import")), importIndex, &funcRef))
|
||||
return false;
|
||||
|
||||
AstExprVector args(c.lifo);
|
||||
@ -332,7 +334,7 @@ AstDecodeGetBlockRef(AstDecodeContext& c, uint32_t depth, AstRef* ref)
|
||||
|
||||
uint32_t index = c.blockLabels().length() - depth - 1;
|
||||
if (c.blockLabels()[index].empty()) {
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("$label$"), 7), c.nextLabelIndex(), &c.blockLabels()[index]))
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("label")), c.nextLabelIndex(), &c.blockLabels()[index]))
|
||||
return false;
|
||||
}
|
||||
*ref = AstRef(c.blockLabels()[index], AstNoIndex);
|
||||
@ -661,7 +663,7 @@ AstDecodeGetLocal(AstDecodeContext& c)
|
||||
return false;
|
||||
|
||||
AstRef localRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$var$"), 5), getLocalId, &localRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("var")), getLocalId, &localRef))
|
||||
return false;
|
||||
|
||||
AstGetLocal* getLocal = new(c.lifo) AstGetLocal(localRef);
|
||||
@ -681,7 +683,7 @@ AstDecodeSetLocal(AstDecodeContext& c)
|
||||
return false;
|
||||
|
||||
AstRef localRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$var$"), 5), setLocalId, &localRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("var")), setLocalId, &localRef))
|
||||
return false;
|
||||
|
||||
AstSetLocal* setLocal = new(c.lifo) AstSetLocal(localRef, *setLocalValue.expr);
|
||||
@ -1052,7 +1054,7 @@ AstDecodeTypeSection(AstDecodeContext& c)
|
||||
|
||||
AstSig sigNoName(Move(args), result);
|
||||
AstName sigName;
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("$type$"), 6), sigIndex, &sigName))
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("type")), sigIndex, &sigName))
|
||||
return false;
|
||||
|
||||
AstSig* sig = new(c.lifo) AstSig(sigName, Move(sigNoName));
|
||||
@ -1173,7 +1175,7 @@ AstDecodeImport(AstDecodeContext& c, uint32_t importIndex, AstImport** import)
|
||||
return false;
|
||||
|
||||
AstRef sigRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$type$"), 6), sigIndex, &sigRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("type")), sigIndex, &sigRef))
|
||||
return false;
|
||||
|
||||
AstName moduleName;
|
||||
@ -1188,7 +1190,7 @@ AstDecodeImport(AstDecodeContext& c, uint32_t importIndex, AstImport** import)
|
||||
return AstDecodeFail(c, "expected import func name");
|
||||
|
||||
AstName importName;
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("$import$"), 8), importIndex, &importName))
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("import")), importIndex, &importName))
|
||||
return false;
|
||||
|
||||
*import = new(c.lifo) AstImport(importName, moduleName, funcName, sigRef);
|
||||
@ -1265,7 +1267,7 @@ AstDecodeMemorySection(AstDecodeContext& c)
|
||||
}
|
||||
|
||||
if (exported) {
|
||||
AstExport* export_ = new(c.lifo) AstExport(AstName(MOZ_UTF16("memory"), 6));
|
||||
AstExport* export_ = new(c.lifo) AstExport(AstName(MOZ_UTF16("memory")));
|
||||
if (!export_ || !c.module().append(export_))
|
||||
return false;
|
||||
}
|
||||
@ -1359,7 +1361,7 @@ AstDecodeFunctionBody(AstDecodeContext &c, uint32_t funcIndex, AstFunc** func)
|
||||
c.startFunction(&iter, &locals);
|
||||
|
||||
AstName funcName;
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("$func$"), 6), funcIndex, &funcName))
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("func")), funcIndex, &funcName))
|
||||
return false;
|
||||
|
||||
uint32_t numParams = sig->args().length();
|
||||
@ -1370,7 +1372,7 @@ AstDecodeFunctionBody(AstDecodeContext &c, uint32_t funcIndex, AstFunc** func)
|
||||
}
|
||||
for (uint32_t i = 0; i < numLocals; i++) {
|
||||
AstName varName;
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("$var$"), 5), i, &varName))
|
||||
if (!AstDecodeGenerateName(c, AstName(MOZ_UTF16("var")), i, &varName))
|
||||
return false;
|
||||
if (!localsNames.append(varName))
|
||||
return false;
|
||||
@ -1398,7 +1400,7 @@ AstDecodeFunctionBody(AstDecodeContext &c, uint32_t funcIndex, AstFunc** func)
|
||||
return AstDecodeFail(c, "function body length mismatch");
|
||||
|
||||
AstRef sigRef;
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("$type$"), 6), sigIndex, &sigRef))
|
||||
if (!AstDecodeGenerateRef(c, AstName(MOZ_UTF16("type")), sigIndex, &sigRef))
|
||||
return false;
|
||||
|
||||
*func = new(c.lifo) AstFunc(funcName, sigRef, Move(vars), Move(localsNames), Move(body));
|
||||
|
@ -34,11 +34,11 @@ runTest(`
|
||||
(export "test" 0)
|
||||
(memory 1 10)
|
||||
)`,
|
||||
"type $type$0 of function (i32) : (f64) " +
|
||||
"export $func$0 as \"test\" " +
|
||||
"function $func$0($var$0:i32) : (f64) {" +
|
||||
" var $var$1:f32 { $var$1 = 0.0f loop { br_if $var$0,$label$0 br $label$1 $label$0: }" +
|
||||
" if (1) { f64.min -1.0 0.0 } else { 0.5 + f64.load [0] } $label$1: }" +
|
||||
"type $type0 of function (i32) : (f64) " +
|
||||
"export $func0 as \"test\" " +
|
||||
"function $func0($var0:i32) : (f64) {" +
|
||||
" var $var1:f32 { $var1 = 0.0f loop { br_if $var0,$label0 br $label1 $label0: }" +
|
||||
" if (1) { f64.min -1.0 0.0 } else { 0.5 + f64.load [0] } $label1: }" +
|
||||
" i32.store16 [8],128 return 0.0 "+
|
||||
"} memory 1,10 {} ");
|
||||
|
||||
@ -59,14 +59,14 @@ runTest(`
|
||||
(export "test" $test)
|
||||
(memory 1 65535)
|
||||
)`,
|
||||
"type $type$0 of function (i32) : (i32) " +
|
||||
"type $type$1 of function (f32) : (f32) " +
|
||||
"type $type$2 of function (i32,f32) : () " +
|
||||
"type $type$3 of function () : () " +
|
||||
"import \"test\" as $import$0 from \"mod\" typeof function (f32) : (f32) " +
|
||||
"table [$func$0,$func$1] export $func$2 as \"test\" " +
|
||||
"function $func$0($var$0:i32,$var$1:f32) : () { nop } " +
|
||||
"function $func$1($var$0:i32) : (i32) { $var$0 } " +
|
||||
"function $func$2() : () {" +
|
||||
" call $func$0 (call_indirect $type$0 [1] (2),call_import $import$0 (1.0f)) " +
|
||||
"type $type0 of function (i32) : (i32) " +
|
||||
"type $type1 of function (f32) : (f32) " +
|
||||
"type $type2 of function (i32,f32) : () " +
|
||||
"type $type3 of function () : () " +
|
||||
"import \"test\" as $import0 from \"mod\" typeof function (f32) : (f32) " +
|
||||
"table [$func0,$func1] export $func2 as \"test\" " +
|
||||
"function $func0($var0:i32,$var1:f32) : () { nop } " +
|
||||
"function $func1($var0:i32) : (i32) { $var0 } " +
|
||||
"function $func2() : () {" +
|
||||
" call $func0 (call_indirect $type0 [1] (2),call_import $import0 (1.0f)) " +
|
||||
"} memory 1,65535 {} ");
|
||||
|
@ -6422,7 +6422,10 @@ DescribeScriptedCaller(JSContext* cx, AutoFilename* filename, unsigned* lineno,
|
||||
if (column)
|
||||
*column = 0;
|
||||
|
||||
NonBuiltinFrameIter i(cx, FrameIter::STOP_AT_SAVED);
|
||||
if (!cx->compartment())
|
||||
return false;
|
||||
|
||||
NonBuiltinFrameIter i(cx, cx->compartment()->principals());
|
||||
if (i.done())
|
||||
return false;
|
||||
|
||||
|
@ -246,6 +246,8 @@ SavedFrame::HashPolicy::hash(const Lookup& lookup)
|
||||
/* static */ bool
|
||||
SavedFrame::HashPolicy::match(SavedFrame* existing, const Lookup& lookup)
|
||||
{
|
||||
MOZ_ASSERT(existing);
|
||||
|
||||
if (existing->getLine() != lookup.line)
|
||||
return false;
|
||||
|
||||
|
@ -266,7 +266,7 @@ interface nsIXPCFunctionThisTranslator : nsISupports
|
||||
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
%}
|
||||
|
||||
[noscript, uuid(f339ea52-10ce-4103-b1f2-fd9659040e3c)]
|
||||
[noscript, uuid(768507b5-b981-40c7-8276-f6a1da502a24)]
|
||||
interface nsIXPConnect : nsISupports
|
||||
{
|
||||
%{ C++
|
||||
@ -499,14 +499,6 @@ interface nsIXPConnect : nsISupports
|
||||
in JSObjectPtr sandbox,
|
||||
in int32_t version);
|
||||
|
||||
/**
|
||||
* Whether or not XPConnect should report all JS exceptions when returning
|
||||
* from JS into C++. False by default, although any value set in the
|
||||
* MOZ_REPORT_ALL_JS_EXCEPTIONS environment variable will override the value
|
||||
* passed here.
|
||||
*/
|
||||
void setReportAllJSExceptions(in boolean reportAllJSExceptions);
|
||||
|
||||
/**
|
||||
* Trigger a JS garbage collection.
|
||||
* Use a js::gcreason::Reason from jsfriendapi.h for the kind.
|
||||
|
@ -591,8 +591,6 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
|
||||
if (targetObj != result_obj)
|
||||
principal = GetObjectPrincipal(targetObj);
|
||||
|
||||
JSAutoCompartment ac(cx, targetObj);
|
||||
|
||||
/* load up the url. From here on, failures are reflected as ``custom''
|
||||
* js exceptions */
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
@ -606,6 +604,8 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
JSAutoCompartment ac(cx, targetObj);
|
||||
|
||||
// Suppress caching if we're compiling as content.
|
||||
StartupCache* cache = (principal == mSystemPrincipal)
|
||||
? StartupCache::GetSingleton()
|
||||
|
@ -774,8 +774,7 @@ nsresult
|
||||
nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
|
||||
AutoEntryScript& aes,
|
||||
const char * aPropertyName,
|
||||
const char * anInterfaceName,
|
||||
bool aForceReport)
|
||||
const char * anInterfaceName)
|
||||
{
|
||||
XPCContext * xpcc = ccx.GetXPCContext();
|
||||
JSContext * cx = ccx.GetJSContext();
|
||||
@ -818,28 +817,12 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
|
||||
// Figure out whether or not we should report this exception.
|
||||
bool reportable = xpc_IsReportableErrorCode(e_result);
|
||||
if (reportable) {
|
||||
// Always want to report forced exceptions and XPConnect's own
|
||||
// errors.
|
||||
reportable = aForceReport ||
|
||||
NS_ERROR_GET_MODULE(e_result) == NS_ERROR_MODULE_XPCONNECT;
|
||||
|
||||
// See if an environment variable was set or someone has told us
|
||||
// that a user pref was set indicating that we should report all
|
||||
// exceptions.
|
||||
if (!reportable)
|
||||
reportable = nsXPConnect::ReportAllJSExceptions();
|
||||
|
||||
// Finally, check to see if this is the last JS frame on the
|
||||
// stack. If so then we always want to report it.
|
||||
if (!reportable)
|
||||
reportable = !JS::DescribeScriptedCaller(cx);
|
||||
|
||||
// Ugly special case for GetInterface. It's "special" in the
|
||||
// same way as QueryInterface in that a failure is not
|
||||
// exceptional and shouldn't be reported. We have to do this
|
||||
// check here instead of in xpcwrappedjs (like we do for QI) to
|
||||
// avoid adding extra code to all xpcwrappedjs objects.
|
||||
if (reportable && e_result == NS_ERROR_NO_INTERFACE &&
|
||||
if (e_result == NS_ERROR_NO_INTERFACE &&
|
||||
!strcmp(anInterfaceName, "nsIInterfaceRequestor") &&
|
||||
!strcmp(aPropertyName, "getInterface")) {
|
||||
reportable = false;
|
||||
@ -997,7 +980,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
|
||||
// Throw and warn for good measure.
|
||||
JS_ReportError(cx, str);
|
||||
NS_WARNING(str);
|
||||
return CheckForException(ccx, aes, name, GetInterfaceName(), false);
|
||||
return CheckForException(ccx, aes, name, GetInterfaceName());
|
||||
}
|
||||
|
||||
RootedValue fval(cx);
|
||||
@ -1259,17 +1242,8 @@ pre_call_clean_up:
|
||||
}
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
bool forceReport;
|
||||
if (NS_FAILED(mInfo->IsFunction(&forceReport)))
|
||||
forceReport = false;
|
||||
|
||||
// May also want to check if we're moving from content->chrome and force
|
||||
// a report in that case.
|
||||
|
||||
return CheckForException(ccx, aes, name, GetInterfaceName(),
|
||||
forceReport);
|
||||
}
|
||||
if (!success)
|
||||
return CheckForException(ccx, aes, name, GetInterfaceName());
|
||||
|
||||
XPCJSRuntime::Get()->SetPendingException(nullptr); // XXX necessary?
|
||||
|
||||
|
@ -43,7 +43,6 @@ NS_IMPL_ISUPPORTS(nsXPConnect, nsIXPConnect)
|
||||
|
||||
nsXPConnect* nsXPConnect::gSelf = nullptr;
|
||||
bool nsXPConnect::gOnceAliveNowDead = false;
|
||||
uint32_t nsXPConnect::gReportAllJSExceptions = 0;
|
||||
|
||||
// Global cache of the default script security manager (QI'd to
|
||||
// nsIScriptSecurityManager) and the system principal.
|
||||
@ -67,10 +66,6 @@ nsXPConnect::nsXPConnect()
|
||||
if (!mRuntime) {
|
||||
NS_RUNTIMEABORT("Couldn't create XPCJSRuntime.");
|
||||
}
|
||||
|
||||
char* reportableEnv = PR_GetEnv("MOZ_REPORT_ALL_JS_EXCEPTIONS");
|
||||
if (reportableEnv && *reportableEnv)
|
||||
gReportAllJSExceptions = 1;
|
||||
}
|
||||
|
||||
nsXPConnect::~nsXPConnect()
|
||||
@ -983,16 +978,6 @@ nsXPConnect::JSToVariant(JSContext* ctx, HandleValue value, nsIVariant** _retval
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::SetReportAllJSExceptions(bool newval)
|
||||
{
|
||||
// Ignore if the environment variable was set.
|
||||
if (gReportAllJSExceptions != 1)
|
||||
gReportAllJSExceptions = newval ? 2 : 0;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
JSContext*
|
||||
nsXPConnect::GetCurrentJSContext()
|
||||
|
@ -303,12 +303,6 @@ public:
|
||||
bool showLocals,
|
||||
bool showThisProps) override;
|
||||
|
||||
|
||||
static bool ReportAllJSExceptions()
|
||||
{
|
||||
return gReportAllJSExceptions > 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~nsXPConnect();
|
||||
|
||||
@ -322,8 +316,6 @@ private:
|
||||
XPCJSRuntime* mRuntime;
|
||||
bool mShuttingDown;
|
||||
|
||||
static uint32_t gReportAllJSExceptions;
|
||||
|
||||
public:
|
||||
static nsIScriptSecurityManager* gScriptSecurityManager;
|
||||
static nsIPrincipal* gSystemPrincipal;
|
||||
@ -2300,8 +2292,7 @@ private:
|
||||
static nsresult CheckForException(XPCCallContext & ccx,
|
||||
mozilla::dom::AutoEntryScript& aes,
|
||||
const char * aPropertyName,
|
||||
const char * anInterfaceName,
|
||||
bool aForceReport);
|
||||
const char * anInterfaceName);
|
||||
virtual ~nsXPCWrappedJSClass();
|
||||
|
||||
nsXPCWrappedJSClass(); // not implemented
|
||||
|
@ -374,6 +374,8 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
|
||||
UpdateDisplayPortMargins();
|
||||
}
|
||||
|
||||
CSSSize oldSize = mMobileViewportSize;
|
||||
|
||||
// Update internal state.
|
||||
mIsFirstPaint = false;
|
||||
mMobileViewportSize = viewport;
|
||||
@ -381,5 +383,7 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
|
||||
// Kick off a reflow.
|
||||
mPresShell->ResizeReflowIgnoreOverride(
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.width),
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.height));
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.height),
|
||||
nsPresContext::CSSPixelsToAppUnits(oldSize.width),
|
||||
nsPresContext::CSSPixelsToAppUnits(oldSize.height));
|
||||
}
|
||||
|
@ -1905,7 +1905,7 @@ nsDocumentViewer::SetPreviousViewer(nsIContentViewer* aViewer)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
|
||||
nsDocumentViewer::SetBoundsWithFlags(const nsIntRect& aBounds, uint32_t aFlags)
|
||||
{
|
||||
NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
@ -1920,7 +1920,8 @@ nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
|
||||
} else if (mPresContext && mViewManager) {
|
||||
int32_t p2a = mPresContext->AppUnitsPerDevPixel();
|
||||
mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(mBounds.width, p2a),
|
||||
NSIntPixelsToAppUnits(mBounds.height, p2a));
|
||||
NSIntPixelsToAppUnits(mBounds.height, p2a),
|
||||
!!(aFlags & nsIContentViewer::eDelayResize));
|
||||
}
|
||||
|
||||
// If there's a previous viewer, it's the one that's actually showing,
|
||||
@ -1938,6 +1939,12 @@ nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
|
||||
{
|
||||
return SetBoundsWithFlags(aBounds, 0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentViewer::Move(int32_t aX, int32_t aY)
|
||||
{
|
||||
|
@ -418,12 +418,12 @@ public:
|
||||
* Reflow the frame model into a new width and height. The
|
||||
* coordinates for aWidth and aHeight must be in standard nscoord's.
|
||||
*/
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) = 0;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) = 0;
|
||||
/**
|
||||
* Do the same thing as ResizeReflow but even if ResizeReflowOverride was
|
||||
* called previously.
|
||||
*/
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) = 0;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) = 0;
|
||||
|
||||
/**
|
||||
* Returns true if ResizeReflowOverride has been called.
|
||||
@ -905,6 +905,11 @@ public:
|
||||
*/
|
||||
bool IsPaintingSuppressed() const { return mPaintingSuppressed; }
|
||||
|
||||
/**
|
||||
* Update the painting suppression status and do unsuppress painting if needs.
|
||||
*/
|
||||
virtual void CheckIfTimeToUnsuppressPainting() = 0;
|
||||
|
||||
/**
|
||||
* Pause painting by freezing the refresh driver of this and all parent
|
||||
* presentations. This may not have the desired effect if this pres shell
|
||||
|
@ -1769,6 +1769,8 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
mPaintSuppressionTimer->InitWithNamedFuncCallback(
|
||||
sPaintSuppressionCallback, this, delay, nsITimer::TYPE_ONE_SHOT,
|
||||
"PresShell::sPaintSuppressionCallback");
|
||||
|
||||
mPaintSuppressionExpectTime = TimeStamp::Now() + TimeDuration::FromMilliseconds(delay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1801,7 +1803,7 @@ PresShell::AsyncResizeEventCallback(nsITimer* aTimer, void* aPresShell)
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
|
||||
{
|
||||
if (mZoomConstraintsClient) {
|
||||
// If we have a ZoomConstraintsClient and the available screen area
|
||||
@ -1817,11 +1819,11 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return ResizeReflowIgnoreOverride(aWidth, aHeight);
|
||||
return ResizeReflowIgnoreOverride(aWidth, aHeight, aOldWidth, aOldHeight);
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
|
||||
{
|
||||
NS_PRECONDITION(!mIsReflowing, "Shouldn't be in reflow here!");
|
||||
|
||||
@ -1835,7 +1837,6 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsSize oldVisibleSize = mPresContext->GetVisibleArea().Size();
|
||||
mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
|
||||
|
||||
// There isn't anything useful we can do if the initial reflow hasn't happened.
|
||||
@ -1848,8 +1849,8 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
"shouldn't use unconstrained isize anymore");
|
||||
|
||||
const bool isBSizeChanging = wm.IsVertical()
|
||||
? oldVisibleSize.width != aWidth
|
||||
: oldVisibleSize.height != aHeight;
|
||||
? aOldWidth != aWidth
|
||||
: aOldHeight != aHeight;
|
||||
|
||||
RefPtr<nsViewManager> viewManagerDeathGrip = mViewManager;
|
||||
// Take this ref after viewManager so it'll make sure to go away first.
|
||||
@ -3648,6 +3649,16 @@ PresShell::ScheduleViewManagerFlush(PaintType aType)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
FlushLayoutRecursive(nsIDocument* aDocument,
|
||||
void* aData = nullptr)
|
||||
{
|
||||
MOZ_ASSERT(!aData);
|
||||
aDocument->EnumerateSubDocuments(FlushLayoutRecursive, nullptr);
|
||||
aDocument->FlushPendingNotifications(Flush_Layout);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
|
||||
bool aFlushOnHoverChange)
|
||||
@ -3672,7 +3683,10 @@ PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
|
||||
hoverGenerationBefore != restyleManager->AsGecko()->GetHoverGeneration()) {
|
||||
// Flush so that the resulting reflow happens now so that our caller
|
||||
// can suppress any synthesized mouse moves caused by that reflow.
|
||||
FlushPendingNotifications(Flush_Layout);
|
||||
// This code only ever runs for the root document, but :hover changes
|
||||
// can happen in descendant documents too, so make sure we flush
|
||||
// all of them.
|
||||
FlushLayoutRecursive(mDocument);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6503,6 +6517,8 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
nsAutoNotifyDidPaint notifyDidPaint(this, aFlags);
|
||||
AutoUpdateHitRegion updateHitRegion(this, frame);
|
||||
|
||||
CheckIfTimeToUnsuppressPainting();
|
||||
|
||||
// Whether or not we should set first paint when painting is
|
||||
// suppressed is debatable. For now we'll do it because
|
||||
// B2G relies on first paint to configure the viewport and
|
||||
@ -11520,3 +11536,15 @@ nsIPresShell::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::CheckIfTimeToUnsuppressPainting()
|
||||
{
|
||||
if (!mPaintingSuppressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (TimeStamp::Now() >= mPaintSuppressionExpectTime) {
|
||||
UnsuppressPainting();
|
||||
}
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ public:
|
||||
virtual void BeginObservingDocument() override;
|
||||
virtual void EndObservingDocument() override;
|
||||
virtual nsresult Initialize(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) override;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) override;
|
||||
virtual nsIPageSequenceFrame* GetPageSequenceFrame() const override;
|
||||
virtual nsCanvasFrame* GetCanvasFrame() const override;
|
||||
|
||||
@ -422,6 +422,8 @@ public:
|
||||
|
||||
void SetNextPaintCompressed() { mNextPaintCompressed = true; }
|
||||
|
||||
virtual void CheckIfTimeToUnsuppressPainting() override;
|
||||
|
||||
protected:
|
||||
virtual ~PresShell();
|
||||
|
||||
@ -949,6 +951,7 @@ protected:
|
||||
// or all frames are constructed, we won't paint anything but
|
||||
// our <body> background and scrollbars.
|
||||
nsCOMPtr<nsITimer> mPaintSuppressionTimer;
|
||||
mozilla::TimeStamp mPaintSuppressionExpectTime;
|
||||
|
||||
nsCOMPtr<nsITimer> mDelayedPaintTimer;
|
||||
|
||||
|
@ -1671,6 +1671,8 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
return;
|
||||
}
|
||||
|
||||
presShell->CheckIfTimeToUnsuppressPainting();
|
||||
|
||||
mResizeSuppressed = false;
|
||||
|
||||
AutoRestore<bool> restoreInRefresh(mInRefresh);
|
||||
|
@ -6,11 +6,7 @@
|
||||
#ifndef nsBlockDebugFlags_h__
|
||||
#define nsBlockDebugFlags_h__
|
||||
|
||||
#undef NOISY_FIRST_LINE // enables debug output for first-line specific layout
|
||||
#undef REALLY_NOISY_FIRST_LINE // enables extra debug output for first-line specific layout
|
||||
#undef NOISY_FIRST_LETTER // enables debug output for first-letter specific layout
|
||||
#undef NOISY_MAX_ELEMENT_SIZE // enables debug output for max element size computation
|
||||
#undef NOISY_MAXIMUM_WIDTH // enables debug output for max width computation
|
||||
#undef NOISY_FLOAT // enables debug output for float reflow (the in/out metrics for the floated block)
|
||||
#undef NOISY_FLOAT_CLEARING
|
||||
#undef NOISY_FINAL_SIZE // enables debug output for desired width/height computation, once all children have been reflowed
|
||||
|
@ -231,24 +231,6 @@ const char* nsBlockFrame::kReflowCommandType[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef REALLY_NOISY_FIRST_LINE
|
||||
static void
|
||||
DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
{
|
||||
fputs(gap, stdout);
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": ");
|
||||
nsStyleContext* sc = aFrame->StyleContext();
|
||||
while (nullptr != sc) {
|
||||
nsStyleContext* psc;
|
||||
printf("%p ", sc);
|
||||
psc = sc->GetParent();
|
||||
sc = psc;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef REFLOW_STATUS_COVERAGE
|
||||
static void
|
||||
RecordReflowStatus(bool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
|
||||
@ -1505,7 +1487,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
ListTag(stdout);
|
||||
printf(": mBCoord=%d mIsBEndMarginRoot=%s mPrevBEndMargin=%d bp=%d,%d\n",
|
||||
aState.mBCoord, aState.GetFlag(BRS_ISBENDMARGINROOT) ? "yes" : "no",
|
||||
aState.mPrevBEndMargin,
|
||||
aState.mPrevBEndMargin.get(),
|
||||
borderPadding.BStart(wm), borderPadding.BEnd(wm));
|
||||
#endif
|
||||
|
||||
@ -1732,7 +1714,10 @@ nsBlockFrame::ComputeOverflowAreas(const nsRect& aBounds,
|
||||
|
||||
#ifdef NOISY_COMBINED_AREA
|
||||
ListTag(stdout);
|
||||
printf(": ca=%d,%d,%d,%d\n", area.x, area.y, area.width, area.height);
|
||||
const nsRect& vis = areas.VisualOverflow();
|
||||
printf(": VisualOverflowArea CA=%d,%d,%d,%d\n", vis.x, vis.y, vis.width, vis.height);
|
||||
const nsRect& scr = areas.ScrollableOverflow();
|
||||
printf(": ScrollableOverflowArea CA=%d,%d,%d,%d\n", scr.x, scr.y, scr.width, scr.height);
|
||||
#endif
|
||||
|
||||
aOverflowAreas = areas;
|
||||
@ -3644,7 +3629,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
printf(": reflow incomplete, frame=");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf(" prevBEndMargin=%d, setting to zero\n",
|
||||
aState.mPrevBEndMargin);
|
||||
aState.mPrevBEndMargin.get());
|
||||
#endif
|
||||
aState.mPrevBEndMargin.Zero();
|
||||
}
|
||||
@ -3672,7 +3657,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
printf(": reflow complete but overflow incomplete for ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf(" prevBEndMargin=%d collapsedBEndMargin=%d\n",
|
||||
aState.mPrevBEndMargin, collapsedBEndMargin.get());
|
||||
aState.mPrevBEndMargin.get(), collapsedBEndMargin.get());
|
||||
#endif
|
||||
aState.mPrevBEndMargin = collapsedBEndMargin;
|
||||
}
|
||||
@ -3683,7 +3668,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
printf(": reflow complete for ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf(" prevBEndMargin=%d collapsedBEndMargin=%d\n",
|
||||
aState.mPrevBEndMargin, collapsedBEndMargin.get());
|
||||
aState.mPrevBEndMargin.get(), collapsedBEndMargin.get());
|
||||
#endif
|
||||
aState.mPrevBEndMargin = collapsedBEndMargin;
|
||||
}
|
||||
@ -3692,8 +3677,8 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
printf(": frame=");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf(" carriedOutBEndMargin=%d collapsedBEndMargin=%d => %d\n",
|
||||
brc.GetCarriedOutBEndMargin(), collapsedBEndMargin.get(),
|
||||
aState.mPrevBEndMargin);
|
||||
brc.GetCarriedOutBEndMargin().get(), collapsedBEndMargin.get(),
|
||||
aState.mPrevBEndMargin.get());
|
||||
#endif
|
||||
} else {
|
||||
if ((aLine == mLines.front() && !GetPrevInFlow()) ||
|
||||
@ -4106,7 +4091,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
aLineLayout.SetDirtyNextLine();
|
||||
}
|
||||
|
||||
#ifdef REALLY_NOISY_REFLOW_CHILD
|
||||
#ifdef REALLY_NOISY_REFLOW
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": status=%x\n", frameReflowStatus);
|
||||
#endif
|
||||
@ -6139,8 +6124,8 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
||||
#ifdef NOISY_FLOAT
|
||||
printf("Reflow Float %p in parent %p, availSpace(%d,%d,%d,%d)\n",
|
||||
aFloat, this,
|
||||
aFloatAvailableSpace.IStart(wm), aFloatAvailableSpace.BStart(wm),
|
||||
aFloatAvailableSpace.ISize(wm), aFloatAvailableSpace.BSize(wm)
|
||||
aAdjustedAvailableSpace.IStart(wm), aAdjustedAvailableSpace.BStart(wm),
|
||||
aAdjustedAvailableSpace.ISize(wm), aAdjustedAvailableSpace.BSize(wm)
|
||||
);
|
||||
#endif
|
||||
|
||||
|
@ -3468,6 +3468,11 @@ public:
|
||||
ListTag(t, aFrame);
|
||||
fputs(t.get(), out);
|
||||
}
|
||||
static void ListTag(FILE* out, const nsFrameList& aFrameList) {
|
||||
for (nsIFrame* frame : aFrameList) {
|
||||
ListTag(out, frame);
|
||||
}
|
||||
}
|
||||
void ListTag(nsACString& aTo) const;
|
||||
nsAutoCString ListTag() const {
|
||||
nsAutoCString tag;
|
||||
|
@ -212,6 +212,7 @@ RenderFrameParent::OwnerContentChanged(nsIContent* aContent)
|
||||
// Perhaps the document containing this frame currently has no presentation?
|
||||
if (lm && lm->AsClientLayerManager()) {
|
||||
lm->AsClientLayerManager()->GetRemoteRenderer()->SendAdoptChild(mLayersId);
|
||||
FrameLayerBuilder::InvalidateAllLayers(lm);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="-moz-column-width: 12em;
|
||||
border: silver solid;
|
||||
height: 5em;">
|
||||
<div style="border: dotted;
|
||||
<div style="border: solid;
|
||||
background: aqua;
|
||||
color: gray;">
|
||||
blah<br>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<div style="-moz-column-width: 12em;
|
||||
border: silver solid;
|
||||
height: 5em;">
|
||||
<div style="border: dotted;
|
||||
<div style="border: solid;
|
||||
background: aqua;
|
||||
color: gray;">
|
||||
blah<br>
|
||||
|
@ -146,126 +146,111 @@ function step6() {
|
||||
step6called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setResize("step7()");
|
||||
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
|
||||
setTimeout(step7, 500); // time to detect oscillations if they exist
|
||||
}
|
||||
|
||||
var step7called = false;
|
||||
function step7() {
|
||||
is(step7called, false, "step7 called only once");
|
||||
is(step7called, false, "step7 called only once (more than two cycles of oscillation)");
|
||||
if (step7called)
|
||||
return;
|
||||
step7called = true;
|
||||
if (getComputedStyle(iframe, "").width == "50px") {
|
||||
// The two resize events may be coalesced into a single one.
|
||||
step8();
|
||||
return;
|
||||
}
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setResize("step8()");
|
||||
/* expect to get a second resize from the oscillation */
|
||||
}
|
||||
|
||||
var step8called = false;
|
||||
function step8() {
|
||||
is(step8called, false, "step8 called only once (more than two cycles of oscillation)");
|
||||
if (step8called)
|
||||
return;
|
||||
step8called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setTimeout(step9, 500); // time to detect oscillations if they exist
|
||||
setTimeout(step8, 500); // time to detect oscillations if they exist
|
||||
}
|
||||
|
||||
/* test the same case with scrolltop */
|
||||
|
||||
var step8called = false;
|
||||
function step8() {
|
||||
is(step8called, false, "step8 called only once");
|
||||
step8called = true;
|
||||
iframe.contentDocument.body.removeAttribute("onresize");
|
||||
/* move the mouse out of the way */
|
||||
synthesizeMouse(divtwoparent, 200, 5, moveEvent, window);
|
||||
divtwoparent.scrollLeft = 5;
|
||||
setResize("step9()");
|
||||
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
|
||||
/* mouse now over 7, 5 */
|
||||
}
|
||||
|
||||
var step9called = false;
|
||||
function step9() {
|
||||
is(step9called, false, "step9 called only once");
|
||||
step9called = true;
|
||||
iframe.contentDocument.body.removeAttribute("onresize");
|
||||
/* move the mouse out of the way */
|
||||
synthesizeMouse(divtwoparent, 200, 5, moveEvent, window);
|
||||
divtwoparent.scrollLeft = 5;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setResize("step10()");
|
||||
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
|
||||
/* mouse now over 7, 5 */
|
||||
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
|
||||
}
|
||||
|
||||
var step10called = false;
|
||||
function step10() {
|
||||
is(step10called, false, "step10 called only once");
|
||||
step10called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setResize("step11()");
|
||||
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
|
||||
}
|
||||
|
||||
var step11called = false;
|
||||
function step11() {
|
||||
is(step11called, false, "step11 called only once");
|
||||
step11called = true;
|
||||
if (getComputedStyle(iframe, "").width == "100px") {
|
||||
// The two resize events may be coalesced into a single one.
|
||||
step12();
|
||||
step11();
|
||||
return;
|
||||
}
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setResize("step12()");
|
||||
setResize("step11()");
|
||||
/* expect to get a second resize from the oscillation */
|
||||
}
|
||||
|
||||
var step11called = false;
|
||||
function step11() {
|
||||
is(step11called, false, "step11 called only once (more than two cycles of oscillation)");
|
||||
if (step11called)
|
||||
return;
|
||||
step11called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setTimeout(step12, 500); // time to detect oscillations if they exist
|
||||
}
|
||||
|
||||
var step12called = false;
|
||||
function step12() {
|
||||
is(step12called, false, "step12 called only once (more than two cycles of oscillation)");
|
||||
if (step12called)
|
||||
return;
|
||||
is(step12called, false, "step12 called only once");
|
||||
step12called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setTimeout(step13, 500); // time to detect oscillations if they exist
|
||||
setResize("step13()");
|
||||
divtwoparent.scrollLeft = 25; /* mouse now over 27,5 */
|
||||
}
|
||||
|
||||
var step13called = false;
|
||||
function step13() {
|
||||
is(step13called, false, "step13 called only once");
|
||||
step13called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setResize("step14()");
|
||||
divtwoparent.scrollLeft = 25; /* mouse now over 27,5 */
|
||||
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
|
||||
}
|
||||
|
||||
var step14called = false;
|
||||
function step14() {
|
||||
is(step14called, false, "step14 called only once");
|
||||
step14called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setResize("step15()");
|
||||
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
|
||||
}
|
||||
|
||||
var step15called = false;
|
||||
function step15() {
|
||||
is(step15called, false, "step15 called only once");
|
||||
step15called = true;
|
||||
if (getComputedStyle(iframe, "").width == "50px") {
|
||||
// The two resize events may be coalesced into a single one.
|
||||
step16();
|
||||
step15();
|
||||
return;
|
||||
}
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
|
||||
":hover applies");
|
||||
setResize("step16()");
|
||||
setResize("step15()");
|
||||
/* expect to get a second resize from the oscillation */
|
||||
}
|
||||
|
||||
var step16called = false;
|
||||
function step16() {
|
||||
is(step16called, false, "step16 called only once (more than two cycles of oscillation)");
|
||||
if (step16called)
|
||||
var step15called = false;
|
||||
function step15() {
|
||||
is(step15called, false, "step15 called only once (more than two cycles of oscillation)");
|
||||
if (step15called)
|
||||
return;
|
||||
step16called = true;
|
||||
step15called = true;
|
||||
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
|
||||
":hover does not apply");
|
||||
setTimeout(finish, 500); // time to detect oscillations if they exist
|
||||
|
@ -285,7 +285,8 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
else {
|
||||
window->SetPositionAndSize(rect.x, rect.y, rect.width, rect.height, true); // do the repaint.
|
||||
window->SetPositionAndSize(rect.x, rect.y, rect.width, rect.height,
|
||||
nsIBaseWindow::eRepaint); // do the repaint.
|
||||
}
|
||||
|
||||
doDefault = false;
|
||||
|
@ -657,7 +657,6 @@ pref("services.push.enabled", false);
|
||||
pref("device.camera.enabled", true);
|
||||
pref("media.realtime_decoder.enabled", true);
|
||||
|
||||
pref("dom.report_all_js_exceptions", true);
|
||||
pref("javascript.options.showInConsole", true);
|
||||
|
||||
pref("full-screen-api.enabled", true);
|
||||
|
@ -170,17 +170,6 @@ public class AppConstants {
|
||||
false;
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Whether this APK was built with constrained resources --
|
||||
* no xhdpi+ images, for example.
|
||||
*/
|
||||
public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
|
||||
//#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
|
||||
true;
|
||||
//#else
|
||||
false;
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_SERVICES_HEALTHREPORT =
|
||||
//#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||
true;
|
||||
|
@ -462,8 +462,6 @@ ANDROID_AAPT_IGNORE := !.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc
|
||||
# thinking aapt's outputs are stale. This is safe because Make
|
||||
# removes the target file if any recipe command fails.
|
||||
|
||||
CONSTRAINED_AAPT_CONFIGURATIONS := hdpi
|
||||
|
||||
define aapt_command
|
||||
$(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2)
|
||||
@$$(TOUCH) $$@
|
||||
@ -481,7 +479,6 @@ $(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2)
|
||||
-F $(3) \
|
||||
-J $(4) \
|
||||
--output-text-symbols $(5) \
|
||||
$(if $(MOZ_ANDROID_RESOURCE_CONSTRAINED),-c $(CONSTRAINED_AAPT_CONFIGURATIONS),) \
|
||||
--ignore-assets "$$(ANDROID_AAPT_IGNORE)"
|
||||
endef
|
||||
|
||||
|
@ -45,11 +45,8 @@ if test "$COMPILE_ENVIRONMENT"; then
|
||||
MOZ_ENABLE_SZIP=1
|
||||
fi
|
||||
|
||||
# Enable second screen using native Android libraries, provided we're
|
||||
# not resource constrained.
|
||||
if test -z "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then
|
||||
MOZ_NATIVE_DEVICES=1
|
||||
fi
|
||||
# Enable second screen using native Android libraries.
|
||||
MOZ_NATIVE_DEVICES=1
|
||||
|
||||
# Enable install tracking SDK if we have Google Play support; MOZ_NATIVE_DEVICES
|
||||
# is a proxy flag for that support.
|
||||
|
@ -49,10 +49,9 @@ nsStreamListenerTee::OnStopRequest(nsIRequest *request,
|
||||
}
|
||||
|
||||
nsresult rv = mListener->OnStopRequest(request, context, status);
|
||||
mListener = nullptr;
|
||||
if (mObserver)
|
||||
mObserver->OnStopRequest(request, context, status);
|
||||
mObserver = nullptr;
|
||||
mObserver = 0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user