diff --git a/devtools/client/framework/toolbox-process-window.js b/devtools/client/framework/toolbox-process-window.js index fea73a0071f1..1e350b774b7a 100644 --- a/devtools/client/framework/toolbox-process-window.js +++ b/devtools/client/framework/toolbox-process-window.js @@ -104,6 +104,7 @@ function setPrefDefaults() { Services.prefs.setBoolPref("devtools.performance.ui.show-platform-data", true); Services.prefs.setBoolPref("devtools.inspector.showAllAnonymousContent", true); Services.prefs.setBoolPref("browser.dom.window.dump.enabled", true); + Services.prefs.setBoolPref("devtools.console.stdout.chrome", true); Services.prefs.setBoolPref("devtools.command-button-noautohide.enabled", true); // Bug 1225160 - Using source maps with browser debugging can lead to a crash Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", false); diff --git a/devtools/docs/getting-started/development-profiles.md b/devtools/docs/getting-started/development-profiles.md index 5d141a425b15..d1ce89231826 100644 --- a/devtools/docs/getting-started/development-profiles.md +++ b/devtools/docs/getting-started/development-profiles.md @@ -29,6 +29,8 @@ You can change the value of these preferences by going to `about:config`: | Preference name | Value | Comments | | --------------- | --------------- | -------- | | `browser.dom.window.dump.enabled` | `true` | Adds global `dump` function to log strings to `stdout` | +| `devtools.console.stdout.chrome` | `true` | Allows console API to write to `stdout` when used by chrome content | +| `devtools.console.stdout.content` | `true` | Allows console API to write to `stdout` when used by content | | `devtools.debugger.log` (*) | `true` | Dump packets sent over remote debugging protocol to `stdout`.

The [remote protocol inspector add-on](https://github.com/firebug/rdp-inspector/wiki) might be useful too. | | `devtools.dump.emit` (*) | `true` | Log event notifications from the EventEmitter class
(found at `devtools/shared/event-emitter.js`). | diff --git a/devtools/server/actors/replay/debugger.js b/devtools/server/actors/replay/debugger.js index 0c546e149f6d..c0f0cd0521f5 100644 --- a/devtools/server/actors/replay/debugger.js +++ b/devtools/server/actors/replay/debugger.js @@ -243,12 +243,15 @@ ReplayDebugger.prototype = { // Object methods ///////////////////////////////////////////////////////// - _getObject(id) { + // Objects which |forConsole| is set are objects that were logged in console + // messages, and had their properties recorded so that they can be inspected + // without switching to a replaying child. + _getObject(id, forConsole) { if (id && !this._objects[id]) { const data = this._sendRequest({ type: "getObject", id }); switch (data.kind) { case "Object": - this._objects[id] = new ReplayDebuggerObject(this, data); + this._objects[id] = new ReplayDebuggerObject(this, data, forConsole); break; case "Environment": this._objects[id] = new ReplayDebuggerEnvironment(this, data); @@ -257,13 +260,17 @@ ReplayDebugger.prototype = { ThrowError("Unknown object kind"); } } - return this._objects[id]; + const rv = this._objects[id]; + if (forConsole) { + rv._forConsole = true; + } + return rv; }, - _convertValue(value) { - if (value && typeof value == "object") { + _convertValue(value, forConsole) { + if (isNonNullObject(value)) { if (value.object) { - return this._getObject(value.object); + return this._getObject(value.object, forConsole); } else if (value.special == "undefined") { return undefined; } else if (value.special == "NaN") { @@ -332,7 +339,8 @@ ReplayDebugger.prototype = { // other contents of the message can be left alone. if (message.messageType == "ConsoleAPI" && message.arguments) { for (let i = 0; i < message.arguments.length; i++) { - message.arguments[i] = this._convertValue(message.arguments[i]); + message.arguments[i] = this._convertValue(message.arguments[i], + /* forConsole = */ true); } } return message; @@ -497,7 +505,7 @@ function ReplayDebuggerFrame(dbg, data) { this._data = data; if (this._data.arguments) { this._data.arguments = - this._data.arguments.map(this._dbg._convertValue.bind(this._dbg)); + this._data.arguments.map(a => this._dbg._convertValue(a)); } } @@ -606,9 +614,10 @@ ReplayDebuggerFrame.prototype = { // ReplayDebuggerObject /////////////////////////////////////////////////////////////////////////////// -function ReplayDebuggerObject(dbg, data) { +function ReplayDebuggerObject(dbg, data, forConsole) { this._dbg = dbg; this._data = data; + this._forConsole = forConsole; this._properties = null; } @@ -623,7 +632,6 @@ ReplayDebuggerObject.prototype = { get isArrowFunction() { return this._data.isArrowFunction; }, get isGeneratorFunction() { return this._data.isGeneratorFunction; }, get isAsyncFunction() { return this._data.isAsyncFunction; }, - get proto() { return this._dbg._getObject(this._data.proto); }, get class() { return this._data.class; }, get name() { return this._data.name; }, get displayName() { return this._data.displayName; }, @@ -641,6 +649,13 @@ ReplayDebuggerObject.prototype = { isFrozen() { return this._data.isFrozen; }, unwrap() { return this.isProxy ? NYI() : this; }, + get proto() { + // Don't allow inspection of the prototypes of objects logged to the + // console. This is a hack that prevents the object inspector from crawling + // the object's prototype chain. + return this._forConsole ? null : this._dbg._getObject(this._data.proto); + }, + unsafeDereference() { // Direct access to the referent is not currently available. return null; @@ -664,10 +679,10 @@ ReplayDebuggerObject.prototype = { _ensureProperties() { if (!this._properties) { - const properties = this._dbg._sendRequestAllowDiverge({ - type: "getObjectProperties", - id: this._data.id, - }); + const id = this._data.id; + const properties = this._forConsole + ? this._dbg._sendRequest({ type: "getObjectPropertiesForConsole", id }) + : this._dbg._sendRequestAllowDiverge({ type: "getObjectProperties", id }); this._properties = {}; properties.forEach(({name, desc}) => { this._properties[name] = desc; }); } @@ -791,4 +806,8 @@ function assert(v) { } } +function isNonNullObject(obj) { + return obj && (typeof obj == "object" || typeof obj == "function"); +} + module.exports = ReplayDebugger; diff --git a/devtools/server/actors/replay/replay.js b/devtools/server/actors/replay/replay.js index b3f23925b6e7..469e567e0a01 100644 --- a/devtools/server/actors/replay/replay.js +++ b/devtools/server/actors/replay/replay.js @@ -116,6 +116,10 @@ function scriptFrameForIndex(index) { return frame; } +function isNonNullObject(obj) { + return obj && (typeof obj == "object" || typeof obj == "function"); +} + /////////////////////////////////////////////////////////////////////////////// // Persistent Script State /////////////////////////////////////////////////////////////////////////////// @@ -179,6 +183,26 @@ dbg.onNewScript = function(script) { installPendingHandlers(); }; +const gConsoleObjectProperties = new Map(); + +function shouldSaveConsoleProperty({ desc }) { + // When logging an object to the console, only properties captured here will + // be shown. We limit this to non-object data properties, as more complex + // properties have two problems: A) to inspect them we will need to switch to + // a replaying child process, which is very slow when there are many console + // messages, and B) trying to access objects transitively referred to by + // logged console objects will fail when unpaused, and depends on the current + // state of the process otherwise. + return "value" in desc && !isNonNullObject(desc.value); +} + +function saveConsoleObjectProperties(obj) { + if (obj instanceof Debugger.Object) { + const properties = getObjectProperties(obj).filter(shouldSaveConsoleProperty); + gConsoleObjectProperties.set(obj, properties); + } +} + /////////////////////////////////////////////////////////////////////////////// // Console Message State /////////////////////////////////////////////////////////////////////////////// @@ -250,6 +274,7 @@ Services.obs.addObserver({ // Message arguments are preserved as debuggee values. if (apiMessage.arguments) { contents.arguments = apiMessage.arguments.map(makeDebuggeeValue); + contents.arguments.forEach(saveConsoleObjectProperties); } newConsoleMessage("ConsoleAPI", null, contents); @@ -465,7 +490,7 @@ function convertCompletionValue(value) { } function makeDebuggeeValue(value) { - if (value && typeof value == "object") { + if (isNonNullObject(value)) { assert(!(value instanceof Debugger.Object)); const global = Cu.getGlobalForObject(value); const dbgGlobal = dbg.makeGlobalObjectReference(global); @@ -517,6 +542,24 @@ function forwardToScript(name) { return request => gScripts.getObject(request.id)[name](request.value); } +function getObjectProperties(object) { + const names = object.getOwnPropertyNames(); + + return names.map(name => { + const desc = object.getOwnPropertyDescriptor(name); + if ("value" in desc) { + desc.value = convertValue(desc.value); + } + if ("get" in desc) { + desc.get = getObjectId(desc.get); + } + if ("set" in desc) { + desc.set = getObjectId(desc.set); + } + return { name, desc }; + }); +} + /////////////////////////////////////////////////////////////////////////////// // Handlers /////////////////////////////////////////////////////////////////////////////// @@ -626,21 +669,16 @@ const gRequestHandlers = { } const object = gPausedObjects.getObject(request.id); - const names = object.getOwnPropertyNames(); + return getObjectProperties(object); + }, - return names.map(name => { - const desc = object.getOwnPropertyDescriptor(name); - if ("value" in desc) { - desc.value = convertValue(desc.value); - } - if ("get" in desc) { - desc.get = getObjectId(desc.get); - } - if ("set" in desc) { - desc.set = getObjectId(desc.set); - } - return { name, desc }; - }); + getObjectPropertiesForConsole(request) { + const object = gPausedObjects.getObject(request.id); + const properties = gConsoleObjectProperties.get(object); + if (!properties) { + throw new Error("Console object properties not saved"); + } + return properties; }, getEnvironmentNames(request) { diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index cdaf9ee47dba..5b26a64de762 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -545,10 +545,20 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { if (steppingType == "finish") { const parentFrame = thread._getNextStepFrame(this); if (parentFrame && parentFrame.script) { + // We can't use the completion value in stepping hooks if we're + // replaying, as we can't use its contents after resuming. + const ncompletion = thread.dbg.replaying ? null : completion; const { onStep, onPop } = thread._makeSteppingHooks( - originalLocation, "next", false, completion + originalLocation, "next", false, ncompletion ); - parentFrame.onStep = onStep; + if (thread.dbg.replaying) { + const offsets = + thread._findReplayingStepOffsets(originalLocation, parentFrame, + /* rewinding = */ false); + parentFrame.setReplayingOnStep(onStep, offsets); + } else { + parentFrame.onStep = onStep; + } // We need the onPop alongside the onStep because it is possible that // the parent frame won't have any steppable offsets, and we want to // make sure that we always pause in the parent _somewhere_. diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 8ef0483d2183..e9f5fbea0ba7 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -484,6 +484,15 @@ WebGLContext::CreateAndInitGL(bool forceEnabled, return false; } + // WebGL can't be used when recording/replaying. + if (recordreplay::IsRecordingOrReplaying()) { + FailureReason reason; + reason.info = "Can't use WebGL when recording or replaying (https://bugzil.la/1506467)."; + out_failReasons->push_back(reason); + GenerateWarning("%s", reason.info.BeginReading()); + return false; + } + // WebGL2 is separately blocked: if (IsWebGL2()) { const nsCOMPtr gfxInfo = services::GetGfxInfo(); diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp index f90d38b84d54..e4860c4d6eea 100644 --- a/dom/console/Console.cpp +++ b/dom/console/Console.cpp @@ -1093,7 +1093,9 @@ Console::Console(JSContext* aCx, nsIGlobalObject* aGlobal, { // Let's enable the dumping to stdout by default for chrome. if (nsContentUtils::ThreadsafeIsSystemCaller(aCx)) { - mDumpToStdout = DOMPrefs::DumpEnabled(); + mDumpToStdout = StaticPrefs::devtools_console_stdout_chrome(); + } else { + mDumpToStdout = StaticPrefs::devtools_console_stdout_content(); } mozilla::HoldJSObjects(this); diff --git a/dom/media/tests/crashtests/1505957.html b/dom/media/tests/crashtests/1505957.html new file mode 100644 index 000000000000..85a67f1c290c --- /dev/null +++ b/dom/media/tests/crashtests/1505957.html @@ -0,0 +1,23 @@ + + + + + + diff --git a/dom/media/tests/crashtests/crashtests.list b/dom/media/tests/crashtests/crashtests.list index f7a980a9bc2b..efec885d499e 100644 --- a/dom/media/tests/crashtests/crashtests.list +++ b/dom/media/tests/crashtests/crashtests.list @@ -24,3 +24,4 @@ pref(browser.link.open_newwindow,2) load 1429507_1.html # window.open() in tab d pref(browser.link.open_newwindow,2) load 1429507_2.html # window.open() in tab doesn't work for crashtest in e10s, this opens a new window instead load 1453030.html skip-if(Android) load 1490700.html # No screenshare on Android +load 1505957.html diff --git a/embedding/ios/GeckoEmbed/GeckoEmbed/browser/defaults/preferences/prefs.js b/embedding/ios/GeckoEmbed/GeckoEmbed/browser/defaults/preferences/prefs.js index 464b02234842..124a79b02fd0 100644 --- a/embedding/ios/GeckoEmbed/GeckoEmbed/browser/defaults/preferences/prefs.js +++ b/embedding/ios/GeckoEmbed/GeckoEmbed/browser/defaults/preferences/prefs.js @@ -1,3 +1,4 @@ pref("toolkit.defaultChromeURI", "chrome://mybrowser/content/hello.xul"); pref("browser.dom.window.dump.enabled", true); +pref("devtools.console.stdout.chrome", true); pref("dom.max_script_run_time", 0); diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index c6e1b43da5b0..5585477f6f88 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -16,6 +16,7 @@ #include "mozilla/gfx/BaseSize.h" // for BaseSize #include "mozilla/gfx/Logging.h" // for gfxCriticalError #include "mozilla/layers/ISurfaceAllocator.h" +#include "mozilla/webrender/WebRenderAPI.h" #include "nsRegion.h" // for nsIntRegion #include "AndroidSurfaceTexture.h" #include "GfxTexturesReporter.h" // for GfxTexturesReporter @@ -26,6 +27,10 @@ #include "mozilla/layers/MacIOSurfaceTextureHostOGL.h" #endif +#ifdef MOZ_WIDGET_ANDROID +#include "mozilla/webrender/RenderAndroidSurfaceTextureHostOGL.h" +#endif + using namespace mozilla::gl; using namespace mozilla::gfx; @@ -678,6 +683,66 @@ SurfaceTextureHost::DeallocateDeviceData() } } +void +SurfaceTextureHost::CreateRenderTexture(const wr::ExternalImageId& aExternalImageId) +{ + RefPtr texture = + new wr::RenderAndroidSurfaceTextureHostOGL(mSurfTex, mSize, mFormat, mContinuousUpdate); + wr::RenderThread::Get()->RegisterExternalImage(wr::AsUint64(aExternalImageId), texture.forget()); +} + +void +SurfaceTextureHost::PushResourceUpdates(wr::TransactionBuilder& aResources, + ResourceUpdateOp aOp, + const Range& aImageKeys, + const wr::ExternalImageId& aExtID) +{ + auto method = aOp == TextureHost::ADD_IMAGE ? &wr::TransactionBuilder::AddExternalImage + : &wr::TransactionBuilder::UpdateExternalImage; + auto bufferType = wr::WrExternalImageBufferType::TextureRectHandle; + + switch (GetFormat()) { + case gfx::SurfaceFormat::R8G8B8X8: + case gfx::SurfaceFormat::R8G8B8A8: { + MOZ_ASSERT(aImageKeys.length() == 1); + + // XXX Add RGBA handling. Temporary hack to avoid crash + // With BGRA format setting, rendering works without problem. + auto format = GetFormat() == gfx::SurfaceFormat::R8G8B8A8 ? gfx::SurfaceFormat::B8G8R8A8 + : gfx::SurfaceFormat::B8G8R8X8; + wr::ImageDescriptor descriptor(GetSize(), format); + (aResources.*method)(aImageKeys[0], descriptor, aExtID, bufferType, 0); + break; + } + default: { + MOZ_ASSERT_UNREACHABLE("unexpected to be called"); + } + } +} + +void +SurfaceTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder, + const wr::LayoutRect& aBounds, + const wr::LayoutRect& aClip, + wr::ImageRendering aFilter, + const Range& aImageKeys) +{ + switch (GetFormat()) { + case gfx::SurfaceFormat::R8G8B8X8: + case gfx::SurfaceFormat::R8G8B8A8: + case gfx::SurfaceFormat::B8G8R8A8: + case gfx::SurfaceFormat::B8G8R8X8: { + + MOZ_ASSERT(aImageKeys.length() == 1); + aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0], !(mFlags & TextureFlags::NON_PREMULTIPLIED)); + break; + } + default: { + MOZ_ASSERT_UNREACHABLE("unexpected to be called"); + } + } +} + #endif // MOZ_WIDGET_ANDROID //////////////////////////////////////////////////////////////////////// diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index 1255578e7341..519fa8fe99db 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -26,6 +26,7 @@ #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor #include "mozilla/layers/TextureHost.h" // for TextureHost, etc #include "mozilla/mozalloc.h" // for operator delete, etc +#include "mozilla/webrender/RenderThread.h" #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_WARNING #include "nsISupportsImpl.h" // for TextureImage::Release, etc @@ -474,6 +475,19 @@ public: virtual const char* Name() override { return "SurfaceTextureHost"; } + virtual void CreateRenderTexture(const wr::ExternalImageId& aExternalImageId) override; + + virtual void PushResourceUpdates(wr::TransactionBuilder& aResources, + ResourceUpdateOp aOp, + const Range& aImageKeys, + const wr::ExternalImageId& aExtID) override; + + virtual void PushDisplayItems(wr::DisplayListBuilder& aBuilder, + const wr::LayoutRect& aBounds, + const wr::LayoutRect& aClip, + wr::ImageRendering aFilter, + const Range& aImageKeys) override; + protected: bool EnsureAttached(); diff --git a/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.cpp b/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.cpp new file mode 100644 index 000000000000..58f577eb6a37 --- /dev/null +++ b/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.cpp @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "RenderAndroidSurfaceTextureHostOGL.h" + +#include "mozilla/gfx/Logging.h" + +namespace mozilla { +namespace wr { + +RenderAndroidSurfaceTextureHostOGL::RenderAndroidSurfaceTextureHostOGL( + const java::GeckoSurfaceTexture::GlobalRef& aSurfTex, + gfx::IntSize aSize, + gfx::SurfaceFormat aFormat, + bool aContinuousUpdate) + : mSurfTex(aSurfTex) + , mSize(aSize) +{ + MOZ_COUNT_CTOR_INHERITED(RenderAndroidSurfaceTextureHostOGL, RenderTextureHostOGL); + + if (mSurfTex) { + mSurfTex->IncrementUse(); + } +} + +RenderAndroidSurfaceTextureHostOGL::~RenderAndroidSurfaceTextureHostOGL() +{ + MOZ_COUNT_DTOR_INHERITED(RenderAndroidSurfaceTextureHostOGL, RenderTextureHostOGL); + DeleteTextureHandle(); + if (mSurfTex) { + mSurfTex->DecrementUse(); + } +} + +GLuint +RenderAndroidSurfaceTextureHostOGL::GetGLHandle(uint8_t aChannelIndex) const +{ + if (!mSurfTex) { + return 0; + } + return mSurfTex->GetTexName(); +} + +gfx::IntSize +RenderAndroidSurfaceTextureHostOGL::GetSize(uint8_t aChannelIndex) const +{ + return mSize; +} + +wr::WrExternalImage +RenderAndroidSurfaceTextureHostOGL::Lock(uint8_t aChannelIndex, + gl::GLContext* aGL, + wr::ImageRendering aRendering) +{ + MOZ_ASSERT(aChannelIndex == 0); + + if (mGL.get() != aGL) { + // release the texture handle in the previous gl context + DeleteTextureHandle(); + mGL = aGL; + mGL->MakeCurrent(); + } + + if (!mSurfTex || !mGL || !mGL->MakeCurrent()) { + return InvalidToWrExternalImage(); + } + + if (!mSurfTex->IsAttachedToGLContext((int64_t)mGL.get())) { + GLuint texName; + mGL->fGenTextures(1, &texName); + // Cache rendering filter. + mCachedRendering = aRendering; + ActivateBindAndTexParameteri(mGL, + LOCAL_GL_TEXTURE0, + LOCAL_GL_TEXTURE_EXTERNAL_OES, + texName, + aRendering); + + if (NS_FAILED(mSurfTex->AttachToGLContext((int64_t)mGL.get(), texName))) { + MOZ_ASSERT(0); + mGL->fDeleteTextures(1, &texName); + return InvalidToWrExternalImage();; + } + } else if(IsFilterUpdateNecessary(aRendering)) { + // Cache new rendering filter. + mCachedRendering = aRendering; + ActivateBindAndTexParameteri(mGL, + LOCAL_GL_TEXTURE0, + LOCAL_GL_TEXTURE_EXTERNAL_OES, + mSurfTex->GetTexName(), + aRendering); + } + + // XXX Call UpdateTexImage() only when it is necessary. + // For now, alyways call UpdateTexImage(). + //if (mContinuousUpdate) { + mSurfTex->UpdateTexImage(); + //} + + return NativeTextureToWrExternalImage(mSurfTex->GetTexName(), 0, 0, + mSize.width, mSize.height); +} + +void +RenderAndroidSurfaceTextureHostOGL::Unlock() +{ +} + +void +RenderAndroidSurfaceTextureHostOGL::DeleteTextureHandle() +{ + // XXX Do we need to call mSurfTex->DetachFromGLContext() here? + // But Surface texture is shared among many SurfaceTextureHosts. +} + +} // namespace wr +} // namespace mozilla diff --git a/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.h b/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.h new file mode 100644 index 000000000000..14202ec83349 --- /dev/null +++ b/gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MOZILLA_GFX_RENDERANDROIDSURFACETEXTUREHOSTOGL_H +#define MOZILLA_GFX_RENDERANDROIDSURFACETEXTUREHOSTOGL_H + +#include "GeneratedJNIWrappers.h" +#include "mozilla/layers/TextureHostOGL.h" +#include "RenderTextureHostOGL.h" + +namespace mozilla { + +namespace wr { + +class RenderAndroidSurfaceTextureHostOGL final : public RenderTextureHostOGL +{ +public: + explicit RenderAndroidSurfaceTextureHostOGL(const java::GeckoSurfaceTexture::GlobalRef& aSurfTex, + gfx::IntSize aSize, + gfx::SurfaceFormat aFormat, + bool aContinuousUpdate); + + wr::WrExternalImage Lock(uint8_t aChannelIndex, + gl::GLContext* aGL, + wr::ImageRendering aRendering) override; + void Unlock() override; + + virtual gfx::IntSize GetSize(uint8_t aChannelIndex) const override; + virtual GLuint GetGLHandle(uint8_t aChannelIndex) const override; + +private: + virtual ~RenderAndroidSurfaceTextureHostOGL(); + void DeleteTextureHandle(); + + const mozilla::java::GeckoSurfaceTexture::GlobalRef mSurfTex; + const gfx::IntSize mSize; + // XXX const bool mContinuousUpdate; + // XXX const bool mIgnoreTransform; + + RefPtr mGL; +}; + +} // namespace wr +} // namespace mozilla + +#endif // MOZILLA_GFX_RENDERANDROIDSURFACETEXTUREHOSTOGL_H diff --git a/gfx/webrender_bindings/moz.build b/gfx/webrender_bindings/moz.build index 45439d62d38f..4acdfbb817d3 100644 --- a/gfx/webrender_bindings/moz.build +++ b/gfx/webrender_bindings/moz.build @@ -46,6 +46,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': 'RenderMacIOSurfaceTextureHostOGL.cpp', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': + EXPORTS.mozilla.webrender += [ + 'RenderAndroidSurfaceTextureHostOGL.h', + ] + UNIFIED_SOURCES += [ + 'RenderAndroidSurfaceTextureHostOGL.cpp', + ] + if CONFIG['MOZ_ENABLE_D3D10_LAYER']: DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True EXPORTS.mozilla.webrender += [ diff --git a/js/src/tests/user.js b/js/src/tests/user.js index a82dbd06eb30..364219870aef 100755 --- a/js/src/tests/user.js +++ b/js/src/tests/user.js @@ -1,5 +1,6 @@ user_pref("app.update.disabledForTesting", true); user_pref("browser.dom.window.dump.enabled", true); +user_pref("devtools.console.stdout.chrome", true); user_pref("browser.sessionstore.resume_from_crash", false); user_pref("browser.shell.checkDefaultBrowser", false); user_pref("browser.xul.error_pages.enabled", true); diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index 2cc28c901429..6715a1900a6f 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -1291,6 +1291,7 @@ XRE_XPCShellMain(int argc, char** argv, char** envp, // xpc::ErrorReport::LogToConsoleWithStack needs this to print errors // to stderr. Preferences::SetBool("browser.dom.window.dump.enabled", true); + Preferences::SetBool("devtools.console.stdout.chrome", true); AutoJSAPI jsapi; jsapi.Init(); diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 25390e7f3436..83d0de9360b4 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -6400,6 +6400,14 @@ PresShell::Paint(nsView* aViewToPaint, // We can paint directly into the widget using its layer manager. nsLayoutUtils::PaintFrame(nullptr, frame, aDirtyRegion, bgcolor, nsDisplayListBuilderMode::PAINTING, flags); + + // When recording/replaying, create a checkpoint after every paint. This + // can cause content JS to run, so reset |nojs|. + if (recordreplay::IsRecordingOrReplaying()) { + nojs.reset(); + recordreplay::child::CreateCheckpoint(); + } + return; } diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp index 510ad98cf5ce..4ecf8473a78a 100644 --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -30,7 +30,9 @@ #include "nsAccessibilityService.h" #endif -#define LONG_SIDE_TO_SHORT_SIDE_RATIO 10 +// Our intrinsic size is 12em in the main-axis and 1.3em in the cross-axis. +#define MAIN_AXIS_EM_SIZE 12 +#define CROSS_AXIS_EM_SIZE 1.3f using namespace mozilla; using namespace mozilla::dom; @@ -774,61 +776,34 @@ nsRangeFrame::ComputeAutoSize(gfxContext* aRenderingContext, const LogicalSize& aPadding, ComputeSizeFlags aFlags) { - nscoord oneEm = NSToCoordRound(StyleFont()->mFont.size * - nsLayoutUtils::FontSizeInflationFor(this)); // 1em - bool isInlineOriented = IsInlineOriented(); + auto em = StyleFont()->mFont.size * nsLayoutUtils::FontSizeInflationFor(this); const WritingMode wm = GetWritingMode(); LogicalSize autoSize(wm); - - // nsFrame::ComputeSize calls GetMinimumWidgetSize to prevent us from being - // given too small a size when we're natively themed. If we're themed, we set - // our "thickness" dimension to zero below and rely on that - // GetMinimumWidgetSize check to correct that dimension to the natural - // thickness of a slider in the current theme. - if (isInlineOriented) { - autoSize.ISize(wm) = LONG_SIDE_TO_SHORT_SIDE_RATIO * oneEm; - autoSize.BSize(wm) = IsThemed() ? 0 : oneEm; + autoSize.ISize(wm) = NSToCoordRound(MAIN_AXIS_EM_SIZE * em); + autoSize.BSize(wm) = NSToCoordRound(CROSS_AXIS_EM_SIZE * em); } else { - autoSize.ISize(wm) = IsThemed() ? 0 : oneEm; - autoSize.BSize(wm) = LONG_SIDE_TO_SHORT_SIDE_RATIO * oneEm; + autoSize.ISize(wm) = NSToCoordRound(CROSS_AXIS_EM_SIZE * em); + autoSize.BSize(wm) = NSToCoordRound(MAIN_AXIS_EM_SIZE * em); } return autoSize.ConvertTo(aWM, wm); } nscoord -nsRangeFrame::GetMinISize(gfxContext *aRenderingContext) +nsRangeFrame::GetMinISize(gfxContext* aRenderingContext) { - // nsFrame::ComputeSize calls GetMinimumWidgetSize to prevent us from being - // given too small a size when we're natively themed. If we aren't native - // themed, we don't mind how small we're sized. return nscoord(0); } nscoord -nsRangeFrame::GetPrefISize(gfxContext *aRenderingContext) +nsRangeFrame::GetPrefISize(gfxContext* aRenderingContext) { bool isInline = IsInlineOriented(); - - if (!isInline && IsThemed()) { - // nsFrame::ComputeSize calls GetMinimumWidgetSize to prevent us from being - // given too small a size when we're natively themed. We return zero and - // depend on that correction to get our "natural" width when we're a - // vertical slider. - return 0; - } - - nscoord prefISize = NSToCoordRound(StyleFont()->mFont.size * - nsLayoutUtils::FontSizeInflationFor(this)); // 1em - - if (isInline) { - prefISize *= LONG_SIDE_TO_SHORT_SIDE_RATIO; - } - - return prefISize; + auto em = StyleFont()->mFont.size * nsLayoutUtils::FontSizeInflationFor(this); + return NSToCoordRound(em * (isInline ? MAIN_AXIS_EM_SIZE : CROSS_AXIS_EM_SIZE)); } bool @@ -876,9 +851,6 @@ nsRangeFrame::ShouldUseNativeStyle() const nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame(); return (StyleDisplay()->mAppearance == StyleAppearance::Range) && - !PresContext()->HasAuthorSpecifiedRules(this, - (NS_AUTHOR_SPECIFIED_BORDER | - NS_AUTHOR_SPECIFIED_BACKGROUND)) && trackFrame && !PresContext()->HasAuthorSpecifiedRules(trackFrame, STYLES_DISABLING_NATIVE_THEMING) && diff --git a/layout/reftests/forms/input/range/range-border-background-ref.html b/layout/reftests/forms/input/range/range-border-background-ref.html new file mode 100644 index 000000000000..4f1f44c7a724 --- /dev/null +++ b/layout/reftests/forms/input/range/range-border-background-ref.html @@ -0,0 +1,26 @@ + + + +
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
diff --git a/layout/reftests/forms/input/range/range-border-background.html b/layout/reftests/forms/input/range/range-border-background.html new file mode 100644 index 000000000000..bd4ea3419eff --- /dev/null +++ b/layout/reftests/forms/input/range/range-border-background.html @@ -0,0 +1,26 @@ + + + +
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
diff --git a/layout/reftests/forms/input/range/reftest.list b/layout/reftests/forms/input/range/reftest.list index 84cd711a91aa..d3e36e84c7ae 100644 --- a/layout/reftests/forms/input/range/reftest.list +++ b/layout/reftests/forms/input/range/reftest.list @@ -14,13 +14,13 @@ fuzzy-if(skiaContent,0-1,0-40) == to-range-from-other-type-unthemed-1.html to-ra # dynamic value changes: fuzzy-if(skiaContent,0-1,0-40) == value-prop-unthemed.html 75pct-unthemed-common-ref.html -fuzzy-if(webrender&>kWidget,96-96,163-163) == value-prop.html 75pct-common-ref.html +fuzzy-if(webrender&>kWidget,79-79,138-138) == value-prop.html 75pct-common-ref.html fuzzy-if(skiaContent,0-1,0-40) == valueAsNumber-prop-unthemed.html 75pct-unthemed-common-ref.html -fuzzy-if(webrender&>kWidget,96-96,163-163) == valueAsNumber-prop.html 75pct-common-ref.html +fuzzy-if(webrender&>kWidget,79-79,138-138) == valueAsNumber-prop.html 75pct-common-ref.html fuzzy-if(skiaContent,0-1,0-40) == stepDown-unthemed.html 75pct-unthemed-common-ref.html -fuzzy-if(webrender&>kWidget,96-96,163-163) == stepDown.html 75pct-common-ref.html +fuzzy-if(webrender&>kWidget,79-79,138-138) == stepDown.html 75pct-common-ref.html fuzzy-if(skiaContent,0-1,0-40) == stepUp-unthemed.html 75pct-unthemed-common-ref.html -fuzzy-if(webrender&>kWidget,96-96,163-163) == stepUp.html 75pct-common-ref.html +fuzzy-if(webrender&>kWidget,79-79,138-138) == stepUp.html 75pct-common-ref.html == max-prop.html 100pct-common-ref.html == reset-value.html reset-value-ref.html @@ -47,3 +47,5 @@ fuzzy-if(webrender&>kWidget,96-96,163-163) == stepUp.html 75pct-common-ref.htm == range-vrl-orient-inline.html range-orient-vertical-rtl.html == range-vrl-orient-horizontal.html range-orient-horizontal-rtl.html == range-vrl-orient-vertical.html range-orient-vertical-rtl.html + +skip-if(Android) == range-border-background.html range-border-background-ref.html # Android doesn't have a native theme for -webkit-appearance:range diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css index a93b85bd781d..f30d9f824339 100644 --- a/layout/style/res/forms.css +++ b/layout/style/res/forms.css @@ -877,41 +877,15 @@ meter { input[type=range] { -moz-appearance: range; display: inline-block; - inline-size: 12em; - block-size: 1.3em; - margin-inline-start: 0.7em; - margin-inline-end: 0.7em; - margin-block-start: 0; - margin-block-end: 0; + margin: 2px; /* Override some rules that apply on all input types: */ cursor: default; - background: none; - border: none; + padding: unset; + border: unset; /* Prevent nsFrame::HandlePress setting mouse capture to this element. */ -moz-user-select: none ! important; } -input[type=range][orient=block] { - inline-size: 1.3em; - block-size: 12em; - margin-inline-start: 0; - margin-inline-end: 0; - margin-block-start: 0.7em; - margin-block-end: 0.7em; -} - -input[type=range][orient=horizontal] { - width: 12em; - height: 1.3em; - margin: 0 0.7em; -} - -input[type=range][orient=vertical] { - width: 1.3em; - height: 12em; - margin: 0.7em 0; -} - /** * Ideally we'd also require :-moz-focusring here, but that doesn't currently * work. Instead we only use the -moz-focus-outer border style if @@ -933,32 +907,16 @@ input[type=range]::-moz-focus-outer { */ input[type=range]::-moz-range-track { /* Prevent styling that would change the type of frame we construct. */ - display: inline-block !important; + display: block !important; float: none !important; position: static !important; - border: none; - background-color: #999; - inline-size: 100%; + writing-mode: unset !important; + direction: unset !important; block-size: 0.2em; /* Prevent nsFrame::HandlePress setting mouse capture to this element. */ -moz-user-select: none ! important; } -input[type=range][orient=block]::-moz-range-track { - inline-size: 0.2em; - block-size: 100%; -} - -input[type=range][orient=horizontal]::-moz-range-track { - width: 100%; - height: 0.2em; -} - -input[type=range][orient=vertical]::-moz-range-track { - width: 0.2em; - height: 100%; -} - /** * Layout handles positioning of this pseudo-element specially (so that content * authors can concentrate on styling this pseudo-element without worrying @@ -969,9 +927,11 @@ input[type=range][orient=vertical]::-moz-range-track { */ input[type=range]::-moz-range-progress { /* Prevent styling that would change the type of frame we construct. */ - display: inline-block !important; + display: block !important; float: none !important; position: static !important; + writing-mode: unset !important; + direction: unset !important; /* Since one of width/height will be ignored, this just sets the "other" dimension. */ @@ -993,9 +953,11 @@ input[type=range]::-moz-range-thumb { */ -moz-appearance: range-thumb !important; /* Prevent styling that would change the type of frame we construct. */ - display: inline-block !important; + display: block !important; float: none !important; position: static !important; + writing-mode: unset !important; + direction: unset !important; width: 1em; height: 1em; border: 0.1em solid #999; diff --git a/layout/tools/reftest/README.txt b/layout/tools/reftest/README.txt index b8e574eab15a..e67477532803 100644 --- a/layout/tools/reftest/README.txt +++ b/layout/tools/reftest/README.txt @@ -394,8 +394,9 @@ that do not depend on XUL, or even ones testing other layout engines. Running Tests ============= -(If you're not using a DEBUG build, first set browser.dom.window.dump.enabled -to true (in about:config, in the profile you'll be using to run the tests). +(If you're not using a DEBUG build, first set browser.dom.window.dump.enabled, +devtools.console.stdout.chrome and devtools.console.stdout.content to true (in +about:config, in the profile you'll be using to run the tests). Create the option as a new boolean if it doesn't exist already. If you skip this step you won't get any output in the terminal.) diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 25c8bd0416e8..9830f5596b3e 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -623,6 +623,7 @@ pref("browser.firstrun.show.localepicker", false); // $ adb shell setprop log.redirect-stdio true // $ adb shell start pref("browser.dom.window.dump.enabled", true); +pref("devtools.console.stdout.chrome", true); // controls if we want camera support pref("device.camera.enabled", true); diff --git a/modules/libpref/init/StaticPrefList.h b/modules/libpref/init/StaticPrefList.h index 9e8cff8800b4..5f61fe02c725 100644 --- a/modules/libpref/init/StaticPrefList.h +++ b/modules/libpref/init/StaticPrefList.h @@ -1776,6 +1776,24 @@ VARCACHE_PREF( RelaxedAtomicBool, false ) +#ifdef MOZILLA_OFFICIAL +# define PREF_VALUE false +#else +# define PREF_VALUE true +#endif +VARCACHE_PREF( + "devtools.console.stdout.chrome", + devtools_console_stdout_chrome, + RelaxedAtomicBool, PREF_VALUE +) +#undef PREF_VALUE + +VARCACHE_PREF( + "devtools.console.stdout.content", + devtools_console_stdout_content, + RelaxedAtomicBool, false +) + //--------------------------------------------------------------------------- // Feature-Policy prefs //--------------------------------------------------------------------------- diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index f0882fc39f5b..9a825bb99a08 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1096,10 +1096,14 @@ pref("toolkit.asyncshutdown.log", false); // it being specified, dump is disabled in artifact builds (see Bug 1490412). #ifdef MOZILLA_OFFICIAL pref("browser.dom.window.dump.enabled", false, sticky); +pref("devtools.console.stdout.chrome", false, sticky); #else pref("browser.dom.window.dump.enabled", true, sticky); +pref("devtools.console.stdout.chrome", true, sticky); #endif +pref("devtools.console.stdout.content", false, sticky); + // Controls whether EventEmitter module throws dump message on each emit pref("toolkit.dump.emit", false); diff --git a/services/fxaccounts/tests/mochitest/test_invalidEmailCase.html b/services/fxaccounts/tests/mochitest/test_invalidEmailCase.html index 59d00016ea09..d95d9d18e2cd 100644 --- a/services/fxaccounts/tests/mochitest/test_invalidEmailCase.html +++ b/services/fxaccounts/tests/mochitest/test_invalidEmailCase.html @@ -118,6 +118,7 @@ SpecialPowers.pushPrefEnv({"set": [ ["identity.fxaccounts.enabled", true], // fx accounts ["identity.fxaccounts.auth.uri", TEST_SERVER], // our sjs server ["browser.dom.window.dump.enabled", true], + ["devtools.console.stdout.chrome", true], ]}, function() { runTest(); } ); diff --git a/testing/geckodriver/src/prefs.rs b/testing/geckodriver/src/prefs.rs index 57aadc2ff4c4..d23a504243b2 100644 --- a/testing/geckodriver/src/prefs.rs +++ b/testing/geckodriver/src/prefs.rs @@ -18,6 +18,7 @@ lazy_static! { // Enable the dump function, which sends messages to the system // console ("browser.dom.window.dump.enabled", Pref::new(true)), + ("devtools.console.stdout.chrome", Pref::new(true)), // Disable safebrowsing components ("browser.safebrowsing.blockedURIs.enabled", Pref::new(false)), diff --git a/testing/marionette/client/marionette_driver/geckoinstance.py b/testing/marionette/client/marionette_driver/geckoinstance.py index f4eb0a8abfbe..cee88aae7efc 100644 --- a/testing/marionette/client/marionette_driver/geckoinstance.py +++ b/testing/marionette/client/marionette_driver/geckoinstance.py @@ -376,8 +376,9 @@ class GeckoInstance(object): class FennecInstance(GeckoInstance): fennec_prefs = { - # Enable output of dump() + # Enable output for dump() and chrome console API "browser.dom.window.dump.enabled": True, + "devtools.console.stdout.chrome": True, # Disable Android snippets "browser.snippets.enabled": False, @@ -504,8 +505,9 @@ class DesktopInstance(GeckoInstance): # We use a larger number than the default 22 to have some buffer "browser.contentblocking.introCount": 99, - # Enable output of dump() + # Enable output for dump() and chrome console API "browser.dom.window.dump.enabled": True, + "devtools.console.stdout.chrome": True, # Indicate that the download panel has been shown once so that whichever # download test runs first doesn"t show the popup inconsistently diff --git a/testing/mozbase/mozrunner/mozrunner/application.py b/testing/mozbase/mozrunner/mozrunner/application.py index c4ee7e858f85..7155d42f8e75 100644 --- a/testing/mozbase/mozrunner/mozrunner/application.py +++ b/testing/mozbase/mozrunner/mozrunner/application.py @@ -93,6 +93,9 @@ class RemoteContext(object): pass +devices = {} + + class FennecContext(RemoteContext): _remote_profiles_ini = None _remote_test_root = None @@ -102,7 +105,19 @@ class FennecContext(RemoteContext): self.avd_home = avd_home self.remote_process = app self.device_serial = device_serial - self.device = ADBAndroid(adb=self.adb, device=device_serial) + self.device = self.get_device(self.adb, device_serial) + + def get_device(self, adb_path, device_serial): + # Create a mozdevice.ADBAndroid object for the specified device_serial + # and cache it for future use. If the same device_serial is subsequently + # requested, retrieve it from the cache to avoid costly re-initialization. + global devices + if device_serial in devices: + device = devices[device_serial] + else: + device = ADBAndroid(adb=adb_path, device=device_serial) + devices[device_serial] = device + return device def stop_application(self): self.device.stop_application(self.remote_process) diff --git a/testing/profiles/common/user.js b/testing/profiles/common/user.js index 4eee7bc528f3..8b3037d12308 100644 --- a/testing/profiles/common/user.js +++ b/testing/profiles/common/user.js @@ -3,6 +3,7 @@ user_pref("app.update.disabledForTesting", true); user_pref("browser.chrome.guess_favicon", false); user_pref("browser.dom.window.dump.enabled", true); +user_pref("devtools.console.stdout.chrome", true); // Use a python-eval-able empty JSON array even though asrouter expects plain object user_pref("browser.newtabpage.activity-stream.asrouter.providers.snippets", "[]"); user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); diff --git a/testing/tps/tps/testrunner.py b/testing/tps/tps/testrunner.py index 560baa7f4c57..c2537ee72f73 100644 --- a/testing/tps/tps/testrunner.py +++ b/testing/tps/tps/testrunner.py @@ -59,6 +59,7 @@ class TPSTestRunner(object): 'app.update.disabledForTesting': True, 'security.turn_off_all_security_so_that_viruses_can_take_over_this_computer': True, 'browser.dom.window.dump.enabled': True, + 'devtools.console.stdout.chrome': True, 'browser.sessionstore.resume_from_crash': False, 'browser.shell.checkDefaultBrowser': False, 'browser.tabs.warnOnClose': False, diff --git a/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range-ref.html b/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range-ref.html new file mode 100644 index 000000000000..ad71302aef9b --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range-ref.html @@ -0,0 +1,61 @@ + + + + + CSS Grid Reference: align/justify-self on range INPUT items + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + diff --git a/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range.html b/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range.html new file mode 100644 index 000000000000..fb17f3a4a8b2 --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/alignment/grid-self-alignment-stretch-input-range.html @@ -0,0 +1,58 @@ + + + + + CSS Grid Test: align/justify-self on range INPUT items + + + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py index 0e40cec048ac..87216822e1d7 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py @@ -39,8 +39,9 @@ class FennecProfile(FirefoxProfile): "app.normandy.api_url": "", # Increase the APZ content response timeout in tests to 1 minute. "apz.content_response_timeout": 60000, - # Enable output of dump() + # Enable output for dump() and chrome console API "browser.dom.window.dump.enabled": True, + "devtools.console.stdout.chrome": True, # Disable safebrowsing components "browser.safebrowsing.blockedURIs.enabled": False, "browser.safebrowsing.downloads.enabled": False, diff --git a/toolkit/recordreplay/ipc/ChildIPC.cpp b/toolkit/recordreplay/ipc/ChildIPC.cpp index 344633a30030..0072fb040af2 100644 --- a/toolkit/recordreplay/ipc/ChildIPC.cpp +++ b/toolkit/recordreplay/ipc/ChildIPC.cpp @@ -536,8 +536,6 @@ NotifyPaintStart() gNumPendingPaints++; gNumPendingMainThreadPaints++; - - CreateCheckpoint(); } static void diff --git a/toolkit/recordreplay/ipc/ParentIPC.cpp b/toolkit/recordreplay/ipc/ParentIPC.cpp index 6e1d847d552c..3b16cac53ce2 100644 --- a/toolkit/recordreplay/ipc/ParentIPC.cpp +++ b/toolkit/recordreplay/ipc/ParentIPC.cpp @@ -585,8 +585,7 @@ SpawnReplayingChildren() } // Hit any installed breakpoints with the specified kind. -static void HitBreakpointsWithKind(js::BreakpointPosition::Kind aKind, - bool aRecordingBoundary = false); +static void HitBreakpointsWithKind(js::BreakpointPosition::Kind aKind); // Change the current active child, and select a new role for the old one. static void @@ -1058,8 +1057,7 @@ Resume(bool aForward) // Don't rewind if we are at the beginning of the recording. if (targetCheckpoint == CheckpointId::Invalid) { SendMessageToUIProcess("HitRecordingBeginning"); - HitBreakpointsWithKind(js::BreakpointPosition::Kind::ForcedPause, - /* aRecordingBoundary = */ true); + HitBreakpointsWithKind(js::BreakpointPosition::Kind::ForcedPause); return; } @@ -1086,8 +1084,7 @@ Resume(bool aForward) MOZ_RELEASE_ASSERT(!gActiveChild->IsRecording()); if (!gRecordingChild) { SendMessageToUIProcess("HitRecordingEndpoint"); - HitBreakpointsWithKind(js::BreakpointPosition::Kind::ForcedPause, - /* aRecordingBoundary = */ true); + HitBreakpointsWithKind(js::BreakpointPosition::Kind::ForcedPause); return; } @@ -1216,34 +1213,47 @@ RecvHitCheckpoint(const HitCheckpointMessage& aMsg) } static void -HitBreakpoint(uint32_t* aBreakpoints, size_t aNumBreakpoints, bool aRecordingBoundary) +HitBreakpoint(uint32_t* aBreakpoints, size_t aNumBreakpoints, + js::BreakpointPosition::Kind aSharedKind) { if (!gActiveChild->IsPaused()) { - if (aNumBreakpoints) { - Print("Warning: Process resumed before breakpoints were hit.\n"); - } delete[] aBreakpoints; return; } - MarkActiveChildExplicitPause(); - - gResumeForwardOrBackward = true; - - // Call breakpoint handlers until one of them explicitly resumes forward or - // backward travel. - for (size_t i = 0; i < aNumBreakpoints && gResumeForwardOrBackward; i++) { - AutoSafeJSContext cx; - if (!js::HitBreakpoint(cx, aBreakpoints[i])) { - Print("Warning: hitBreakpoint hook threw an exception.\n"); + switch (aSharedKind) { + case js::BreakpointPosition::ForcedPause: + MarkActiveChildExplicitPause(); + MOZ_FALLTHROUGH; + case js::BreakpointPosition::PositionChange: + // Call all breakpoint handlers. + for (size_t i = 0; i < aNumBreakpoints; i++) { + AutoSafeJSContext cx; + if (!js::HitBreakpoint(cx, aBreakpoints[i])) { + Print("Warning: hitBreakpoint hook threw an exception.\n"); + } } - } + break; + default: + gResumeForwardOrBackward = true; - // If the child was not explicitly resumed by any breakpoint handler, and we - // are not at a forced pause at the recording boundary, resume travel in - // whichever direction it was going previously. - if (gResumeForwardOrBackward && !aRecordingBoundary) { - ResumeForwardOrBackward(); + MarkActiveChildExplicitPause(); + + // Call breakpoint handlers until one of them explicitly resumes forward or + // backward travel. + for (size_t i = 0; i < aNumBreakpoints && gResumeForwardOrBackward; i++) { + AutoSafeJSContext cx; + if (!js::HitBreakpoint(cx, aBreakpoints[i])) { + Print("Warning: hitBreakpoint hook threw an exception.\n"); + } + } + + // If the child was not explicitly resumed by any breakpoint handler, + // resume travel in whichever direction we were going previously. + if (gResumeForwardOrBackward) { + ResumeForwardOrBackward(); + } + break; } delete[] aBreakpoints; @@ -1256,11 +1266,11 @@ RecvHitBreakpoint(const HitBreakpointMessage& aMsg) PodCopy(breakpoints, aMsg.Breakpoints(), aMsg.NumBreakpoints()); gMainThreadMessageLoop->PostTask(NewRunnableFunction("HitBreakpoint", HitBreakpoint, breakpoints, aMsg.NumBreakpoints(), - /* aRecordingBoundary = */ false)); + js::BreakpointPosition::Invalid)); } static void -HitBreakpointsWithKind(js::BreakpointPosition::Kind aKind, bool aRecordingBoundary) +HitBreakpointsWithKind(js::BreakpointPosition::Kind aKind) { Vector breakpoints; gActiveChild->GetMatchingInstalledBreakpoints([=](js::BreakpointPosition::Kind aInstalled) { @@ -1271,7 +1281,7 @@ HitBreakpointsWithKind(js::BreakpointPosition::Kind aKind, bool aRecordingBounda PodCopy(newBreakpoints, breakpoints.begin(), breakpoints.length()); gMainThreadMessageLoop->PostTask(NewRunnableFunction("HitBreakpoint", HitBreakpoint, newBreakpoints, breakpoints.length(), - aRecordingBoundary)); + aKind)); } } diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index e7a63dd69105..faa1bac33472 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -4390,24 +4390,6 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, break; } - case StyleAppearance::Range: - { - // The Mac Appearance Manager API (the old API we're currently using) - // doesn't define constants to obtain a minimum size for sliders. We use - // the "thickness" of a slider that has default dimensions for both the - // minimum width and height to get something sane and so that paint - // invalidation works. - SInt32 size = 0; - if (IsRangeHorizontal(aFrame)) { - ::GetThemeMetric(kThemeMetricHSliderHeight, &size); - } else { - ::GetThemeMetric(kThemeMetricVSliderWidth, &size); - } - aResult->SizeTo(size, size); - *aIsOverridable = true; - break; - } - case StyleAppearance::RangeThumb: { SInt32 width = 0; diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 5f752c6995b4..43a122a8c1b6 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -1618,19 +1618,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, *aIsOverridable = false; } break; - case StyleAppearance::Range: - { - gint scale_width, scale_height; - - moz_gtk_get_scale_metrics(IsRangeHorizontal(aFrame) ? - GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, - &scale_width, &scale_height); - aResult->width = scale_width; - aResult->height = scale_height; - - *aIsOverridable = true; - } - break; case StyleAppearance::ScalethumbHorizontal: case StyleAppearance::ScalethumbVertical: { diff --git a/widget/headless/HeadlessThemeGTK.cpp b/widget/headless/HeadlessThemeGTK.cpp index bccf2901fff4..2e6a041691e6 100644 --- a/widget/headless/HeadlessThemeGTK.cpp +++ b/widget/headless/HeadlessThemeGTK.cpp @@ -305,10 +305,6 @@ HeadlessThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, aResult->height = 13; *aIsOverridable = false; break; - case StyleAppearance::Range: - aResult->width = 14; - aResult->height = 18; - break; case StyleAppearance::Menuseparator: aResult->width = 0; aResult->height = 8;