зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1746750) for causing mochitest webgl failures on test_2_conformance2__offscreencanvas__offscreencanvas-sync.html. CLOSED TREE
Backed out changeset 011f75653bfb (bug 1746750) Backed out changeset 9c2aca08a507 (bug 1746750) Backed out changeset cccf6afc3ce9 (bug 1746750) Backed out changeset 36fedb339908 (bug 1746750)
This commit is contained in:
Родитель
8f1c963ed3
Коммит
30f1186aa5
|
@ -609,12 +609,6 @@ DOMInterfaces = {
|
|||
'nativeType': 'nsDOMOfflineResourceList',
|
||||
},
|
||||
|
||||
'OffscreenCanvasRenderingContext2D': {
|
||||
'implicitJSContext': [
|
||||
'createImageData', 'getImageData', 'isPointInPath', 'isPointInStroke'
|
||||
],
|
||||
},
|
||||
|
||||
'PaintRequestList': {
|
||||
'headerFile': 'mozilla/dom/PaintRequest.h',
|
||||
},
|
||||
|
|
|
@ -817,7 +817,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
|
|||
// Make sure we remove ourselves from the list of demotable contexts (raw
|
||||
// pointers), since we're logically destructed at this point.
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCanvasElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOffscreenCanvas)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
|
||||
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
|
||||
ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::STROKE]);
|
||||
|
@ -846,7 +845,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCanvasElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOffscreenCanvas)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell)
|
||||
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
|
||||
ImplCycleCollectionTraverse(
|
||||
|
@ -962,7 +960,7 @@ void CanvasRenderingContext2D::ContextState::SetGradientStyle(
|
|||
**/
|
||||
|
||||
// Initialize our static variables.
|
||||
Atomic<uintptr_t> CanvasRenderingContext2D::sNumLivingContexts(0);
|
||||
uintptr_t CanvasRenderingContext2D::sNumLivingContexts = 0;
|
||||
DrawTarget* CanvasRenderingContext2D::sErrorTarget = nullptr;
|
||||
|
||||
CanvasRenderingContext2D::CanvasRenderingContext2D(
|
||||
|
@ -985,6 +983,9 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(
|
|||
mInvalidateCount(0),
|
||||
mWriteOnly(false) {
|
||||
sNumLivingContexts++;
|
||||
|
||||
mShutdownObserver = new CanvasShutdownObserver(this);
|
||||
nsContentUtils::RegisterShutdownObserver(mShutdownObserver);
|
||||
}
|
||||
|
||||
CanvasRenderingContext2D::~CanvasRenderingContext2D() {
|
||||
|
@ -998,8 +999,6 @@ CanvasRenderingContext2D::~CanvasRenderingContext2D() {
|
|||
}
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::Initialize() { AddShutdownObserver(); }
|
||||
|
||||
JSObject* CanvasRenderingContext2D::WrapObject(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
|
||||
return CanvasRenderingContext2D_Binding::Wrap(aCx, this, aGivenProto);
|
||||
|
@ -1073,14 +1072,6 @@ void CanvasRenderingContext2D::OnShutdown() {
|
|||
}
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::AddShutdownObserver() {
|
||||
MOZ_ASSERT(!mShutdownObserver);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
mShutdownObserver = new CanvasShutdownObserver(this);
|
||||
nsContentUtils::RegisterShutdownObserver(mShutdownObserver);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::RemoveShutdownObserver() {
|
||||
if (mShutdownObserver) {
|
||||
mShutdownObserver->OnShutdown();
|
||||
|
@ -1140,15 +1131,15 @@ nsresult CanvasRenderingContext2D::Redraw() {
|
|||
|
||||
mIsEntireFrameInvalid = true;
|
||||
|
||||
if (mCanvasElement) {
|
||||
SVGObserverUtils::InvalidateDirectRenderingObservers(mCanvasElement);
|
||||
mCanvasElement->InvalidateCanvasContent(nullptr);
|
||||
} else if (mOffscreenCanvas) {
|
||||
mOffscreenCanvas->QueueCommitToCompositor();
|
||||
} else {
|
||||
if (!mCanvasElement) {
|
||||
NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SVGObserverUtils::InvalidateDirectRenderingObservers(mCanvasElement);
|
||||
|
||||
mCanvasElement->InvalidateCanvasContent(nullptr);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1166,14 +1157,14 @@ void CanvasRenderingContext2D::Redraw(const gfx::Rect& aR) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (mCanvasElement) {
|
||||
SVGObserverUtils::InvalidateDirectRenderingObservers(mCanvasElement);
|
||||
mCanvasElement->InvalidateCanvasContent(&aR);
|
||||
} else if (mOffscreenCanvas) {
|
||||
mOffscreenCanvas->QueueCommitToCompositor();
|
||||
} else {
|
||||
if (!mCanvasElement) {
|
||||
NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!");
|
||||
return;
|
||||
}
|
||||
|
||||
SVGObserverUtils::InvalidateDirectRenderingObservers(mCanvasElement);
|
||||
|
||||
mCanvasElement->InvalidateCanvasContent(&aR);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::DidRefresh() {}
|
||||
|
@ -1563,14 +1554,6 @@ void CanvasRenderingContext2D::ClearTarget(int32_t aWidth, int32_t aHeight) {
|
|||
}
|
||||
}
|
||||
|
||||
if (mOffscreenCanvas) {
|
||||
OffscreenCanvasDisplayData data;
|
||||
data.mSize = {mWidth, mHeight};
|
||||
data.mIsOpaque = mOpaque;
|
||||
data.mIsAlphaPremult = true;
|
||||
mOffscreenCanvas->UpdateDisplayData(data);
|
||||
}
|
||||
|
||||
if (!mCanvasElement || !mCanvasElement->IsInComposedDoc()) {
|
||||
return;
|
||||
}
|
||||
|
@ -4279,12 +4262,6 @@ bool CanvasRenderingContext2D::IsPointInPath(JSContext* aCx, double aX,
|
|||
double aY,
|
||||
const CanvasWindingRule& aWinding,
|
||||
nsIPrincipal& aSubjectPrincipal) {
|
||||
return IsPointInPath(aCx, aX, aY, aWinding, Some(&aSubjectPrincipal));
|
||||
}
|
||||
|
||||
bool CanvasRenderingContext2D::IsPointInPath(
|
||||
JSContext* aCx, double aX, double aY, const CanvasWindingRule& aWinding,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal) {
|
||||
if (!FloatValidate(aX, aY)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -4296,9 +4273,6 @@ bool CanvasRenderingContext2D::IsPointInPath(
|
|||
aSubjectPrincipal)) {
|
||||
return false;
|
||||
}
|
||||
} else if (mOffscreenCanvas &&
|
||||
mOffscreenCanvas->ShouldResistFingerprinting()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EnsureUserSpacePath(aWinding);
|
||||
|
@ -4317,15 +4291,7 @@ bool CanvasRenderingContext2D::IsPointInPath(JSContext* aCx,
|
|||
const CanvasPath& aPath, double aX,
|
||||
double aY,
|
||||
const CanvasWindingRule& aWinding,
|
||||
nsIPrincipal& aSubjectPrincipal) {
|
||||
return IsPointInPath(aCx, aPath, aX, aY, aWinding, Some(&aSubjectPrincipal));
|
||||
}
|
||||
|
||||
bool CanvasRenderingContext2D::IsPointInPath(JSContext* aCx,
|
||||
const CanvasPath& aPath, double aX,
|
||||
double aY,
|
||||
const CanvasWindingRule& aWinding,
|
||||
Maybe<nsIPrincipal*>) {
|
||||
nsIPrincipal&) {
|
||||
if (!FloatValidate(aX, aY)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -4342,12 +4308,6 @@ bool CanvasRenderingContext2D::IsPointInPath(JSContext* aCx,
|
|||
|
||||
bool CanvasRenderingContext2D::IsPointInStroke(
|
||||
JSContext* aCx, double aX, double aY, nsIPrincipal& aSubjectPrincipal) {
|
||||
return IsPointInStroke(aCx, aX, aY, Some(&aSubjectPrincipal));
|
||||
}
|
||||
|
||||
bool CanvasRenderingContext2D::IsPointInStroke(
|
||||
JSContext* aCx, double aX, double aY,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal) {
|
||||
if (!FloatValidate(aX, aY)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -4359,9 +4319,6 @@ bool CanvasRenderingContext2D::IsPointInStroke(
|
|||
aSubjectPrincipal)) {
|
||||
return false;
|
||||
}
|
||||
} else if (mOffscreenCanvas &&
|
||||
mOffscreenCanvas->ShouldResistFingerprinting()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EnsureUserSpacePath();
|
||||
|
@ -4382,16 +4339,10 @@ bool CanvasRenderingContext2D::IsPointInStroke(
|
|||
mTarget->GetTransform());
|
||||
}
|
||||
|
||||
bool CanvasRenderingContext2D::IsPointInStroke(
|
||||
JSContext* aCx, const CanvasPath& aPath, double aX, double aY,
|
||||
nsIPrincipal& aSubjectPrincipal) {
|
||||
return IsPointInStroke(aCx, aPath, aX, aY, Some(&aSubjectPrincipal));
|
||||
}
|
||||
|
||||
bool CanvasRenderingContext2D::IsPointInStroke(JSContext* aCx,
|
||||
const CanvasPath& aPath,
|
||||
double aX, double aY,
|
||||
Maybe<nsIPrincipal*>) {
|
||||
nsIPrincipal&) {
|
||||
if (!FloatValidate(aX, aY)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -5090,14 +5041,7 @@ void CanvasRenderingContext2D::DrawWindow(nsGlobalWindowInner& aWindow,
|
|||
already_AddRefed<ImageData> CanvasRenderingContext2D::GetImageData(
|
||||
JSContext* aCx, int32_t aSx, int32_t aSy, int32_t aSw, int32_t aSh,
|
||||
nsIPrincipal& aSubjectPrincipal, ErrorResult& aError) {
|
||||
return GetImageData(aCx, aSx, aSy, aSw, aSh, Some(&aSubjectPrincipal),
|
||||
aError);
|
||||
}
|
||||
|
||||
already_AddRefed<ImageData> CanvasRenderingContext2D::GetImageData(
|
||||
JSContext* aCx, int32_t aSx, int32_t aSy, int32_t aSw, int32_t aSh,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal, ErrorResult& aError) {
|
||||
if (!mCanvasElement && !mDocShell && !mOffscreenCanvas) {
|
||||
if (!mCanvasElement && !mDocShell) {
|
||||
NS_ERROR("No canvas element and no docshell in GetImageData!!!");
|
||||
aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
|
@ -5105,7 +5049,6 @@ already_AddRefed<ImageData> CanvasRenderingContext2D::GetImageData(
|
|||
|
||||
// Check only if we have a canvas element; if we were created with a docshell,
|
||||
// then it's special internal use.
|
||||
// FIXME(aosmond): OffscreenCanvas security check??!
|
||||
if (IsWriteOnly() ||
|
||||
(mCanvasElement && !mCanvasElement->CallerCanRead(aCx))) {
|
||||
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
|
||||
|
@ -5153,7 +5096,7 @@ already_AddRefed<ImageData> CanvasRenderingContext2D::GetImageData(
|
|||
|
||||
nsresult CanvasRenderingContext2D::GetImageDataArray(
|
||||
JSContext* aCx, int32_t aX, int32_t aY, uint32_t aWidth, uint32_t aHeight,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal, JSObject** aRetval) {
|
||||
nsIPrincipal& aSubjectPrincipal, JSObject** aRetval) {
|
||||
MOZ_ASSERT(aWidth && aHeight);
|
||||
|
||||
// Restrict the typed array length to INT32_MAX because that's all we support
|
||||
|
@ -5218,8 +5161,6 @@ nsresult CanvasRenderingContext2D::GetImageDataArray(
|
|||
nsCOMPtr<Document> ownerDoc = mCanvasElement->OwnerDoc();
|
||||
usePlaceholder = !CanvasUtils::IsImageExtractionAllowed(ownerDoc, aCx,
|
||||
aSubjectPrincipal);
|
||||
} else if (mOffscreenCanvas) {
|
||||
usePlaceholder = mOffscreenCanvas->ShouldResistFingerprinting();
|
||||
}
|
||||
|
||||
do {
|
||||
|
|
|
@ -12,10 +12,8 @@
|
|||
#include "mozilla/intl/Bidi.h"
|
||||
#include "mozilla/gfx/Rect.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EnumeratedArray.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/SurfaceFromElementResult.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
@ -72,10 +70,9 @@ struct DOMMatrix2DInit;
|
|||
/**
|
||||
** CanvasRenderingContext2D
|
||||
**/
|
||||
class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
||||
public nsWrapperCache,
|
||||
public BasicRenderingContext2D {
|
||||
protected:
|
||||
class CanvasRenderingContext2D final : public nsICanvasRenderingContextInternal,
|
||||
public nsWrapperCache,
|
||||
public BasicRenderingContext2D {
|
||||
virtual ~CanvasRenderingContext2D();
|
||||
|
||||
public:
|
||||
|
@ -209,23 +206,13 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
bool IsPointInPath(JSContext* aCx, double aX, double aY,
|
||||
const CanvasWindingRule& aWinding,
|
||||
nsIPrincipal& aSubjectPrincipal);
|
||||
bool IsPointInPath(JSContext* aCx, double aX, double aY,
|
||||
const CanvasWindingRule& aWinding,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal);
|
||||
bool IsPointInPath(JSContext* aCx, const CanvasPath& aPath, double aX,
|
||||
double aY, const CanvasWindingRule& aWinding,
|
||||
nsIPrincipal&);
|
||||
bool IsPointInPath(JSContext* aCx, const CanvasPath& aPath, double aX,
|
||||
double aY, const CanvasWindingRule& aWinding,
|
||||
Maybe<nsIPrincipal*>);
|
||||
bool IsPointInStroke(JSContext* aCx, double aX, double aY,
|
||||
nsIPrincipal& aSubjectPrincipal);
|
||||
bool IsPointInStroke(JSContext* aCx, double aX, double aY,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal);
|
||||
bool IsPointInStroke(JSContext* aCx, const CanvasPath& aPath, double aX,
|
||||
double aY, nsIPrincipal&);
|
||||
bool IsPointInStroke(JSContext* aCx, const CanvasPath& aPath, double aX,
|
||||
double aY, Maybe<nsIPrincipal*>);
|
||||
void FillText(const nsAString& aText, double aX, double aY,
|
||||
const Optional<double>& aMaxWidth,
|
||||
mozilla::ErrorResult& aError);
|
||||
|
@ -265,9 +252,6 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
int32_t aSw, int32_t aSh,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult&);
|
||||
already_AddRefed<ImageData> GetImageData(
|
||||
JSContext*, int32_t aSx, int32_t aSy, int32_t aSw, int32_t aSh,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal, ErrorResult&);
|
||||
void PutImageData(ImageData&, int32_t aDx, int32_t aDy, ErrorResult&);
|
||||
void PutImageData(ImageData&, int32_t aDx, int32_t aDy, int32_t aDirtyX,
|
||||
int32_t aDirtyY, int32_t aDirtyWidth, int32_t aDirtyHeight,
|
||||
|
@ -425,7 +409,6 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
* Gets the pres shell from either the canvas element or the doc shell
|
||||
*/
|
||||
PresShell* GetPresShell() final;
|
||||
void Initialize() override;
|
||||
NS_IMETHOD SetDimensions(int32_t aWidth, int32_t aHeight) override;
|
||||
NS_IMETHOD InitializeWithDrawTarget(
|
||||
nsIDocShell* aShell, NotNull<gfx::DrawTarget*> aTarget) override;
|
||||
|
@ -518,7 +501,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
// return true and fills in the bound rect if element has a hit region.
|
||||
bool GetHitRegionRect(Element* aElement, nsRect& aRect) override;
|
||||
|
||||
virtual void OnShutdown();
|
||||
void OnShutdown();
|
||||
|
||||
/**
|
||||
* Update CurrentState().filter with the filter description for
|
||||
|
@ -530,7 +513,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
protected:
|
||||
nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY,
|
||||
uint32_t aWidth, uint32_t aHeight,
|
||||
Maybe<nsIPrincipal*> aSubjectPrincipal,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
JSObject** aRetval);
|
||||
|
||||
void PutImageData_explicit(int32_t aX, int32_t aY, ImageData&,
|
||||
|
@ -554,7 +537,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
* The number of living nsCanvasRenderingContexts. When this goes down to
|
||||
* 0, we free the premultiply and unpremultiply tables, if they exist.
|
||||
*/
|
||||
static mozilla::Atomic<uintptr_t> sNumLivingContexts;
|
||||
static uintptr_t sNumLivingContexts;
|
||||
|
||||
static mozilla::gfx::DrawTarget* sErrorTarget;
|
||||
|
||||
|
@ -751,9 +734,8 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
RefPtr<mozilla::layers::PersistentBufferProvider> mBufferProvider;
|
||||
|
||||
RefPtr<CanvasShutdownObserver> mShutdownObserver;
|
||||
virtual void AddShutdownObserver();
|
||||
virtual void RemoveShutdownObserver();
|
||||
virtual bool AlreadyShutDown() const { return !mShutdownObserver; }
|
||||
void RemoveShutdownObserver();
|
||||
bool AlreadyShutDown() const { return !mShutdownObserver; }
|
||||
|
||||
/**
|
||||
* Flag to avoid duplicate calls to InvalidateFrame. Set to true whenever
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "ImageEncoder.h"
|
||||
#include "mozilla/dom/BlobImpl.h"
|
||||
#include "mozilla/dom/CanvasRenderingContext2D.h"
|
||||
#include "mozilla/dom/OffscreenCanvasRenderingContext2D.h"
|
||||
#include "mozilla/GfxMessageUtils.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
@ -138,11 +137,6 @@ CanvasRenderingContextHelper::CreateContextHelper(
|
|||
ret = new CanvasRenderingContext2D(aCompositorBackend);
|
||||
break;
|
||||
|
||||
case CanvasContextType::OffscreenCanvas2D:
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1);
|
||||
ret = new OffscreenCanvasRenderingContext2D(aCompositorBackend);
|
||||
break;
|
||||
|
||||
case CanvasContextType::WebGL1:
|
||||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
|
||||
|
||||
|
@ -172,7 +166,6 @@ CanvasRenderingContextHelper::CreateContextHelper(
|
|||
}
|
||||
MOZ_ASSERT(ret);
|
||||
|
||||
ret->Initialize();
|
||||
return ret.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ class EncodeCompleteCallback;
|
|||
enum class CanvasContextType : uint8_t {
|
||||
NoContext,
|
||||
Canvas2D,
|
||||
OffscreenCanvas2D,
|
||||
WebGL1,
|
||||
WebGL2,
|
||||
WebGPU,
|
||||
|
|
|
@ -51,26 +51,24 @@ using namespace mozilla::gfx;
|
|||
namespace mozilla::CanvasUtils {
|
||||
|
||||
bool IsImageExtractionAllowed(dom::Document* aDocument, JSContext* aCx,
|
||||
Maybe<nsIPrincipal*> aPrincipal) {
|
||||
nsIPrincipal& aPrincipal) {
|
||||
// Do the rest of the checks only if privacy.resistFingerprinting is on.
|
||||
if (!nsContentUtils::ShouldResistFingerprinting(aDocument)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't proceed if we don't have a document or JavaScript context.
|
||||
if (!aDocument || !aCx || !aPrincipal) {
|
||||
if (!aDocument || !aCx) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIPrincipal& subjectPrincipal = *aPrincipal.ref();
|
||||
|
||||
// The system principal can always extract canvas data.
|
||||
if (subjectPrincipal.IsSystemPrincipal()) {
|
||||
if (aPrincipal.IsSystemPrincipal()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow extension principals.
|
||||
auto* principal = BasePrincipal::Cast(&subjectPrincipal);
|
||||
auto principal = BasePrincipal::Cast(&aPrincipal);
|
||||
if (principal->AddonPolicy() || principal->ContentScriptAddonPolicy()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ bool IsOffscreenCanvasEnabled(JSContext* aCx, JSObject* aObj);
|
|||
|
||||
// Check site-specific permission and display prompt if appropriate.
|
||||
bool IsImageExtractionAllowed(dom::Document* aDocument, JSContext* aCx,
|
||||
Maybe<nsIPrincipal*> aPrincipal);
|
||||
nsIPrincipal& aPrincipal);
|
||||
|
||||
// Make a double out of |v|, treating undefined values as 0.0 (for
|
||||
// the sake of sparse arrays). Return true iff coercion
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "mozilla/dom/BlobImpl.h"
|
||||
#include "mozilla/dom/OffscreenCanvasBinding.h"
|
||||
#include "mozilla/dom/OffscreenCanvasDisplayHelper.h"
|
||||
#include "mozilla/dom/OffscreenCanvasRenderingContext2D.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/WorkerPrivate.h"
|
||||
#include "mozilla/dom/WorkerScope.h"
|
||||
|
@ -119,9 +118,6 @@ void OffscreenCanvas::GetContext(
|
|||
|
||||
CanvasContextType contextType;
|
||||
switch (aContextId) {
|
||||
case OffscreenRenderingContextId::_2d:
|
||||
contextType = CanvasContextType::OffscreenCanvas2D;
|
||||
break;
|
||||
case OffscreenRenderingContextId::Bitmaprenderer:
|
||||
contextType = CanvasContextType::ImageBitmap;
|
||||
break;
|
||||
|
@ -152,11 +148,6 @@ void OffscreenCanvas::GetContext(
|
|||
|
||||
MOZ_ASSERT(mCurrentContext);
|
||||
switch (mCurrentContextType) {
|
||||
case CanvasContextType::OffscreenCanvas2D:
|
||||
aResult.SetValue().SetAsOffscreenCanvasRenderingContext2D() =
|
||||
*static_cast<OffscreenCanvasRenderingContext2D*>(
|
||||
mCurrentContext.get());
|
||||
break;
|
||||
case CanvasContextType::ImageBitmap:
|
||||
aResult.SetValue().SetAsImageBitmapRenderingContext() =
|
||||
*static_cast<ImageBitmapRenderingContext*>(mCurrentContext.get());
|
||||
|
@ -314,12 +305,6 @@ already_AddRefed<Promise> OffscreenCanvas::ConvertToBlob(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (mNeutered) {
|
||||
aRv.ThrowInvalidStateError(
|
||||
"Cannot get blob from placeholder canvas transferred to worker.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
|
||||
|
||||
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||
|
@ -342,9 +327,6 @@ already_AddRefed<Promise> OffscreenCanvas::ConvertToBlob(
|
|||
CanvasRenderingContextHelper::ToBlob(callback, type, encodeOptions,
|
||||
/* aUsingCustomOptions */ false,
|
||||
usePlaceholder, aRv);
|
||||
if (aRv.Failed()) {
|
||||
promise->MaybeReject(std::move(aRv));
|
||||
}
|
||||
|
||||
return promise.forget();
|
||||
}
|
||||
|
@ -359,12 +341,6 @@ already_AddRefed<Promise> OffscreenCanvas::ToBlob(JSContext* aCx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (mNeutered) {
|
||||
aRv.ThrowInvalidStateError(
|
||||
"Cannot get blob from placeholder canvas transferred to worker.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
|
||||
|
||||
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||
|
|
|
@ -36,7 +36,7 @@ class ImageBitmap;
|
|||
struct ImageEncodeOptions;
|
||||
|
||||
using OwningOffscreenRenderingContext = class
|
||||
OwningOffscreenCanvasRenderingContext2DOrImageBitmapRenderingContextOrWebGLRenderingContextOrWebGL2RenderingContextOrGPUCanvasContext;
|
||||
OwningImageBitmapRenderingContextOrWebGLRenderingContextOrWebGL2RenderingContextOrGPUCanvasContext;
|
||||
|
||||
// This is helper class for transferring OffscreenCanvas to worker thread.
|
||||
// Because OffscreenCanvas is not thread-safe. So we cannot pass Offscreen-
|
||||
|
@ -151,8 +151,6 @@ class OffscreenCanvas final : public DOMEventTargetHelper,
|
|||
|
||||
bool ShouldResistFingerprinting() const;
|
||||
|
||||
bool IsTransferredFromElement() const { return !!mDisplay; }
|
||||
|
||||
private:
|
||||
~OffscreenCanvas();
|
||||
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* 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 "OffscreenCanvasRenderingContext2D.h"
|
||||
#include "mozilla/dom/OffscreenCanvasRenderingContext2DBinding.h"
|
||||
#include "mozilla/dom/OffscreenCanvas.h"
|
||||
#include "mozilla/dom/WorkerCommon.h"
|
||||
#include "mozilla/dom/WorkerRef.h"
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
||||
class OffscreenCanvasShutdownObserver final {
|
||||
NS_INLINE_DECL_REFCOUNTING(OffscreenCanvasShutdownObserver)
|
||||
|
||||
public:
|
||||
explicit OffscreenCanvasShutdownObserver(
|
||||
OffscreenCanvasRenderingContext2D* aOwner)
|
||||
: mOwner(aOwner) {}
|
||||
|
||||
void OnShutdown() {
|
||||
if (mOwner) {
|
||||
mOwner->OnShutdown();
|
||||
mOwner = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearOwner() { mOwner = nullptr; }
|
||||
|
||||
private:
|
||||
~OffscreenCanvasShutdownObserver() = default;
|
||||
|
||||
OffscreenCanvasRenderingContext2D* mOwner;
|
||||
};
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(
|
||||
OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(OffscreenCanvasRenderingContext2D)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_END_INHERITING(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(OffscreenCanvasRenderingContext2D,
|
||||
CanvasRenderingContext2D)
|
||||
NS_IMPL_RELEASE_INHERITED(OffscreenCanvasRenderingContext2D,
|
||||
CanvasRenderingContext2D)
|
||||
|
||||
OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(
|
||||
layers::LayersBackend aCompositorBackend)
|
||||
: CanvasRenderingContext2D(aCompositorBackend) {}
|
||||
|
||||
OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D() =
|
||||
default;
|
||||
|
||||
JSObject* OffscreenCanvasRenderingContext2D::WrapObject(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
|
||||
return OffscreenCanvasRenderingContext2D_Binding::Wrap(aCx, this,
|
||||
aGivenProto);
|
||||
}
|
||||
|
||||
nsIGlobalObject* OffscreenCanvasRenderingContext2D::GetParentObject() const {
|
||||
return mOffscreenCanvas->GetOwnerGlobal();
|
||||
}
|
||||
|
||||
void OffscreenCanvasRenderingContext2D::AddShutdownObserver() {
|
||||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
||||
if (!workerPrivate) {
|
||||
// We may be using OffscreenCanvas on the main thread.
|
||||
CanvasRenderingContext2D::AddShutdownObserver();
|
||||
return;
|
||||
}
|
||||
|
||||
mOffscreenShutdownObserver =
|
||||
MakeAndAddRef<OffscreenCanvasShutdownObserver>(this);
|
||||
mWorkerRef = WeakWorkerRef::Create(
|
||||
workerPrivate,
|
||||
[observer = mOffscreenShutdownObserver] { observer->OnShutdown(); });
|
||||
}
|
||||
|
||||
void OffscreenCanvasRenderingContext2D::RemoveShutdownObserver() {
|
||||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
||||
if (!workerPrivate) {
|
||||
// We may be using OffscreenCanvas on the main thread.
|
||||
CanvasRenderingContext2D::RemoveShutdownObserver();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mOffscreenShutdownObserver) {
|
||||
mOffscreenShutdownObserver->ClearOwner();
|
||||
}
|
||||
mOffscreenShutdownObserver = nullptr;
|
||||
mWorkerRef = nullptr;
|
||||
}
|
||||
|
||||
void OffscreenCanvasRenderingContext2D::OnShutdown() {
|
||||
if (mOffscreenShutdownObserver) {
|
||||
mOffscreenShutdownObserver->ClearOwner();
|
||||
mOffscreenShutdownObserver = nullptr;
|
||||
}
|
||||
|
||||
CanvasRenderingContext2D::OnShutdown();
|
||||
}
|
||||
|
||||
void OffscreenCanvasRenderingContext2D::Commit(ErrorResult& aRv) {
|
||||
if (!mOffscreenCanvas->IsTransferredFromElement()) {
|
||||
aRv.ThrowInvalidStateError(
|
||||
"Cannot commit on an OffscreenCanvas that is not transferred from an "
|
||||
"HTMLCanvasElement.");
|
||||
return;
|
||||
}
|
||||
|
||||
mOffscreenCanvas->CommitFrameToCompositor();
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
|
@ -1,60 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* 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_DOM_OFFSCREENCANVASRENDERINGCONTEXT2D_H_
|
||||
#define MOZILLA_DOM_OFFSCREENCANVASRENDERINGCONTEXT2D_H_
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/dom/CanvasRenderingContext2D.h"
|
||||
|
||||
struct JSContext;
|
||||
class nsIGlobalObject;
|
||||
|
||||
namespace mozilla::dom {
|
||||
class OffscreenCanvas;
|
||||
class OffscreenCanvasShutdownObserver;
|
||||
class WeakWorkerRef;
|
||||
|
||||
class OffscreenCanvasRenderingContext2D final
|
||||
: public CanvasRenderingContext2D {
|
||||
public:
|
||||
// nsISupports interface + CC
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
|
||||
OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
|
||||
|
||||
explicit OffscreenCanvasRenderingContext2D(
|
||||
layers::LayersBackend aCompositorBackend);
|
||||
|
||||
nsIGlobalObject* GetParentObject() const;
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
OffscreenCanvas* Canvas() { return mOffscreenCanvas; }
|
||||
const OffscreenCanvas* Canvas() const { return mOffscreenCanvas; }
|
||||
|
||||
void Commit(ErrorResult& aRv);
|
||||
|
||||
void OnShutdown() override;
|
||||
|
||||
private:
|
||||
void AddShutdownObserver() override;
|
||||
void RemoveShutdownObserver() override;
|
||||
bool AlreadyShutDown() const override {
|
||||
return !mOffscreenShutdownObserver &&
|
||||
CanvasRenderingContext2D::AlreadyShutDown();
|
||||
}
|
||||
|
||||
~OffscreenCanvasRenderingContext2D() override;
|
||||
|
||||
RefPtr<OffscreenCanvasShutdownObserver> mOffscreenShutdownObserver;
|
||||
RefPtr<WeakWorkerRef> mWorkerRef;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
#endif // MOZILLA_DOM_OFFSCREENCANVASRENDERINGCONTEXT2D_H_
|
|
@ -61,7 +61,6 @@ EXPORTS.mozilla.dom += [
|
|||
"ImageUtils.h",
|
||||
"OffscreenCanvas.h",
|
||||
"OffscreenCanvasDisplayHelper.h",
|
||||
"OffscreenCanvasRenderingContext2D.h",
|
||||
"QueueParamTraits.h",
|
||||
"TextMetrics.h",
|
||||
"WebGLChild.h",
|
||||
|
@ -102,7 +101,6 @@ SOURCES += [
|
|||
"DrawTargetWebgl.cpp", # Isolate Skia
|
||||
"ImageUtils.cpp",
|
||||
"OffscreenCanvasDisplayHelper.cpp", # See bug 1745384
|
||||
"OffscreenCanvasRenderingContext2D.cpp", # See bug 1745384
|
||||
]
|
||||
|
||||
# WebGL Sources
|
||||
|
|
|
@ -96,9 +96,6 @@ class nsICanvasRenderingContextInternal : public nsISupports,
|
|||
// whenever the size of the element changes.
|
||||
NS_IMETHOD SetDimensions(int32_t width, int32_t height) = 0;
|
||||
|
||||
// Initializes the canvas after the object is constructed.
|
||||
virtual void Initialize() {}
|
||||
|
||||
// Initializes with an nsIDocShell and DrawTarget. The size is taken from the
|
||||
// DrawTarget.
|
||||
NS_IMETHOD InitializeWithDrawTarget(
|
||||
|
|
|
@ -68,8 +68,6 @@ function runTest() {
|
|||
}
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
['dom.workers.requestAnimationFrame', true],
|
||||
['gfx.offscreencanvas.enabled', true],
|
||||
['webgl.force-enabled', true],
|
||||
['webgl.enable-draft-extensions', true],
|
||||
]}, runTest);
|
||||
|
|
|
@ -800,8 +800,7 @@ already_AddRefed<CanvasCaptureMediaStream> HTMLCanvasElement::CaptureStream(
|
|||
// If no permission, arrange for the frame capture listener to return
|
||||
// all-white, opaque image data.
|
||||
bool usePlaceholder = !CanvasUtils::IsImageExtractionAllowed(
|
||||
OwnerDoc(), nsContentUtils::GetCurrentJSContext(),
|
||||
Some(&aSubjectPrincipal));
|
||||
OwnerDoc(), nsContentUtils::GetCurrentJSContext(), aSubjectPrincipal);
|
||||
|
||||
rv = RegisterFrameCaptureListener(stream->FrameCaptureListener(),
|
||||
usePlaceholder);
|
||||
|
@ -821,7 +820,7 @@ nsresult HTMLCanvasElement::ExtractData(JSContext* aCx,
|
|||
// Check site-specific permission and display prompt if appropriate.
|
||||
// If no permission, return all-white, opaque image data.
|
||||
bool usePlaceholder = !CanvasUtils::IsImageExtractionAllowed(
|
||||
OwnerDoc(), aCx, Some(&aSubjectPrincipal));
|
||||
OwnerDoc(), aCx, aSubjectPrincipal);
|
||||
return ImageEncoder::ExtractData(aType, aOptions, GetSize(), usePlaceholder,
|
||||
mCurrentContext, mCanvasRenderer, aStream);
|
||||
}
|
||||
|
@ -905,7 +904,7 @@ void HTMLCanvasElement::ToBlob(JSContext* aCx, BlobCallback& aCallback,
|
|||
// Check site-specific permission and display prompt if appropriate.
|
||||
// If no permission, return all-white, opaque image data.
|
||||
bool usePlaceholder = !CanvasUtils::IsImageExtractionAllowed(
|
||||
OwnerDoc(), aCx, Some(&aSubjectPrincipal));
|
||||
OwnerDoc(), aCx, aSubjectPrincipal);
|
||||
CanvasRenderingContextHelper::ToBlob(aCx, global, aCallback, aType, aParams,
|
||||
usePlaceholder, aRv);
|
||||
}
|
||||
|
|
|
@ -338,8 +338,7 @@ interface mixin CanvasHitRegions {
|
|||
[Pref="canvas.hitregions.enabled"] void clearHitRegions();
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
|
||||
[Exposed=Window]
|
||||
interface CanvasGradient {
|
||||
// opaque object
|
||||
[Throws]
|
||||
|
@ -347,8 +346,7 @@ interface CanvasGradient {
|
|||
void addColorStop(float offset, UTF8String color);
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
|
||||
[Exposed=Window]
|
||||
interface CanvasPattern {
|
||||
// opaque object
|
||||
// [Throws, LenientFloat] - could not do this overload because of bug 1020975
|
||||
|
@ -399,8 +397,7 @@ interface TextMetrics {
|
|||
};
|
||||
|
||||
[Pref="canvas.path.enabled",
|
||||
Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread",
|
||||
Exposed=(Window,Worker)]
|
||||
Exposed=Window]
|
||||
interface Path2D
|
||||
{
|
||||
constructor();
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
* https://html.spec.whatwg.org/#the-offscreencanvas-interface
|
||||
*/
|
||||
|
||||
typedef (OffscreenCanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext or GPUCanvasContext) OffscreenRenderingContext;
|
||||
typedef (ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext or GPUCanvasContext) OffscreenRenderingContext;
|
||||
|
||||
dictionary ImageEncodeOptions {
|
||||
DOMString type = "image/png";
|
||||
unrestricted double quality;
|
||||
};
|
||||
|
||||
enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2", "webgpu" };
|
||||
enum OffscreenRenderingContextId { /* "2d", */ "bitmaprenderer", "webgl", "webgl2", "webgpu" };
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
Func="CanvasUtils::IsOffscreenCanvasEnabled"]
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*
|
||||
* For more information on this interface, please see
|
||||
* https://html.spec.whatwg.org/#the-offscreen-2d-rendering-context
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
Func="CanvasUtils::IsOffscreenCanvasEnabled"]
|
||||
interface OffscreenCanvasRenderingContext2D {
|
||||
[Throws]
|
||||
void commit();
|
||||
|
||||
readonly attribute OffscreenCanvas canvas;
|
||||
};
|
||||
|
||||
OffscreenCanvasRenderingContext2D includes CanvasState;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasTransform;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasCompositing;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasShadowStyles;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasRect;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasDrawPath;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasDrawImage;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasImageData;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles;
|
||||
OffscreenCanvasRenderingContext2D includes CanvasPathMethods;
|
|
@ -241,9 +241,6 @@ with Files("OfflineAudio*"):
|
|||
with Files("OffscreenCanvas.webidl"):
|
||||
BUG_COMPONENT = ("Core", "Canvas: 2D")
|
||||
|
||||
with Files("OffscreenCanvasRenderingContext2D.webidl"):
|
||||
BUG_COMPONENT = ("Core", "Canvas: 2D")
|
||||
|
||||
with Files("OscillatorNode.webidl"):
|
||||
BUG_COMPONENT = ("Core", "Web Audio")
|
||||
|
||||
|
@ -755,7 +752,6 @@ WEBIDL_FILES = [
|
|||
"OfflineAudioContext.webidl",
|
||||
"OfflineResourceList.webidl",
|
||||
"OffscreenCanvas.webidl",
|
||||
"OffscreenCanvasRenderingContext2D.webidl",
|
||||
"OscillatorNode.webidl",
|
||||
"PaintRequest.webidl",
|
||||
"PaintRequestList.webidl",
|
||||
|
|
|
@ -1525,7 +1525,7 @@
|
|||
|
||||
# Add support for canvas path objects
|
||||
- name: canvas.path.enabled
|
||||
type: RelaxedAtomicBool
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
|
|
|
@ -100,6 +100,3 @@ user_pref("toolkit.telemetry.initDelay", 99999999);
|
|||
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
|
||||
// Use a light color-scheme unless explicitly overriden.
|
||||
user_pref("layout.css.prefers-color-scheme.content-override", 1);
|
||||
// Force OffscreenCanvas support
|
||||
user_pref("gfx.offscreencanvas.enabled", true);
|
||||
user_pref("dom.workers.requestAnimationFrame", true);
|
||||
|
|
|
@ -73,6 +73,3 @@ user_pref("browser.cache.offline.enable", true);
|
|||
user_pref("network.cookie.cookieBehavior", 4);
|
||||
// Force a light color scheme unless explicitly overriden by pref.
|
||||
user_pref("layout.css.prefers-color-scheme.content-override", 1);
|
||||
// Force OffscreenCanvas support
|
||||
user_pref("gfx.offscreencanvas.enabled", true);
|
||||
user_pref("dom.workers.requestAnimationFrame", true);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
prefs: [gfx.offscreencanvas.enabled:true]
|
|
@ -1,7 +1,16 @@
|
|||
[createImageBitmap-drawImage.html]
|
||||
[createImageBitmap from an OffscreenCanvas resized, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an HTMLVideoElement from a data URL scaled down, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an OffscreenCanvas scaled down, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an HTMLVideoElement scaled down, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -14,9 +23,15 @@
|
|||
[createImageBitmap from an HTMLVideoElement from a data URL scaled up, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an OffscreenCanvas scaled up, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an HTMLVideoElement from a data URL resized, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an HTMLVideoElement, and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
[createImageBitmap-flipY.html]
|
||||
[createImageBitmap from an OffscreenCanvas imageOrientation: "flipY", and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an OffscreenCanvas imageOrientation: "none", and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap from an HTMLVideoElement imageOrientation: "none", and drawImage on the created ImageBitmap]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
[createImageBitmap-invalid-args.html]
|
||||
[createImageBitmap with an OffscreenCanvas source and sh set to 0]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and sw set to 0]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with CanvasRenderingContext2D image source.]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and a value of 0 int resizeWidth]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and a value of 0 in resizeHeight]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and a value between 0 and 1 in resizeWidth]
|
||||
expected: FAIL
|
||||
|
||||
[createImageBitmap with an OffscreenCanvas source and a value between 0 and 1 in resizeHeight]
|
||||
expected: FAIL
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[createImageBitmap-serializable.html]
|
||||
[Serialize ImageBitmap created from an OffscreenCanvas]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[createImageBitmap-transfer.html]
|
||||
[Transfer ImageBitmap created from an OffscreenCanvas]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[canvas-drawImage-offscreenCanvas.html]
|
||||
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, uint8; OffscreenCanvas color params: srgb, float16]
|
||||
expected: FAIL
|
||||
|
||||
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, float16; OffscreenCanvas color params: srgb, float16]
|
||||
expected: FAIL
|
||||
|
||||
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, float16; OffscreenCanvas color params: srgb, uint8]
|
||||
expected: FAIL
|
||||
|
||||
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, uint8; OffscreenCanvas color params: srgb, uint8]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[2d.conformance.requirements.basics.html]
|
||||
[void methods return undefined]
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[2d.conformance.requirements.basics.worker.html]
|
||||
[void methods return undefined]
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[2d.conformance.requirements.missingargs.html]
|
||||
[Missing arguments cause TypeError]
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[2d.conformance.requirements.missingargs.worker.html]
|
||||
[Missing arguments cause TypeError]
|
||||
expected: FAIL
|
|
@ -0,0 +1 @@
|
|||
prefs: [dom.workers.requestAnimationFrame:true, gfx.offscreencanvas.enabled:true]
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.copy.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.copy]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.copy.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-atop.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.destination-atop]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-atop.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-in.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.destination-in]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-in.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-out.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.destination-out]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-out.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-over.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.destination-over]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.destination-over.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.lighter.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.lighter]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.lighter.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-atop.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.source-atop]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-atop.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-in.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.source-in]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-in.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-out.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.source-out]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-out.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-over.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.source-over]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.source-over.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.xor.html]
|
||||
[OffscreenCanvas test: 2d.composite.canvas.xor]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.canvas.xor.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.copy.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.copy.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-atop.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-atop.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-in.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-in.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-out.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-out.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-over.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.destination-over.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.lighter.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.lighter.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-atop.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-atop.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-in.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-in.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-out.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-out.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-over.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.source-over.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.xor.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.clip.xor.worker.html]
|
||||
[fill() does not affect pixels outside the clip region.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvas.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.canvas]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvas.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvascopy.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.canvascopy]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvascopy.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvaspattern.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.canvaspattern]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.canvaspattern.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.default.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.default]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.default.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.fill.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.fill]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.fill.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.image.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.image]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.image.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.imagepattern.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.imagepattern]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.imagepattern.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.invalid.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.invalid]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.invalid.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.range.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.range]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.globalAlpha.range.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.image.copy.html]
|
||||
[OffscreenCanvas test: 2d.composite.image.copy]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.image.copy.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.image.destination-atop.html]
|
||||
[OffscreenCanvas test: 2d.composite.image.destination-atop]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.image.destination-atop.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче