зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to fx-team. a=merge
This commit is contained in:
Коммит
44cc0b6341
|
@ -6,10 +6,12 @@
|
|||
if not CONFIG['LIBXUL_SDK']:
|
||||
include('/toolkit/toolkit.mozbuild')
|
||||
elif CONFIG['ENABLE_TESTS']:
|
||||
add_tier_dir('testharness', 'testing/mochitest')
|
||||
DIRS += ['/testing/mochitest']
|
||||
|
||||
if CONFIG['MOZ_EXTENSIONS']:
|
||||
add_tier_dir('app', 'extensions')
|
||||
DIRS += ['/extensions']
|
||||
|
||||
add_tier_dir('app', CONFIG['MOZ_BRANDING_DIRECTORY'])
|
||||
add_tier_dir('app', 'b2g')
|
||||
DIRS += [
|
||||
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
|
||||
'/b2g',
|
||||
]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4f9042d3a705307849a6f63961eaaaa2e1d85d77"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4f9042d3a705307849a6f63961eaaaa2e1d85d77"/>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "52f7b7099a47ab3904a70d9a295ab0ed927ad59e",
|
||||
"revision": "3e43be9b8c24802b40fdfbcf17895c4355e6d238",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4f9042d3a705307849a6f63961eaaaa2e1d85d77"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="191d805f4911628d37a8a90a1e23a6013995138f"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d711d1e469eeeecf25a02b2407a542a598918b2c"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -7,19 +7,19 @@ if not CONFIG['LIBXUL_SDK']:
|
|||
include('/toolkit/toolkit.mozbuild')
|
||||
|
||||
if CONFIG['MOZ_EXTENSIONS']:
|
||||
add_tier_dir('app', 'extensions')
|
||||
DIRS += ['/extensions']
|
||||
|
||||
add_tier_dir('app', [CONFIG['MOZ_BRANDING_DIRECTORY']])
|
||||
DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
|
||||
|
||||
if CONFIG['MOZ_WEBAPP_RUNTIME']:
|
||||
add_tier_dir('app', 'webapprt')
|
||||
DIRS += ['/webapprt']
|
||||
|
||||
add_tier_dir('app', 'b2g/chrome')
|
||||
add_tier_dir('app', 'b2g/components')
|
||||
|
||||
add_tier_dir('app', 'b2g/dev/app')
|
||||
|
||||
# Never add tier dirs after browser because they apparently won't get
|
||||
# packaged properly on Mac.
|
||||
add_tier_dir('app', 'browser')
|
||||
DIRS += [
|
||||
'/b2g/chrome',
|
||||
'/b2g/components',
|
||||
'/b2g/dev/app',
|
||||
|
||||
# Never add dirs after browser because they apparently won't get
|
||||
# packaged properly on Mac.
|
||||
'/browser',
|
||||
]
|
||||
|
|
|
@ -7,14 +7,14 @@ if not CONFIG['LIBXUL_SDK']:
|
|||
include('/toolkit/toolkit.mozbuild')
|
||||
|
||||
if CONFIG['MOZ_EXTENSIONS']:
|
||||
add_tier_dir('app', 'extensions')
|
||||
DIRS += ['/extensions']
|
||||
|
||||
add_tier_dir('app', [CONFIG['MOZ_BRANDING_DIRECTORY']])
|
||||
DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
|
||||
|
||||
if CONFIG['MOZ_WEBAPP_RUNTIME']:
|
||||
add_tier_dir('app', 'webapprt')
|
||||
DIRS += ['/webapprt']
|
||||
|
||||
# Never add tier dirs after browser because they apparently won't get
|
||||
# Never add dirs after browser because they apparently won't get
|
||||
# packaged properly on Mac.
|
||||
add_tier_dir('app', 'browser')
|
||||
DIRS += ['/browser']
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:moz_xmalloc
|
||||
...
|
||||
fun:_ZN20mozJSComponentLoader10LoadModuleERN7mozilla12FileLocationE
|
||||
...
|
||||
}
|
||||
|
@ -81,6 +82,7 @@
|
|||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:moz_xmalloc
|
||||
...
|
||||
fun:_ZN22nsComponentManagerImpl15RegisterFactoryERK4nsIDPKcS4_P10nsIFactory
|
||||
...
|
||||
}
|
||||
|
@ -89,6 +91,7 @@
|
|||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:moz_xmalloc
|
||||
...
|
||||
fun:_ZN22nsComponentManagerImpl22RegisterCIDEntryLockedEPKN7mozilla6Module8CIDEntryEPNS_11KnownModuleE
|
||||
...
|
||||
}
|
||||
|
@ -97,6 +100,7 @@
|
|||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:moz_xmalloc
|
||||
...
|
||||
fun:_ZN22nsComponentManagerImpl17ManifestComponentERNS_25ManifestProcessingContextEiPKPc
|
||||
...
|
||||
}
|
||||
|
|
|
@ -101,7 +101,6 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
|
|||
SONAME \
|
||||
STATIC_LIBRARY_NAME \
|
||||
TEST_DIRS \
|
||||
TIERS \
|
||||
TOOL_DIRS \
|
||||
XPCSHELL_TESTS \
|
||||
XPIDL_MODULE \
|
||||
|
@ -124,6 +123,7 @@ _DEPRECATED_VARIABLES := \
|
|||
SHORT_LIBNAME \
|
||||
TESTING_JS_MODULES \
|
||||
TESTING_JS_MODULE_DIR \
|
||||
TIERS \
|
||||
$(NULL)
|
||||
|
||||
# Freeze the values specified by moz.build to catch them if they fail.
|
||||
|
|
|
@ -25,12 +25,6 @@ endef
|
|||
echo-variable-%:
|
||||
@echo $(call shell_quote,$($*))
|
||||
|
||||
echo-tiers:
|
||||
@echo $(TIERS)
|
||||
|
||||
echo-tier-dirs:
|
||||
@$(foreach tier,$(TIERS),echo '$(tier):'; echo ' dirs: $(tier_$(tier)_dirs)')
|
||||
|
||||
echo-dirs:
|
||||
@echo $(call shell_quote,$(DIRS))
|
||||
|
||||
|
|
|
@ -30,12 +30,6 @@ ifeq (.,$(DEPTH))
|
|||
|
||||
include root.mk
|
||||
|
||||
# Disable build status for mach in top directories without TIERS.
|
||||
# In practice this disables it when recursing under js/src, which confuses mach.
|
||||
ifndef TIERS
|
||||
BUILDSTATUS =
|
||||
endif
|
||||
|
||||
# Main rules (export, compile, libs and tools) call recurse_* rules.
|
||||
# This wrapping is only really useful for build status.
|
||||
compile libs export tools::
|
||||
|
@ -70,9 +64,7 @@ export NO_RECURSE_MAKELEVEL=$(word $(MAKELEVEL),2 3 4 5 6 7 8 9 10 11 12 13 14 1
|
|||
endif
|
||||
endif
|
||||
|
||||
# Get all directories traversed for all subtiers in the current tier, or use
|
||||
# directly the $(*_dirs) variables available in root.mk when there is no
|
||||
# TIERS (like for js/src).
|
||||
# Use the $(*_dirs) variables available in root.mk
|
||||
CURRENT_DIRS := $($(CURRENT_TIER)_dirs)
|
||||
|
||||
# Need a list of compile targets because we can't use pattern rules:
|
||||
|
@ -123,16 +115,6 @@ else
|
|||
# Tier traversal handling
|
||||
#########################
|
||||
|
||||
ifdef TIERS
|
||||
|
||||
libs export tools::
|
||||
$(call BUILDSTATUS,TIER_START $@)
|
||||
$(foreach tier,$(TIERS), $(if $(filter-out libs_precompile tools_precompile,$@_$(tier)), \
|
||||
$(foreach dir, $(tier_$(tier)_dirs), $(call TIER_DIR_SUBMAKE,$@,$(tier),$(dir),$@))))
|
||||
$(call BUILDSTATUS,TIER_FINISH $@)
|
||||
|
||||
else
|
||||
|
||||
define CREATE_SUBTIER_TRAVERSAL_RULE
|
||||
.PHONY: $(1)
|
||||
|
||||
|
@ -147,8 +129,6 @@ ifndef TOPLEVEL_BUILD
|
|||
libs:: target host
|
||||
endif
|
||||
|
||||
endif # ifdef TIERS
|
||||
|
||||
endif # ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
|
||||
|
||||
endif # ifeq (.,$(DEPTH))
|
||||
|
|
|
@ -648,15 +648,8 @@ clean clobber realclean clobber_all::
|
|||
-$(RM) $(ALL_TRASH)
|
||||
-$(RM) -r $(ALL_TRASH_DIRS)
|
||||
|
||||
ifdef TIERS
|
||||
clean clobber realclean clobber_all distclean::
|
||||
$(foreach dir, \
|
||||
$(foreach tier, $(TIERS), $(tier_$(tier)_dirs)), \
|
||||
-$(call SUBMAKE,$@,$(dir)))
|
||||
else
|
||||
clean clobber realclean clobber_all distclean::
|
||||
$(foreach dir,$(DIRS),-$(call SUBMAKE,$@,$(dir)))
|
||||
endif
|
||||
|
||||
distclean::
|
||||
-$(RM) -r $(ALL_TRASH_DIRS)
|
||||
|
@ -1636,7 +1629,6 @@ FREEZE_VARIABLES = \
|
|||
DIRS \
|
||||
LIBRARY \
|
||||
MODULE \
|
||||
TIERS \
|
||||
EXTRA_COMPONENTS \
|
||||
EXTRA_PP_COMPONENTS \
|
||||
$(NULL)
|
||||
|
|
|
@ -646,6 +646,10 @@ public:
|
|||
}
|
||||
bool HasAttributeNS(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName) const;
|
||||
bool HasAttributes() const
|
||||
{
|
||||
return HasAttrs();
|
||||
}
|
||||
Element* Closest(const nsAString& aSelector,
|
||||
ErrorResult& aResult);
|
||||
bool Matches(const nsAString& aSelector,
|
||||
|
@ -1349,11 +1353,6 @@ inline const mozilla::dom::Element* nsINode::AsElement() const
|
|||
return static_cast<const mozilla::dom::Element*>(this);
|
||||
}
|
||||
|
||||
inline bool nsINode::HasAttributes() const
|
||||
{
|
||||
return IsElement() && AsElement()->HasAttrs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Macros to implement Clone(). _elementName is the class for which to implement
|
||||
* Clone.
|
||||
|
@ -1537,6 +1536,11 @@ NS_IMETHOD HasAttributeNS(const nsAString& namespaceURI, \
|
|||
*_retval = Element::HasAttributeNS(namespaceURI, localName); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD HasAttributes(bool* _retval) MOZ_FINAL \
|
||||
{ \
|
||||
*_retval = Element::HasAttributes(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD GetAttributeNode(const nsAString& name, \
|
||||
nsIDOMAttr** _retval) MOZ_FINAL \
|
||||
{ \
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "Units.h"
|
||||
#include "mozilla/dom/AutocompleteInfoBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// Undefine LoadImage to prevent naming conflict with Windows.
|
||||
|
@ -186,6 +187,7 @@ public:
|
|||
|
||||
/**
|
||||
* Returns the parent node of aChild crossing document boundaries.
|
||||
* Uses the parent node in the composed document.
|
||||
*/
|
||||
static nsINode* GetCrossDocParentNode(nsINode* aChild);
|
||||
|
||||
|
@ -216,7 +218,8 @@ public:
|
|||
|
||||
/**
|
||||
* Similar to ContentIsDescendantOf except it crosses document boundaries,
|
||||
* also crosses ShadowRoot boundaries from ShadowRoot to its host.
|
||||
* this function uses ancestor/descendant relations in the composed document
|
||||
* (see shadow DOM spec).
|
||||
*/
|
||||
static bool ContentIsCrossDocDescendantOf(nsINode* aPossibleDescendant,
|
||||
nsINode* aPossibleAncestor);
|
||||
|
@ -2351,7 +2354,7 @@ public:
|
|||
if (aIID.Equals(NS_GET_IID(_interface))) { \
|
||||
foundInterface = static_cast<_interface *>(_allocator); \
|
||||
if (!foundInterface) { \
|
||||
*aInstancePtr = nullptr; \
|
||||
*aInstancePtr = nullptr; \
|
||||
return NS_ERROR_OUT_OF_MEMORY; \
|
||||
} \
|
||||
} else
|
||||
|
@ -2362,27 +2365,27 @@ public:
|
|||
* series is not finite.
|
||||
*/
|
||||
#define NS_ENSURE_FINITE(f, rv) \
|
||||
if (!NS_finite(f)) { \
|
||||
if (!mozilla::IsFinite(f)) { \
|
||||
return (rv); \
|
||||
}
|
||||
|
||||
#define NS_ENSURE_FINITE2(f1, f2, rv) \
|
||||
if (!NS_finite((f1)+(f2))) { \
|
||||
if (!mozilla::IsFinite((f1)+(f2))) { \
|
||||
return (rv); \
|
||||
}
|
||||
|
||||
#define NS_ENSURE_FINITE4(f1, f2, f3, f4, rv) \
|
||||
if (!NS_finite((f1)+(f2)+(f3)+(f4))) { \
|
||||
if (!mozilla::IsFinite((f1)+(f2)+(f3)+(f4))) { \
|
||||
return (rv); \
|
||||
}
|
||||
|
||||
#define NS_ENSURE_FINITE5(f1, f2, f3, f4, f5, rv) \
|
||||
if (!NS_finite((f1)+(f2)+(f3)+(f4)+(f5))) { \
|
||||
if (!mozilla::IsFinite((f1)+(f2)+(f3)+(f4)+(f5))) { \
|
||||
return (rv); \
|
||||
}
|
||||
|
||||
#define NS_ENSURE_FINITE6(f1, f2, f3, f4, f5, f6, rv) \
|
||||
if (!NS_finite((f1)+(f2)+(f3)+(f4)+(f5)+(f6))) { \
|
||||
if (!mozilla::IsFinite((f1)+(f2)+(f3)+(f4)+(f5)+(f6))) { \
|
||||
return (rv); \
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ class Element;
|
|||
struct ElementRegistrationOptions;
|
||||
class Event;
|
||||
class EventTarget;
|
||||
class FontFaceSet;
|
||||
class FrameRequestCallback;
|
||||
class ImportManager;
|
||||
class OverfillCallback;
|
||||
|
@ -2390,6 +2391,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
// FontFaceSource
|
||||
mozilla::dom::FontFaceSet* GetFonts(mozilla::ErrorResult& aRv);
|
||||
|
||||
bool DidFireDOMContentLoaded() const { return mDidFireDOMContentLoaded; }
|
||||
|
||||
private:
|
||||
uint64_t mWarnedAbout;
|
||||
SelectorCache mSelectorCache;
|
||||
|
|
|
@ -1640,8 +1640,7 @@ public:
|
|||
localName.Length());
|
||||
}
|
||||
}
|
||||
// HasAttributes is defined inline in Element.h.
|
||||
bool HasAttributes() const;
|
||||
|
||||
nsDOMAttributeMap* GetAttributes();
|
||||
void SetUserData(JSContext* aCx, const nsAString& aKey,
|
||||
JS::Handle<JS::Value> aData,
|
||||
|
@ -1994,12 +1993,6 @@ ToCanonicalSupports(nsINode* aPointer)
|
|||
aLocalName = nsINode::LocalName(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
using nsINode::HasAttributes; \
|
||||
NS_IMETHOD HasAttributes(bool* aResult) __VA_ARGS__ \
|
||||
{ \
|
||||
*aResult = nsINode::HasAttributes(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD GetDOMBaseURI(nsAString& aBaseURI) __VA_ARGS__ \
|
||||
{ \
|
||||
nsINode::GetBaseURI(aBaseURI); \
|
||||
|
|
|
@ -122,12 +122,14 @@ protected:
|
|||
|
||||
// Iterates over the flattened children of a node, which accounts for anonymous
|
||||
// children and nodes moved by insertion points. If a node has anonymous
|
||||
// children, those are iterated over.
|
||||
// children, those are iterated over. The iterator can be initialized to start
|
||||
// at the end by providing false for aStartAtBeginning in order to start
|
||||
// iterating in reverse from the last child.
|
||||
class FlattenedChildIterator : public ExplicitChildIterator
|
||||
{
|
||||
public:
|
||||
explicit FlattenedChildIterator(nsIContent* aParent)
|
||||
: ExplicitChildIterator(aParent), mXBLInvolved(false)
|
||||
explicit FlattenedChildIterator(nsIContent* aParent, bool aStartAtBeginning = true)
|
||||
: ExplicitChildIterator(aParent, aStartAtBeginning), mXBLInvolved(false)
|
||||
{
|
||||
Init(false);
|
||||
}
|
||||
|
@ -145,10 +147,11 @@ protected:
|
|||
* This constructor is a hack to help AllChildrenIterator which sometimes
|
||||
* doesn't want to consider XBL.
|
||||
*/
|
||||
FlattenedChildIterator(nsIContent* aParent, bool aIgnoreXBL)
|
||||
: ExplicitChildIterator(aParent), mXBLInvolved(false)
|
||||
FlattenedChildIterator(nsIContent* aParent, uint32_t aFlags, bool aStartAtBeginning = true)
|
||||
: ExplicitChildIterator(aParent, aStartAtBeginning), mXBLInvolved(false)
|
||||
{
|
||||
Init(aIgnoreXBL);
|
||||
bool ignoreXBL = aFlags & nsIContent::eAllButXBL;
|
||||
Init(ignoreXBL);
|
||||
}
|
||||
|
||||
void Init(bool aIgnoreXBL);
|
||||
|
@ -162,13 +165,15 @@ protected:
|
|||
* AllChildrenIterator returns the children of a element including before /
|
||||
* after content and optionally XBL children. It assumes that no mutation of
|
||||
* the DOM or frame tree takes place during iteration, and will break horribly
|
||||
* if that is not true.
|
||||
* if that is not true. The iterator can be initialized to start at the end by
|
||||
* providing false for aStartAtBeginning in order to start iterating in reverse
|
||||
* from the last child.
|
||||
*/
|
||||
class AllChildrenIterator : private FlattenedChildIterator
|
||||
{
|
||||
public:
|
||||
AllChildrenIterator(nsIContent* aNode, uint32_t aFlags) :
|
||||
FlattenedChildIterator(aNode, (aFlags & nsIContent::eAllButXBL)),
|
||||
AllChildrenIterator(nsIContent* aNode, uint32_t aFlags, bool aStartAtBeginning = true) :
|
||||
FlattenedChildIterator(aNode, aFlags, aStartAtBeginning),
|
||||
mOriginalContent(aNode), mFlags(aFlags),
|
||||
mPhase(eNeedBeforeKid) {}
|
||||
|
||||
|
|
|
@ -2939,6 +2939,11 @@ Element::MozRequestPointerLock()
|
|||
void
|
||||
Element::GetAnimationPlayers(nsTArray<nsRefPtr<AnimationPlayer> >& aPlayers)
|
||||
{
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (doc) {
|
||||
doc->FlushPendingNotifications(Flush_Style);
|
||||
}
|
||||
|
||||
nsIAtom* properties[] = { nsGkAtoms::transitionsProperty,
|
||||
nsGkAtoms::animationsProperty };
|
||||
for (size_t propIdx = 0; propIdx < MOZ_ARRAY_LENGTH(properties);
|
||||
|
@ -2953,7 +2958,7 @@ Element::GetAnimationPlayers(nsTArray<nsRefPtr<AnimationPlayer> >& aPlayers)
|
|||
playerIdx < collection->mPlayers.Length();
|
||||
playerIdx++) {
|
||||
AnimationPlayer* player = collection->mPlayers[playerIdx];
|
||||
if (player->IsCurrent()) {
|
||||
if (player->HasCurrentSource() || player->HasInEffectSource()) {
|
||||
aPlayers.AppendElement(player);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -298,21 +298,15 @@ nsCSPHostSrc::permits(nsIURI* aUri, const nsAString& aNonce, bool aWasRedirected
|
|||
}
|
||||
#endif
|
||||
|
||||
// If the host is defined as a "*", and:
|
||||
// a) no scheme, and
|
||||
// b) no port is defined, allow the load.
|
||||
// http://www.w3.org/TR/CSP11/#matching
|
||||
if (mHost.EqualsASCII("*") &&
|
||||
mScheme.IsEmpty() &&
|
||||
mPort.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
// we are following the enforcement rules from the spec, see:
|
||||
// http://www.w3.org/TR/CSP11/#match-source-expression
|
||||
|
||||
// Check if the scheme matches.
|
||||
// 4.3) scheme matching: Check if the scheme matches.
|
||||
nsAutoCString scheme;
|
||||
nsresult rv = aUri->GetScheme(scheme);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
if (!mScheme.EqualsASCII(scheme.get())) {
|
||||
if (!mScheme.IsEmpty() &&
|
||||
!mScheme.EqualsASCII(scheme.get())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -320,30 +314,36 @@ nsCSPHostSrc::permits(nsIURI* aUri, const nsAString& aNonce, bool aWasRedirected
|
|||
// just a specific scheme, the parser should generate a nsCSPSchemeSource.
|
||||
NS_ASSERTION((!mHost.IsEmpty()), "host can not be the empty string");
|
||||
|
||||
// Extract the host part from aUri.
|
||||
// 2) host matching: Enforce a single *
|
||||
if (mHost.EqualsASCII("*")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Before we can check if the host matches, we have to
|
||||
// extract the host part from aUri.
|
||||
nsAutoCString uriHost;
|
||||
rv = aUri->GetHost(uriHost);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
// Check it the allowed host starts with a wilcard.
|
||||
// 4.5) host matching: Check if the allowed host starts with a wilcard.
|
||||
if (mHost.First() == '*') {
|
||||
NS_ASSERTION(mHost[1] == '.', "Second character needs to be '.' whenever host starts with '*'");
|
||||
|
||||
// Eliminate leading "*", but keeping the FULL STOP (.) thereafter before checking
|
||||
// if the remaining characters match: see http://www.w3.org/TR/CSP11/#matching
|
||||
// if the remaining characters match
|
||||
nsString wildCardHost = mHost;
|
||||
wildCardHost = Substring(wildCardHost, 1, wildCardHost.Length() - 1);
|
||||
if (!StringEndsWith(NS_ConvertUTF8toUTF16(uriHost), wildCardHost)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Check if hosts match.
|
||||
// 4.6) host matching: Check if hosts match.
|
||||
else if (!mHost.Equals(NS_ConvertUTF8toUTF16(uriHost))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is a path, we have to enforce path-level matching,
|
||||
// unless the channel got redirected, see:
|
||||
// 4.9) Path matching: If there is a path, we have to enforce
|
||||
// path-level matching, unless the channel got redirected, see:
|
||||
// http://www.w3.org/TR/CSP11/#source-list-paths-and-redirects
|
||||
if (!aWasRedirected && !mPath.IsEmpty()) {
|
||||
// cloning uri so we can ignore the ref
|
||||
|
@ -370,25 +370,26 @@ nsCSPHostSrc::permits(nsIURI* aUri, const nsAString& aNonce, bool aWasRedirected
|
|||
}
|
||||
}
|
||||
|
||||
// If port uses wildcard, allow the load.
|
||||
// 4.8) Port matching: If port uses wildcard, allow the load.
|
||||
if (mPort.EqualsASCII("*")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if ports match
|
||||
// Before we can check if the port matches, we have to
|
||||
// query the port from aUri.
|
||||
int32_t uriPort;
|
||||
rv = aUri->GetPort(&uriPort);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
uriPort = (uriPort > 0) ? uriPort : NS_GetDefaultPort(scheme.get());
|
||||
|
||||
// If mPort is empty, we have to compare default ports.
|
||||
// 4.7) Default port matching: If mPort is empty, we have to compare default ports.
|
||||
if (mPort.IsEmpty()) {
|
||||
int32_t port = NS_GetDefaultPort(NS_ConvertUTF16toUTF8(mScheme).get());
|
||||
if (port != uriPort) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Otherwise compare the ports
|
||||
// 4.7) Port matching: Compare the ports.
|
||||
else {
|
||||
nsString portStr;
|
||||
portStr.AppendInt(uriPort);
|
||||
|
|
|
@ -2025,6 +2025,10 @@ nsContentUtils::GetCrossDocParentNode(nsINode* aChild)
|
|||
NS_PRECONDITION(aChild, "The child is null!");
|
||||
|
||||
nsINode* parent = aChild->GetParentNode();
|
||||
if (parent && parent->IsContent() && aChild->IsContent()) {
|
||||
parent = aChild->AsContent()->GetFlattenedTreeParent();
|
||||
}
|
||||
|
||||
if (parent || !aChild->IsNodeOfType(nsINode::eDOCUMENT))
|
||||
return parent;
|
||||
|
||||
|
@ -2083,12 +2087,6 @@ nsContentUtils::ContentIsCrossDocDescendantOf(nsINode* aPossibleDescendant,
|
|||
if (aPossibleDescendant == aPossibleAncestor)
|
||||
return true;
|
||||
|
||||
// Step over shadow root to the host node.
|
||||
ShadowRoot* shadowRoot = ShadowRoot::FromNode(aPossibleDescendant);
|
||||
if (shadowRoot) {
|
||||
aPossibleDescendant = shadowRoot->GetHost();
|
||||
}
|
||||
|
||||
aPossibleDescendant = GetCrossDocParentNode(aPossibleDescendant);
|
||||
} while (aPossibleDescendant);
|
||||
|
||||
|
|
|
@ -223,6 +223,7 @@
|
|||
#include "mozilla/dom/DOMStringList.h"
|
||||
#include "nsWindowMemoryReporter.h"
|
||||
#include "nsLocation.h"
|
||||
#include "mozilla/dom/FontFaceSet.h"
|
||||
|
||||
#ifdef MOZ_MEDIA_NAVIGATOR
|
||||
#include "mozilla/MediaManager.h"
|
||||
|
@ -12415,3 +12416,20 @@ nsAutoSyncOperation::~nsAutoSyncOperation()
|
|||
nsContentUtils::SetMicroTaskLevel(mMicroTaskLevel);
|
||||
}
|
||||
|
||||
FontFaceSet*
|
||||
nsIDocument::GetFonts(ErrorResult& aRv)
|
||||
{
|
||||
nsIPresShell* shell = GetShell();
|
||||
if (!shell) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsPresContext* presContext = shell->GetPresContext();
|
||||
if (!presContext) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return presContext->Fonts();
|
||||
}
|
||||
|
|
|
@ -775,6 +775,9 @@ GK_ATOM(onlanguagechange, "onlanguagechange")
|
|||
GK_ATOM(onlevelchange, "onlevelchange")
|
||||
GK_ATOM(onLoad, "onLoad")
|
||||
GK_ATOM(onload, "onload")
|
||||
GK_ATOM(onloading, "onloading")
|
||||
GK_ATOM(onloadingdone, "onloadingdone")
|
||||
GK_ATOM(onloadingerror, "onloadingerror")
|
||||
GK_ATOM(onpopstate, "onpopstate")
|
||||
GK_ATOM(only, "only") // this one is not an event
|
||||
GK_ATOM(onmessage, "onmessage")
|
||||
|
|
|
@ -376,6 +376,8 @@ nsresult TestSimplePolicies() {
|
|||
"default-src *" },
|
||||
{ "default-src https:",
|
||||
"default-src https:" },
|
||||
{ "default-src https://*",
|
||||
"default-src https://*" },
|
||||
{ "default-src *:*",
|
||||
"default-src http://*:*" },
|
||||
{ "default-src *:80",
|
||||
|
|
|
@ -24,6 +24,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
|
||||
var policies = [
|
||||
["allowed", "*"],
|
||||
["allowed", "http://*"], // test for bug 1075230, enforcing scheme and wildcard
|
||||
["allowed", "test1.example.com"],
|
||||
["allowed", "test1.example.com/"],
|
||||
["allowed", "test1.example.com/tests/content/base/test/csp/"],
|
||||
|
|
|
@ -42,7 +42,7 @@ function testVideoPlayPause() {
|
|||
video.pause();
|
||||
});
|
||||
|
||||
navigator.mozPower.addWakeLockListener(function testVideoPlayPauseListener(topic, state) {
|
||||
function testVideoPlayPauseListener(topic, state) {
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
|
||||
|
@ -62,8 +62,9 @@ function testVideoPlayPause() {
|
|||
navigator.mozPower.removeWakeLockListener(testVideoPlayPauseListener);
|
||||
runTests();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mozPower.addWakeLockListener(testVideoPlayPauseListener);
|
||||
video.play();
|
||||
}
|
||||
|
||||
|
@ -84,7 +85,7 @@ function testVideoPlay() {
|
|||
startDate = new Date();
|
||||
});
|
||||
|
||||
navigator.mozPower.addWakeLockListener(function testVideoPlayListener(topic, state) {
|
||||
function testVideoPlayListener(topic, state) {
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
|
||||
|
@ -108,8 +109,9 @@ function testVideoPlay() {
|
|||
navigator.mozPower.removeWakeLockListener(testVideoPlayListener);
|
||||
runTests();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mozPower.addWakeLockListener(testVideoPlayListener);
|
||||
video.play();
|
||||
}
|
||||
|
||||
|
@ -124,8 +126,11 @@ function runTests() {
|
|||
test();
|
||||
};
|
||||
|
||||
SpecialPowers.addPermission("power", true, document);
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
|
||||
SpecialPowers.pushPermissions(
|
||||
[{'type': 'power', 'allow': true, 'context': document}],
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
|
|
@ -248,11 +248,10 @@ protected:
|
|||
MediaInputPort::InputInterval interval = map->mInputPort->GetNextInputInterval(t);
|
||||
interval.mEnd = std::min(interval.mEnd, aTo);
|
||||
StreamTime inputEnd = source->GraphTimeToStreamTime(interval.mEnd);
|
||||
TrackTicks inputTrackEndPoint = TRACK_TICKS_MAX;
|
||||
TrackTicks inputTrackEndPoint = aInputTrack->GetEnd();
|
||||
|
||||
if (aInputTrack->IsEnded() &&
|
||||
aInputTrack->GetEndTimeRoundDown() <= inputEnd) {
|
||||
inputTrackEndPoint = aInputTrack->GetEnd();
|
||||
*aOutputTrackFinished = true;
|
||||
}
|
||||
|
||||
|
@ -325,6 +324,10 @@ protected:
|
|||
// <= rate*aInputTrack->GetSegment()->GetDuration()/rate
|
||||
// = aInputTrack->GetSegment()->GetDuration()
|
||||
// as required.
|
||||
// Note that while the above proof appears to be generally right, if we are suffering
|
||||
// from a lot of underrun, then in rare cases inputStartTicks >> inputTrackEndPoint.
|
||||
// As such, we still need to verify the sanity of property #2 and use null data as
|
||||
// appropriate.
|
||||
|
||||
if (inputStartTicks < 0) {
|
||||
// Data before the start of the track is just null.
|
||||
|
@ -337,13 +340,20 @@ protected:
|
|||
inputStartTicks = 0;
|
||||
}
|
||||
if (inputEndTicks > inputStartTicks) {
|
||||
segment->AppendSlice(*aInputTrack->GetSegment(),
|
||||
std::min(inputTrackEndPoint, inputStartTicks),
|
||||
std::min(inputTrackEndPoint, inputEndTicks));
|
||||
if (inputEndTicks <= inputTrackEndPoint) {
|
||||
segment->AppendSlice(*aInputTrack->GetSegment(), inputStartTicks, inputEndTicks);
|
||||
STREAM_LOG(PR_LOG_DEBUG+1, ("TrackUnionStream %p appending %lld ticks of input data to track %d",
|
||||
this, ticks, outputTrack->GetID()));
|
||||
} else {
|
||||
if (inputStartTicks < inputTrackEndPoint) {
|
||||
segment->AppendSlice(*aInputTrack->GetSegment(), inputStartTicks, inputTrackEndPoint);
|
||||
ticks -= inputTrackEndPoint - inputStartTicks;
|
||||
}
|
||||
segment->AppendNullData(ticks);
|
||||
STREAM_LOG(PR_LOG_DEBUG+1, ("TrackUnionStream %p appending %lld ticks of input data and %lld of null data to track %d",
|
||||
this, inputTrackEndPoint - inputStartTicks, ticks, outputTrack->GetID()));
|
||||
}
|
||||
}
|
||||
STREAM_LOG(PR_LOG_DEBUG+1, ("TrackUnionStream %p appending %lld ticks of input data to track %d",
|
||||
this, (long long)(std::min(inputTrackEndPoint, inputEndTicks) - std::min(inputTrackEndPoint, inputStartTicks)),
|
||||
outputTrack->GetID()));
|
||||
}
|
||||
ApplyTrackDisabling(outputTrack->GetID(), segment);
|
||||
for (uint32_t j = 0; j < mListeners.Length(); ++j) {
|
||||
|
|
|
@ -40,6 +40,8 @@ GMPSharedMemManager::MgrAllocShmem(GMPSharedMem::GMPMemoryClasses aClass, size_t
|
|||
size_t pagesize = ipc::SharedMemory::SystemPageSize();
|
||||
aSize = (aSize + (pagesize-1)) & ~(pagesize-1); // round up to page size
|
||||
bool retval = Alloc(aSize, aType, aMem);
|
||||
// The allocator (or NeedsShmem call) should never return less than we ask for...
|
||||
MOZ_ASSERT(aMem->Size<uint8_t>() >= aSize);
|
||||
if (retval) {
|
||||
mData->mGmpAllocated[aClass]++;
|
||||
}
|
||||
|
@ -53,6 +55,18 @@ GMPSharedMemManager::MgrDeallocShmem(GMPSharedMem::GMPMemoryClasses aClass, ipc:
|
|||
|
||||
size_t size = aMem.Size<uint8_t>();
|
||||
size_t total = 0;
|
||||
|
||||
// XXX Bug NNNNNNN Until we put better guards on ipc::shmem, verify we
|
||||
// weren't fed an shmem we already had.
|
||||
for (uint32_t i = 0; i < GetGmpFreelist(aClass).Length(); i++) {
|
||||
if (NS_WARN_IF(aMem == GetGmpFreelist(aClass)[i])) {
|
||||
// Safest to crash in this case; should never happen in normal
|
||||
// operation.
|
||||
MOZ_CRASH("Deallocating Shmem we already have in our cache!");
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
|
||||
// XXX This works; there are better pool algorithms. We need to avoid
|
||||
// "falling off a cliff" with too low a number
|
||||
if (GetGmpFreelist(aClass).Length() > 10) {
|
||||
|
|
|
@ -228,6 +228,10 @@ GMPVideoDecoderParent::RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!GMPVideoi420FrameImpl::CheckFrameData(aDecodedFrame)) {
|
||||
LOG(PR_LOG_ERROR, ("%s: Decoded frame corrupt, ignoring", __FUNCTION__));
|
||||
return false;
|
||||
}
|
||||
auto f = new GMPVideoi420FrameImpl(aDecodedFrame, &mVideoHost);
|
||||
|
||||
// Ignore any return code. It is OK for this to fail without killing the process.
|
||||
|
|
|
@ -63,6 +63,31 @@ GMPVideoi420FrameImpl::Destroy()
|
|||
delete this;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
GMPVideoi420FrameImpl::CheckFrameData(const GMPVideoi420FrameData& aFrameData)
|
||||
{
|
||||
// We may be passed the "wrong" shmem (one smaller than the actual size).
|
||||
// This implies a bug or serious error on the child size. Ignore this frame if so.
|
||||
// Note: Size() greater than expected is also an error, but with no negative consequences
|
||||
int32_t half_width = (aFrameData.mWidth() + 1) / 2;
|
||||
if ((aFrameData.mYPlane().mStride() <= 0) || (aFrameData.mYPlane().mSize() <= 0) ||
|
||||
(aFrameData.mUPlane().mStride() <= 0) || (aFrameData.mUPlane().mSize() <= 0) ||
|
||||
(aFrameData.mVPlane().mStride() <= 0) || (aFrameData.mVPlane().mSize() <= 0) ||
|
||||
(aFrameData.mYPlane().mSize() > (int32_t) aFrameData.mYPlane().mBuffer().Size<uint8_t>()) ||
|
||||
(aFrameData.mUPlane().mSize() > (int32_t) aFrameData.mUPlane().mBuffer().Size<uint8_t>()) ||
|
||||
(aFrameData.mVPlane().mSize() > (int32_t) aFrameData.mVPlane().mBuffer().Size<uint8_t>()) ||
|
||||
(aFrameData.mYPlane().mStride() < aFrameData.mWidth()) ||
|
||||
(aFrameData.mUPlane().mStride() < half_width) ||
|
||||
(aFrameData.mVPlane().mStride() < half_width) ||
|
||||
(aFrameData.mYPlane().mSize() < aFrameData.mYPlane().mStride() * aFrameData.mHeight()) ||
|
||||
(aFrameData.mUPlane().mSize() < aFrameData.mUPlane().mStride() * ((aFrameData.mHeight()+1)/2)) ||
|
||||
(aFrameData.mVPlane().mSize() < aFrameData.mVPlane().mStride() * ((aFrameData.mHeight()+1)/2)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GMPVideoi420FrameImpl::CheckDimensions(int32_t aWidth, int32_t aHeight,
|
||||
int32_t aStride_y, int32_t aStride_u, int32_t aStride_v)
|
||||
|
|
|
@ -24,6 +24,8 @@ public:
|
|||
GMPVideoi420FrameImpl(const GMPVideoi420FrameData& aFrameData, GMPVideoHostImpl* aHost);
|
||||
virtual ~GMPVideoi420FrameImpl();
|
||||
|
||||
static bool CheckFrameData(const GMPVideoi420FrameData& aFrameData);
|
||||
|
||||
bool InitFrameData(GMPVideoi420FrameData& aFrameData);
|
||||
const GMPPlaneImpl* GetPlane(GMPPlaneType aType) const;
|
||||
GMPPlaneImpl* GetPlane(GMPPlaneType aType);
|
||||
|
|
|
@ -373,6 +373,10 @@ public:
|
|||
MOZ_ASSERT(mPeriodicWave, "No custom waveform data");
|
||||
|
||||
uint32_t periodicWaveSize = mPeriodicWave->periodicWaveSize();
|
||||
// Mask to wrap wave data indices into the range [0,periodicWaveSize).
|
||||
uint32_t indexMask = periodicWaveSize - 1;
|
||||
MOZ_ASSERT(periodicWaveSize && (periodicWaveSize & indexMask) == 0,
|
||||
"periodicWaveSize must be power of 2");
|
||||
float* higherWaveData = nullptr;
|
||||
float* lowerWaveData = nullptr;
|
||||
float tableInterpolationFactor;
|
||||
|
@ -387,14 +391,15 @@ public:
|
|||
lowerWaveData,
|
||||
higherWaveData,
|
||||
tableInterpolationFactor);
|
||||
mPhase = fmod(mPhase, periodicWaveSize);
|
||||
// Bilinear interpolation between adjacent samples in each table.
|
||||
uint32_t j1 = floor(mPhase);
|
||||
float floorPhase = floorf(mPhase);
|
||||
uint32_t j1 = floorPhase;
|
||||
j1 &= indexMask;
|
||||
uint32_t j2 = j1 + 1;
|
||||
if (j2 >= periodicWaveSize) {
|
||||
j2 -= periodicWaveSize;
|
||||
}
|
||||
float sampleInterpolationFactor = mPhase - j1;
|
||||
j2 &= indexMask;
|
||||
|
||||
float sampleInterpolationFactor = mPhase - floorPhase;
|
||||
|
||||
float lower = (1.0f - sampleInterpolationFactor) * lowerWaveData[j1] +
|
||||
sampleInterpolationFactor * lowerWaveData[j2];
|
||||
float higher = (1.0f - sampleInterpolationFactor) * higherWaveData[j1] +
|
||||
|
@ -402,7 +407,10 @@ public:
|
|||
aOutput[i] = (1.0f - tableInterpolationFactor) * lower +
|
||||
tableInterpolationFactor * higher;
|
||||
|
||||
mPhase += basePhaseIncrement * mFinalFrequency;
|
||||
// Calculate next phase position from wrapped value j1 to avoid loss of
|
||||
// precision at large values.
|
||||
mPhase =
|
||||
j1 + sampleInterpolationFactor + basePhaseIncrement * mFinalFrequency;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -708,8 +708,7 @@ SpeechRecognition::Start(const Optional<NonNull<DOMMediaStream>>& aStream, Error
|
|||
StartRecording(&aStream.Value());
|
||||
} else {
|
||||
MediaManager* manager = MediaManager::Get();
|
||||
manager->GetUserMedia(false,
|
||||
GetOwner(),
|
||||
manager->GetUserMedia(GetOwner(),
|
||||
constraints,
|
||||
new GetUserMediaSuccessCallback(this),
|
||||
new GetUserMediaErrorCallback(this));
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "nsError.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "mozilla/dom/SVGLengthBinding.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "nsSVGAttrTearoffTable.h"
|
||||
|
||||
// See the architecture comment in DOMSVGAnimatedLengthList.h.
|
||||
|
@ -228,7 +229,7 @@ DOMSVGLength::GetValue(ErrorResult& aRv)
|
|||
}
|
||||
if (HasOwner()) {
|
||||
float value = InternalItem().GetValueInUserUnits(Element(), Axis());
|
||||
if (!NS_finite(value)) {
|
||||
if (!IsFinite(value)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
}
|
||||
return value;
|
||||
|
@ -276,7 +277,7 @@ DOMSVGLength::SetValue(float aUserUnitValue, ErrorResult& aRv)
|
|||
float uuPerUnit = InternalItem().GetUserUnitsPerUnit(Element(), Axis());
|
||||
if (uuPerUnit > 0) {
|
||||
float newValue = aUserUnitValue / uuPerUnit;
|
||||
if (NS_finite(newValue)) {
|
||||
if (IsFinite(newValue)) {
|
||||
AutoChangeLengthNotifier notifier(this);
|
||||
InternalItem().SetValueAndUnit(newValue, InternalItem().GetUnit());
|
||||
return;
|
||||
|
@ -295,7 +296,7 @@ DOMSVGLength::SetValue(float aUserUnitValue, ErrorResult& aRv)
|
|||
NS_IMETHODIMP
|
||||
DOMSVGLength::SetValue(float aUserUnitValue)
|
||||
{
|
||||
if (!NS_finite(aUserUnitValue)) {
|
||||
if (!IsFinite(aUserUnitValue)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
@ -355,7 +356,7 @@ DOMSVGLength::SetValueInSpecifiedUnits(float aValue, ErrorResult& aRv)
|
|||
NS_IMETHODIMP
|
||||
DOMSVGLength::SetValueInSpecifiedUnits(float aValue)
|
||||
{
|
||||
if (!NS_finite(aValue)) {
|
||||
if (!IsFinite(aValue)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
@ -460,7 +461,7 @@ DOMSVGLength::NewValueSpecifiedUnits(uint16_t aUnit, float aValue,
|
|||
NS_IMETHODIMP
|
||||
DOMSVGLength::NewValueSpecifiedUnits(uint16_t aUnit, float aValue)
|
||||
{
|
||||
if (!NS_finite(aValue)) {
|
||||
if (!IsFinite(aValue)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
@ -492,7 +493,7 @@ DOMSVGLength::ConvertToSpecifiedUnits(uint16_t aUnit, ErrorResult& aRv)
|
|||
}
|
||||
float val = InternalItem().GetValueInSpecifiedUnit(
|
||||
aUnit, Element(), Axis());
|
||||
if (NS_finite(val)) {
|
||||
if (IsFinite(val)) {
|
||||
AutoChangeLengthNotifier notifier(this);
|
||||
InternalItem().SetValueAndUnit(val, aUnit);
|
||||
return;
|
||||
|
@ -500,7 +501,7 @@ DOMSVGLength::ConvertToSpecifiedUnits(uint16_t aUnit, ErrorResult& aRv)
|
|||
} else {
|
||||
SVGLength len(mValue, mUnit);
|
||||
float val = len.GetValueInSpecifiedUnit(aUnit, nullptr, 0);
|
||||
if (NS_finite(val)) {
|
||||
if (IsFinite(val)) {
|
||||
mValue = val;
|
||||
mUnit = aUnit;
|
||||
return;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "nsISVGPoint.h"
|
||||
#include "SVGPoint.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
class nsSVGElement;
|
||||
|
||||
|
@ -82,7 +83,7 @@ public:
|
|||
{
|
||||
mPt.mX = aPt.x;
|
||||
mPt.mY = aPt.y;
|
||||
NS_ASSERTION(NS_finite(mPt.mX) && NS_finite(mPt.mX),
|
||||
NS_ASSERTION(IsFinite(mPt.mX) && IsFinite(mPt.mX),
|
||||
"DOMSVGPoint coords are not finite");
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/Types.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsSVGPathDataParser.h"
|
||||
#include "SVGPathData.h"
|
||||
|
@ -664,7 +665,7 @@ SVGContentUtils::ParseNumber(RangedPtr<const char16_t>& aIter,
|
|||
return false;
|
||||
}
|
||||
floatType floatValue = floatType(value);
|
||||
if (!NS_finite(floatValue)) {
|
||||
if (!IsFinite(floatValue)) {
|
||||
return false;
|
||||
}
|
||||
aValue = floatValue;
|
||||
|
|
|
@ -124,17 +124,17 @@ SVGLength::GetValueInSpecifiedUnit(uint8_t aUnit,
|
|||
SVGLength(0.0f, aUnit).GetUserUnitsPerUnit(aElement, aAxis);
|
||||
|
||||
NS_ASSERTION(userUnitsPerCurrentUnit >= 0 ||
|
||||
!NS_finite(userUnitsPerCurrentUnit),
|
||||
!IsFinite(userUnitsPerCurrentUnit),
|
||||
"bad userUnitsPerCurrentUnit");
|
||||
NS_ASSERTION(userUnitsPerNewUnit >= 0 ||
|
||||
!NS_finite(userUnitsPerNewUnit),
|
||||
!IsFinite(userUnitsPerNewUnit),
|
||||
"bad userUnitsPerNewUnit");
|
||||
|
||||
float value = mValue * userUnitsPerCurrentUnit / userUnitsPerNewUnit;
|
||||
|
||||
// userUnitsPerCurrentUnit could be infinity, or userUnitsPerNewUnit could
|
||||
// be zero.
|
||||
if (NS_finite(value)) {
|
||||
if (IsFinite(value)) {
|
||||
return value;
|
||||
}
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "nsDebug.h"
|
||||
#include "nsIDOMSVGLength.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
class nsSVGElement;
|
||||
|
||||
|
@ -139,7 +140,7 @@ private:
|
|||
|
||||
#ifdef DEBUG
|
||||
bool IsValid() const {
|
||||
return NS_finite(mValue) && IsValidUnitType(mUnit);
|
||||
return IsFinite(mValue) && IsValidUnitType(mUnit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "nsSMILValue.h"
|
||||
#include "SVGLengthList.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -216,7 +217,7 @@ SVGLengthListSMILType::ComputeDistance(const nsSMILValue& aFrom,
|
|||
}
|
||||
|
||||
float distance = sqrt(total);
|
||||
if (!NS_finite(distance)) {
|
||||
if (!IsFinite(distance)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
aDistance = distance;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "mozilla/dom/SVGMarkerElementBinding.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "SVGContentUtils.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
@ -173,7 +174,7 @@ void
|
|||
SVGMarkerElement::SetOrientToAngle(SVGAngle& angle, ErrorResult& rv)
|
||||
{
|
||||
float f = angle.Value();
|
||||
if (!NS_finite(f)) {
|
||||
if (!IsFinite(f)) {
|
||||
rv.Throw(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "nsError.h"
|
||||
#include <math.h>
|
||||
#include "mozilla/dom/SVGMatrixBinding.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
const double radPerDegree = 2.0 * M_PI / 360.0;
|
||||
|
||||
|
@ -194,7 +195,7 @@ already_AddRefed<SVGMatrix>
|
|||
SVGMatrix::SkewX(float angle, ErrorResult& rv)
|
||||
{
|
||||
double ta = tan( angle*radPerDegree );
|
||||
if (!NS_finite(ta)) {
|
||||
if (!IsFinite(ta)) {
|
||||
rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -211,7 +212,7 @@ already_AddRefed<SVGMatrix>
|
|||
SVGMatrix::SkewY(float angle, ErrorResult& rv)
|
||||
{
|
||||
double ta = tan( angle*radPerDegree );
|
||||
if (!NS_finite(ta)) {
|
||||
if (!IsFinite(ta)) {
|
||||
rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "nsSMILValue.h"
|
||||
#include "SVGNumberList.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include <math.h>
|
||||
|
||||
/* The "identity" number list for a given number list attribute (the effective
|
||||
|
@ -155,7 +156,7 @@ SVGNumberListSMILType::ComputeDistance(const nsSMILValue& aFrom,
|
|||
total += delta * delta;
|
||||
}
|
||||
double distance = sqrt(total);
|
||||
if (!NS_finite(distance)) {
|
||||
if (!IsFinite(distance)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
aDistance = distance;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "nsDebug.h"
|
||||
#include "gfxPoint.h"
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -66,7 +67,7 @@ public:
|
|||
|
||||
#ifdef DEBUG
|
||||
bool IsValid() const {
|
||||
return NS_finite(mX) && NS_finite(mY);
|
||||
return IsFinite(mX) && IsFinite(mY);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "nsSMILValue.h"
|
||||
#include "SVGPointList.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include <math.h>
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -135,7 +136,7 @@ SVGPointListSMILType::ComputeDistance(const nsSMILValue& aFrom,
|
|||
total += dx * dx + dy * dy;
|
||||
}
|
||||
double distance = sqrt(total);
|
||||
if (!NS_finite(distance)) {
|
||||
if (!IsFinite(distance)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
aDistance = distance;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "nsSVGAnimatedTransformList.h"
|
||||
#include "nsSVGAttrTearoffTable.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
namespace {
|
||||
const double kRadPerDegree = 2.0 * M_PI / 360.0;
|
||||
|
@ -263,7 +264,7 @@ SVGTransform::SetSkewX(float angle, ErrorResult& rv)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!NS_finite(tan(angle * kRadPerDegree))) {
|
||||
if (!IsFinite(tan(angle * kRadPerDegree))) {
|
||||
rv.Throw(NS_ERROR_RANGE_ERR);
|
||||
return;
|
||||
}
|
||||
|
@ -286,7 +287,7 @@ SVGTransform::SetSkewY(float angle, ErrorResult& rv)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!NS_finite(tan(angle * kRadPerDegree))) {
|
||||
if (!IsFinite(tan(angle * kRadPerDegree))) {
|
||||
rv.Throw(NS_ERROR_RANGE_ERR);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "nsMathUtils.h"
|
||||
#include "nsSVGElement.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/dom/SVGAnimatedNumber.h"
|
||||
|
||||
class nsSMILValue;
|
||||
|
@ -83,7 +84,7 @@ public:
|
|||
}
|
||||
virtual void SetBaseVal(float aValue) MOZ_OVERRIDE
|
||||
{
|
||||
MOZ_ASSERT(NS_finite(aValue));
|
||||
MOZ_ASSERT(mozilla::IsFinite(aValue));
|
||||
mVal->SetBaseValue(aValue, mSVGElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "nsSVGElement.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGAnimatedNumber.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
|
||||
class nsSMILValue;
|
||||
|
||||
|
@ -93,7 +95,7 @@ public:
|
|||
}
|
||||
virtual void SetBaseVal(float aValue) MOZ_OVERRIDE
|
||||
{
|
||||
MOZ_ASSERT(NS_finite(aValue));
|
||||
MOZ_ASSERT(mozilla::IsFinite(aValue));
|
||||
mVal->SetBaseValue(aValue, mIndex, mSVGElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ const double ComputedTiming::kNullTimeFraction = PositiveInfinity<double>();
|
|||
|
||||
namespace dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Animation, mDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Animation, mDocument, mTarget)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Animation, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Animation, Release)
|
||||
|
@ -227,6 +227,29 @@ Animation::ActiveDuration(const AnimationTiming& aTiming)
|
|||
aTiming.mIterationDuration.MultDouble(aTiming.mIterationCount));
|
||||
}
|
||||
|
||||
bool
|
||||
Animation::IsCurrent() const
|
||||
{
|
||||
if (IsFinishedTransition()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ComputedTiming computedTiming = GetComputedTiming();
|
||||
return computedTiming.mPhase == ComputedTiming::AnimationPhase_Before ||
|
||||
computedTiming.mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
|
||||
bool
|
||||
Animation::IsInEffect() const
|
||||
{
|
||||
if (IsFinishedTransition()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ComputedTiming computedTiming = GetComputedTiming();
|
||||
return computedTiming.mTimeFraction != ComputedTiming::kNullTimeFraction;
|
||||
}
|
||||
|
||||
bool
|
||||
Animation::HasAnimationOfProperty(nsCSSProperty aProperty) const
|
||||
{
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/StickyTimeDuration.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Nullable.h"
|
||||
#include "nsSMILKeySpline.h"
|
||||
#include "nsStyleStruct.h" // for nsTimingFunction
|
||||
|
@ -128,14 +130,19 @@ class Animation : public nsWrapperCache
|
|||
{
|
||||
public:
|
||||
Animation(nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
nsCSSPseudoElements::Type aPseudoType,
|
||||
const AnimationTiming &aTiming,
|
||||
const nsSubstring& aName)
|
||||
: mDocument(aDocument)
|
||||
, mTarget(aTarget)
|
||||
, mTiming(aTiming)
|
||||
, mName(aName)
|
||||
, mIsFinishedTransition(false)
|
||||
, mLastNotification(LAST_NOTIFICATION_NONE)
|
||||
, mPseudoType(aPseudoType)
|
||||
{
|
||||
MOZ_ASSERT(aTarget, "null animation target is not yet supported");
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
|
@ -157,6 +164,15 @@ public:
|
|||
// This currently returns a new object each time when used from C++ but is
|
||||
// cached when used from JS.
|
||||
already_AddRefed<AnimationEffect> GetEffect();
|
||||
Element* GetTarget() const {
|
||||
// Currently we only implement Element.getAnimationPlayers() which only
|
||||
// returns animations targetting Elements so we should this should never
|
||||
// be called for an animation that targets a pseudo-element.
|
||||
MOZ_ASSERT(mPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement,
|
||||
"Requesting the target of an Animation that targets a"
|
||||
" pseudo-element is not yet supported.");
|
||||
return mTarget;
|
||||
}
|
||||
|
||||
void SetParentTime(Nullable<TimeDuration> aParentTime);
|
||||
|
||||
|
@ -224,15 +240,8 @@ public:
|
|||
mIsFinishedTransition = true;
|
||||
}
|
||||
|
||||
bool IsCurrent() const {
|
||||
if (IsFinishedTransition()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ComputedTiming computedTiming = GetComputedTiming();
|
||||
return computedTiming.mPhase == ComputedTiming::AnimationPhase_Before ||
|
||||
computedTiming.mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
bool IsCurrent() const;
|
||||
bool IsInEffect() const;
|
||||
|
||||
enum {
|
||||
LAST_NOTIFICATION_NONE = uint64_t(-1),
|
||||
|
@ -256,7 +265,8 @@ protected:
|
|||
|
||||
// We use a document for a parent object since the other likely candidate,
|
||||
// the target element, can be empty.
|
||||
nsRefPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<Element> mTarget;
|
||||
Nullable<TimeDuration> mParentTime;
|
||||
|
||||
AnimationTiming mTiming;
|
||||
|
@ -267,6 +277,7 @@ protected:
|
|||
// One of the LAST_NOTIFICATION_* constants, or an integer for the iteration
|
||||
// whose start we last notified on.
|
||||
uint64_t mLastNotification;
|
||||
nsCSSPseudoElements::Type mPseudoType;
|
||||
|
||||
InfallibleTArray<AnimationProperty> mProperties;
|
||||
};
|
||||
|
|
|
@ -64,12 +64,6 @@ AnimationPlayer::IsRunning() const
|
|||
return computedTiming.mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayer::IsCurrent() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsCurrent();
|
||||
}
|
||||
|
||||
Nullable<TimeDuration>
|
||||
AnimationPlayer::GetCurrentTimeDuration() const
|
||||
{
|
||||
|
|
|
@ -64,7 +64,13 @@ public:
|
|||
}
|
||||
|
||||
bool IsRunning() const;
|
||||
bool IsCurrent() const;
|
||||
|
||||
bool HasCurrentSource() const {
|
||||
return GetSource() && GetSource()->IsCurrent();
|
||||
}
|
||||
bool HasInEffectSource() const {
|
||||
return GetSource() && GetSource()->IsInEffect();
|
||||
}
|
||||
|
||||
// Return the duration since the start time of the player, taking into
|
||||
// account the pause state. May be negative or null.
|
||||
|
|
|
@ -42,7 +42,6 @@ var omtaEnabled = SpecialPowers.DOMWindowUtils.layerManagerRemote &&
|
|||
// FIXME: When we implement Element.animate, use that here instead of CSS
|
||||
// so that we remove any dependency on the CSS mapping.
|
||||
div.style.animation = 'anim 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var player = div.getAnimationPlayers()[0];
|
||||
|
||||
// Wait so that animation can be set up.
|
||||
|
|
|
@ -20,8 +20,6 @@ function addDiv() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'xyz 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz',
|
||||
'Animation effect name matches keyframes rule name');
|
||||
div.remove();
|
||||
|
@ -30,8 +28,6 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'x\\yz 100s';
|
||||
dump(window.getComputedStyle(div).animationName + "\n");
|
||||
|
||||
assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz',
|
||||
'Escaped animation effect name matches keyframes rule name');
|
||||
div.remove();
|
||||
|
@ -40,8 +36,6 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'x\\79 z 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz',
|
||||
'Hex-escaped animation effect name matches keyframes rule'
|
||||
+ ' name');
|
||||
|
@ -56,7 +50,6 @@ test(function() {
|
|||
window.getComputedStyle(div).transitionProperty;
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.left = '100px';
|
||||
window.getComputedStyle(div).left;
|
||||
|
||||
assert_equals(div.getAnimationPlayers()[0].source.effect.name, '',
|
||||
'Animation effects for transitions have an empty name');
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<style>
|
||||
@keyframes anim { }
|
||||
</style>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
function addDiv() {
|
||||
var div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
return div;
|
||||
}
|
||||
|
||||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim 100s';
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players[0].source.target, div,
|
||||
'Animation.target is the animatable div');
|
||||
div.remove();
|
||||
}, 'Returned CSS animations have the correct Animation.target');
|
||||
|
||||
test(function() {
|
||||
var div = addDiv();
|
||||
|
||||
div.style.left = '0px';
|
||||
window.getComputedStyle(div).transitionProperty;
|
||||
div.style.transition = 'left 100s';
|
||||
div.style.left = '100px';
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players[0].source.target, div,
|
||||
'Animation.target is the animatable div');
|
||||
div.remove();
|
||||
}, 'Returned CSS transitions have the correct Animation.target');
|
||||
|
||||
</script>
|
|
@ -21,7 +21,6 @@ function addDiv() {
|
|||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var originalPlayer = div.getAnimationPlayers()[0];
|
||||
var originalStartTime = originalPlayer.startTime;
|
||||
|
@ -31,7 +30,6 @@ async_test(function(t) {
|
|||
// simply reflect the current time).
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.animationDuration = '200s';
|
||||
window.getComputedStyle(div).animationDuration;
|
||||
var player = div.getAnimationPlayers()[0];
|
||||
assert_equals(player, originalPlayer,
|
||||
'The same AnimationPlayer is returned after updating'
|
||||
|
@ -51,7 +49,6 @@ async_test(function(t) {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
// Store original state
|
||||
var players = div.getAnimationPlayers();
|
||||
|
@ -60,7 +57,6 @@ test(function() {
|
|||
|
||||
// Update first in list
|
||||
div.style.animationDuration = '200s, 100s';
|
||||
window.getComputedStyle(div).animationDuration;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players[0], player1,
|
||||
'First player is in same position after update');
|
||||
|
@ -71,7 +67,6 @@ test(function() {
|
|||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 200s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
// Store original state
|
||||
var players = div.getAnimationPlayers();
|
||||
|
@ -83,7 +78,6 @@ async_test(function(t) {
|
|||
// Swap duration of first and second in list and prepend animation at the
|
||||
// same time
|
||||
div.style.animation = 'anim1 100s, anim1 100s, anim1 200s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_true(players[0] !== player1 && players[0] !== player2,
|
||||
'New player is prepended to start of list');
|
||||
|
@ -103,15 +97,12 @@ async_test(function(t) {
|
|||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var secondPlayer = div.getAnimationPlayers()[1];
|
||||
|
||||
// Wait before continuing so we can compare start times
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
// Trim list of animations
|
||||
div.style.animationName = 'anim1';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1, 'List of players was trimmed');
|
||||
assert_equals(players[0], secondPlayer,
|
||||
|
@ -127,19 +118,16 @@ async_test(function(t) {
|
|||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var firstAddedPlayer = div.getAnimationPlayers()[0];
|
||||
|
||||
// Wait and add second player
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.animation = 'anim1 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var secondAddedPlayer = div.getAnimationPlayers()[0];
|
||||
|
||||
// Wait again and add another player
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.animation = 'anim1 100s, anim2 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_not_equals(firstAddedPlayer, secondAddedPlayer,
|
||||
'New players are added to start of the list');
|
||||
|
|
|
@ -37,7 +37,6 @@ async_test(function(t) {
|
|||
|
||||
// Add an animation
|
||||
div.style.animation = 'anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1,
|
||||
'getAnimationPlayers returns a player running CSS Animations');
|
||||
|
@ -51,7 +50,6 @@ async_test(function(t) {
|
|||
// the animations differ.
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.animation = 'anim1 100s, anim2 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 2,
|
||||
'getAnimationPlayers returns one player for each value of'
|
||||
|
@ -69,7 +67,6 @@ test(function() {
|
|||
|
||||
// Add an animation that targets multiple properties
|
||||
div.style.animation = 'multiPropAnim 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
assert_equals(div.getAnimationPlayers().length, 1,
|
||||
'getAnimationPlayers returns only one player for a CSS Animation'
|
||||
+ ' that targets multiple properties');
|
||||
|
@ -83,10 +80,10 @@ async_test(function(t) {
|
|||
div.style.left = '0px';
|
||||
div.style.top = '0px';
|
||||
window.getComputedStyle(div).transitionProperty;
|
||||
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.left = '100px';
|
||||
div.style.top = '100px';
|
||||
window.getComputedStyle(div).left;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 2,
|
||||
|
@ -100,7 +97,6 @@ async_test(function(t) {
|
|||
// Wait a moment then add a third transition
|
||||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.backgroundColor = 'green';
|
||||
window.getComputedStyle(div).backgroundColor;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 3,
|
||||
'getAnimationPlayers returns players for all running CSS Transitions');
|
||||
|
@ -124,7 +120,6 @@ async_test(function(t) {
|
|||
window.requestAnimationFrame(t.step_func(function() {
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.backgroundColor = 'green';
|
||||
window.getComputedStyle(div).backgroundColor;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 2,
|
||||
|
@ -152,9 +147,25 @@ async_test(function(t) {
|
|||
|
||||
// Add a very short animation
|
||||
div.style.animation = 'anim1 0.01s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
}, 'getAnimationPlayers for CSS Animations that have finished');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
|
||||
// Set up event listener
|
||||
div.addEventListener('animationend', t.step_func(function() {
|
||||
assert_equals(div.getAnimationPlayers().length, 1,
|
||||
'getAnimationPlayers returns players for CSS Animations that have'
|
||||
+ ' finished but are filling forwards');
|
||||
div.remove();
|
||||
t.done();
|
||||
}));
|
||||
|
||||
// Add a very short animation
|
||||
div.style.animation = 'anim1 0.01s forwards';
|
||||
}, 'getAnimationPlayers for CSS Animations that have finished but are'
|
||||
+ ' forwards filling');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
|
||||
|
@ -169,6 +180,7 @@ async_test(function(t) {
|
|||
// Add a very short transition
|
||||
div.style.left = '0px';
|
||||
window.getComputedStyle(div).left;
|
||||
|
||||
div.style.transition = 'all 0.01s';
|
||||
div.style.left = '100px';
|
||||
window.getComputedStyle(div).left;
|
||||
|
@ -177,7 +189,6 @@ async_test(function(t) {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'none 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 0,
|
||||
|
@ -185,7 +196,6 @@ test(function() {
|
|||
+ ' with animation-name: none');
|
||||
|
||||
div.style.animation = 'none 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1,
|
||||
'getAnimationPlayers returns players only for those CSS Animations whose'
|
||||
|
@ -197,15 +207,12 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'missing 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 0,
|
||||
'getAnimationPlayers returns an empty sequence for an element'
|
||||
+ ' with animation-name: missing');
|
||||
|
||||
div.style.animation = 'anim1 100s, missing 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1,
|
||||
'getAnimationPlayers returns players only for those CSS Animations whose'
|
||||
|
@ -217,8 +224,6 @@ test(function() {
|
|||
async_test(function(t) {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s, notyet 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1,
|
||||
'getAnimationPlayers initally only returns players for CSS Animations whose'
|
||||
|
@ -227,8 +232,6 @@ async_test(function(t) {
|
|||
window.requestAnimationFrame(t.step_func(function() {
|
||||
var keyframes = '@keyframes notyet { to { left: 100px; } }';
|
||||
document.styleSheets[0].insertRule(keyframes, 0);
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 2,
|
||||
'getAnimationPlayers includes player when @keyframes rule is added'
|
||||
|
@ -245,8 +248,6 @@ async_test(function(t) {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s, anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
assert_equals(div.getAnimationPlayers().length, 2,
|
||||
'getAnimationPlayers returns one player for each CSS animation-name'
|
||||
+ ' even if the names are duplicated');
|
||||
|
@ -256,8 +257,6 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'empty 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
assert_equals(div.getAnimationPlayers().length, 1,
|
||||
'getAnimationPlayers returns players for CSS animations with an'
|
||||
+ ' empty keyframes rule');
|
||||
|
@ -267,8 +266,6 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var players = div.getAnimationPlayers();
|
||||
assert_equals(players.length, 1,
|
||||
'getAnimationPlayers returns animations for CSS animations whose'
|
||||
|
@ -282,8 +279,6 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 0s 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
assert_equals(div.getAnimationPlayers().length, 1,
|
||||
'getAnimationPlayers returns animations for CSS animations whose'
|
||||
+ ' duration is zero');
|
||||
|
@ -296,9 +291,9 @@ test(function() {
|
|||
// Try to transition non-animatable property animation-duration
|
||||
div.style.animationDuration = '10s';
|
||||
window.getComputedStyle(div).animationDuration;
|
||||
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.animationDuration = '100s';
|
||||
window.getComputedStyle(div).left;
|
||||
|
||||
assert_equals(div.getAnimationPlayers().length, 0,
|
||||
'getAnimationPlayers returns an empty sequence for a transition'
|
||||
|
@ -313,7 +308,6 @@ test(function() {
|
|||
window.getComputedStyle(div).transitionProperty;
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.setProperty('-vendor-unsupported', '100px', '');
|
||||
window.getComputedStyle(div).getPropertyValue('-vendor-unsupported');
|
||||
|
||||
assert_equals(div.getAnimationPlayers().length, 0,
|
||||
'getAnimationPlayers returns an empty sequence for a transition'
|
||||
|
@ -324,13 +318,10 @@ test(function() {
|
|||
test(function() {
|
||||
var div = addDiv();
|
||||
div.style.animation = 'anim1 100s';
|
||||
window.getComputedStyle(div).animationName;
|
||||
|
||||
var originalPlayer = div.getAnimationPlayers()[0];
|
||||
|
||||
// Update pause state (an AnimationPlayer change)
|
||||
div.style.animationPlayState = 'paused';
|
||||
window.getComputedStyle(div).animationPlayState;
|
||||
var pausedPlayer = div.getAnimationPlayers()[0];
|
||||
// FIXME: Check pausedPlayer.playState has changed once the API is available
|
||||
// (bug 1037321)
|
||||
|
@ -340,7 +331,6 @@ test(function() {
|
|||
|
||||
// Update duration (an Animation change)
|
||||
div.style.animationDuration = '200s';
|
||||
window.getComputedStyle(div).animationDuration
|
||||
var extendedPlayer = div.getAnimationPlayers()[0];
|
||||
// FIXME: Check extendedPlayer.source.timing.duration has changed once the
|
||||
// API is available
|
||||
|
|
|
@ -4,3 +4,4 @@ skip-if = buildapp == 'mulet'
|
|||
skip-if = buildapp == 'mulet'
|
||||
[css-integration/test_animations-dynamic-changes.html]
|
||||
[css-integration/test_animation-effect-name.html]
|
||||
[css-integration/test_animation-target.html]
|
||||
|
|
|
@ -632,11 +632,18 @@ this.DOMApplicationRegistry = {
|
|||
this.webapps[id].removable = false;
|
||||
}
|
||||
} else {
|
||||
// Fields that we must not update. Confere bug 993011 comment 10.
|
||||
let fieldsBlacklist = ["basePath", "id", "installerAppId",
|
||||
"installerIsBrowser", "localId", "receipts", "storeId",
|
||||
"storeVersion"];
|
||||
// we fall into this case if the app is present in /system/b2g/webapps/webapps.json
|
||||
// and in /data/local/webapps/webapps.json: this happens when updating gaia apps
|
||||
// Confere bug 989876
|
||||
this.webapps[id].updateTime = data[id].updateTime;
|
||||
this.webapps[id].lastUpdateCheck = data[id].updateTime;
|
||||
for (let field in data[id]) {
|
||||
if (fieldsBlacklist.indexOf(field) === -1) {
|
||||
this.webapps[id][field] = data[id][field];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.bind(this)).then(null, Cu.reportError);
|
||||
|
|
|
@ -1251,11 +1251,8 @@ Navigator::MozGetUserMedia(const MediaStreamConstraints& aConstraints,
|
|||
return;
|
||||
}
|
||||
|
||||
bool privileged = nsContentUtils::IsChromeDoc(mWindow->GetExtantDoc());
|
||||
|
||||
MediaManager* manager = MediaManager::Get();
|
||||
aRv = manager->GetUserMedia(privileged, mWindow, aConstraints,
|
||||
onsuccess, onerror);
|
||||
aRv = manager->GetUserMedia(mWindow, aConstraints, onsuccess, onerror);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -2063,10 +2063,11 @@ ConstructJSImplementation(JSContext* aCx, const char* aContractId,
|
|||
AutoNoJSAPI nojsapi;
|
||||
|
||||
// Get the XPCOM component containing the JS implementation.
|
||||
nsCOMPtr<nsISupports> implISupports = do_CreateInstance(aContractId);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISupports> implISupports = do_CreateInstance(aContractId, &rv);
|
||||
if (!implISupports) {
|
||||
NS_WARNING("Failed to get JS implementation for contract");
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
}
|
||||
// Initialize the object, if it implements nsIDOMGlobalPropertyInitializer.
|
||||
|
@ -2074,7 +2075,7 @@ ConstructJSImplementation(JSContext* aCx, const char* aContractId,
|
|||
do_QueryInterface(implISupports);
|
||||
if (gpi) {
|
||||
JS::Rooted<JS::Value> initReturn(aCx);
|
||||
nsresult rv = gpi->Init(aWindow, &initReturn);
|
||||
rv = gpi->Init(aWindow, &initReturn);
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
|
@ -2089,10 +2090,10 @@ ConstructJSImplementation(JSContext* aCx, const char* aContractId,
|
|||
}
|
||||
// Extract the JS implementation from the XPCOM object.
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> implWrapped =
|
||||
do_QueryInterface(implISupports);
|
||||
do_QueryInterface(implISupports, &rv);
|
||||
MOZ_ASSERT(implWrapped, "Failed to get wrapped JS from XPCOM component.");
|
||||
if (!implWrapped) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
}
|
||||
aObject.set(implWrapped->GetJSObject());
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
#include "mozilla/dom/TextMetrics.h"
|
||||
#include "mozilla/dom/UnionTypes.h"
|
||||
#include "mozilla/dom/SVGMatrix.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "GLContext.h"
|
||||
#include "GLContextProvider.h"
|
||||
|
@ -4354,8 +4355,8 @@ CanvasRenderingContext2D::GetImageData(JSContext* aCx, double aSx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (!NS_finite(aSx) || !NS_finite(aSy) ||
|
||||
!NS_finite(aSw) || !NS_finite(aSh)) {
|
||||
if (!IsFinite(aSx) || !IsFinite(aSy) ||
|
||||
!IsFinite(aSw) || !IsFinite(aSh)) {
|
||||
error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
||||
class nsIPrincipal;
|
||||
|
||||
|
@ -53,7 +54,7 @@ void DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement,
|
|||
bool CoerceDouble(JS::Value v, double* d);
|
||||
|
||||
/* Float validation stuff */
|
||||
#define VALIDATE(_f) if (!NS_finite(_f)) return false
|
||||
#define VALIDATE(_f) if (!IsFinite(_f)) return false
|
||||
|
||||
inline bool FloatValidate (double f1) {
|
||||
VALIDATE(f1);
|
||||
|
|
|
@ -227,6 +227,7 @@ WebGLContextOptions::WebGLContextOptions()
|
|||
|
||||
WebGLContext::WebGLContext()
|
||||
: gl(nullptr)
|
||||
, mNeedsFakeNoAlpha(false)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
|
||||
|
@ -926,6 +927,12 @@ WebGLContext::SetDimensions(int32_t sWidth, int32_t sHeight)
|
|||
MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias || !gl->Caps().antialias);
|
||||
MOZ_ASSERT(gl->Caps().preserve == mOptions.preserveDrawingBuffer);
|
||||
|
||||
if (gl->WorkAroundDriverBugs() && gl->IsANGLE()) {
|
||||
if (!mOptions.alpha) {
|
||||
mNeedsFakeNoAlpha = true;
|
||||
}
|
||||
}
|
||||
|
||||
AssertCachedBindings();
|
||||
AssertCachedState();
|
||||
|
||||
|
@ -1340,7 +1347,12 @@ WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask, const bool
|
|||
}
|
||||
|
||||
gl->fColorMask(1, 1, 1, 1);
|
||||
gl->fClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
if (mNeedsFakeNoAlpha) {
|
||||
gl->fClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
} else {
|
||||
gl->fClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (initializeDepthBuffer) {
|
||||
|
@ -1805,9 +1817,32 @@ bool WebGLContext::TexImageFromVideoElement(const TexImageTarget texImageTarget,
|
|||
return ok;
|
||||
}
|
||||
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
WebGLContext::ScopedMaskWorkaround::ScopedMaskWorkaround(WebGLContext& webgl)
|
||||
: mWebGL(webgl)
|
||||
, mNeedsChange(NeedsChange(webgl))
|
||||
{
|
||||
if (mNeedsChange) {
|
||||
mWebGL.gl->fColorMask(mWebGL.mColorWriteMask[0],
|
||||
mWebGL.mColorWriteMask[1],
|
||||
mWebGL.mColorWriteMask[2],
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
WebGLContext::ScopedMaskWorkaround::~ScopedMaskWorkaround()
|
||||
{
|
||||
if (mNeedsChange) {
|
||||
mWebGL.gl->fColorMask(mWebGL.mColorWriteMask[0],
|
||||
mWebGL.mColorWriteMask[1],
|
||||
mWebGL.mColorWriteMask[2],
|
||||
mWebGL.mColorWriteMask[3]);
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// XPCOM goop
|
||||
//
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLContext)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLContext)
|
||||
|
|
|
@ -1327,6 +1327,22 @@ protected:
|
|||
|
||||
uint64_t mLastUseIndex;
|
||||
|
||||
bool mNeedsFakeNoAlpha;
|
||||
|
||||
struct ScopedMaskWorkaround {
|
||||
WebGLContext& mWebGL;
|
||||
const bool mNeedsChange;
|
||||
|
||||
static bool NeedsChange(WebGLContext& webgl) {
|
||||
return webgl.mNeedsFakeNoAlpha &&
|
||||
webgl.mColorWriteMask[3] != false;
|
||||
}
|
||||
|
||||
ScopedMaskWorkaround(WebGLContext& webgl);
|
||||
|
||||
~ScopedMaskWorkaround();
|
||||
};
|
||||
|
||||
void LoseOldestWebGLContextIfLimitExceeded();
|
||||
void UpdateLastUseIndex();
|
||||
|
||||
|
|
|
@ -134,7 +134,11 @@ WebGLContext::DrawArrays(GLenum mode, GLint first, GLsizei count)
|
|||
return;
|
||||
|
||||
RunContextLossTimer();
|
||||
gl->fDrawArrays(mode, first, count);
|
||||
|
||||
{
|
||||
ScopedMaskWorkaround autoMask(*this);
|
||||
gl->fDrawArrays(mode, first, count);
|
||||
}
|
||||
|
||||
Draw_cleanup();
|
||||
}
|
||||
|
@ -152,7 +156,11 @@ WebGLContext::DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsiz
|
|||
return;
|
||||
|
||||
RunContextLossTimer();
|
||||
gl->fDrawArraysInstanced(mode, first, count, primcount);
|
||||
|
||||
{
|
||||
ScopedMaskWorkaround autoMask(*this);
|
||||
gl->fDrawArraysInstanced(mode, first, count, primcount);
|
||||
}
|
||||
|
||||
Draw_cleanup();
|
||||
}
|
||||
|
@ -313,11 +321,16 @@ WebGLContext::DrawElements(GLenum mode, GLsizei count, GLenum type,
|
|||
|
||||
RunContextLossTimer();
|
||||
|
||||
if (gl->IsSupported(gl::GLFeature::draw_range_elements)) {
|
||||
gl->fDrawRangeElements(mode, 0, upperBound,
|
||||
count, type, reinterpret_cast<GLvoid*>(byteOffset));
|
||||
} else {
|
||||
gl->fDrawElements(mode, count, type, reinterpret_cast<GLvoid*>(byteOffset));
|
||||
{
|
||||
ScopedMaskWorkaround autoMask(*this);
|
||||
|
||||
if (gl->IsSupported(gl::GLFeature::draw_range_elements)) {
|
||||
gl->fDrawRangeElements(mode, 0, upperBound, count, type,
|
||||
reinterpret_cast<GLvoid*>(byteOffset));
|
||||
} else {
|
||||
gl->fDrawElements(mode, count, type,
|
||||
reinterpret_cast<GLvoid*>(byteOffset));
|
||||
}
|
||||
}
|
||||
|
||||
Draw_cleanup();
|
||||
|
@ -334,12 +347,20 @@ WebGLContext::DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
|||
return;
|
||||
|
||||
GLuint upperBound = 0;
|
||||
if (!DrawElements_check(count, type, byteOffset, primcount, "drawElementsInstanced",
|
||||
&upperBound))
|
||||
if (!DrawElements_check(count, type, byteOffset, primcount,
|
||||
"drawElementsInstanced", &upperBound))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RunContextLossTimer();
|
||||
gl->fDrawElementsInstanced(mode, count, type, reinterpret_cast<GLvoid*>(byteOffset), primcount);
|
||||
|
||||
{
|
||||
ScopedMaskWorkaround autoMask(*this);
|
||||
gl->fDrawElementsInstanced(mode, count, type,
|
||||
reinterpret_cast<GLvoid*>(byteOffset),
|
||||
primcount);
|
||||
}
|
||||
|
||||
Draw_cleanup();
|
||||
}
|
||||
|
|
|
@ -40,8 +40,10 @@ WebGLContext::Clear(GLbitfield mask)
|
|||
}
|
||||
|
||||
// Ok, we're clearing the default framebuffer/screen.
|
||||
|
||||
gl->fClear(mask);
|
||||
{
|
||||
ScopedMaskWorkaround autoMask(*this);
|
||||
gl->fClear(mask);
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
mShouldPresent = true;
|
||||
|
|
|
@ -102,6 +102,10 @@ const kEventConstructors = {
|
|||
return e;
|
||||
},
|
||||
},
|
||||
CSSFontFaceLoadEvent: { create: function (aName, aProps) {
|
||||
return new CSSFontFaceLoadEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
CustomEvent: { create: function (aName, aProps) {
|
||||
return new CustomEvent(aName, aProps);
|
||||
},
|
||||
|
|
|
@ -8,6 +8,5 @@
|
|||
"Historical DOM features must be removed: getAttributeNodeNS": true,
|
||||
"Historical DOM features must be removed: setAttributeNode": true,
|
||||
"Historical DOM features must be removed: removeAttributeNode": true,
|
||||
"DocumentType member must be nuked: internalSubset": true,
|
||||
"Node member must be nuked: hasAttributes": true
|
||||
"DocumentType member must be nuked: internalSubset": true
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(93bf61ba-9ffa-42b7-9594-2de803c9627c)]
|
||||
[builtinclass, uuid(7d0582bd-09a7-430e-969b-054abbea19fe)]
|
||||
interface nsIDOMAttr : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString name;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(864c4e6a-3933-4f8a-8dd8-3883be60ea10)]
|
||||
[uuid(4ac42d40-69b7-4506-b730-c41ec74b74bd)]
|
||||
interface nsIDOMCDATASection : nsIDOMText
|
||||
{
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(7b1b8719-6669-4614-bf96-93ddf7966f64)]
|
||||
[uuid(844b8e7e-6d37-4fa1-8196-86e3afdfa0ca)]
|
||||
interface nsIDOMCharacterData : nsIDOMNode
|
||||
{
|
||||
attribute DOMString data;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(8edde4d9-dc26-492c-8477-2be0f95088ad)]
|
||||
[uuid(c1a1d2ea-e106-4ee8-806d-2633468e8098)]
|
||||
interface nsIDOMComment : nsIDOMCharacterData
|
||||
{
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ interface nsIDOMLocation;
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(950ca868-e09f-4a7d-9b87-e4ec9aedb3e5)]
|
||||
[uuid(08c6400b-0b6d-4ce6-b88d-e7a15a9c7c03)]
|
||||
interface nsIDOMDocument : nsIDOMNode
|
||||
{
|
||||
readonly attribute nsIDOMDocumentType doctype;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(5c601878-5b77-4f88-9425-3fe8d2dc8813)]
|
||||
[builtinclass, uuid(24b34c61-7326-42d4-87ec-5d3b5c0b1b26)]
|
||||
interface nsIDOMDocumentFragment : nsIDOMNode
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(55fe2f3f-35e8-4cb0-b39d-bea1bd0061c7)]
|
||||
[uuid(23c1f549-d40b-49b8-992e-2a1136afa13f)]
|
||||
interface nsIDOMDocumentType : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString name;
|
||||
|
|
|
@ -15,7 +15,7 @@ interface nsIDOMMozNamedAttrMap;
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-element
|
||||
*/
|
||||
|
||||
[uuid(ea94c5e2-5d5d-4afe-b3ab-431903797f31)]
|
||||
[uuid(59eb63f9-c8c0-41d2-bf73-739de43b17f9)]
|
||||
interface nsIDOMElement : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString tagName;
|
||||
|
@ -42,6 +42,7 @@ interface nsIDOMElement : nsIDOMNode
|
|||
boolean hasAttribute(in DOMString name);
|
||||
boolean hasAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
boolean hasAttributes();
|
||||
|
||||
// Obsolete methods.
|
||||
nsIDOMAttr getAttributeNode(in DOMString name);
|
||||
|
|
|
@ -16,7 +16,7 @@ interface nsIVariant;
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(3eef1ab9-2f87-4eda-9bb9-469c37294f72)]
|
||||
[uuid(238222a9-7aa5-4804-9f86-484853ce4b15)]
|
||||
interface nsIDOMNode : nsISupports
|
||||
{
|
||||
const unsigned short ELEMENT_NODE = 1;
|
||||
|
@ -68,8 +68,6 @@ interface nsIDOMNode : nsISupports
|
|||
|
||||
// Introduced in DOM Level 2:
|
||||
readonly attribute DOMString localName;
|
||||
// Introduced in DOM Level 2:
|
||||
boolean hasAttributes();
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
// This uses a binaryname to avoid warnings due to name collision with
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(ca632936-4c6b-48b4-9920-fbe1e3710802)]
|
||||
[uuid(d0163f44-8f5b-4234-b3aa-43cab64e2039)]
|
||||
interface nsIDOMProcessingInstruction : nsIDOMCharacterData
|
||||
{
|
||||
readonly attribute DOMString target;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(b16d449b-60f1-444a-a7e5-dc50a5d0ffad)]
|
||||
[uuid(775bbd26-1581-4e54-b82c-5d9dc5a3363b)]
|
||||
interface nsIDOMText : nsIDOMCharacterData
|
||||
{
|
||||
nsIDOMText splitText(in unsigned long offset)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "nsIDOMDocument.idl"
|
||||
|
||||
[uuid(dc767223-838f-4ca2-9f4c-ae685862d1df)]
|
||||
[uuid(1d54e44a-2012-4567-805d-bd5455fc6421)]
|
||||
interface nsIDOMXMLDocument : nsIDOMDocument
|
||||
{
|
||||
// DOM Level 3 Load & Save, DocumentLS
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
interface nsISelection;
|
||||
|
||||
[uuid(b7fcb58a-9ad5-44b5-8c6f-b7181c249413)]
|
||||
[uuid(abf369fb-a8b2-4fba-95f5-9e4a896e40a8)]
|
||||
interface nsIDOMHTMLDocument : nsIDOMDocument
|
||||
{
|
||||
attribute DOMString domain;
|
||||
|
|
|
@ -19,7 +19,7 @@ interface nsIDOMHTMLMenuElement;
|
|||
* with changes from the work-in-progress WHATWG HTML specification:
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
[uuid(2728c077-9ecc-4a75-ac95-16fbfcb007df)]
|
||||
[uuid(8c9472c2-785a-40b6-ad47-4d98e64562bd)]
|
||||
interface nsIDOMHTMLElement : nsIDOMElement
|
||||
{
|
||||
// metadata attributes
|
||||
|
|
|
@ -9,7 +9,7 @@ interface nsIDOMCSSStyleDeclaration;
|
|||
interface nsIDOMCSSValue;
|
||||
|
||||
|
||||
[uuid(7a11697a-668b-4a6e-a44a-909abffee230)]
|
||||
[uuid(6618074e-0c77-4fec-8870-a6f79aa79b07)]
|
||||
interface nsIDOMSVGElement : nsIDOMElement
|
||||
{
|
||||
// raises DOMException on setting
|
||||
|
|
|
@ -10,7 +10,7 @@ interface nsIDOMXULCommandDispatcher;
|
|||
interface nsIObserver;
|
||||
interface nsIBoxObject;
|
||||
|
||||
[uuid(546c658e-805f-4293-9738-6e6a00d75839)]
|
||||
[uuid(6f932360-ae43-4fa7-9200-66f64e05a356)]
|
||||
interface nsIDOMXULDocument : nsIDOMDocument
|
||||
{
|
||||
attribute nsIDOMNode popupNode;
|
||||
|
|
|
@ -12,7 +12,7 @@ interface nsIControllers;
|
|||
interface nsIBoxObject;
|
||||
|
||||
|
||||
[uuid(1bd9303d-0854-4ed3-9fda-added29a570e)]
|
||||
[uuid(ef62515d-3160-4463-abd7-fc9b7385ecef)]
|
||||
interface nsIDOMXULElement : nsIDOMElement
|
||||
{
|
||||
// Layout properties
|
||||
|
|
|
@ -1577,7 +1577,7 @@ MediaManager::NotifyRecordingStatusChange(nsPIDOMWindow* aWindow,
|
|||
* for handling all incoming getUserMedia calls from every window.
|
||||
*/
|
||||
nsresult
|
||||
MediaManager::GetUserMedia(bool aPrivileged,
|
||||
MediaManager::GetUserMedia(
|
||||
nsPIDOMWindow* aWindow, const MediaStreamConstraints& aConstraints,
|
||||
nsIDOMGetUserMediaSuccessCallback* aOnSuccess,
|
||||
nsIDOMGetUserMediaErrorCallback* aOnError)
|
||||
|
@ -1588,6 +1588,8 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
NS_ENSURE_TRUE(aOnError, NS_ERROR_NULL_POINTER);
|
||||
NS_ENSURE_TRUE(aOnSuccess, NS_ERROR_NULL_POINTER);
|
||||
|
||||
bool privileged = nsContentUtils::IsChromeDoc(aWindow->GetExtantDoc());
|
||||
|
||||
nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> onSuccess(aOnSuccess);
|
||||
nsCOMPtr<nsIDOMGetUserMediaErrorCallback> onError(aOnError);
|
||||
|
||||
|
@ -1601,7 +1603,7 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
* may point we can decide whether to extend this test there as well.
|
||||
*/
|
||||
#if !defined(MOZ_WEBRTC)
|
||||
if (c.mPicture && !aPrivileged) {
|
||||
if (c.mPicture && !privileged) {
|
||||
if (aWindow->GetPopupControlState() > openControlled) {
|
||||
nsCOMPtr<nsIPopupWindowManager> pm =
|
||||
do_GetService(NS_POPUPWINDOWMANAGER_CONTRACTID);
|
||||
|
@ -1653,7 +1655,7 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
|
||||
// Developer preference for turning off permission check.
|
||||
if (Preferences::GetBool("media.navigator.permission.disabled", false)) {
|
||||
aPrivileged = true;
|
||||
privileged = true;
|
||||
}
|
||||
if (!Preferences::GetBool("media.navigator.video.enabled", true)) {
|
||||
c.mVideo.SetAsBoolean() = false;
|
||||
|
@ -1681,7 +1683,7 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (c.mVideo.IsMediaTrackConstraints() && !aPrivileged) {
|
||||
if (c.mVideo.IsMediaTrackConstraints() && !privileged) {
|
||||
auto& tc = c.mVideo.GetAsMediaTrackConstraints();
|
||||
// only allow privileged content to set the window id
|
||||
if (tc.mBrowserWindow.WasPassed()) {
|
||||
|
@ -1738,7 +1740,7 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
#endif
|
||||
) ||
|
||||
#endif
|
||||
(!aPrivileged && !HostHasPermission(*docURI))) {
|
||||
(!privileged && !HostHasPermission(*docURI))) {
|
||||
return task->Denied(NS_LITERAL_STRING("PERMISSION_DENIED"));
|
||||
}
|
||||
}
|
||||
|
@ -1767,11 +1769,11 @@ MediaManager::GetUserMedia(bool aPrivileged,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (isLoop) {
|
||||
aPrivileged = true;
|
||||
privileged = true;
|
||||
}
|
||||
|
||||
// XXX No full support for picture in Desktop yet (needs proper UI)
|
||||
if (aPrivileged ||
|
||||
if (privileged ||
|
||||
(c.mFake && !Preferences::GetBool("media.navigator.permission.fake"))) {
|
||||
MediaManager::GetMessageLoop()->PostTask(FROM_HERE, task.forget());
|
||||
} else {
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
* 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_MEDIAMANAGER_H
|
||||
#define MOZILLA_MEDIAMANAGER_H
|
||||
|
||||
#include "MediaEngine.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
@ -574,9 +577,9 @@ public:
|
|||
void RemoveFromWindowList(uint64_t aWindowID,
|
||||
GetUserMediaCallbackMediaStreamListener *aListener);
|
||||
|
||||
nsresult GetUserMedia(bool aPrivileged,
|
||||
nsresult GetUserMedia(
|
||||
nsPIDOMWindow* aWindow,
|
||||
const dom::MediaStreamConstraints& aRawConstraints,
|
||||
const dom::MediaStreamConstraints& aConstraints,
|
||||
nsIDOMGetUserMediaSuccessCallback* onSuccess,
|
||||
nsIDOMGetUserMediaErrorCallback* onError);
|
||||
|
||||
|
@ -632,3 +635,5 @@ private:
|
|||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // MOZILLA_MEDIAMANAGER_H
|
||||
|
|
|
@ -683,7 +683,11 @@ let SettingsRequestManager = {
|
|||
if (DEBUG) debug("Cannot find principal for message manager to check permissions");
|
||||
}
|
||||
else if (SettingsPermissions.hasReadPermission(principal, aContent.key)) {
|
||||
msgMgr.sendAsyncMessage(aMsgName, aContent);
|
||||
try {
|
||||
msgMgr.sendAsyncMessage(aMsgName, aContent);
|
||||
} catch (e) {
|
||||
if (DEBUG) debug("Failed sending message: " + aMsgName);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
if (DEBUG) debug("Finished Broadcasting");
|
||||
|
|
|
@ -27,7 +27,7 @@ bug371552 = ["elementhasattributens02"];
|
|||
wrongDocError = ["elementsetattributenodens05", "namednodemapsetnameditemns03",
|
||||
"setAttributeNodeNS05", "setNamedItemNS02"];
|
||||
attrExodus = ["elementsetattributenodens06", "importNode01",
|
||||
"hc_namednodemapinvalidtype1"];
|
||||
"hc_namednodemapinvalidtype1", "nodehasattributes02"];
|
||||
bogusPrefix = ["nodesetprefix05", "nodesetprefix09", "prefix06", "prefix07"];
|
||||
prefixReplacement = ["setAttributeNodeNS04"];
|
||||
|
||||
|
|
|
@ -254,6 +254,8 @@ var interfaceNamesInGlobalScope =
|
|||
"CSSConditionRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSCounterStyleRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "CSSFontFaceLoadEvent", pref: "layout.css.font-loading-api.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSFontFaceRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
@ -398,6 +400,10 @@ var interfaceNamesInGlobalScope =
|
|||
"FocusEvent",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"FormData",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "FontFace", pref: "layout.css.font-loading-api.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "FontFaceSet", pref: "layout.css.font-loading-api.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"GainNode",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -9,6 +9,7 @@ var NotificationTest = (function () {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
// turn on testing pref (used by notification.cpp, and mock the alerts
|
||||
SpecialPowers.setBoolPref("notification.prompt.testing", true);
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
}
|
||||
|
||||
function teardown_testing_env() {
|
||||
|
|
|
@ -14,5 +14,8 @@
|
|||
interface Animation {
|
||||
// FIXME: |effect| should have type (AnimationEffect or EffectCallback)?
|
||||
// but we haven't implemented EffectCallback yet.
|
||||
[Cached,Pure] readonly attribute AnimationEffect? effect;
|
||||
[Cached,Pure]
|
||||
readonly attribute AnimationEffect? effect;
|
||||
// FIXME: This should be writeable (bug 1067769)
|
||||
readonly attribute Element? target;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
|
||||
*
|
||||
* Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
dictionary CSSFontFaceLoadEventInit : EventInit {
|
||||
sequence<FontFace> fontfaces = [];
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional CSSFontFaceLoadEventInit eventInitDict),
|
||||
Pref="layout.css.font-loading-api.enabled"]
|
||||
interface CSSFontFaceLoadEvent : Event {
|
||||
[Cached, Constant] readonly attribute sequence<FontFace> fontfaces;
|
||||
};
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче