summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-08-05 11:35:53 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-08-05 11:35:53 +0200
commit6bd66b1728eeddb058066edda740aaeb2ceaec23 (patch)
tree985faf01c526763515731569fa01a99f4dbef36e /dom
parente0a8dcfed131ffa58a5e2cb1d30fe48c745c2fdc (diff)
parent559824514dc95e02fbe81f1786e6ac13ee8e9d55 (diff)
downloadUXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar
UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.gz
UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.lz
UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.xz
UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.zip
Merge branch 'master' into js-modules
Diffstat (limited to 'dom')
-rw-r--r--dom/base/Element.cpp36
-rw-r--r--dom/base/Element.h2
-rw-r--r--dom/base/nsImageLoadingContent.cpp36
-rw-r--r--dom/base/nsImageLoadingContent.h10
-rw-r--r--dom/bindings/Bindings.conf5
-rw-r--r--dom/bindings/test/test_dom_xrays.html2
-rw-r--r--dom/canvas/WebGLContextExtensions.cpp8
-rw-r--r--dom/canvas/WebGLContextState.cpp12
-rw-r--r--dom/canvas/WebGLContextUtils.cpp12
-rw-r--r--dom/canvas/WebGLContextUtils.h2
-rw-r--r--dom/canvas/WebGLExtensionDebugGet.cpp79
-rw-r--r--dom/canvas/WebGLExtensions.h14
-rw-r--r--dom/canvas/WebGLShaderValidator.cpp68
-rw-r--r--dom/canvas/WebGLShaderValidator.h6
-rw-r--r--dom/canvas/WebGLTypes.h1
-rw-r--r--dom/canvas/moz.build1
-rw-r--r--dom/events/DataTransfer.cpp17
-rw-r--r--dom/events/DataTransfer.h3
-rw-r--r--dom/html/HTMLMediaElement.cpp2
-rw-r--r--dom/html/nsHTMLDocument.cpp6
-rw-r--r--dom/locales/en-US/chrome/security/security.properties1
-rw-r--r--dom/media/fmp4/MP4Demuxer.cpp9
-rw-r--r--dom/webidl/DataTransfer.webidl2
-rw-r--r--dom/webidl/Element.webidl2
-rw-r--r--dom/webidl/Event.webidl2
-rw-r--r--dom/webidl/HTMLDocument.webidl2
-rw-r--r--dom/webidl/WebGLRenderingContext.webidl9
27 files changed, 262 insertions, 87 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 52d06b0f8..79b36a314 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1230,6 +1230,42 @@ Element::GetAttribute(const nsAString& aName, DOMString& aReturn)
}
}
+bool
+Element::ToggleAttribute(const nsAString& aName,
+ const Optional<bool>& aForce,
+ ErrorResult& aError)
+{
+ aError = nsContentUtils::CheckQName(aName, false);
+ if (aError.Failed()) {
+ return false;
+ }
+
+ nsAutoString nameToUse;
+ const nsAttrName* name = InternalGetAttrNameFromQName(aName, &nameToUse);
+ if (!name) {
+ if (aForce.WasPassed() && !aForce.Value()) {
+ return false;
+ }
+ nsCOMPtr<nsIAtom> nameAtom = NS_Atomize(nameToUse);
+ if (!nameAtom) {
+ aError.Throw(NS_ERROR_OUT_OF_MEMORY);
+ return false;
+ }
+ aError = SetAttr(kNameSpaceID_None, nameAtom, EmptyString(), true);
+ return true;
+ }
+ if (aForce.WasPassed() && aForce.Value()) {
+ return true;
+ }
+ // Hold a strong reference here so that the atom or nodeinfo doesn't go
+ // away during UnsetAttr. If it did UnsetAttr would be left with a
+ // dangling pointer as argument without knowing it.
+ nsAttrName tmp(*name);
+
+ aError = UnsetAttr(name->NamespaceID(), name->LocalName(), true);
+ return false;
+}
+
void
Element::SetAttribute(const nsAString& aName,
const nsAString& aValue,
diff --git a/dom/base/Element.h b/dom/base/Element.h
index 049984d1b..c269ab14a 100644
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -686,6 +686,8 @@ public:
void GetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsAString& aReturn);
+ bool ToggleAttribute(const nsAString& aName, const Optional<bool>& aForce,
+ ErrorResult& aError);
void SetAttribute(const nsAString& aName, const nsAString& aValue,
ErrorResult& aError);
void SetAttributeNS(const nsAString& aNamespaceURI,
diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp
index d25dd6319..0c6c37b44 100644
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -94,8 +94,7 @@ nsImageLoadingContent::nsImageLoadingContent()
mNewRequestsWillNeedAnimationReset(false),
mStateChangerDepth(0),
mCurrentRequestRegistered(false),
- mPendingRequestRegistered(false),
- mFrameCreateCalled(false)
+ mPendingRequestRegistered(false)
{
if (!nsContentUtils::GetImgLoaderForChannel(nullptr, nullptr)) {
mLoadingEnabled = false;
@@ -489,10 +488,8 @@ nsImageLoadingContent::FrameCreated(nsIFrame* aFrame)
{
NS_ASSERTION(aFrame, "aFrame is null");
- mFrameCreateCalled = true;
-
- TrackImage(mCurrentRequest);
- TrackImage(mPendingRequest);
+ TrackImage(mCurrentRequest, aFrame);
+ TrackImage(mPendingRequest, aFrame);
// We need to make sure that our image request is registered, if it should
// be registered.
@@ -513,8 +510,6 @@ nsImageLoadingContent::FrameDestroyed(nsIFrame* aFrame)
{
NS_ASSERTION(aFrame, "aFrame is null");
- mFrameCreateCalled = false;
-
// We need to make sure that our image request is deregistered.
nsPresContext* presContext = GetFramePresContext();
if (mCurrentRequest) {
@@ -1486,7 +1481,8 @@ nsImageLoadingContent::OnVisibilityChange(Visibility aNewVisibility,
}
void
-nsImageLoadingContent::TrackImage(imgIRequest* aImage)
+nsImageLoadingContent::TrackImage(imgIRequest* aImage,
+ nsIFrame* aFrame /*= nullptr */)
{
if (!aImage)
return;
@@ -1499,13 +1495,21 @@ nsImageLoadingContent::TrackImage(imgIRequest* aImage)
return;
}
- // We only want to track this request if we're visible. Ordinarily we check
- // the visible count, but that requires a frame; in cases where
- // GetOurPrimaryFrame() cannot obtain a frame (e.g. <feImage>), we assume
- // we're visible if FrameCreated() was called.
- nsIFrame* frame = GetOurPrimaryFrame();
- if ((frame && frame->GetVisibility() == Visibility::APPROXIMATELY_NONVISIBLE) ||
- (!frame && !mFrameCreateCalled)) {
+ if (!aFrame) {
+ aFrame = GetOurPrimaryFrame();
+ }
+
+ /* This line is deceptively simple. It hides a lot of subtlety. Before we
+ * create an nsImageFrame we call nsImageFrame::ShouldCreateImageFrameFor
+ * to determine if we should create an nsImageFrame or create a frame based
+ * on the display of the element (ie inline, block, etc). Inline, block, etc
+ * frames don't register for visibility tracking so they will return UNTRACKED
+ * from GetVisibility(). So this line is choosing to mark such images as
+ * visible. Once the image loads we will get an nsImageFrame and the proper
+ * visibility. This is a pitfall of tracking the visibility on the frames
+ * instead of the content node.
+ */
+ if (!aFrame || aFrame->GetVisibility() == Visibility::APPROXIMATELY_NONVISIBLE) {
return;
}
diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h
index 85db2bd2c..5f7daff72 100644
--- a/dom/base/nsImageLoadingContent.h
+++ b/dom/base/nsImageLoadingContent.h
@@ -364,6 +364,11 @@ protected:
*
* No-op if aImage is null.
*
+ * @param aFrame If called from FrameCreated the frame passed to FrameCreated.
+ * This is our frame, but at the time of the FrameCreated call
+ * our primary frame pointer hasn't been set yet, so this is
+ * only way to get our frame.
+ *
* @param aNonvisibleAction A requested action if the frame has become
* nonvisible. If Nothing(), no action is
* requested. If DISCARD_IMAGES is specified, the
@@ -371,7 +376,7 @@ protected:
* associated with to discard their surfaces if
* possible.
*/
- void TrackImage(imgIRequest* aImage);
+ void TrackImage(imgIRequest* aImage, nsIFrame* aFrame = nullptr);
void UntrackImage(imgIRequest* aImage,
const Maybe<OnNonvisible>& aNonvisibleAction = Nothing());
@@ -454,9 +459,6 @@ private:
// registered with the refresh driver.
bool mCurrentRequestRegistered;
bool mPendingRequestRegistered;
-
- // True when FrameCreate has been called but FrameDestroy has not.
- bool mFrameCreateCalled;
};
#endif // nsImageLoadingContent_h__
diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index aa7f26ad6..6f9733c5f 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1222,6 +1222,11 @@ DOMInterfaces = {
'headerFile': 'WebGLExtensions.h'
},
+'MOZ_debug_get': {
+ 'nativeType': 'mozilla::WebGLExtensionDebugGet',
+ 'headerFile': 'WebGLExtensions.h'
+},
+
'WebGLFramebuffer': {
'nativeType': 'mozilla::WebGLFramebuffer',
'headerFile': 'WebGLFramebuffer.h'
diff --git a/dom/bindings/test/test_dom_xrays.html b/dom/bindings/test/test_dom_xrays.html
index 0700db2f8..15d7013ad 100644
--- a/dom/bindings/test/test_dom_xrays.html
+++ b/dom/bindings/test/test_dom_xrays.html
@@ -172,7 +172,7 @@ function test()
// Check that DataTransfer's .types has the hack to alias contains()
// to includes().
- var dataTransfer = new win.DataTransfer("foo", true);
+ var dataTransfer = new win.DataTransfer();
is(dataTransfer.types.contains, dataTransfer.types.includes,
"Should have contains() set up as an alias to includes()");
// Waive Xrays on the dataTransfer itself, since the .types we get is
diff --git a/dom/canvas/WebGLContextExtensions.cpp b/dom/canvas/WebGLContextExtensions.cpp
index 4a5a23274..7f338b4e9 100644
--- a/dom/canvas/WebGLContextExtensions.cpp
+++ b/dom/canvas/WebGLContextExtensions.cpp
@@ -40,6 +40,7 @@ WebGLContext::GetExtensionString(WebGLExtensionID ext)
WEBGL_EXTENSION_IDENTIFIER(EXT_sRGB)
WEBGL_EXTENSION_IDENTIFIER(EXT_texture_filter_anisotropic)
WEBGL_EXTENSION_IDENTIFIER(EXT_disjoint_timer_query)
+ WEBGL_EXTENSION_IDENTIFIER(MOZ_debug_get)
WEBGL_EXTENSION_IDENTIFIER(OES_element_index_uint)
WEBGL_EXTENSION_IDENTIFIER(OES_standard_derivatives)
WEBGL_EXTENSION_IDENTIFIER(OES_texture_float)
@@ -91,6 +92,8 @@ bool WebGLContext::IsExtensionSupported(dom::CallerType callerType,
switch (ext) {
case WebGLExtensionID::EXT_disjoint_timer_query:
return WebGLExtensionDisjointTimerQuery::IsSupported(this);
+ case WebGLExtensionID::MOZ_debug_get:
+ return true;
case WebGLExtensionID::WEBGL_debug_renderer_info:
return true;
case WebGLExtensionID::WEBGL_debug_shaders:
@@ -372,6 +375,11 @@ WebGLContext::EnableExtension(WebGLExtensionID ext)
obj = new WebGLExtensionTextureFilterAnisotropic(this);
break;
+ // MOZ_
+ case WebGLExtensionID::MOZ_debug_get:
+ obj = new WebGLExtensionDebugGet(this);
+ break;
+
// OES_
case WebGLExtensionID::OES_element_index_uint:
obj = new WebGLExtensionElementIndexUint(this);
diff --git a/dom/canvas/WebGLContextState.cpp b/dom/canvas/WebGLContextState.cpp
index e0234f5c6..c2f4c1a75 100644
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -61,18 +61,6 @@ WebGLContext::Enable(GLenum cap)
gl->fEnable(cap);
}
-static JS::Value
-StringValue(JSContext* cx, const nsAString& str, ErrorResult& rv)
-{
- JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length());
- if (!jsStr) {
- rv.Throw(NS_ERROR_OUT_OF_MEMORY);
- return JS::NullValue();
- }
-
- return JS::StringValue(jsStr);
-}
-
bool
WebGLContext::GetStencilBits(GLint* const out_stencilBits)
{
diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp
index 9c0d34939..3fd32eb30 100644
--- a/dom/canvas/WebGLContextUtils.cpp
+++ b/dom/canvas/WebGLContextUtils.cpp
@@ -874,4 +874,16 @@ InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims)
}
}
+JS::Value
+StringValue(JSContext* cx, const nsAString& str, ErrorResult& er)
+{
+ JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length());
+ if (!jsStr) {
+ er.Throw(NS_ERROR_OUT_OF_MEMORY);
+ return JS::NullValue();
+ }
+
+ return JS::StringValue(jsStr);
+}
+
} // namespace mozilla
diff --git a/dom/canvas/WebGLContextUtils.h b/dom/canvas/WebGLContextUtils.h
index 5401fc878..1d06659b1 100644
--- a/dom/canvas/WebGLContextUtils.h
+++ b/dom/canvas/WebGLContextUtils.h
@@ -94,6 +94,8 @@ WebGLContext::WebGLObjectAsJSObject(JSContext* cx,
*/
const char* InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims);
+JS::Value StringValue(JSContext* cx, const nsAString& str, ErrorResult& er);
+
} // namespace mozilla
#endif // WEBGL_CONTEXT_UTILS_H_
diff --git a/dom/canvas/WebGLExtensionDebugGet.cpp b/dom/canvas/WebGLExtensionDebugGet.cpp
new file mode 100644
index 000000000..39bb3c57a
--- /dev/null
+++ b/dom/canvas/WebGLExtensionDebugGet.cpp
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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 "WebGLExtensions.h"
+
+#include "mozilla/dom/WebGLRenderingContextBinding.h"
+#include "WebGLContext.h"
+#include "WebGLContextUtils.h"
+
+namespace mozilla {
+
+WebGLExtensionDebugGet::WebGLExtensionDebugGet(WebGLContext* webgl)
+ : WebGLExtensionBase(webgl)
+{
+}
+
+WebGLExtensionDebugGet::~WebGLExtensionDebugGet()
+{
+}
+
+void
+WebGLExtensionDebugGet::GetParameter(JSContext* cx, GLenum pname,
+ JS::MutableHandle<JS::Value> retval,
+ ErrorResult& er) const
+{
+ const auto& gl = mContext->gl;
+ gl->MakeCurrent();
+
+ switch (pname) {
+ case LOCAL_GL_EXTENSIONS:
+ {
+ nsString ret;
+ if (!gl->IsCoreProfile()) {
+ const auto rawExts = (const char*)gl->fGetString(LOCAL_GL_EXTENSIONS);
+ ret = NS_ConvertUTF8toUTF16(rawExts);
+ } else {
+ const auto& numExts = gl->GetIntAs<GLuint>(LOCAL_GL_NUM_EXTENSIONS);
+ for (GLuint i = 0; i < numExts; i++) {
+ const auto rawExt = (const char*)gl->fGetStringi(LOCAL_GL_EXTENSIONS,
+ i);
+ if (i > 0) {
+ ret.AppendLiteral(" ");
+ }
+ ret.Append(NS_ConvertUTF8toUTF16(rawExt));
+ }
+ }
+ retval.set(StringValue(cx, ret, er));
+ return;
+ }
+
+ case LOCAL_GL_RENDERER:
+ case LOCAL_GL_VENDOR:
+ case LOCAL_GL_VERSION:
+ {
+ const auto raw = (const char*)gl->fGetString(pname);
+ retval.set(StringValue(cx, NS_ConvertUTF8toUTF16(raw), er));
+ return;
+ }
+
+ case 0x10000: // "WSI_INFO"
+ {
+ nsCString info;
+ gl->GetWSIInfo(&info);
+ retval.set(StringValue(cx, NS_ConvertUTF8toUTF16(info), er));
+ return;
+ }
+
+ default:
+ mContext->ErrorInvalidEnumArg("MOZ_debug_get.getParameter", "pname", pname);
+ retval.set(JS::NullValue());
+ return;
+ }
+}
+
+IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDebugGet, MOZ_debug_get)
+
+} // namespace mozilla
diff --git a/dom/canvas/WebGLExtensions.h b/dom/canvas/WebGLExtensions.h
index 741f6997f..7b6b6b54b 100644
--- a/dom/canvas/WebGLExtensions.h
+++ b/dom/canvas/WebGLExtensions.h
@@ -12,6 +12,7 @@
#include "WebGLTypes.h"
namespace mozilla {
+class ErrorResult;
namespace dom {
template<typename T>
@@ -385,6 +386,19 @@ public:
DECL_WEBGL_EXTENSION_GOOP
};
+class WebGLExtensionDebugGet final
+ : public WebGLExtensionBase
+{
+public:
+ explicit WebGLExtensionDebugGet(WebGLContext* webgl);
+ virtual ~WebGLExtensionDebugGet();
+
+ void GetParameter(JSContext* cx, GLenum pname,
+ JS::MutableHandle<JS::Value> retval, ErrorResult& er) const;
+
+ DECL_WEBGL_EXTENSION_GOOP
+};
+
} // namespace mozilla
#endif // WEBGL_EXTENSIONS_H_
diff --git a/dom/canvas/WebGLShaderValidator.cpp b/dom/canvas/WebGLShaderValidator.cpp
index 80ba359a3..fda31e212 100644
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -28,20 +28,39 @@ IdentifierHashFunc(const char* name, size_t len)
return hash[0];
}
-static ShCompileOptions
+static int
ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
const mozilla::gl::GLContext* gl)
{
- ShCompileOptions options = SH_VARIABLES |
- SH_ENFORCE_PACKING_RESTRICTIONS |
- SH_OBJECT_CODE |
- SH_INIT_GL_POSITION;
-
+ int options = SH_VARIABLES |
+ SH_ENFORCE_PACKING_RESTRICTIONS |
+ SH_INIT_VARYINGS_WITHOUT_STATIC_USE |
+ SH_OBJECT_CODE |
+ SH_INIT_GL_POSITION;
+
+ if (resources.MaxExpressionComplexity > 0) {
+ options |= SH_LIMIT_EXPRESSION_COMPLEXITY;
+ }
// Sampler arrays indexed with non-constant expressions are forbidden in
// GLSL 1.30 and later.
// ESSL 3 requires constant-integral-expressions for this as well.
// Just do it universally.
options |= SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX;
+
+ // Needed for driver bug detection
+ options |= SH_EMULATE_BUILT_IN_FUNCTIONS;
+
+ if (gfxPrefs::WebGLAllANGLEOptions()) {
+ return options |
+ SH_VALIDATE_LOOP_INDEXING |
+ SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX |
+ SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX |
+ SH_CLAMP_INDIRECT_ARRAY_BOUNDS |
+ SH_UNFOLD_SHORT_CIRCUIT |
+ SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS |
+ SH_INIT_OUTPUT_VARIABLES |
+ SH_REGENERATE_STRUCT_NAMES;
+ }
#ifndef XP_MACOSX
// We want to do this everywhere, but to do this on Mac, we need
@@ -55,30 +74,23 @@ ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
// Work around https://bugs.webkit.org/show_bug.cgi?id=124684,
// https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb
options |= SH_UNFOLD_SHORT_CIRCUIT;
+
+ // OS X 10.7/10.8 specific:
+
+ // Work around bug 665578 and bug 769810
+ if (gl->Vendor() == gl::GLVendor::ATI) {
+ options |= SH_EMULATE_BUILT_IN_FUNCTIONS;
+ }
+ // Work around bug 735560
+ if (gl->Vendor() == gl::GLVendor::Intel) {
+ options |= SH_EMULATE_BUILT_IN_FUNCTIONS;
+ }
// Work around that Mac drivers handle struct scopes incorrectly.
options |= SH_REGENERATE_STRUCT_NAMES;
- options |= SH_INIT_OUTPUT_VARIABLES;
}
#endif
- if (gfxPrefs::WebGLAllANGLEOptions()) {
- options = -1;
-
- options ^= SH_INTERMEDIATE_TREE;
- options ^= SH_LINE_DIRECTIVES;
- options ^= SH_SOURCE_PATH;
-
- options ^= SH_LIMIT_EXPRESSION_COMPLEXITY;
- options ^= SH_LIMIT_CALL_STACK_DEPTH;
-
- options ^= SH_EXPAND_SELECT_HLSL_INTEGER_POW_EXPRESSIONS;
- options ^= SH_HLSL_GET_DIMENSIONS_IGNORES_BASE_LEVEL;
-
- options ^= SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT;
- options ^= SH_REMOVE_INVARIANT_AND_CENTROID_FOR_ESSL3;
- }
-
if (resources.MaxExpressionComplexity > 0) {
options |= SH_LIMIT_EXPRESSION_COMPLEXITY;
}
@@ -173,7 +185,7 @@ WebGLContext::CreateShaderValidator(GLenum shaderType) const
#endif
}
- const auto compileOptions = webgl::ChooseValidatorCompileOptions(resources, gl);
+ int compileOptions = webgl::ChooseValidatorCompileOptions(resources, gl);
return webgl::ShaderValidator::Create(shaderType, spec, outputLanguage, resources,
compileOptions);
}
@@ -186,7 +198,7 @@ namespace webgl {
ShaderValidator::Create(GLenum shaderType, ShShaderSpec spec,
ShShaderOutput outputLanguage,
const ShBuiltInResources& resources,
- ShCompileOptions compileOptions)
+ int compileOptions)
{
ShHandle handle = ShConstructCompiler(shaderType, spec, outputLanguage, &resources);
if (!handle)
@@ -283,8 +295,8 @@ ShaderValidator::CanLinkTo(const ShaderValidator* prev, nsCString* const out_log
}
}
{
- const auto vertVars = sh::GetInterfaceBlocks(prev->mHandle);
- const auto fragVars = sh::GetInterfaceBlocks(mHandle);
+ const auto vertVars = ShGetInterfaceBlocks(prev->mHandle);
+ const auto fragVars = ShGetInterfaceBlocks(mHandle);
if (!vertVars || !fragVars) {
nsPrintfCString error("Could not create uniform block list.");
*out_log = error;
diff --git a/dom/canvas/WebGLShaderValidator.h b/dom/canvas/WebGLShaderValidator.h
index deb1c7c7f..ba50def28 100644
--- a/dom/canvas/WebGLShaderValidator.h
+++ b/dom/canvas/WebGLShaderValidator.h
@@ -17,7 +17,7 @@ namespace webgl {
class ShaderValidator final
{
const ShHandle mHandle;
- const ShCompileOptions mCompileOptions;
+ const int mCompileOptions;
const int mMaxVaryingVectors;
bool mHasRun;
@@ -25,10 +25,10 @@ public:
static ShaderValidator* Create(GLenum shaderType, ShShaderSpec spec,
ShShaderOutput outputLanguage,
const ShBuiltInResources& resources,
- ShCompileOptions compileOptions);
+ int compileOptions);
private:
- ShaderValidator(ShHandle handle, ShCompileOptions compileOptions,
+ ShaderValidator(ShHandle handle, int compileOptions,
int maxVaryingVectors)
: mHandle(handle)
, mCompileOptions(compileOptions)
diff --git a/dom/canvas/WebGLTypes.h b/dom/canvas/WebGLTypes.h
index 42b8701f3..2f4a4368a 100644
--- a/dom/canvas/WebGLTypes.h
+++ b/dom/canvas/WebGLTypes.h
@@ -149,6 +149,7 @@ enum class WebGLExtensionID : uint8_t {
EXT_shader_texture_lod,
EXT_texture_filter_anisotropic,
EXT_disjoint_timer_query,
+ MOZ_debug_get,
OES_element_index_uint,
OES_standard_derivatives,
OES_texture_float,
diff --git a/dom/canvas/moz.build b/dom/canvas/moz.build
index f7555b33d..6d5e2756f 100644
--- a/dom/canvas/moz.build
+++ b/dom/canvas/moz.build
@@ -105,6 +105,7 @@ UNIFIED_SOURCES += [
'WebGLExtensionCompressedTextureETC1.cpp',
'WebGLExtensionCompressedTexturePVRTC.cpp',
'WebGLExtensionCompressedTextureS3TC.cpp',
+ 'WebGLExtensionDebugGet.cpp',
'WebGLExtensionDebugRendererInfo.cpp',
'WebGLExtensionDebugShaders.cpp',
'WebGLExtensionDepthTexture.cpp',
diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp
index 2c6ecdd56..45c72e662 100644
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -161,22 +161,11 @@ DataTransfer::~DataTransfer()
// static
already_AddRefed<DataTransfer>
-DataTransfer::Constructor(const GlobalObject& aGlobal,
- const nsAString& aEventType, bool aIsExternal,
- ErrorResult& aRv)
+DataTransfer::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
{
- nsAutoCString onEventType("on");
- AppendUTF16toUTF8(aEventType, onEventType);
- nsCOMPtr<nsIAtom> eventTypeAtom = NS_Atomize(onEventType);
- if (!eventTypeAtom) {
- aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
- return nullptr;
- }
-
- EventMessage eventMessage = nsContentUtils::GetEventMessage(eventTypeAtom);
RefPtr<DataTransfer> transfer = new DataTransfer(aGlobal.GetAsSupports(),
- eventMessage, aIsExternal,
- -1);
+ eCopy, /* is external */ false, /* clipboard type */ -1);
+ transfer->mEffectAllowed = nsIDragService::DRAGDROP_ACTION_NONE;
return transfer.forget();
}
diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h
index 7c6b0b8c1..344593ed0 100644
--- a/dom/events/DataTransfer.h
+++ b/dom/events/DataTransfer.h
@@ -115,8 +115,7 @@ public:
}
static already_AddRefed<DataTransfer>
- Constructor(const GlobalObject& aGlobal, const nsAString& aEventType,
- bool aIsExternal, ErrorResult& aRv);
+ Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
void GetDropEffect(nsString& aDropEffect)
{
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 0b9f606f1..3954e6208 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5514,7 +5514,9 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
}
mEventDeliveryPaused = aSuspendEvents;
} else {
+#ifdef MOZ_EME
MOZ_ASSERT(!mMediaKeys);
+#endif
if (mDecoder) {
mDecoder->Resume();
if (!mPaused && !mDecoder->IsEnded()) {
diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp
index 69e710242..d64c27727 100644
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -886,7 +886,7 @@ nsHTMLDocument::GetDomain(nsAString& aDomain)
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
- SetDOMStringToNull(aDomain);
+ aDomain.Truncate();
return NS_OK;
}
@@ -896,8 +896,8 @@ nsHTMLDocument::GetDomain(nsAString& aDomain)
CopyUTF8toUTF16(hostName, aDomain);
} else {
// If we can't get the host from the URI (e.g. about:, javascript:,
- // etc), just return an null string.
- SetDOMStringToNull(aDomain);
+ // etc), just return an empty string.
+ aDomain.Truncate();
}
return NS_OK;
}
diff --git a/dom/locales/en-US/chrome/security/security.properties b/dom/locales/en-US/chrome/security/security.properties
index c0b80996c..8efdb0a6d 100644
--- a/dom/locales/en-US/chrome/security/security.properties
+++ b/dom/locales/en-US/chrome/security/security.properties
@@ -8,6 +8,7 @@ BlockMixedActiveContent = Blocked loading mixed active content “%1$S”
CORSDisabled=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: CORS disabled).
CORSRequestNotHttp=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: CORS request not http).
CORSMissingAllowOrigin=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
+CORSMultipleAllowOriginNotAllowed=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: Multiple CORS headers ‘Access-Control-Allow-Origin’ not allowed).
CORSAllowOriginNotMatchingOrigin=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘%2$S’).
CORSNotSupportingCredentials=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘%1$S’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’).
CORSMethodNotFound=Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at %1$S. (Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’).
diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp
index 70b176699..646897468 100644
--- a/dom/media/fmp4/MP4Demuxer.cpp
+++ b/dom/media/fmp4/MP4Demuxer.cpp
@@ -349,8 +349,13 @@ MP4TrackDemuxer::GetNextSample()
if (sample->mCrypto.mValid) {
nsAutoPtr<MediaRawDataWriter> writer(sample->CreateWriter());
writer->mCrypto.mMode = mInfo->mCrypto.mMode;
- writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
- writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId);
+
+ // Only use the default key parsed from the moov if we haven't already got
+ // one from the sample group description.
+ if (writer->mCrypto.mKeyId.Length() == 0) {
+ writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
+ writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId);
+ }
}
return sample.forget();
}
diff --git a/dom/webidl/DataTransfer.webidl b/dom/webidl/DataTransfer.webidl
index 206d80804..dd44e1ddc 100644
--- a/dom/webidl/DataTransfer.webidl
+++ b/dom/webidl/DataTransfer.webidl
@@ -7,7 +7,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface
*/
-[ChromeConstructor(DOMString eventType, boolean isExternal)]
+[Constructor]
interface DataTransfer {
attribute DOMString dropEffect;
attribute DOMString effectAllowed;
diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl
index ca5f1b35c..97eb4ffe0 100644
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -41,6 +41,8 @@ interface Element : Node {
[Pure]
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[Throws]
+ boolean toggleAttribute(DOMString name, optional boolean force);
+ [Throws]
void setAttribute(DOMString name, DOMString value);
[Throws]
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
diff --git a/dom/webidl/Event.webidl b/dom/webidl/Event.webidl
index f87dc195c..70a0ef513 100644
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -17,6 +17,8 @@ interface Event {
readonly attribute DOMString type;
[Pure]
readonly attribute EventTarget? target;
+ [Pure, BinaryName="target"]
+ readonly attribute EventTarget? srcElement;
[Pure]
readonly attribute EventTarget? currentTarget;
diff --git a/dom/webidl/HTMLDocument.webidl b/dom/webidl/HTMLDocument.webidl
index 42f6d98f7..ffb61ccdd 100644
--- a/dom/webidl/HTMLDocument.webidl
+++ b/dom/webidl/HTMLDocument.webidl
@@ -7,7 +7,7 @@
[OverrideBuiltins]
interface HTMLDocument : Document {
[SetterThrows]
- attribute DOMString? domain;
+ attribute DOMString domain;
[Throws]
attribute DOMString cookie;
// DOM tree accessors
diff --git a/dom/webidl/WebGLRenderingContext.webidl b/dom/webidl/WebGLRenderingContext.webidl
index dd0e6ff69..323d23421 100644
--- a/dom/webidl/WebGLRenderingContext.webidl
+++ b/dom/webidl/WebGLRenderingContext.webidl
@@ -1046,3 +1046,12 @@ interface EXT_disjoint_timer_query {
any getQueryEXT(GLenum target, GLenum pname);
any getQueryObjectEXT(WebGLQuery query, GLenum pname);
};
+
+[NoInterfaceObject]
+interface MOZ_debug_get {
+ const GLenum EXTENSIONS = 0x1F03;
+ const GLenum WSI_INFO = 0x10000;
+
+ [Throws]
+ any getParameter(GLenum pname);
+};