mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Merge inbound to central, a=merge
MozReview-Commit-ID: BpCN8N6VSVt
This commit is contained in:
commit
656b901828
@ -223,7 +223,6 @@ pref("dom.use_watchdog", false);
|
||||
// ensure that those calls don't accidentally trigger the dialog.
|
||||
pref("dom.max_script_run_time", 0);
|
||||
pref("dom.max_chrome_script_run_time", 0);
|
||||
pref("dom.max_child_script_run_time", 0);
|
||||
|
||||
// plugins
|
||||
pref("plugin.disable", true);
|
||||
|
@ -395,6 +395,8 @@
|
||||
@RESPATH@/components/nsLoginInfo.js
|
||||
@RESPATH@/components/nsLoginManager.js
|
||||
@RESPATH@/components/nsLoginManagerPrompter.js
|
||||
@RESPATH@/components/TooltipTextProvider.js
|
||||
@RESPATH@/components/TooltipTextProvider.manifest
|
||||
@RESPATH@/components/NetworkGeolocationProvider.manifest
|
||||
@RESPATH@/components/NetworkGeolocationProvider.js
|
||||
@RESPATH@/components/TVSimulatorService.js
|
||||
|
@ -23,14 +23,6 @@ FINAL_TARGET_FILES += ['blocklist.xml']
|
||||
FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js']
|
||||
FINAL_TARGET_FILES.defaults += ['permissions']
|
||||
|
||||
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
||||
FINAL_TARGET_FILES.icons += ['!/dist/branding/mozicon128.png']
|
||||
FINAL_TARGET_FILES.chrome.icons.default += [
|
||||
'!/dist/branding/default16.png',
|
||||
'!/dist/branding/default32.png',
|
||||
'!/dist/branding/default48.png',
|
||||
]
|
||||
|
||||
DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -4136,7 +4136,7 @@ var XULBrowserWindow = {
|
||||
LinkTargetDisplay.update();
|
||||
},
|
||||
|
||||
showTooltip: function (x, y, tooltip) {
|
||||
showTooltip: function (x, y, tooltip, direction) {
|
||||
if (Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).
|
||||
getCurrentSession()) {
|
||||
return;
|
||||
@ -4146,6 +4146,7 @@ var XULBrowserWindow = {
|
||||
// the chrome zoom level.
|
||||
let elt = document.getElementById("remoteBrowserTooltip");
|
||||
elt.label = tooltip;
|
||||
elt.style.direction = direction;
|
||||
|
||||
let anchor = gBrowser.selectedBrowser;
|
||||
elt.openPopupAtScreen(anchor.boxObject.screenX + x, anchor.boxObject.screenY + y, false, null);
|
||||
@ -4156,6 +4157,10 @@ var XULBrowserWindow = {
|
||||
elt.hidePopup();
|
||||
},
|
||||
|
||||
getTabCount: function () {
|
||||
return gBrowser.tabs.length;
|
||||
},
|
||||
|
||||
updateStatusField: function () {
|
||||
var text, type, types = ["overLink"];
|
||||
if (this._busyUI)
|
||||
|
@ -118,7 +118,6 @@ support-files =
|
||||
test_mcb_double_redirect_image.html
|
||||
test_mcb_redirect.js
|
||||
test_mcb_redirect.sjs
|
||||
xul_tooltiptext.xhtml
|
||||
file_bug1045809_1.html
|
||||
file_bug1045809_2.html
|
||||
file_csp_block_all_mixedcontent.html
|
||||
@ -176,10 +175,6 @@ skip-if = buildapp == 'mulet' || toolkit == "windows" # Disabled on Windows due
|
||||
[browser_bug304198.js]
|
||||
[browser_bug321000.js]
|
||||
skip-if = true # browser_bug321000.js is disabled because newline handling is shaky (bug 592528)
|
||||
[browser_bug329212.js]
|
||||
skip-if = e10s # Bug 1236991 - Update or remove tests that use fillInPageTooltip
|
||||
[browser_bug331772_xul_tooltiptext_in_html.js]
|
||||
skip-if = e10s # Bug 1236991 - Update or remove tests that use fillInPageTooltip
|
||||
[browser_bug356571.js]
|
||||
[browser_bug380960.js]
|
||||
[browser_bug386835.js]
|
||||
@ -232,8 +227,6 @@ skip-if = buildapp == 'mulet' # Bug 1066070 - I don't think either popup notific
|
||||
[browser_bug555767.js]
|
||||
[browser_bug556061.js]
|
||||
[browser_bug559991.js]
|
||||
[browser_bug561623.js]
|
||||
skip-if = e10s # Bug 1236991 - Update or remove tests that use fillInPageTooltip
|
||||
[browser_bug561636.js]
|
||||
[browser_bug562649.js]
|
||||
[browser_bug563588.js]
|
||||
@ -250,8 +243,6 @@ skip-if = toolkit != "cocoa"
|
||||
[browser_bug580956.js]
|
||||
[browser_bug581242.js]
|
||||
[browser_bug581253.js]
|
||||
[browser_bug581947.js]
|
||||
skip-if = e10s # Bug 1236991 - Update or remove tests that use fillInPageTooltip
|
||||
[browser_bug585558.js]
|
||||
[browser_bug585785.js]
|
||||
[browser_bug585830.js]
|
||||
@ -580,4 +571,4 @@ skip-if = !e10s
|
||||
[browser_csp_block_all_mixedcontent.js]
|
||||
tags = mcb
|
||||
[browser_newwindow_focus.js]
|
||||
skip-if = (os == "linux" && !e10s) # Bug 1263254 - Perma fails on Linux without e10s for some reason.
|
||||
skip-if = (os == "linux" && !e10s) # Bug 1263254 - Perma fails on Linux without e10s for some reason.
|
||||
|
@ -1,42 +0,0 @@
|
||||
function test () {
|
||||
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tooltip = document.getElementById("aHTMLTooltip");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("svg1")), "should get title");
|
||||
is(tooltip.getAttribute("label"), "This is a non-root SVG element title");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("text1")), "should get title");
|
||||
is(tooltip.getAttribute("label"), "\n\n\n This is a title\n\n ");
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(doc.getElementById("text2")), "should not get title");
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(doc.getElementById("text3")), "should not get title");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("link1")), "should get title");
|
||||
is(tooltip.getAttribute("label"), "\n This is a title\n ");
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("text4")), "should get title");
|
||||
is(tooltip.getAttribute("label"), "\n This is a title\n ");
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(doc.getElementById("link2")), "should not get title");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("link3")), "should get title");
|
||||
isnot(tooltip.getAttribute("label"), "");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("link4")), "should get title");
|
||||
is(tooltip.getAttribute("label"), "This is an xlink:title attribute");
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(doc.getElementById("text5")), "should not get title");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
|
||||
gBrowser.loadURI(
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/general/title_test.svg"
|
||||
);
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Tests that the tooltiptext attribute is used for XUL elements in an HTML doc.
|
||||
*/
|
||||
function test () {
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tooltip = document.getElementById("aHTMLTooltip");
|
||||
|
||||
ok(tooltip.fillInPageTooltip(doc.getElementById("xulToolbarButton")), "should get tooltiptext");
|
||||
is(tooltip.getAttribute("label"), "XUL tooltiptext");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
|
||||
gBrowser.loadURI(
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/general/xul_tooltiptext.xhtml"
|
||||
);
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tooltip = document.getElementById("aHTMLTooltip");
|
||||
let i = doc.getElementById("i");
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(i),
|
||||
"No tooltip should be shown when @title is null");
|
||||
|
||||
i.title = "foo";
|
||||
ok(tooltip.fillInPageTooltip(i),
|
||||
"A tooltip should be shown when @title is not the empty string");
|
||||
|
||||
i.pattern = "bar";
|
||||
ok(tooltip.fillInPageTooltip(i),
|
||||
"A tooltip should be shown when @title is not the empty string");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
|
||||
gBrowser.loadURI(
|
||||
"data:text/html,<!DOCTYPE html><html><body><input id='i'></body></html>"
|
||||
);
|
||||
}
|
||||
|
@ -1,94 +0,0 @@
|
||||
function check(aElementName, aBarred, aType) {
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tooltip = document.getElementById("aHTMLTooltip");
|
||||
let content = doc.getElementById('content');
|
||||
|
||||
let e = doc.createElement(aElementName);
|
||||
content.appendChild(e);
|
||||
|
||||
if (aType) {
|
||||
e.type = aType;
|
||||
}
|
||||
|
||||
ok(!tooltip.fillInPageTooltip(e),
|
||||
"No tooltip should be shown when the element is valid");
|
||||
|
||||
e.setCustomValidity('foo');
|
||||
if (aBarred) {
|
||||
ok(!tooltip.fillInPageTooltip(e),
|
||||
"No tooltip should be shown when the element is barred from constraint validation");
|
||||
} else {
|
||||
ok(tooltip.fillInPageTooltip(e),
|
||||
e.tagName + " " +"A tooltip should be shown when the element isn't valid");
|
||||
}
|
||||
|
||||
e.setAttribute('title', '');
|
||||
ok (!tooltip.fillInPageTooltip(e),
|
||||
"No tooltip should be shown if the title attribute is set");
|
||||
|
||||
e.removeAttribute('title');
|
||||
content.setAttribute('novalidate', '');
|
||||
ok (!tooltip.fillInPageTooltip(e),
|
||||
"No tooltip should be shown if the novalidate attribute is set on the form owner");
|
||||
content.removeAttribute('novalidate');
|
||||
|
||||
content.removeChild(e);
|
||||
}
|
||||
|
||||
function todo_check(aElementName, aBarred) {
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tooltip = document.getElementById("aHTMLTooltip");
|
||||
let content = doc.getElementById('content');
|
||||
|
||||
let e = doc.createElement(aElementName);
|
||||
content.appendChild(e);
|
||||
|
||||
let cought = false;
|
||||
try {
|
||||
e.setCustomValidity('foo');
|
||||
} catch (e) {
|
||||
cought = true;
|
||||
}
|
||||
|
||||
todo(!cought, "setCustomValidity should exist for " + aElementName);
|
||||
|
||||
content.removeChild(e);
|
||||
}
|
||||
|
||||
function test () {
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
|
||||
let testData = [
|
||||
/* element name, barred */
|
||||
[ 'input', false, null],
|
||||
[ 'textarea', false, null],
|
||||
[ 'button', true, 'button'],
|
||||
[ 'button', false, 'submit'],
|
||||
[ 'select', false, null],
|
||||
[ 'output', true, null],
|
||||
[ 'fieldset', true, null],
|
||||
[ 'object', true, null],
|
||||
];
|
||||
|
||||
for (let data of testData) {
|
||||
check(data[0], data[1], data[2]);
|
||||
}
|
||||
|
||||
let todo_testData = [
|
||||
[ 'keygen', 'false' ],
|
||||
];
|
||||
|
||||
for (let data of todo_testData) {
|
||||
todo_check(data[0], data[1]);
|
||||
}
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
|
||||
gBrowser.loadURI(
|
||||
"data:text/html,<!DOCTYPE html><html><body><form id='content'></form></body></html>"
|
||||
);
|
||||
}
|
||||
|
@ -43,3 +43,9 @@ def FirefoxBranding():
|
||||
'default48.png',
|
||||
'mozicon128.png',
|
||||
]
|
||||
FINAL_TARGET_FILES.icons += ['mozicon128.png']
|
||||
FINAL_TARGET_FILES.chrome.icons.default += [
|
||||
'default16.png',
|
||||
'default32.png',
|
||||
'default48.png',
|
||||
]
|
||||
|
@ -387,6 +387,8 @@
|
||||
@RESPATH@/components/nsLoginManagerPrompter.js
|
||||
@RESPATH@/components/storage-json.js
|
||||
@RESPATH@/components/crypto-SDR.js
|
||||
@RESPATH@/components/TooltipTextProvider.js
|
||||
@RESPATH@/components/TooltipTextProvider.manifest
|
||||
@RESPATH@/components/jsconsole-clhandler.manifest
|
||||
@RESPATH@/components/jsconsole-clhandler.js
|
||||
@RESPATH@/components/webvtt.xpt
|
||||
|
@ -346,7 +346,6 @@ def old_configure_options(*options):
|
||||
)
|
||||
@imports(_from='__builtin__', _import='compile')
|
||||
@imports(_from='__builtin__', _import='open')
|
||||
@imports(_from='__builtin__', _import='zip')
|
||||
@imports('logging')
|
||||
@imports('os')
|
||||
@imports('subprocess')
|
||||
|
@ -31,15 +31,11 @@ def normsep(path):
|
||||
return mozpath.normsep(path)
|
||||
|
||||
|
||||
# This unlocks the sandbox. Do not copy blindly.
|
||||
@imports(_import='__builtin__', _as='__builtins__')
|
||||
@imports(_from='which', _import='which')
|
||||
@imports(_from='which', _import='WhichError')
|
||||
def find_program(file):
|
||||
if is_absolute_or_relative(file):
|
||||
return os.path.abspath(file) if os.path.isfile(file) else None
|
||||
# We can't use @imports here because it imports at declaration time,
|
||||
# and the declaration of find_program happens before we ensure the
|
||||
# which module is available in sys.path somehow.
|
||||
from which import which, WhichError
|
||||
try:
|
||||
return normsep(which(file))
|
||||
except WhichError:
|
||||
@ -100,7 +96,6 @@ def namespace(**kwargs):
|
||||
@template
|
||||
def delayed_getattr(func, key):
|
||||
@depends(func)
|
||||
@imports(_from='__builtin__', _import='getattr')
|
||||
def result(value):
|
||||
# The @depends function we're being passed may have returned
|
||||
# None, or an object that simply doesn't have the wanted key.
|
||||
|
@ -367,12 +367,15 @@ ifdef FOUND_MOZCONFIG
|
||||
endif
|
||||
|
||||
configure:: $(configure-preqs)
|
||||
$(call BUILDSTATUS,TIERS configure)
|
||||
$(call BUILDSTATUS,TIER_START configure)
|
||||
@echo cd $(OBJDIR);
|
||||
@echo $(CONFIGURE) $(CONFIGURE_ARGS)
|
||||
@cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
|
||||
|| ( echo '*** Fix above errors and then restart with\
|
||||
"$(MAKE) -f client.mk build"' && exit 1 )
|
||||
@touch $(OBJDIR)/Makefile
|
||||
$(call BUILDSTATUS,TIER_FINISH configure)
|
||||
|
||||
ifneq (,$(MAKEFILE))
|
||||
$(OBJDIR)/Makefile: $(OBJDIR)/config.status
|
||||
|
@ -137,8 +137,6 @@ parseMessage(ZeroCopyInputStream& stream, uint32_t sizeOfMessage, MessageType& m
|
||||
template<typename CharT, typename InternedStringSet>
|
||||
struct GetOrInternStringMatcher
|
||||
{
|
||||
using ReturnType = const CharT*;
|
||||
|
||||
InternedStringSet& internedStrings;
|
||||
|
||||
explicit GetOrInternStringMatcher(InternedStringSet& strings) : internedStrings(strings) { }
|
||||
@ -860,8 +858,6 @@ class TwoByteString : public Variant<JSAtom*, const char16_t*, JS::ubi::EdgeName
|
||||
|
||||
struct AsTwoByteStringMatcher
|
||||
{
|
||||
using ReturnType = TwoByteString;
|
||||
|
||||
TwoByteString match(JSAtom* atom) {
|
||||
return TwoByteString(atom);
|
||||
}
|
||||
@ -873,16 +869,12 @@ class TwoByteString : public Variant<JSAtom*, const char16_t*, JS::ubi::EdgeName
|
||||
|
||||
struct IsNonNullMatcher
|
||||
{
|
||||
using ReturnType = bool;
|
||||
|
||||
template<typename T>
|
||||
bool match(const T& t) { return t != nullptr; }
|
||||
};
|
||||
|
||||
struct LengthMatcher
|
||||
{
|
||||
using ReturnType = size_t;
|
||||
|
||||
size_t match(JSAtom* atom) {
|
||||
MOZ_ASSERT(atom);
|
||||
JS::ubi::AtomOrTwoByteChars s(atom);
|
||||
@ -902,8 +894,6 @@ class TwoByteString : public Variant<JSAtom*, const char16_t*, JS::ubi::EdgeName
|
||||
|
||||
struct CopyToBufferMatcher
|
||||
{
|
||||
using ReturnType = size_t;
|
||||
|
||||
RangedPtr<char16_t> destination;
|
||||
size_t maxLength;
|
||||
|
||||
@ -985,8 +975,6 @@ struct TwoByteString::HashPolicy {
|
||||
using Lookup = TwoByteString;
|
||||
|
||||
struct HashingMatcher {
|
||||
using ReturnType = js::HashNumber;
|
||||
|
||||
js::HashNumber match(const JSAtom* atom) {
|
||||
return js::DefaultHasher<const JSAtom*>::hash(atom);
|
||||
}
|
||||
@ -1009,7 +997,6 @@ struct TwoByteString::HashPolicy {
|
||||
}
|
||||
|
||||
struct EqualityMatcher {
|
||||
using ReturnType = bool;
|
||||
const TwoByteString& rhs;
|
||||
explicit EqualityMatcher(const TwoByteString& rhs) : rhs(rhs) { }
|
||||
|
||||
|
@ -47,7 +47,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
|
||||
[test_popup-navigates-children.html]
|
||||
skip-if = buildapp == 'b2g' # b2g(Needs multiple window.open support, also uses docshelltreenode) b2g-debug(Needs multiple window.open support, also uses docshelltreenode) b2g-desktop(Needs multiple window.open support, also uses docshelltreenode)
|
||||
[test_reserved.html]
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || (toolkit == 'android') || (e10s && debug && os == 'win') #too slow on Android 4.3 aws only; bug 1030403
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || (toolkit == 'android') #too slow on Android 4.3 aws only; bug 1030403
|
||||
[test_sessionhistory.html]
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' #RANDOM # b2g-debug(Perma-orange on debug emulator builds) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
|
||||
[test_sibling-matching-parent.html]
|
||||
|
@ -1204,7 +1204,7 @@ Animation::EffectEnd() const
|
||||
return StickyTimeDuration(0);
|
||||
}
|
||||
|
||||
return mEffect->GetComputedTiming().mEndTime;
|
||||
return mEffect->SpecifiedTiming().EndTime();
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
|
@ -125,9 +125,25 @@ AnimationEffectTiming::SetDirection(const PlaybackDirection& aDirection)
|
||||
}
|
||||
|
||||
void
|
||||
AnimationEffectTiming::SetEasing(const nsAString& aEasing, ErrorResult& aRv)
|
||||
AnimationEffectTiming::SetEasing(JSContext* aCx,
|
||||
const nsAString& aEasing,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
// TODO: Bug 1244643 - implement AnimationEffectTiming easing
|
||||
Maybe<ComputedTimingFunction> newFunction =
|
||||
TimingParams::ParseEasing(aEasing,
|
||||
AnimationUtils::GetCurrentRealmDocument(aCx),
|
||||
aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mTiming.mFunction == newFunction) {
|
||||
return;
|
||||
}
|
||||
|
||||
mTiming.mFunction = newFunction;
|
||||
|
||||
PostSpecifiedTimingUpdated(mEffect);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
void SetDuration(const UnrestrictedDoubleOrString& aDuration,
|
||||
ErrorResult& aRv);
|
||||
void SetDirection(const PlaybackDirection& aDirection);
|
||||
void SetEasing(const nsAString& aEasing, ErrorResult& aRv);
|
||||
void SetEasing(JSContext* aCx, const nsAString& aEasing, ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
KeyframeEffect* MOZ_NON_OWNING_REF mEffect;
|
||||
|
@ -49,14 +49,6 @@ public:
|
||||
static void LogAsyncAnimationFailure(nsCString& aMessage,
|
||||
const nsIContent* aContent = nullptr);
|
||||
|
||||
/**
|
||||
* Parses a CSS <single-transition-timing-function> value from
|
||||
* aEasing into a ComputedTimingFunction. If parsing fails, Nothing() will
|
||||
* be returned.
|
||||
*/
|
||||
static Maybe<ComputedTimingFunction>
|
||||
ParseEasing(const nsAString& aEasing, nsIDocument* aDocument);
|
||||
|
||||
/**
|
||||
* Get the document from the JS context to use when parsing CSS properties.
|
||||
*/
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
|
||||
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
|
||||
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
|
||||
#include <algorithm> // For std::max
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -245,14 +244,17 @@ KeyframeEffectReadOnly::GetComputedTimingAt(
|
||||
result.mDuration = aTiming.mDuration.ref();
|
||||
}
|
||||
|
||||
result.mIterations = IsNaN(aTiming.mIterations) || aTiming.mIterations < 0.0f ?
|
||||
1.0f :
|
||||
aTiming.mIterations;
|
||||
result.mIterationStart = std::max(aTiming.mIterationStart, 0.0);
|
||||
MOZ_ASSERT(aTiming.mIterations >= 0.0 && !IsNaN(aTiming.mIterations),
|
||||
"mIterations should be nonnegative & finite, as ensured by "
|
||||
"ValidateIterations or CSSParser");
|
||||
result.mIterations = aTiming.mIterations;
|
||||
MOZ_ASSERT(aTiming.mIterationStart >= 0.0,
|
||||
"mIterationStart should be nonnegative, as ensured by "
|
||||
"ValidateIterationStart");
|
||||
result.mIterationStart = aTiming.mIterationStart;
|
||||
|
||||
result.mActiveDuration = ActiveDuration(result.mDuration, result.mIterations);
|
||||
result.mEndTime = aTiming.mDelay + result.mActiveDuration +
|
||||
aTiming.mEndDelay;
|
||||
result.mActiveDuration = aTiming.ActiveDuration();
|
||||
result.mEndTime = aTiming.EndTime();
|
||||
result.mFill = aTiming.mFill == dom::FillMode::Auto ?
|
||||
dom::FillMode::None :
|
||||
aTiming.mFill;
|
||||
@ -403,23 +405,6 @@ KeyframeEffectReadOnly::GetComputedTimingAt(
|
||||
return result;
|
||||
}
|
||||
|
||||
StickyTimeDuration
|
||||
KeyframeEffectReadOnly::ActiveDuration(
|
||||
const StickyTimeDuration& aIterationDuration,
|
||||
double aIterationCount)
|
||||
{
|
||||
// If either the iteration duration or iteration count is zero,
|
||||
// Web Animations says that the active duration is zero. This is to
|
||||
// ensure that the result is defined when the other argument is Infinity.
|
||||
const StickyTimeDuration zeroDuration;
|
||||
if (aIterationDuration == zeroDuration ||
|
||||
aIterationCount == 0.0) {
|
||||
return zeroDuration;
|
||||
}
|
||||
|
||||
return aIterationDuration.MultDouble(aIterationCount);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/web-animations/#in-play
|
||||
bool
|
||||
KeyframeEffectReadOnly::IsInPlay() const
|
||||
|
@ -274,12 +274,6 @@ public:
|
||||
void
|
||||
GetComputedTimingAsDict(ComputedTimingProperties& aRetVal) const override;
|
||||
|
||||
// Return the duration of the active interval for the given duration and
|
||||
// iteration count.
|
||||
static StickyTimeDuration
|
||||
ActiveDuration(const StickyTimeDuration& aIterationDuration,
|
||||
double aIterationCount);
|
||||
|
||||
bool IsInPlay() const;
|
||||
bool IsCurrent() const;
|
||||
bool IsInEffect() const;
|
||||
|
@ -161,6 +161,24 @@ TimingParams::ParseEasing(const nsAString& aEasing,
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected animation-timing-function unit");
|
||||
break;
|
||||
}
|
||||
|
||||
// Bug 1247004
|
||||
//
|
||||
// The Web Animations polyfill had a bug that translated 'linear' into
|
||||
// the string 'function (a){return a}'. This bug has been fixed but older
|
||||
// versions of the polyfill are still widely used. Google are collecting
|
||||
// usage data on this but for now we need to *not* throw on
|
||||
// 'function (a){return a}' or else a lot of sites will break.
|
||||
//
|
||||
// Instead, we should treat this string as equivalent to 'linear' and
|
||||
// return Nothing().
|
||||
//
|
||||
// Chromium has a similar special case path for this string.
|
||||
// See: https://bugs.chromium.org/p/chromium/issues/detail?id=601672
|
||||
if (aEasing == NS_LITERAL_STRING("function (a){return a}")) {
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
aRv.ThrowTypeError<dom::MSG_INVALID_EASING_ERROR>(aEasing);
|
||||
return Nothing();
|
||||
}
|
||||
|
@ -97,6 +97,26 @@ struct TimingParams
|
||||
dom::FillMode mFill = dom::FillMode::Auto;
|
||||
Maybe<ComputedTimingFunction> mFunction;
|
||||
|
||||
// Return the duration of the active interval calculated by duration and
|
||||
// iteration count.
|
||||
StickyTimeDuration ActiveDuration() const
|
||||
{
|
||||
// If either the iteration duration or iteration count is zero,
|
||||
// Web Animations says that the active duration is zero. This is to
|
||||
// ensure that the result is defined when the other argument is Infinity.
|
||||
static const StickyTimeDuration zeroDuration;
|
||||
if (!mDuration || *mDuration == zeroDuration || mIterations == 0.0) {
|
||||
return zeroDuration;
|
||||
}
|
||||
|
||||
return mDuration->MultDouble(mIterations);
|
||||
}
|
||||
|
||||
StickyTimeDuration EndTime() const
|
||||
{
|
||||
return mDelay + ActiveDuration() + mEndDelay;
|
||||
}
|
||||
|
||||
bool operator==(const TimingParams& aOther) const;
|
||||
bool operator!=(const TimingParams& aOther) const
|
||||
{
|
||||
|
@ -1669,6 +1669,29 @@ addAsyncAnimTest("change_delay",
|
||||
"records after animation end");
|
||||
});
|
||||
|
||||
addAsyncAnimTest("change_easing",
|
||||
{ observe: div, subtree: true }, function*() {
|
||||
var anim = div.animate({ opacity: [ 0, 1 ] },
|
||||
{ duration: 100 * MS_PER_SEC,
|
||||
easing: "steps(2, start)" });
|
||||
|
||||
yield await_frame();
|
||||
assert_records([{ added: [anim], changed: [], removed: [] }],
|
||||
"records after animation is added");
|
||||
|
||||
anim.effect.timing.easing = "steps(2, end)";
|
||||
yield await_frame();
|
||||
assert_records([{ added: [], changed: [anim], removed: [] }],
|
||||
"records after easing is changed");
|
||||
|
||||
anim.effect.timing.easing = "steps(2, end)";
|
||||
yield await_frame();
|
||||
assert_records([], "records after assigning same value");
|
||||
|
||||
anim.cancel();
|
||||
yield await_frame();
|
||||
});
|
||||
|
||||
addAsyncAnimTest("negative_delay_in_constructor",
|
||||
{ observe: div, subtree: true }, function*() {
|
||||
var anim = div.animate({ opacity: [ 0, 1 ] },
|
||||
|
@ -2305,6 +2305,19 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(int64_t aMilliseconds)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetLastTransactionId(uint64_t *aLastTransactionId)
|
||||
{
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (!presContext) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsRefreshDriver* driver = presContext->GetRootPresContext()->RefreshDriver();
|
||||
*aLastTransactionId = driver->LastTransactionId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::RestoreNormalRefresh()
|
||||
{
|
||||
|
@ -6434,13 +6434,23 @@ nsGlobalWindow::CanMoveResizeWindows(bool aCallerIsChrome)
|
||||
}
|
||||
|
||||
// Ignore the request if we have more than one tab in the window.
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
|
||||
if (treeOwner) {
|
||||
uint32_t itemCount;
|
||||
if (NS_SUCCEEDED(treeOwner->GetTargetableShellCount(&itemCount)) &&
|
||||
itemCount > 1) {
|
||||
return false;
|
||||
uint32_t itemCount = 0;
|
||||
if (XRE_IsContentProcess()) {
|
||||
nsCOMPtr<nsIDocShell> docShell = GetDocShell();
|
||||
if (docShell) {
|
||||
nsCOMPtr<nsITabChild> child = docShell->GetTabChild();
|
||||
if (child) {
|
||||
child->SendGetTabCount(&itemCount);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
|
||||
if (treeOwner) {
|
||||
treeOwner->GetTargetableShellCount(&itemCount);
|
||||
}
|
||||
}
|
||||
if (itemCount > 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -751,7 +751,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android'
|
||||
[test_copyimage.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
|
||||
[test_copypaste.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
|
||||
[test_copypaste.xhtml]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(bug 904183) b2g-debug(bug 904183) b2g-desktop(bug 904183)
|
||||
[test_createHTMLDocument.html]
|
||||
|
@ -88,6 +88,12 @@ DOMInterfaces = {
|
||||
'concrete': False
|
||||
},
|
||||
|
||||
'AnimationEffectTiming': {
|
||||
'implicitJSContext': {
|
||||
'setterOnly': [ 'easing' ]
|
||||
}
|
||||
},
|
||||
|
||||
'AnimationTimeline': {
|
||||
'concrete': False
|
||||
},
|
||||
|
1
dom/cache/test/mochitest/mochitest.ini
vendored
1
dom/cache/test/mochitest/mochitest.ini
vendored
@ -32,7 +32,6 @@ support-files =
|
||||
[test_cache_overwrite.html]
|
||||
[test_cache_match_vary.html]
|
||||
[test_caches.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_cache_keys.html]
|
||||
[test_cache_put.html]
|
||||
[test_cache_requestCache.html]
|
||||
|
@ -1,5 +1,4 @@
|
||||
[DEFAULT]
|
||||
skip-if = e10s && debug && os == 'mac' # Bug 1252348
|
||||
support-files =
|
||||
image-allow-credentials.png
|
||||
image-allow-credentials.png^headers^
|
||||
|
@ -19,7 +19,8 @@ NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
EventMessage aEventMessage,
|
||||
nsInvalidateRequestList* aInvalidateRequests)
|
||||
nsInvalidateRequestList* aInvalidateRequests,
|
||||
uint64_t aTransactionId)
|
||||
: Event(aOwner, aPresContext, aEvent)
|
||||
{
|
||||
if (mEvent) {
|
||||
@ -28,6 +29,8 @@ NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
|
||||
if (aInvalidateRequests) {
|
||||
mInvalidateRequests.AppendElements(Move(aInvalidateRequests->mRequests));
|
||||
}
|
||||
|
||||
mTransactionId = aTransactionId;
|
||||
}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(NotifyPaintEvent)
|
||||
@ -154,6 +157,19 @@ NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NotifyPaintEvent::GetTransactionId(uint64_t* aTransactionId)
|
||||
{
|
||||
*aTransactionId = mTransactionId;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
NotifyPaintEvent::TransactionId()
|
||||
{
|
||||
return mTransactionId;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@ -165,10 +181,11 @@ NS_NewDOMNotifyPaintEvent(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
EventMessage aEventMessage,
|
||||
nsInvalidateRequestList* aInvalidateRequests)
|
||||
nsInvalidateRequestList* aInvalidateRequests,
|
||||
uint64_t aTransactionId)
|
||||
{
|
||||
RefPtr<NotifyPaintEvent> it =
|
||||
new NotifyPaintEvent(aOwner, aPresContext, aEvent, aEventMessage,
|
||||
aInvalidateRequests);
|
||||
aInvalidateRequests, aTransactionId);
|
||||
return it.forget();
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ public:
|
||||
nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
EventMessage aEventMessage,
|
||||
nsInvalidateRequestList* aInvalidateRequests);
|
||||
nsInvalidateRequestList* aInvalidateRequests,
|
||||
uint64_t aTransactionId);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
@ -55,6 +56,8 @@ public:
|
||||
|
||||
already_AddRefed<PaintRequestList> PaintRequests();
|
||||
|
||||
uint64_t TransactionId();
|
||||
|
||||
protected:
|
||||
~NotifyPaintEvent() {}
|
||||
|
||||
@ -62,6 +65,7 @@ private:
|
||||
nsRegion GetRegion();
|
||||
|
||||
nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
|
||||
uint64_t mTransactionId;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
@ -75,6 +79,7 @@ NS_NewDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
|
||||
mozilla::EventMessage aEventMessage =
|
||||
mozilla::eVoidEvent,
|
||||
nsInvalidateRequestList* aInvalidateRequests =
|
||||
nullptr);
|
||||
nullptr,
|
||||
uint64_t aTransactionId = 0);
|
||||
|
||||
#endif // mozilla_dom_NotifyPaintEvent_h_
|
||||
|
@ -596,7 +596,7 @@ support-files = file_bug871161-1.html file_bug871161-2.html
|
||||
[test_hash_encoded.html]
|
||||
[test_bug1081037.html]
|
||||
[test_window_open_close.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # bug 1129014
|
||||
skip-if = buildapp == 'b2g' # bug 1129014
|
||||
[test_img_complete.html]
|
||||
[test_viewport_resize.html]
|
||||
[test_image_clone_load.html]
|
||||
|
@ -106,6 +106,11 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
*/
|
||||
void updateLayerTree();
|
||||
|
||||
/**
|
||||
* Get the last used layer transaction id for this window's refresh driver.
|
||||
*/
|
||||
readonly attribute unsigned long long lastTransactionId;
|
||||
|
||||
/**
|
||||
* Information retrieved from the <meta name="viewport"> tag.
|
||||
* See nsContentUtils::GetViewportInfo for more information.
|
||||
|
@ -19,6 +19,8 @@ interface nsITabChild : nsISupports
|
||||
|
||||
[notxpcom] void sendRequestFocus(in boolean canFocus);
|
||||
|
||||
[notxpcom] void sendGetTabCount(out uint32_t tabCount);
|
||||
|
||||
[noscript, notxpcom] void enableDisableCommands(in AString action,
|
||||
in CommandsArrayRef enabledCommands,
|
||||
in CommandsArrayRef disabledCommands);
|
||||
|
@ -35,5 +35,7 @@ interface nsIDOMNotifyPaintEvent : nsISupports
|
||||
readonly attribute nsIDOMClientRect boundingClientRect;
|
||||
|
||||
readonly attribute nsISupports /* PaintRequestList */ paintRequests;
|
||||
|
||||
readonly attribute unsigned long long transactionId;
|
||||
};
|
||||
|
||||
|
@ -374,7 +374,7 @@ parent:
|
||||
* Show/hide a tooltip when the mouse hovers over an element in the content
|
||||
* document.
|
||||
*/
|
||||
async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip);
|
||||
async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip, nsString direction);
|
||||
async HideTooltip();
|
||||
|
||||
/**
|
||||
@ -470,6 +470,8 @@ parent:
|
||||
bool aLongTap,
|
||||
uint64_t aObserverId);
|
||||
async ClearNativeTouchSequence(uint64_t aObserverId);
|
||||
|
||||
sync GetTabCount() returns (uint32_t value);
|
||||
child:
|
||||
async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
|
||||
|
||||
|
@ -2727,6 +2727,12 @@ TabChild::SendRequestFocus(bool aCanFocus)
|
||||
PBrowserChild::SendRequestFocus(aCanFocus);
|
||||
}
|
||||
|
||||
void
|
||||
TabChild::SendGetTabCount(uint32_t* tabCount)
|
||||
{
|
||||
PBrowserChild::SendGetTabCount(tabCount);
|
||||
}
|
||||
|
||||
void
|
||||
TabChild::EnableDisableCommands(const nsAString& aAction,
|
||||
nsTArray<nsCString>& aEnabledCommands,
|
||||
@ -2894,10 +2900,12 @@ TabChild::CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TabChild::OnShowTooltip(int32_t aXCoords, int32_t aYCoords, const char16_t *aTipText)
|
||||
TabChild::OnShowTooltip(int32_t aXCoords, int32_t aYCoords, const char16_t *aTipText,
|
||||
const char16_t *aTipDir)
|
||||
{
|
||||
nsString str(aTipText);
|
||||
SendShowTooltip(aXCoords, aYCoords, str);
|
||||
nsString dir(aTipDir);
|
||||
SendShowTooltip(aXCoords, aYCoords, str, dir);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1747,14 +1747,15 @@ TabParent::RecvSetStatus(const uint32_t& aType, const nsString& aStatus)
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip)
|
||||
TabParent::RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip,
|
||||
const nsString& aDirection)
|
||||
{
|
||||
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow = GetXULBrowserWindow();
|
||||
if (!xulBrowserWindow) {
|
||||
return true;
|
||||
}
|
||||
|
||||
xulBrowserWindow->ShowTooltip(aX, aY, aTooltip);
|
||||
xulBrowserWindow->ShowTooltip(aX, aY, aTooltip, aDirection);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3243,6 +3244,20 @@ TabParent::AudioChannelChangeNotification(nsPIDOMWindowOuter* aWindow,
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvGetTabCount(uint32_t* aValue)
|
||||
{
|
||||
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow = GetXULBrowserWindow();
|
||||
NS_ENSURE_TRUE(xulBrowserWindow, false);
|
||||
|
||||
uint32_t tabCount;
|
||||
nsresult rv = xulBrowserWindow->GetTabCount(&tabCount);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
*aValue = tabCount;
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FakeChannel::OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo)
|
||||
{
|
||||
|
@ -281,7 +281,8 @@ public:
|
||||
|
||||
virtual bool RecvShowTooltip(const uint32_t& aX,
|
||||
const uint32_t& aY,
|
||||
const nsString& aTooltip) override;
|
||||
const nsString& aTooltip,
|
||||
const nsString& aDirection) override;
|
||||
|
||||
virtual bool RecvHideTooltip() override;
|
||||
|
||||
@ -581,6 +582,8 @@ protected:
|
||||
const int32_t& aX, const int32_t& aY,
|
||||
const int32_t& aCx, const int32_t& aCy) override;
|
||||
|
||||
virtual bool RecvGetTabCount(uint32_t* aValue) override;
|
||||
|
||||
virtual bool RecvAudioChannelActivityNotification(const uint32_t& aAudioChannel,
|
||||
const bool& aActive) override;
|
||||
|
||||
|
@ -23,6 +23,7 @@ learn_more_label=Learn More
|
||||
|
||||
# GMP Plugins
|
||||
gmp_license_info=License information
|
||||
gmp_privacy_info=Privacy Information
|
||||
|
||||
openH264_name=OpenH264 Video Codec provided by Cisco Systems, Inc.
|
||||
openH264_description2=This plugin is automatically installed by Mozilla to comply with the WebRTC specification and to enable WebRTC calls with devices that require the H.264 video codec. Visit http://www.openh264.org/ to view the codec source code and learn more about the implementation.
|
||||
@ -30,5 +31,4 @@ openH264_description2=This plugin is automatically installed by Mozilla to compl
|
||||
eme-adobe_name=Primetime Content Decryption Module provided by Adobe Systems, Incorporated
|
||||
eme-adobe_description=Play back protected web video.
|
||||
|
||||
widevine_name=WidevineCdm
|
||||
widevine_description=Widevine Content Decryption Module provided by Google Inc.
|
||||
|
@ -1411,7 +1411,6 @@ DOMHwMediaStream::Init(MediaStream* stream, OverlayImage* aImage)
|
||||
#endif
|
||||
srcStream->AddTrack(TRACK_VIDEO_PRIMARY, 0, new VideoSegment());
|
||||
srcStream->AppendToTrack(TRACK_VIDEO_PRIMARY, &segment);
|
||||
srcStream->FinishAddTracks();
|
||||
srcStream->AdvanceKnownTracksTime(STREAM_TIME_MAX);
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ inline PrincipalHandle MakePrincipalHandle(nsIPrincipal* aPrincipal)
|
||||
return PrincipalHandle(holder);
|
||||
}
|
||||
|
||||
const PrincipalHandle PRINCIPAL_HANDLE_NONE(nullptr);
|
||||
#define PRINCIPAL_HANDLE_NONE nullptr
|
||||
|
||||
inline nsIPrincipal* GetPrincipalFromHandle(PrincipalHandle& aPrincipalHandle)
|
||||
{
|
||||
|
@ -305,9 +305,12 @@ AndroidDecoderModule::CreateAudioDecoder(
|
||||
|
||||
MediaFormat::LocalRef format;
|
||||
|
||||
LOG("CreateAudioFormat with mimeType=%s, mRate=%d, channels=%d",
|
||||
aConfig.mMimeType.Data(), aConfig.mRate, aConfig.mChannels);
|
||||
|
||||
NS_ENSURE_SUCCESS(MediaFormat::CreateAudioFormat(
|
||||
aConfig.mMimeType,
|
||||
aConfig.mBitDepth,
|
||||
aConfig.mRate,
|
||||
aConfig.mChannels,
|
||||
&format), nullptr);
|
||||
|
||||
|
@ -843,11 +843,8 @@ skip-if = toolkit == 'gonk' # bug 1128845 on gonk
|
||||
[test_VideoPlaybackQuality.html]
|
||||
[test_VideoPlaybackQuality_disabled.html]
|
||||
[test_volume.html]
|
||||
skip-if = e10s && debug && os == 'win' # bug 1245574
|
||||
[test_vttparser.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_webvtt_disabled.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
|
||||
# The tests below contain backend-specific tests. Write backend independent
|
||||
# tests rather than adding to this list.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[DEFAULT]
|
||||
tags=msg
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1191270, bug 1037287, bug 967606, bug 1096400, bug 1238542 etc
|
||||
skip-if = buildapp == 'b2g' # Bug 1191270, bug 1037287, bug 967606, bug 1096400 etc
|
||||
subsuite = media
|
||||
support-files =
|
||||
head.js
|
||||
@ -20,4 +20,3 @@ skip-if = buildapp == 'mulet' || toolkit == 'android'
|
||||
[test_recognition_service_error.html]
|
||||
[test_success_without_recognition_service.html]
|
||||
[test_timeout.html]
|
||||
skip-if = os == "win"
|
||||
|
@ -96,21 +96,29 @@ AddSandboxAllowedFiles(int32_t aSandboxLevel,
|
||||
}
|
||||
|
||||
// Level 2 and above is now using low integrity, so we need to give write
|
||||
// access to the Flash directories. Access also has to be given to create
|
||||
// the parent directories as they may not exist.
|
||||
// access to the Flash directories.
|
||||
// This should be made Flash specific (Bug 1171396).
|
||||
AddSandboxAllowedFile(aAllowedFilesReadWrite, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia\\Flash Player\\*"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia\\Flash Player"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia"));
|
||||
AddSandboxAllowedFile(aAllowedFilesReadWrite, dirSvc, NS_WIN_LOCAL_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia\\Flash Player\\*"));
|
||||
AddSandboxAllowedFile(aAllowedFilesReadWrite, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Adobe\\Flash Player\\*"));
|
||||
|
||||
// Access also has to be given to create the parent directories as they may
|
||||
// not exist.
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Adobe\\Flash Player"));
|
||||
NS_LITERAL_STRING("\\Macromedia"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia\\Flash Player"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_LOCAL_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_LOCAL_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Macromedia\\Flash Player"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Adobe"));
|
||||
AddSandboxAllowedFile(aAllowedDirectories, dirSvc, NS_WIN_APPDATA_DIR,
|
||||
NS_LITERAL_STRING("\\Adobe\\Flash Player"));
|
||||
|
||||
// Write access to the Temp directory is needed in some mochitest crash
|
||||
// tests.
|
||||
|
@ -33,38 +33,31 @@ support-files =
|
||||
[test_headers_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_headers_mainthread.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_fetch_app_protocol.html]
|
||||
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
|
||||
[test_fetch_basic.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_fetch_basic_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_fetch_basic_sw_empty_reroute.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_fetch_basic_http.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_fetch_basic_http_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_fetch_basic_http_sw_empty_reroute.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_fetch_cors.html]
|
||||
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) || (e10s && debug && os == 'win') # Bug 1210552 && 1210282
|
||||
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) # Bug 1210552 && 1210282
|
||||
[test_fetch_cors_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) || (e10s && debug && os == 'win') # Bug 1137683 && 1210282
|
||||
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) # Bug 1137683 && 1210282
|
||||
[test_fetch_cors_sw_empty_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) # Bug 1210282
|
||||
[test_formdataparsing.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_formdataparsing_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_request.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_request_context.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_request_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_response.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_response_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
|
@ -13,4 +13,6 @@ interface NotifyPaintEvent : Event
|
||||
readonly attribute DOMRect boundingClientRect;
|
||||
|
||||
readonly attribute PaintRequestList paintRequests;
|
||||
|
||||
readonly attribute unsigned long long transactionId;
|
||||
};
|
||||
|
@ -29,7 +29,7 @@ namespace mozilla {
|
||||
static StaticRefPtr<WifiProxyService> gWifiProxyService;
|
||||
|
||||
// The singleton supplicant class, that can be used on any thread.
|
||||
static nsAutoPtr<WpaSupplicant> gWpaSupplicant;
|
||||
static UniquePtr<WpaSupplicant> gWpaSupplicant;
|
||||
|
||||
// Runnable used dispatch the WaitForEvent result on the main thread.
|
||||
class WifiEventDispatcher : public nsRunnable
|
||||
@ -160,7 +160,7 @@ WifiProxyService::FactoryCreate()
|
||||
gWifiProxyService = new WifiProxyService();
|
||||
ClearOnShutdown(&gWifiProxyService);
|
||||
|
||||
gWpaSupplicant = new WpaSupplicant();
|
||||
gWpaSupplicant = MakeUnique<WpaSupplicant>();
|
||||
ClearOnShutdown(&gWpaSupplicant);
|
||||
}
|
||||
|
||||
|
@ -387,13 +387,13 @@ WpaSupplicant::WpaSupplicant()
|
||||
mSdkVersion = strtol(propVersion, nullptr, 10);
|
||||
|
||||
if (mSdkVersion < 16) {
|
||||
mImpl = new ICSWpaSupplicantImpl();
|
||||
mImpl = MakeUnique<ICSWpaSupplicantImpl>();
|
||||
} else if (mSdkVersion < 19) {
|
||||
mImpl = new JBWpaSupplicantImpl();
|
||||
mImpl = MakeUnique<JBWpaSupplicantImpl>();
|
||||
} else {
|
||||
mImpl = new KKWpaSupplicantImpl();
|
||||
mImpl = MakeUnique<KKWpaSupplicantImpl>();
|
||||
}
|
||||
mWifiHotspotUtils = new WifiHotspotUtils();
|
||||
mWifiHotspotUtils = MakeUnique<WifiHotspotUtils>();
|
||||
};
|
||||
|
||||
void WpaSupplicant::WaitForEvent(nsAString& aEvent, const nsCString& aInterface)
|
||||
|
@ -13,8 +13,8 @@
|
||||
#define WifiUtils_h
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/dom/WifiOptionsBinding.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "WifiHotspotUtils.h"
|
||||
|
||||
// Needed to add a copy constructor to WifiCommandOptions.
|
||||
@ -51,7 +51,7 @@ public:
|
||||
class WpaSupplicantImpl
|
||||
{
|
||||
public:
|
||||
// Suppress warning from nsAutoPtr
|
||||
// Suppress warning from |UniquePtr|
|
||||
virtual ~WpaSupplicantImpl() {}
|
||||
|
||||
virtual int32_t
|
||||
@ -94,8 +94,8 @@ public:
|
||||
const nsCString& aInterface);
|
||||
|
||||
private:
|
||||
nsAutoPtr<WpaSupplicantImpl> mImpl;
|
||||
nsAutoPtr<WifiHotspotUtils> mWifiHotspotUtils;
|
||||
UniquePtr<WpaSupplicantImpl> mImpl;
|
||||
UniquePtr<WifiHotspotUtils> mWifiHotspotUtils;
|
||||
|
||||
uint32_t mSdkVersion;
|
||||
|
||||
|
@ -243,15 +243,15 @@ skip-if = (toolkit == 'gonk' && debug) # Bug 1176223
|
||||
[test_urlApi.html]
|
||||
[test_urlSearchParams.html]
|
||||
[test_websocket1.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || (e10s && debug && os == 'win') #bug 982828, bug 1237470
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket2.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || (e10s && debug && os == 'win') #bug 982828, bug 1237470
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket3.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || (e10s && debug && os == 'win') #bug 982828, bug 1237470
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket4.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || (e10s && debug && os == 'win') #bug 982828, bug 1237470
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket5.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || (e10s && debug && os == 'win') #bug 982828, bug 1237470
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket_basic.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 982828
|
||||
[test_websocket_https.html]
|
||||
|
@ -11,5 +11,7 @@
|
||||
|
||||
#define NS_TOOLTIPTEXTPROVIDER_CONTRACTID \
|
||||
"@mozilla.org/embedcomp/tooltiptextprovider;1"
|
||||
#define NS_DEFAULTTOOLTIPTEXTPROVIDER_CONTRACTID \
|
||||
"@mozilla.org/embedcomp/default-tooltiptextprovider;1"
|
||||
|
||||
#endif
|
||||
|
@ -1064,198 +1064,6 @@ nsDocShellTreeOwner::GetOwnerRequestor()
|
||||
return req.forget();
|
||||
}
|
||||
|
||||
class DefaultTooltipTextProvider final : public nsITooltipTextProvider
|
||||
{
|
||||
public:
|
||||
DefaultTooltipTextProvider();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSITOOLTIPTEXTPROVIDER
|
||||
|
||||
protected:
|
||||
~DefaultTooltipTextProvider() {}
|
||||
|
||||
nsCOMPtr<nsIAtom> mTag_dialogHeader;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(DefaultTooltipTextProvider, nsITooltipTextProvider)
|
||||
|
||||
DefaultTooltipTextProvider::DefaultTooltipTextProvider()
|
||||
{
|
||||
// There are certain element types which we don't want to use
|
||||
// as tool tip text.
|
||||
mTag_dialogHeader = NS_Atomize("dialogheader");
|
||||
}
|
||||
|
||||
// A helper routine that determines whether we're still interested in SVG
|
||||
// titles. We need to stop at the SVG root element that has a document node
|
||||
// parent.
|
||||
static bool
|
||||
UseSVGTitle(nsIDOMElement* aCurrElement)
|
||||
{
|
||||
nsCOMPtr<dom::Element> element(do_QueryInterface(aCurrElement));
|
||||
if (!element || !element->IsSVGElement() || !element->GetParentNode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return element->GetParentNode()->NodeType() != nsIDOMNode::DOCUMENT_NODE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DefaultTooltipTextProvider::GetNodeText(nsIDOMNode* aNode, char16_t** aText,
|
||||
bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNode);
|
||||
NS_ENSURE_ARG_POINTER(aText);
|
||||
|
||||
nsString outText;
|
||||
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
|
||||
|
||||
bool lookingForSVGTitle = true;
|
||||
bool found = false;
|
||||
nsCOMPtr<nsIDOMNode> current(aNode);
|
||||
|
||||
// If the element implement the constraint validation API and has no title,
|
||||
// show the validation message, if any.
|
||||
nsCOMPtr<nsIConstraintValidation> cvElement = do_QueryInterface(current);
|
||||
if (cvElement) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(cvElement);
|
||||
nsCOMPtr<nsIAtom> titleAtom = NS_Atomize("title");
|
||||
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(content);
|
||||
bool formHasNoValidate = false;
|
||||
mozilla::dom::Element* form = formControl->GetFormElement();
|
||||
if (form) {
|
||||
nsCOMPtr<nsIAtom> noValidateAtom = NS_Atomize("novalidate");
|
||||
formHasNoValidate = form->HasAttr(kNameSpaceID_None, noValidateAtom);
|
||||
}
|
||||
|
||||
if (!content->HasAttr(kNameSpaceID_None, titleAtom) && !formHasNoValidate) {
|
||||
cvElement->GetValidationMessage(outText);
|
||||
found = !outText.IsEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
while (!found && current) {
|
||||
nsCOMPtr<nsIDOMElement> currElement(do_QueryInterface(current));
|
||||
if (currElement) {
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(currElement));
|
||||
if (content) {
|
||||
if (!content->IsAnyOfXULElements(nsGkAtoms::dialog,
|
||||
mTag_dialogHeader,
|
||||
nsGkAtoms::window)) {
|
||||
// first try the normal title attribute...
|
||||
if (!content->IsSVGElement()) {
|
||||
// If the element is an <input type="file"> without a title,
|
||||
// we should show the current file selection.
|
||||
if (content->IsHTMLElement(nsGkAtoms::input) &&
|
||||
content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
||||
NS_LITERAL_STRING("file"), eIgnoreCase) &&
|
||||
!content->HasAttr(kNameSpaceID_None, nsGkAtoms::title)) {
|
||||
found = true;
|
||||
nsCOMPtr<nsIDOMFileList> fileList;
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> currInputElement(do_QueryInterface(currElement));
|
||||
nsresult rv = currInputElement->GetFiles(getter_AddRefs(fileList));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!fileList) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> bundleService =
|
||||
mozilla::services::GetStringBundleService();
|
||||
if (!bundleService) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIStringBundle> bundle;
|
||||
rv = bundleService->CreateBundle("chrome://global/locale/layout/HtmlForm.properties",
|
||||
getter_AddRefs(bundle));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
uint32_t listLength = 0;
|
||||
rv = fileList->GetLength(&listLength);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (listLength == 0) {
|
||||
if (content->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple)) {
|
||||
rv = bundle->GetStringFromName(MOZ_UTF16("NoFilesSelected"),
|
||||
getter_Copies(outText));
|
||||
} else {
|
||||
rv = bundle->GetStringFromName(MOZ_UTF16("NoFileSelected"),
|
||||
getter_Copies(outText));
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
} else {
|
||||
FileList* fl = static_cast<FileList*>(fileList.get());
|
||||
fl->Item(0)->GetName(outText);
|
||||
|
||||
// For UX and performance (jank) reasons we cap the number of
|
||||
// files that we list in the tooltip to 20 plus a "and xxx more"
|
||||
// line, or to 21 if exactly 21 files were picked.
|
||||
const uint32_t TRUNCATED_FILE_COUNT = 20;
|
||||
uint32_t count = std::min(listLength, TRUNCATED_FILE_COUNT);
|
||||
for (uint32_t i = 1; i < count; ++i) {
|
||||
nsString fileName;
|
||||
fl->Item(i)->GetName(fileName);
|
||||
outText.Append(NS_LITERAL_STRING("\n"));
|
||||
outText.Append(fileName);
|
||||
}
|
||||
}
|
||||
} else if (NS_SUCCEEDED(currElement->GetAttribute(NS_LITERAL_STRING("title"), outText)) &&
|
||||
outText.Length()) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
// ...ok, that didn't work, try it in the XLink namespace
|
||||
NS_NAMED_LITERAL_STRING(xlinkNS, "http://www.w3.org/1999/xlink");
|
||||
nsCOMPtr<mozilla::dom::Link> linkContent(
|
||||
do_QueryInterface(currElement));
|
||||
if (linkContent) {
|
||||
nsCOMPtr<nsIURI> uri(linkContent->GetURIExternal());
|
||||
if (uri) {
|
||||
currElement->GetAttributeNS(
|
||||
xlinkNS, NS_LITERAL_STRING("title"), outText);
|
||||
if (outText.Length()) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (lookingForSVGTitle) {
|
||||
lookingForSVGTitle = UseSVGTitle(currElement);
|
||||
}
|
||||
if (lookingForSVGTitle) {
|
||||
nsINodeList* childNodes = content->ChildNodes();
|
||||
uint32_t childNodeCount = childNodes->Length();
|
||||
for (uint32_t i = 0; i < childNodeCount; i++) {
|
||||
nsIContent* child = childNodes->Item(i);
|
||||
if (child->IsSVGElement(nsGkAtoms::title)) {
|
||||
static_cast<dom::SVGTitleElement*>(child)->GetTextContent(outText);
|
||||
if (outText.Length()) {
|
||||
found = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// not found here, walk up to the parent and keep trying
|
||||
if (!found) {
|
||||
nsCOMPtr<nsIDOMNode> temp(current);
|
||||
temp->GetParentNode(getter_AddRefs(current));
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = found;
|
||||
*aText = (found) ? ToNewUnicode(outText) : nullptr;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ChromeTooltipListener, nsIDOMEventListener)
|
||||
|
||||
ChromeTooltipListener::ChromeTooltipListener(nsWebBrowser* aInBrowser,
|
||||
@ -1270,7 +1078,7 @@ ChromeTooltipListener::ChromeTooltipListener(nsWebBrowser* aInBrowser,
|
||||
{
|
||||
mTooltipTextProvider = do_GetService(NS_TOOLTIPTEXTPROVIDER_CONTRACTID);
|
||||
if (!mTooltipTextProvider) {
|
||||
mTooltipTextProvider = new DefaultTooltipTextProvider();
|
||||
mTooltipTextProvider = do_GetService(NS_DEFAULTTOOLTIPTEXTPROVIDER_CONTRACTID);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1460,7 +1268,8 @@ ChromeTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
||||
// Tell the registered chrome that they should show the tooltip.
|
||||
NS_IMETHODIMP
|
||||
ChromeTooltipListener::ShowTooltip(int32_t aInXCoords, int32_t aInYCoords,
|
||||
const nsAString& aInTipText)
|
||||
const nsAString& aInTipText,
|
||||
const nsAString& aTipDir)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@ -1469,7 +1278,8 @@ ChromeTooltipListener::ShowTooltip(int32_t aInXCoords, int32_t aInYCoords,
|
||||
do_QueryInterface(mWebBrowserChrome));
|
||||
if (tooltipListener) {
|
||||
rv = tooltipListener->OnShowTooltip(aInXCoords, aInYCoords,
|
||||
PromiseFlatString(aInTipText).get());
|
||||
PromiseFlatString(aInTipText).get(),
|
||||
PromiseFlatString(aTipDir).get());
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mShowingTooltip = true;
|
||||
}
|
||||
@ -1558,14 +1368,17 @@ ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
|
||||
// off a timer to auto-hide it.
|
||||
|
||||
nsXPIDLString tooltipText;
|
||||
nsXPIDLString directionText;
|
||||
if (self->mTooltipTextProvider) {
|
||||
bool textFound = false;
|
||||
|
||||
self->mTooltipTextProvider->GetNodeText(
|
||||
self->mPossibleTooltipNode, getter_Copies(tooltipText), &textFound);
|
||||
self->mPossibleTooltipNode, getter_Copies(tooltipText),
|
||||
getter_Copies(directionText), &textFound);
|
||||
|
||||
if (textFound) {
|
||||
nsString tipText(tooltipText);
|
||||
nsString dirText(directionText);
|
||||
LayoutDeviceIntPoint screenDot = widget->WidgetToScreenOffset();
|
||||
double scaleFactor = 1.0;
|
||||
if (shell->GetPresContext()) {
|
||||
@ -1576,7 +1389,7 @@ ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
|
||||
// ShowTooltip expects widget-relative position.
|
||||
self->ShowTooltip(self->mMouseScreenX - screenDot.x / scaleFactor,
|
||||
self->mMouseScreenY - screenDot.y / scaleFactor,
|
||||
tipText);
|
||||
tipText, dirText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,8 @@ private:
|
||||
NS_IMETHOD RemoveTooltipListener();
|
||||
|
||||
NS_IMETHOD ShowTooltip(int32_t aInXCoords, int32_t aInYCoords,
|
||||
const nsAString& aInTipText);
|
||||
const nsAString& aInTipText,
|
||||
const nsAString& aDirText);
|
||||
NS_IMETHOD HideTooltip();
|
||||
|
||||
nsWebBrowser* mWebBrowser;
|
||||
|
@ -25,6 +25,7 @@ interface nsITooltipListener : nsISupports
|
||||
* @param aTipText The text to display in the tooltip, typically obtained
|
||||
* from the TITLE attribute of the node (or containing parent)
|
||||
* over which the pointer has been positioned.
|
||||
* @param aTipDir The direction (ltr or rtl) in which to display the text
|
||||
*
|
||||
* @note
|
||||
* Coordinates are specified in pixels, relative to the top-left
|
||||
@ -32,7 +33,8 @@ interface nsITooltipListener : nsISupports
|
||||
*
|
||||
* @return <code>NS_OK</code> if the tooltip was displayed.
|
||||
*/
|
||||
void onShowTooltip(in long aXCoords, in long aYCoords, in wstring aTipText);
|
||||
void onShowTooltip(in long aXCoords, in long aYCoords, in wstring aTipText,
|
||||
in wstring aTipDir);
|
||||
|
||||
/**
|
||||
* Called when the tooltip should be hidden, either because the pointer
|
||||
|
@ -32,12 +32,13 @@ interface nsITooltipTextProvider : nsISupports
|
||||
/**
|
||||
* Called to obtain the tooltip text for a node.
|
||||
*
|
||||
* @arg aNode The node to obtain the text from.
|
||||
* @arg aText The tooltip text.
|
||||
* @arg aNode The node to obtain the text from.
|
||||
* @arg aText The tooltip text.
|
||||
* @arg aDirection The text direction (ltr or rtl) to use
|
||||
*
|
||||
* @return <CODE>PR_TRUE</CODE> if tooltip text is associated
|
||||
* with the node and was returned in the aText argument;
|
||||
* <CODE>PR_FALSE</CODE> otherwise.
|
||||
*/
|
||||
boolean getNodeText(in nsIDOMNode aNode, out wstring aText);
|
||||
boolean getNodeText(in nsIDOMNode aNode, out wstring aText, out wstring aDirection);
|
||||
};
|
||||
|
@ -28,6 +28,13 @@ public:
|
||||
*/
|
||||
virtual uint64_t GetTransactionId() = 0;
|
||||
|
||||
/**
|
||||
* Return the transaction id that for the last non-revoked transaction.
|
||||
* This allows the caller to tell whether a composite was triggered by
|
||||
* a paint that occurred after a call to TransactionId().
|
||||
*/
|
||||
virtual uint64_t LastTransactionId() const = 0;
|
||||
|
||||
/**
|
||||
* Notify that all work (including asynchronous composites)
|
||||
* for a given transaction id has been completed.
|
||||
|
@ -419,11 +419,11 @@ ClientLayerManager::DidComposite(uint64_t aTransactionId,
|
||||
if (aTransactionId) {
|
||||
nsIWidgetListener *listener = mWidget->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->DidCompositeWindow(aCompositeStart, aCompositeEnd);
|
||||
listener->DidCompositeWindow(aTransactionId, aCompositeStart, aCompositeEnd);
|
||||
}
|
||||
listener = mWidget->GetAttachedWidgetListener();
|
||||
if (listener) {
|
||||
listener->DidCompositeWindow(aCompositeStart, aCompositeEnd);
|
||||
listener->DidCompositeWindow(aTransactionId, aCompositeStart, aCompositeEnd);
|
||||
}
|
||||
mTransactionIdAllocator->NotifyTransactionCompleted(aTransactionId);
|
||||
}
|
||||
|
@ -2576,26 +2576,6 @@ gfxFontGroup::GetEllipsisTextRun(int32_t aAppUnitsPerDevPixel, uint32_t aFlags,
|
||||
return textRun;
|
||||
}
|
||||
|
||||
already_AddRefed<gfxFont>
|
||||
gfxFontGroup::FindNonItalicFaceForChar(gfxFontFamily* aFamily, uint32_t aCh)
|
||||
{
|
||||
NS_ASSERTION(mStyle.style != NS_FONT_STYLE_NORMAL,
|
||||
"should only be called in the italic/oblique case");
|
||||
|
||||
gfxFontStyle regularStyle = mStyle;
|
||||
regularStyle.style = NS_FONT_STYLE_NORMAL;
|
||||
bool needsBold;
|
||||
gfxFontEntry *fe = aFamily->FindFontForStyle(regularStyle, needsBold);
|
||||
NS_ASSERTION(!fe->mIsUserFontContainer,
|
||||
"should only be searching platform fonts");
|
||||
if (!fe->HasCharacter(aCh)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<gfxFont> font = fe->FindOrMakeFont(&mStyle, needsBold);
|
||||
return font.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<gfxFont>
|
||||
gfxFontGroup::FindFallbackFaceForChar(gfxFontFamily* aFamily, uint32_t aCh,
|
||||
int32_t aRunScript)
|
||||
@ -2677,24 +2657,30 @@ gfxFontGroup::FindFontForChar(uint32_t aCh, uint32_t aPrevCh, uint32_t aNextCh,
|
||||
return firstFont.forget();
|
||||
}
|
||||
|
||||
RefPtr<gfxFont> font;
|
||||
if (mFonts[0].CheckForFallbackFaces()) {
|
||||
RefPtr<gfxFont> font =
|
||||
FindFallbackFaceForChar(mFonts[0].Family(), aCh, aRunScript);
|
||||
if (font) {
|
||||
*aMatchType = gfxTextRange::kFontGroup;
|
||||
return font.forget();
|
||||
}
|
||||
} else if (mStyle.style != NS_FONT_STYLE_NORMAL &&
|
||||
!firstFont->GetFontEntry()->IsUserFont()) {
|
||||
// If italic, test the regular face to see if it supports
|
||||
// character. Only do this for platform fonts, not userfonts.
|
||||
RefPtr<gfxFont> font =
|
||||
FindNonItalicFaceForChar(mFonts[0].Family(), aCh);
|
||||
if (font) {
|
||||
*aMatchType = gfxTextRange::kFontGroup;
|
||||
return font.forget();
|
||||
font = FindFallbackFaceForChar(mFonts[0].Family(), aCh,
|
||||
aRunScript);
|
||||
} else if (!firstFont->GetFontEntry()->IsUserFont()) {
|
||||
// For platform fonts (but not userfonts), we may need to do
|
||||
// fallback within the family to handle cases where some faces
|
||||
// such as Italic or Black have reduced character sets compared
|
||||
// to the family's Regular face.
|
||||
gfxFontEntry* fe = firstFont->GetFontEntry();
|
||||
if (!fe->IsUpright() ||
|
||||
fe->Weight() != NS_FONT_WEIGHT_NORMAL ||
|
||||
fe->Stretch() != NS_FONT_STRETCH_NORMAL) {
|
||||
// If style/weight/stretch was not Normal, see if we can
|
||||
// fall back to a next-best face (e.g. Arial Black -> Bold,
|
||||
// or Arial Narrow -> Regular).
|
||||
font = FindFallbackFaceForChar(mFonts[0].Family(), aCh,
|
||||
aRunScript);
|
||||
}
|
||||
}
|
||||
if (font) {
|
||||
*aMatchType = gfxTextRange::kFontGroup;
|
||||
return font.forget();
|
||||
}
|
||||
}
|
||||
|
||||
// we don't need to check the first font again below
|
||||
@ -2799,13 +2785,15 @@ gfxFontGroup::FindFontForChar(uint32_t aCh, uint32_t aPrevCh, uint32_t aNextCh,
|
||||
return font.forget();
|
||||
}
|
||||
} else {
|
||||
// If italic, test the regular face to see if it supports the
|
||||
// character. Only do this for platform fonts, not userfonts.
|
||||
// For platform fonts, but not user fonts, consider intra-family
|
||||
// fallback to handle styles with reduced character sets (see
|
||||
// also above).
|
||||
fe = ff.FontEntry();
|
||||
if (mStyle.style != NS_FONT_STYLE_NORMAL &&
|
||||
!fe->mIsUserFontContainer &&
|
||||
!fe->IsUserFont()) {
|
||||
font = FindNonItalicFaceForChar(ff.Family(), aCh);
|
||||
if (!fe->mIsUserFontContainer && !fe->IsUserFont() &&
|
||||
(!fe->IsUpright() ||
|
||||
fe->Weight() != NS_FONT_WEIGHT_NORMAL ||
|
||||
fe->Stretch() != NS_FONT_STRETCH_NORMAL)) {
|
||||
font = FindFallbackFaceForChar(ff.Family(), aCh, aRunScript);
|
||||
if (font) {
|
||||
*aMatchType = gfxTextRange::kFontGroup;
|
||||
return font.forget();
|
||||
|
@ -1142,12 +1142,6 @@ protected:
|
||||
gfxMissingFontRecorder *aMFR);
|
||||
|
||||
// Helper for font-matching:
|
||||
// When matching the italic case, allow use of the regular face
|
||||
// if it supports a character but the italic one doesn't.
|
||||
// Return null if regular face doesn't support aCh
|
||||
already_AddRefed<gfxFont>
|
||||
FindNonItalicFaceForChar(gfxFontFamily* aFamily, uint32_t aCh);
|
||||
|
||||
// search all faces in a family for a fallback in cases where it's unclear
|
||||
// whether the family might have a font for a given character
|
||||
already_AddRefed<gfxFont>
|
||||
|
@ -1020,6 +1020,10 @@ IonScript::trace(JSTracer* trc)
|
||||
ICEntry& ent = sharedStubList()[i];
|
||||
ent.trace(trc);
|
||||
}
|
||||
|
||||
// Trace caches so that the JSScript pointer can be updated if moved.
|
||||
for (size_t i = 0; i < numCaches(); i++)
|
||||
getCacheFromIndex(i).trace(trc);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
@ -383,6 +383,12 @@ IonCache::updateBaseAddress(JitCode* code, MacroAssembler& masm)
|
||||
rejoinLabel_.repoint(code, &masm);
|
||||
}
|
||||
|
||||
void IonCache::trace(JSTracer* trc)
|
||||
{
|
||||
if (script_)
|
||||
TraceManuallyBarrieredEdge(trc, &script_, "IonCache::script_");
|
||||
}
|
||||
|
||||
static void*
|
||||
GetReturnAddressToIonCode(JSContext* cx)
|
||||
{
|
||||
|
@ -341,6 +341,8 @@ class IonCache
|
||||
MOZ_ASSERT(pc_);
|
||||
return pc_;
|
||||
}
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
};
|
||||
|
||||
// Define the cache kind and pre-declare data structures used for calling inline
|
||||
|
@ -1938,8 +1938,6 @@ ScriptSource::chars(JSContext* cx, UncompressedSourceCache::AutoHoldEntry& holde
|
||||
{
|
||||
struct CharsMatcher
|
||||
{
|
||||
using ReturnType = const char16_t*;
|
||||
|
||||
JSContext* cx;
|
||||
ScriptSource& ss;
|
||||
UncompressedSourceCache::AutoHoldEntry& holder;
|
||||
@ -1951,11 +1949,11 @@ ScriptSource::chars(JSContext* cx, UncompressedSourceCache::AutoHoldEntry& holde
|
||||
, holder(holder)
|
||||
{ }
|
||||
|
||||
ReturnType match(Uncompressed& u) {
|
||||
const char16_t* match(Uncompressed& u) {
|
||||
return u.chars;
|
||||
}
|
||||
|
||||
ReturnType match(Compressed& c) {
|
||||
const char16_t* match(Compressed& c) {
|
||||
if (const char16_t* decompressed = cx->runtime()->uncompressedSourceCache.lookup(&ss, holder))
|
||||
return decompressed;
|
||||
|
||||
@ -1984,18 +1982,16 @@ ScriptSource::chars(JSContext* cx, UncompressedSourceCache::AutoHoldEntry& holde
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
ReturnType match(Parent& p) {
|
||||
const char16_t* match(Parent& p) {
|
||||
return p.parent->chars(cx, holder);
|
||||
}
|
||||
|
||||
ReturnType match(Missing&) {
|
||||
const char16_t* match(Missing&) {
|
||||
MOZ_CRASH("ScriptSource::chars() on ScriptSource with SourceType = Missing");
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
CharsMatcher cm(cx, *this, holder);
|
||||
return data.match(cm);
|
||||
return data.match(CharsMatcher(cx, *this, holder));
|
||||
}
|
||||
|
||||
JSFlatString*
|
||||
@ -2192,30 +2188,28 @@ ScriptSource::~ScriptSource()
|
||||
{
|
||||
struct DestroyMatcher
|
||||
{
|
||||
using ReturnType = void;
|
||||
|
||||
ScriptSource& ss;
|
||||
|
||||
explicit DestroyMatcher(ScriptSource& ss)
|
||||
: ss(ss)
|
||||
{ }
|
||||
|
||||
ReturnType match(Uncompressed& u) {
|
||||
void match(Uncompressed& u) {
|
||||
if (u.ownsChars)
|
||||
js_free(const_cast<char16_t*>(u.chars));
|
||||
}
|
||||
|
||||
ReturnType match(Compressed& c) {
|
||||
void match(Compressed& c) {
|
||||
if (ss.inCompressedSourceSet)
|
||||
TlsPerThreadData.get()->runtimeFromMainThread()->compressedSourceSet.remove(&ss);
|
||||
js_free(c.raw);
|
||||
}
|
||||
|
||||
ReturnType match(Parent& p) {
|
||||
void match(Parent& p) {
|
||||
p.parent->decref();
|
||||
}
|
||||
|
||||
ReturnType match(Missing&) {
|
||||
void match(Missing&) {
|
||||
// Nothing to do here.
|
||||
}
|
||||
};
|
||||
@ -2223,8 +2217,7 @@ ScriptSource::~ScriptSource()
|
||||
MOZ_ASSERT(refs == 0);
|
||||
MOZ_ASSERT_IF(inCompressedSourceSet, data.is<Compressed>());
|
||||
|
||||
DestroyMatcher dm(*this);
|
||||
data.match(dm);
|
||||
data.match(DestroyMatcher(*this));
|
||||
}
|
||||
|
||||
void
|
||||
@ -2247,21 +2240,19 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
|
||||
{
|
||||
struct CompressedLengthMatcher
|
||||
{
|
||||
using ReturnType = size_t;
|
||||
|
||||
ReturnType match(Uncompressed&) {
|
||||
size_t match(Uncompressed&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ReturnType match(Compressed& c) {
|
||||
size_t match(Compressed& c) {
|
||||
return c.nbytes;
|
||||
}
|
||||
|
||||
ReturnType match(Parent& p) {
|
||||
size_t match(Parent& p) {
|
||||
return p.parent->data.match(*this);
|
||||
}
|
||||
|
||||
ReturnType match(Missing&) {
|
||||
size_t match(Missing&) {
|
||||
MOZ_CRASH("Missing source data in ScriptSource::performXDR");
|
||||
return 0;
|
||||
}
|
||||
@ -2269,21 +2260,19 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
|
||||
|
||||
struct RawDataMatcher
|
||||
{
|
||||
using ReturnType = void*;
|
||||
|
||||
ReturnType match(Uncompressed& u) {
|
||||
void* match(Uncompressed& u) {
|
||||
return (void*) u.chars;
|
||||
}
|
||||
|
||||
ReturnType match(Compressed& c) {
|
||||
void* match(Compressed& c) {
|
||||
return c.raw;
|
||||
}
|
||||
|
||||
ReturnType match(Parent& p) {
|
||||
void* match(Parent& p) {
|
||||
return p.parent->data.match(*this);
|
||||
}
|
||||
|
||||
ReturnType match(Missing&) {
|
||||
void* match(Missing&) {
|
||||
MOZ_CRASH("Missing source data in ScriptSource::performXDR");
|
||||
return nullptr;
|
||||
}
|
||||
@ -2303,10 +2292,8 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
|
||||
return false;
|
||||
|
||||
uint32_t compressedLength;
|
||||
if (mode == XDR_ENCODE) {
|
||||
CompressedLengthMatcher m;
|
||||
compressedLength = data.match(m);
|
||||
}
|
||||
if (mode == XDR_ENCODE)
|
||||
compressedLength = data.match(CompressedLengthMatcher());
|
||||
if (!xdr->codeUint32(&compressedLength))
|
||||
return false;
|
||||
|
||||
@ -2334,8 +2321,7 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
|
||||
else
|
||||
setSource((const char16_t*) p, length_);
|
||||
} else {
|
||||
RawDataMatcher rdm;
|
||||
void* p = data.match(rdm);
|
||||
void* p = data.match(RawDataMatcher());
|
||||
if (!xdr->codeBytes(p, byteLen))
|
||||
return false;
|
||||
}
|
||||
|
40
js/src/tests/ecma_6/ArrayBuffer/indivisible-byteLength.js
Normal file
40
js/src/tests/ecma_6/ArrayBuffer/indivisible-byteLength.js
Normal file
@ -0,0 +1,40 @@
|
||||
var BUGNUMBER = 1263803;
|
||||
var summary = 'CloneArrayBuffer should allocate ArrayBuffer even with individual byteLength';
|
||||
|
||||
print(BUGNUMBER + ": " + summary);
|
||||
|
||||
var abuf1 = new ArrayBuffer(38);
|
||||
assertEq(abuf1.byteLength, 38);
|
||||
|
||||
var a1 = new Float64Array(abuf1, 24, 0);
|
||||
assertEq(a1.buffer.byteLength, 38);
|
||||
assertEq(a1.byteLength, 0);
|
||||
assertEq(a1.byteOffset, 24);
|
||||
|
||||
var a2 = new Float64Array(a1);
|
||||
// NOTE: There is a behavior difference on ArrayBuffer's byteLength, between
|
||||
// lazily allocated case and eagerly allocated case (bug 1264941).
|
||||
// This one is lazily allocated case, and it equals to a2.byteLength.
|
||||
assertEq(a2.buffer.byteLength, 0);
|
||||
assertEq(a2.byteLength, 0);
|
||||
assertEq(a2.byteOffset, 0);
|
||||
|
||||
class MyArrayBuffer extends ArrayBuffer {}
|
||||
|
||||
var abuf2 = new MyArrayBuffer(38);
|
||||
assertEq(abuf2.byteLength, 38);
|
||||
|
||||
var a3 = new Float64Array(abuf2, 24, 0);
|
||||
assertEq(a3.buffer.byteLength, 38);
|
||||
assertEq(a3.byteLength, 0);
|
||||
assertEq(a3.byteOffset, 24);
|
||||
|
||||
var a4 = new Float64Array(a3);
|
||||
// NOTE: This one is eagerly allocated case, and it differs from a4.byteLength.
|
||||
// Either one should be fixed once bug 1264941 is fixed.
|
||||
assertEq(a4.buffer.byteLength, 14);
|
||||
assertEq(a4.byteLength, 0);
|
||||
assertEq(a4.byteOffset, 0);
|
||||
|
||||
if (typeof reportCompare === 'function')
|
||||
reportCompare(true, true);
|
@ -1560,8 +1560,6 @@ ConcreteStackFrame<SavedFrame>::constructSavedFrameStack(JSContext* cx,
|
||||
// `JS::ubi::AtomOrTwoByteChars` string to a `JSAtom*`.
|
||||
struct MOZ_STACK_CLASS AtomizingMatcher
|
||||
{
|
||||
using ReturnType = JSAtom*;
|
||||
|
||||
JSContext* cx;
|
||||
size_t length;
|
||||
|
||||
|
@ -636,25 +636,19 @@ class TypedArrayObjectTemplate : public TypedArrayObject
|
||||
}
|
||||
|
||||
static bool
|
||||
maybeCreateArrayBuffer(JSContext* cx, uint32_t nelements, HandleObject nonDefaultProto,
|
||||
maybeCreateArrayBuffer(JSContext* cx, uint32_t byteLength, HandleObject nonDefaultProto,
|
||||
MutableHandle<ArrayBufferObject*> buffer)
|
||||
{
|
||||
MOZ_ASSERT(byteLength < INT32_MAX);
|
||||
static_assert(INLINE_BUFFER_LIMIT % sizeof(NativeType) == 0,
|
||||
"ArrayBuffer inline storage shouldn't waste any space");
|
||||
|
||||
if (!nonDefaultProto && nelements <= INLINE_BUFFER_LIMIT / sizeof(NativeType)) {
|
||||
if (!nonDefaultProto && byteLength <= INLINE_BUFFER_LIMIT) {
|
||||
// The array's data can be inline, and the buffer created lazily.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nelements >= INT32_MAX / sizeof(NativeType)) {
|
||||
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_NEED_DIET, "size and count");
|
||||
return false;
|
||||
}
|
||||
|
||||
ArrayBufferObject* buf = ArrayBufferObject::create(cx, nelements * sizeof(NativeType),
|
||||
nonDefaultProto);
|
||||
ArrayBufferObject* buf = ArrayBufferObject::create(cx, byteLength, nonDefaultProto);
|
||||
if (!buf)
|
||||
return false;
|
||||
|
||||
@ -669,15 +663,20 @@ class TypedArrayObjectTemplate : public TypedArrayObject
|
||||
if (!GetPrototypeForInstance(cx, newTarget, &proto))
|
||||
return nullptr;
|
||||
|
||||
if (nelements >= INT32_MAX / BYTES_PER_ELEMENT) {
|
||||
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_NEED_DIET, "size and count");
|
||||
return nullptr;
|
||||
}
|
||||
Rooted<ArrayBufferObject*> buffer(cx);
|
||||
if (!maybeCreateArrayBuffer(cx, nelements, nullptr, &buffer))
|
||||
if (!maybeCreateArrayBuffer(cx, nelements * BYTES_PER_ELEMENT, nullptr, &buffer))
|
||||
return nullptr;
|
||||
|
||||
return makeInstance(cx, buffer, 0, nelements, proto);
|
||||
}
|
||||
|
||||
static bool
|
||||
AllocateArrayBuffer(JSContext* cx, HandleValue ctor, uint32_t elementLength,
|
||||
AllocateArrayBuffer(JSContext* cx, HandleValue ctor, uint32_t byteLength,
|
||||
MutableHandle<ArrayBufferObject*> buffer);
|
||||
|
||||
static bool
|
||||
@ -734,7 +733,7 @@ struct TypedArrayObject::OfType
|
||||
template<typename T>
|
||||
/* static */ bool
|
||||
TypedArrayObjectTemplate<T>::AllocateArrayBuffer(JSContext* cx, HandleValue ctor,
|
||||
uint32_t elementLength,
|
||||
uint32_t byteLength,
|
||||
MutableHandle<ArrayBufferObject*> buffer)
|
||||
{
|
||||
// ES 2016 draft Mar 25, 2016 24.1.1.1 step 1 (partially).
|
||||
@ -750,8 +749,14 @@ TypedArrayObjectTemplate<T>::AllocateArrayBuffer(JSContext* cx, HandleValue ctor
|
||||
if (proto == arrayBufferProto)
|
||||
proto = nullptr;
|
||||
|
||||
if (byteLength >= INT32_MAX) {
|
||||
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_NEED_DIET, "size and count");
|
||||
return false;
|
||||
}
|
||||
|
||||
// ES 2016 draft Mar 25, 2016 24.1.1.1 steps 1 (remaining part), 2-6.
|
||||
if (!maybeCreateArrayBuffer(cx, elementLength, proto, buffer))
|
||||
if (!maybeCreateArrayBuffer(cx, byteLength, proto, buffer))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -847,8 +852,7 @@ TypedArrayObjectTemplate<T>::CloneArrayBufferNoCopy(JSContext* cx,
|
||||
// Step 7 (skipped).
|
||||
|
||||
// Steps 8.
|
||||
MOZ_ASSERT(cloneLength % BYTES_PER_ELEMENT == 0);
|
||||
if (!AllocateArrayBuffer(cx, cloneCtor, cloneLength / BYTES_PER_ELEMENT, buffer))
|
||||
if (!AllocateArrayBuffer(cx, cloneCtor, cloneLength, buffer))
|
||||
return false;
|
||||
|
||||
// Step 9.
|
||||
@ -938,8 +942,8 @@ TypedArrayObjectTemplate<T>::fromTypedArray(JSContext* cx, HandleObject other, b
|
||||
// Step 14.
|
||||
uint32_t srcByteOffset = srcArray->byteOffset();
|
||||
|
||||
// Steps 15-16 (skipped).
|
||||
// Our AllocateArrayBuffer receives elementLength instead of byteLength.
|
||||
// Steps 15-16.
|
||||
uint32_t byteLength = BYTES_PER_ELEMENT * elementLength;
|
||||
|
||||
// Steps 8-9, 17.
|
||||
Rooted<ArrayBufferObject*> buffer(cx);
|
||||
@ -954,7 +958,7 @@ TypedArrayObjectTemplate<T>::fromTypedArray(JSContext* cx, HandleObject other, b
|
||||
return nullptr;
|
||||
|
||||
// Step 18.b.
|
||||
if (!AllocateArrayBuffer(cx, bufferCtor, elementLength, &buffer))
|
||||
if (!AllocateArrayBuffer(cx, bufferCtor, byteLength, &buffer))
|
||||
return nullptr;
|
||||
|
||||
// Step 18.c.
|
||||
@ -991,7 +995,12 @@ TypedArrayObjectTemplate<T>::fromObject(JSContext* cx, HandleObject other, Handl
|
||||
return nullptr;
|
||||
if (!GetPrototypeForInstance(cx, newTarget, &proto))
|
||||
return nullptr;
|
||||
if (!maybeCreateArrayBuffer(cx, len, nullptr, &buffer))
|
||||
if (len >= INT32_MAX / BYTES_PER_ELEMENT) {
|
||||
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_NEED_DIET, "size and count");
|
||||
return nullptr;
|
||||
}
|
||||
if (!maybeCreateArrayBuffer(cx, len * BYTES_PER_ELEMENT, nullptr, &buffer))
|
||||
return nullptr;
|
||||
|
||||
Rooted<TypedArrayObject*> obj(cx, makeInstance(cx, buffer, 0, len, proto));
|
||||
|
@ -55,8 +55,6 @@ using JS::ubi::TracerConcreteWithCompartment;
|
||||
|
||||
struct CopyToBufferMatcher
|
||||
{
|
||||
using ReturnType = size_t;
|
||||
|
||||
RangedPtr<char16_t> destination;
|
||||
size_t maxLength;
|
||||
|
||||
@ -108,8 +106,6 @@ JS::ubi::AtomOrTwoByteChars::copyToBuffer(RangedPtr<char16_t> destination, size_
|
||||
|
||||
struct LengthMatcher
|
||||
{
|
||||
using ReturnType = size_t;
|
||||
|
||||
size_t
|
||||
match(JSAtom* atom)
|
||||
{
|
||||
|
@ -1113,7 +1113,6 @@ class Watchdog
|
||||
#include "ipc/Nuwa.h"
|
||||
#endif
|
||||
|
||||
#define PREF_MAX_SCRIPT_RUN_TIME_CHILD "dom.max_child_script_run_time"
|
||||
#define PREF_MAX_SCRIPT_RUN_TIME_CONTENT "dom.max_script_run_time"
|
||||
#define PREF_MAX_SCRIPT_RUN_TIME_CHROME "dom.max_chrome_script_run_time"
|
||||
|
||||
@ -1136,7 +1135,6 @@ class WatchdogManager : public nsIObserver
|
||||
mozilla::Preferences::AddStrongObserver(this, "dom.use_watchdog");
|
||||
mozilla::Preferences::AddStrongObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CONTENT);
|
||||
mozilla::Preferences::AddStrongObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CHROME);
|
||||
mozilla::Preferences::AddStrongObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CHILD);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -1150,7 +1148,6 @@ class WatchdogManager : public nsIObserver
|
||||
mozilla::Preferences::RemoveObserver(this, "dom.use_watchdog");
|
||||
mozilla::Preferences::RemoveObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CONTENT);
|
||||
mozilla::Preferences::RemoveObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CHROME);
|
||||
mozilla::Preferences::RemoveObserver(this, PREF_MAX_SCRIPT_RUN_TIME_CHILD);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -1228,10 +1225,7 @@ class WatchdogManager : public nsIObserver
|
||||
int32_t chromeTime = Preferences::GetInt(PREF_MAX_SCRIPT_RUN_TIME_CHROME, 20);
|
||||
if (chromeTime <= 0)
|
||||
chromeTime = INT32_MAX;
|
||||
int32_t childTime = Preferences::GetInt(PREF_MAX_SCRIPT_RUN_TIME_CHILD, 3);
|
||||
if (childTime <= 0)
|
||||
childTime = INT32_MAX;
|
||||
mWatchdog->SetMinScriptRunTimeSeconds(std::min(std::min(contentTime, chromeTime), childTime));
|
||||
mWatchdog->SetMinScriptRunTimeSeconds(std::min(contentTime, chromeTime));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1379,16 +1373,13 @@ XPCJSRuntime::InterruptCallback(JSContext* cx)
|
||||
if (!nsContentUtils::IsInitialized())
|
||||
return true;
|
||||
|
||||
bool contentProcess = XRE_IsContentProcess();
|
||||
|
||||
// This is at least the second interrupt callback we've received since
|
||||
// returning to the event loop. See how long it's been, and what the limit
|
||||
// is.
|
||||
TimeDuration duration = TimeStamp::NowLoRes() - self->mSlowScriptCheckpoint;
|
||||
bool chrome = nsContentUtils::IsCallerChrome();
|
||||
const char* prefName = contentProcess ? PREF_MAX_SCRIPT_RUN_TIME_CHILD
|
||||
: chrome ? PREF_MAX_SCRIPT_RUN_TIME_CHROME
|
||||
: PREF_MAX_SCRIPT_RUN_TIME_CONTENT;
|
||||
const char* prefName = chrome ? PREF_MAX_SCRIPT_RUN_TIME_CHROME
|
||||
: PREF_MAX_SCRIPT_RUN_TIME_CONTENT;
|
||||
int32_t limit = Preferences::GetInt(prefName, chrome ? 20 : 10);
|
||||
|
||||
// If there's no limit, or we're within the limit, let it go.
|
||||
|
@ -2157,7 +2157,7 @@ nsPresContext::EnsureSafeToHandOutCSSRules()
|
||||
}
|
||||
|
||||
void
|
||||
nsPresContext::FireDOMPaintEvent(nsInvalidateRequestList* aList)
|
||||
nsPresContext::FireDOMPaintEvent(nsInvalidateRequestList* aList, uint64_t aTransactionId)
|
||||
{
|
||||
nsPIDOMWindowInner* ourWindow = mDocument->GetInnerWindow();
|
||||
if (!ourWindow)
|
||||
@ -2182,7 +2182,7 @@ nsPresContext::FireDOMPaintEvent(nsInvalidateRequestList* aList)
|
||||
// (hopefully it won't, or we're likely to get an infinite loop! At least
|
||||
// it won't be blocking app execution though).
|
||||
RefPtr<NotifyPaintEvent> event =
|
||||
NS_NewDOMNotifyPaintEvent(eventTarget, this, nullptr, eAfterPaint, aList);
|
||||
NS_NewDOMNotifyPaintEvent(eventTarget, this, nullptr, eAfterPaint, aList, aTransactionId);
|
||||
|
||||
// Even if we're not telling the window about the event (so eventTarget is
|
||||
// the chrome event handler, not the window), the window is still
|
||||
@ -2379,6 +2379,7 @@ nsPresContext::ClearNotifySubDocInvalidationData(ContainerLayer* aContainer)
|
||||
|
||||
struct NotifyDidPaintSubdocumentCallbackClosure {
|
||||
uint32_t mFlags;
|
||||
uint64_t mTransactionId;
|
||||
bool mNeedsAnotherDidPaintNotification;
|
||||
};
|
||||
static bool
|
||||
@ -2390,7 +2391,7 @@ NotifyDidPaintSubdocumentCallback(nsIDocument* aDocument, void* aData)
|
||||
if (shell) {
|
||||
nsPresContext* pc = shell->GetPresContext();
|
||||
if (pc) {
|
||||
pc->NotifyDidPaintForSubtree(closure->mFlags);
|
||||
pc->NotifyDidPaintForSubtree(closure->mFlags, closure->mTransactionId);
|
||||
if (pc->IsDOMPaintEventPending()) {
|
||||
closure->mNeedsAnotherDidPaintNotification = true;
|
||||
}
|
||||
@ -2402,8 +2403,10 @@ NotifyDidPaintSubdocumentCallback(nsIDocument* aDocument, void* aData)
|
||||
class DelayedFireDOMPaintEvent : public nsRunnable {
|
||||
public:
|
||||
DelayedFireDOMPaintEvent(nsPresContext* aPresContext,
|
||||
nsInvalidateRequestList* aList)
|
||||
nsInvalidateRequestList* aList,
|
||||
uint64_t aTransactionId)
|
||||
: mPresContext(aPresContext)
|
||||
, mTransactionId(aTransactionId)
|
||||
{
|
||||
MOZ_ASSERT(mPresContext->GetContainerWeak(),
|
||||
"DOMPaintEvent requested for a detached pres context");
|
||||
@ -2414,17 +2417,19 @@ public:
|
||||
// The pres context might have been detached during the delay -
|
||||
// that's fine, just don't fire the event.
|
||||
if (mPresContext->GetContainerWeak()) {
|
||||
mPresContext->FireDOMPaintEvent(&mList);
|
||||
mPresContext->FireDOMPaintEvent(&mList, mTransactionId);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RefPtr<nsPresContext> mPresContext;
|
||||
uint64_t mTransactionId;
|
||||
nsInvalidateRequestList mList;
|
||||
};
|
||||
|
||||
void
|
||||
nsPresContext::NotifyDidPaintForSubtree(uint32_t aFlags)
|
||||
nsPresContext::NotifyDidPaintForSubtree(uint32_t aFlags, uint64_t aTransactionId,
|
||||
const mozilla::TimeStamp& aTimeStamp)
|
||||
{
|
||||
if (IsRoot()) {
|
||||
static_cast<nsRootPresContext*>(this)->CancelDidPaintTimer();
|
||||
@ -2451,11 +2456,12 @@ nsPresContext::NotifyDidPaintForSubtree(uint32_t aFlags)
|
||||
}
|
||||
if (aFlags & nsIPresShell::PAINT_COMPOSITE) {
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new DelayedFireDOMPaintEvent(this, &mUndeliveredInvalidateRequestsBeforeLastPaint);
|
||||
new DelayedFireDOMPaintEvent(this, &mUndeliveredInvalidateRequestsBeforeLastPaint,
|
||||
aTransactionId);
|
||||
nsContentUtils::AddScriptRunner(ev);
|
||||
}
|
||||
|
||||
NotifyDidPaintSubdocumentCallbackClosure closure = { aFlags, false };
|
||||
NotifyDidPaintSubdocumentCallbackClosure closure = { aFlags, aTransactionId, false };
|
||||
mDocument->EnumerateSubDocuments(NotifyDidPaintSubdocumentCallback, &closure);
|
||||
|
||||
if (!closure.mNeedsAnotherDidPaintNotification &&
|
||||
|
@ -926,8 +926,9 @@ public:
|
||||
// aRect is in device pixels
|
||||
void NotifyInvalidation(const nsIntRect& aRect, uint32_t aFlags);
|
||||
// aFlags are nsIPresShell::PAINT_ flags
|
||||
void NotifyDidPaintForSubtree(uint32_t aFlags);
|
||||
void FireDOMPaintEvent(nsInvalidateRequestList* aList);
|
||||
void NotifyDidPaintForSubtree(uint32_t aFlags, uint64_t aTransactionId = 0,
|
||||
const mozilla::TimeStamp& aTimeStamp = mozilla::TimeStamp());
|
||||
void FireDOMPaintEvent(nsInvalidateRequestList* aList, uint64_t aTransactionId);
|
||||
|
||||
// Callback for catching invalidations in ContainerLayers
|
||||
// Passed to LayerProperties::ComputeDifference
|
||||
|
@ -2007,6 +2007,12 @@ nsRefreshDriver::GetTransactionId()
|
||||
return mPendingTransaction;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
nsRefreshDriver::LastTransactionId() const
|
||||
{
|
||||
return mPendingTransaction;
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::RevokeTransactionId(uint64_t aTransactionId)
|
||||
{
|
||||
|
@ -319,7 +319,8 @@ public:
|
||||
static bool GetJankLevels(mozilla::Vector<uint64_t>& aJank);
|
||||
|
||||
// mozilla::layers::TransactionIdAllocator
|
||||
virtual uint64_t GetTransactionId() override;
|
||||
uint64_t GetTransactionId() override;
|
||||
uint64_t LastTransactionId() const override;
|
||||
void NotifyTransactionCompleted(uint64_t aTransactionId) override;
|
||||
void RevokeTransactionId(uint64_t aTransactionId) override;
|
||||
mozilla::TimeStamp GetTransactionStart() override;
|
||||
|
@ -583,6 +583,9 @@ private:
|
||||
aStyleAnimation.GetDuration()));
|
||||
timing.mDelay = TimeDuration::FromMilliseconds(aStyleAnimation.GetDelay());
|
||||
timing.mIterations = aStyleAnimation.GetIterationCount();
|
||||
MOZ_ASSERT(timing.mIterations >= 0.0 && !IsNaN(timing.mIterations),
|
||||
"mIterations should be nonnegative & finite, as ensured by "
|
||||
"CSSParser");
|
||||
timing.mDirection = aStyleAnimation.GetDirection();
|
||||
timing.mFill = aStyleAnimation.GetFillMode();
|
||||
|
||||
|
5
layout/tools/reftest/bootstrap.js
vendored
5
layout/tools/reftest/bootstrap.js
vendored
@ -44,6 +44,8 @@ function startup(data, reason) {
|
||||
return;
|
||||
}
|
||||
|
||||
let orig = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService2);
|
||||
ios.manageOfflineStatus = false;
|
||||
@ -54,6 +56,9 @@ function startup(data, reason) {
|
||||
let dummy = wwatch.openWindow(null, "about:blank", "dummy",
|
||||
"chrome,dialog=no,left=800,height=200,width=200,all",null);
|
||||
dummy.onload = function() {
|
||||
// Close pre-existing window
|
||||
orig.close();
|
||||
|
||||
dummy.focus();
|
||||
wwatch.openWindow(null, "chrome://reftest/content/reftest.xul", "_blank",
|
||||
"chrome,dialog=no,all", {});
|
||||
|
@ -50,8 +50,8 @@ if CONFIG['GNU_CC']:
|
||||
'-Wno-incompatible-pointer-types-discards-qualifiers',
|
||||
'-Wno-logical-op-parentheses',
|
||||
]
|
||||
# Force visibility of cpu symbols
|
||||
CFLAGS += ['-include', 'cpu_perms.h']
|
||||
# Force visibility of cpu and av_log symbols.
|
||||
CFLAGS += ['-include', 'libavutil_visibility.h']
|
||||
elif CONFIG['_MSC_VER']:
|
||||
CFLAGS += [
|
||||
'-wd4090', # 'return' : different 'const' qualifiers
|
||||
@ -85,3 +85,10 @@ elif CONFIG['_MSC_VER']:
|
||||
DEFINES['vsnprintf'] = "avpriv_vsnprintf"
|
||||
|
||||
DEFINES['HAVE_AV_CONFIG_H'] = True
|
||||
|
||||
if CONFIG['MOZ_DEBUG']:
|
||||
# Enable all assertions in debug builds.
|
||||
DEFINES['ASSERT_LEVEL'] = 2
|
||||
elif not CONFIG['RELEASE_BUILD']:
|
||||
# Enable fast assertions in opt builds of Nightly and Aurora.
|
||||
DEFINES['ASSERT_LEVEL'] = 1
|
||||
|
@ -6,11 +6,15 @@
|
||||
|
||||
// Include file for fixing symbol visibility on Linux.
|
||||
|
||||
#ifndef MOZILLA_AVCPU_PERMS_H
|
||||
#define MOZILLA_AVCPU_PERMS_H
|
||||
#ifndef MOZILLA_AVUTIL_VISIBILITY_H
|
||||
#define MOZILLA_AVUTIL_VISIBILITY_H
|
||||
|
||||
#pragma GCC visibility push(default)
|
||||
#include "libavutil/cpu.h"
|
||||
|
||||
// We need av_log() to be visible so we can enable assertions in libavcodec.
|
||||
#include "libavutil/log.h"
|
||||
|
||||
#pragma GCC visibility pop
|
||||
|
||||
#endif // MOZILLA_AVCPU_PERMS_H
|
||||
#endif // MOZILLA_AVUTIL_VISIBILITY_H
|
@ -66,4 +66,11 @@ if CONFIG['OS_ARCH'] != 'WINNT':
|
||||
# We allow warnings for third-party code that can be updated from upstream.
|
||||
ALLOW_COMPILER_WARNINGS = True
|
||||
|
||||
if CONFIG['MOZ_DEBUG']:
|
||||
# Enable all assertions in debug builds.
|
||||
DEFINES['ASSERT_LEVEL'] = 2
|
||||
elif not CONFIG['RELEASE_BUILD']:
|
||||
# Enable fast assertions in opt builds of Nightly and Aurora.
|
||||
DEFINES['ASSERT_LEVEL'] = 1
|
||||
|
||||
include("libavcommon.mozbuild")
|
||||
|
@ -137,6 +137,7 @@ enum {
|
||||
kKeyRequiresSecureBuffers = 'secu', // bool (int32_t)
|
||||
|
||||
kKeyIsADTS = 'adts', // bool (int32_t)
|
||||
kKeyAACAOT = 'aaot', // int32_t
|
||||
|
||||
// If a MediaBuffer's data represents (at least partially) encrypted
|
||||
// data, the following fields aid in decryption.
|
||||
|
@ -2462,6 +2462,58 @@ status_t MPEG4Extractor::verifyTrack(Track *track) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
//AOT_NONE = -1,
|
||||
//AOT_NULL_OBJECT = 0,
|
||||
//AOT_AAC_MAIN = 1, /**< Main profile */
|
||||
AOT_AAC_LC = 2, /**< Low Complexity object */
|
||||
//AOT_AAC_SSR = 3,
|
||||
//AOT_AAC_LTP = 4,
|
||||
AOT_SBR = 5,
|
||||
//AOT_AAC_SCAL = 6,
|
||||
//AOT_TWIN_VQ = 7,
|
||||
//AOT_CELP = 8,
|
||||
//AOT_HVXC = 9,
|
||||
//AOT_RSVD_10 = 10, /**< (reserved) */
|
||||
//AOT_RSVD_11 = 11, /**< (reserved) */
|
||||
//AOT_TTSI = 12, /**< TTSI Object */
|
||||
//AOT_MAIN_SYNTH = 13, /**< Main Synthetic object */
|
||||
//AOT_WAV_TAB_SYNTH = 14, /**< Wavetable Synthesis object */
|
||||
//AOT_GEN_MIDI = 15, /**< General MIDI object */
|
||||
//AOT_ALG_SYNTH_AUD_FX = 16, /**< Algorithmic Synthesis and Audio FX object */
|
||||
AOT_ER_AAC_LC = 17, /**< Error Resilient(ER) AAC Low Complexity */
|
||||
//AOT_RSVD_18 = 18, /**< (reserved) */
|
||||
//AOT_ER_AAC_LTP = 19, /**< Error Resilient(ER) AAC LTP object */
|
||||
AOT_ER_AAC_SCAL = 20, /**< Error Resilient(ER) AAC Scalable object */
|
||||
//AOT_ER_TWIN_VQ = 21, /**< Error Resilient(ER) TwinVQ object */
|
||||
AOT_ER_BSAC = 22, /**< Error Resilient(ER) BSAC object */
|
||||
AOT_ER_AAC_LD = 23, /**< Error Resilient(ER) AAC LowDelay object */
|
||||
//AOT_ER_CELP = 24, /**< Error Resilient(ER) CELP object */
|
||||
//AOT_ER_HVXC = 25, /**< Error Resilient(ER) HVXC object */
|
||||
//AOT_ER_HILN = 26, /**< Error Resilient(ER) HILN object */
|
||||
//AOT_ER_PARA = 27, /**< Error Resilient(ER) Parametric object */
|
||||
//AOT_RSVD_28 = 28, /**< might become SSC */
|
||||
AOT_PS = 29, /**< PS, Parametric Stereo (includes SBR) */
|
||||
//AOT_MPEGS = 30, /**< MPEG Surround */
|
||||
|
||||
AOT_ESCAPE = 31, /**< Signal AOT uses more than 5 bits */
|
||||
|
||||
//AOT_MP3ONMP4_L1 = 32, /**< MPEG-Layer1 in mp4 */
|
||||
//AOT_MP3ONMP4_L2 = 33, /**< MPEG-Layer2 in mp4 */
|
||||
//AOT_MP3ONMP4_L3 = 34, /**< MPEG-Layer3 in mp4 */
|
||||
//AOT_RSVD_35 = 35, /**< might become DST */
|
||||
//AOT_RSVD_36 = 36, /**< might become ALS */
|
||||
//AOT_AAC_SLS = 37, /**< AAC + SLS */
|
||||
//AOT_SLS = 38, /**< SLS */
|
||||
//AOT_ER_AAC_ELD = 39, /**< AAC Enhanced Low Delay */
|
||||
|
||||
//AOT_USAC = 42, /**< USAC */
|
||||
//AOT_SAOC = 43, /**< SAOC */
|
||||
//AOT_LD_MPEGS = 44, /**< Low Delay MPEG Surround */
|
||||
|
||||
//AOT_RSVD50 = 50, /**< Interim AOT for Rsvd50 */
|
||||
} AUDIO_OBJECT_TYPE;
|
||||
|
||||
status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
const void *esds_data, size_t esds_size) {
|
||||
ESDS esds(esds_data, esds_size);
|
||||
@ -2473,9 +2525,9 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
|
||||
if (objectTypeIndication == 0xe1) {
|
||||
// This isn't MPEG4 audio at all, it's QCELP 14k...
|
||||
if (!mLastTrack) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
if (mLastTrack == NULL)
|
||||
return ERROR_MALFORMED;
|
||||
|
||||
mLastTrack->meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_QCELP);
|
||||
return OK;
|
||||
}
|
||||
@ -2496,8 +2548,10 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("ESD of size %d\n", csd_size);
|
||||
hexdump(csd, csd_size);
|
||||
if (kUseHexDump) {
|
||||
printf("ESD of size %zu\n", csd_size);
|
||||
hexdump(csd, csd_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (csd_size == 0) {
|
||||
@ -2512,6 +2566,11 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
|
||||
static uint32_t kSamplingRate[] = {
|
||||
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
|
||||
16000, 12000, 11025, 8000, 7350
|
||||
};
|
||||
|
||||
ABitReader br(csd, csd_size);
|
||||
if (br.numBitsLeft() < 5) {
|
||||
return ERROR_MALFORMED;
|
||||
@ -2525,13 +2584,16 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
objectType = 32 + br.getBits(6);
|
||||
}
|
||||
|
||||
if (mLastTrack == NULL)
|
||||
return ERROR_MALFORMED;
|
||||
|
||||
if (objectType >= 1 && objectType <= 4) {
|
||||
if (!mLastTrack) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
mLastTrack->meta->setInt32(kKeyAACProfile, objectType);
|
||||
}
|
||||
|
||||
//keep AOT type
|
||||
mLastTrack->meta->setInt32(kKeyAACAOT, objectType);
|
||||
|
||||
if (br.numBitsLeft() < 4) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
@ -2540,47 +2602,179 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
int32_t sampleRate = 0;
|
||||
int32_t numChannels = 0;
|
||||
if (freqIndex == 15) {
|
||||
if (csd_size < 5) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
if (br.numBitsLeft() < 24 + 4) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
if (br.numBitsLeft() < 28) return ERROR_MALFORMED;
|
||||
sampleRate = br.getBits(24);
|
||||
numChannels = br.getBits(4);
|
||||
} else {
|
||||
if (br.numBitsLeft() < 4) {
|
||||
if (br.numBitsLeft() < 4) return ERROR_MALFORMED;
|
||||
numChannels = br.getBits(4);
|
||||
|
||||
if (freqIndex == 13 || freqIndex == 14) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
numChannels = br.getBits(4);
|
||||
if (objectType == 5) {
|
||||
// SBR specific config per 14496-3 table 1.13
|
||||
if (br.numBitsLeft() < 4) {
|
||||
|
||||
sampleRate = kSamplingRate[freqIndex];
|
||||
}
|
||||
|
||||
if (objectType == AOT_SBR || objectType == AOT_PS) {//SBR specific config per 14496-3 table 1.13
|
||||
if (br.numBitsLeft() < 4) return ERROR_MALFORMED;
|
||||
uint32_t extFreqIndex = br.getBits(4);
|
||||
int32_t extSampleRate;
|
||||
if (extFreqIndex == 15) {
|
||||
if (csd_size < 8) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
freqIndex = br.getBits(4);
|
||||
if (freqIndex == 15) {
|
||||
if (csd_size < 8) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
if (br.numBitsLeft() < 24) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
sampleRate = br.getBits(24);
|
||||
if (br.numBitsLeft() < 24) return ERROR_MALFORMED;
|
||||
extSampleRate = br.getBits(24);
|
||||
} else {
|
||||
if (extFreqIndex == 13 || extFreqIndex == 14) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
extSampleRate = kSamplingRate[extFreqIndex];
|
||||
}
|
||||
//TODO: save the extension sampling rate value in meta data =>
|
||||
// mLastTrack->meta->setInt32(kKeyExtSampleRate, extSampleRate);
|
||||
}
|
||||
|
||||
switch (numChannels) {
|
||||
// values defined in 14496-3_2009 amendment-4 Table 1.19 - Channel Configuration
|
||||
case 0:
|
||||
case 1:// FC
|
||||
case 2:// FL FR
|
||||
case 3:// FC, FL FR
|
||||
case 4:// FC, FL FR, RC
|
||||
case 5:// FC, FL FR, SL SR
|
||||
case 6:// FC, FL FR, SL SR, LFE
|
||||
//numChannels already contains the right value
|
||||
break;
|
||||
case 11:// FC, FL FR, SL SR, RC, LFE
|
||||
numChannels = 7;
|
||||
break;
|
||||
case 7: // FC, FCL FCR, FL FR, SL SR, LFE
|
||||
case 12:// FC, FL FR, SL SR, RL RR, LFE
|
||||
case 14:// FC, FL FR, SL SR, LFE, FHL FHR
|
||||
numChannels = 8;
|
||||
break;
|
||||
default:
|
||||
return ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
{
|
||||
if (objectType == AOT_SBR || objectType == AOT_PS) {
|
||||
if (br.numBitsLeft() < 5) return ERROR_MALFORMED;
|
||||
objectType = br.getBits(5);
|
||||
|
||||
if (objectType == AOT_ESCAPE) {
|
||||
if (br.numBitsLeft() < 6) return ERROR_MALFORMED;
|
||||
objectType = 32 + br.getBits(6);
|
||||
}
|
||||
}
|
||||
if (objectType == AOT_AAC_LC || objectType == AOT_ER_AAC_LC ||
|
||||
objectType == AOT_ER_AAC_LD || objectType == AOT_ER_AAC_SCAL ||
|
||||
objectType == AOT_ER_BSAC) {
|
||||
if (br.numBitsLeft() < 2) return ERROR_MALFORMED;
|
||||
const int32_t frameLengthFlag = br.getBits(1);
|
||||
|
||||
if (sampleRate == 0) {
|
||||
static uint32_t kSamplingRate[] = {
|
||||
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
|
||||
16000, 12000, 11025, 8000, 7350
|
||||
};
|
||||
const int32_t dependsOnCoreCoder = br.getBits(1);
|
||||
|
||||
if (freqIndex == 13 || freqIndex == 14) {
|
||||
return ERROR_MALFORMED;
|
||||
if (dependsOnCoreCoder ) {
|
||||
if (br.numBitsLeft() < 14) return ERROR_MALFORMED;
|
||||
const int32_t coreCoderDelay = br.getBits(14);
|
||||
}
|
||||
|
||||
sampleRate = kSamplingRate[freqIndex];
|
||||
int32_t extensionFlag = -1;
|
||||
if (br.numBitsLeft() > 0) {
|
||||
extensionFlag = br.getBits(1);
|
||||
} else {
|
||||
switch (objectType) {
|
||||
// 14496-3 4.5.1.1 extensionFlag
|
||||
case AOT_AAC_LC:
|
||||
extensionFlag = 0;
|
||||
break;
|
||||
case AOT_ER_AAC_LC:
|
||||
case AOT_ER_AAC_SCAL:
|
||||
case AOT_ER_BSAC:
|
||||
case AOT_ER_AAC_LD:
|
||||
extensionFlag = 1;
|
||||
break;
|
||||
default:
|
||||
return ERROR_MALFORMED;
|
||||
break;
|
||||
}
|
||||
ALOGW("csd missing extension flag; assuming %d for object type %u.",
|
||||
extensionFlag, objectType);
|
||||
}
|
||||
|
||||
if (numChannels == 0) {
|
||||
int32_t channelsEffectiveNum = 0;
|
||||
int32_t channelsNum = 0;
|
||||
if (br.numBitsLeft() < 32) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
const int32_t ElementInstanceTag = br.getBits(4);
|
||||
const int32_t Profile = br.getBits(2);
|
||||
const int32_t SamplingFrequencyIndex = br.getBits(4);
|
||||
const int32_t NumFrontChannelElements = br.getBits(4);
|
||||
const int32_t NumSideChannelElements = br.getBits(4);
|
||||
const int32_t NumBackChannelElements = br.getBits(4);
|
||||
const int32_t NumLfeChannelElements = br.getBits(2);
|
||||
const int32_t NumAssocDataElements = br.getBits(3);
|
||||
const int32_t NumValidCcElements = br.getBits(4);
|
||||
|
||||
const int32_t MonoMixdownPresent = br.getBits(1);
|
||||
|
||||
if (MonoMixdownPresent != 0) {
|
||||
if (br.numBitsLeft() < 4) return ERROR_MALFORMED;
|
||||
const int32_t MonoMixdownElementNumber = br.getBits(4);
|
||||
}
|
||||
|
||||
if (br.numBitsLeft() < 1) return ERROR_MALFORMED;
|
||||
const int32_t StereoMixdownPresent = br.getBits(1);
|
||||
if (StereoMixdownPresent != 0) {
|
||||
if (br.numBitsLeft() < 4) return ERROR_MALFORMED;
|
||||
const int32_t StereoMixdownElementNumber = br.getBits(4);
|
||||
}
|
||||
|
||||
if (br.numBitsLeft() < 1) return ERROR_MALFORMED;
|
||||
const int32_t MatrixMixdownIndexPresent = br.getBits(1);
|
||||
if (MatrixMixdownIndexPresent != 0) {
|
||||
if (br.numBitsLeft() < 3) return ERROR_MALFORMED;
|
||||
const int32_t MatrixMixdownIndex = br.getBits(2);
|
||||
const int32_t PseudoSurroundEnable = br.getBits(1);
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i=0; i < NumFrontChannelElements; i++) {
|
||||
if (br.numBitsLeft() < 5) return ERROR_MALFORMED;
|
||||
const int32_t FrontElementIsCpe = br.getBits(1);
|
||||
const int32_t FrontElementTagSelect = br.getBits(4);
|
||||
channelsNum += FrontElementIsCpe ? 2 : 1;
|
||||
}
|
||||
|
||||
for (i=0; i < NumSideChannelElements; i++) {
|
||||
if (br.numBitsLeft() < 5) return ERROR_MALFORMED;
|
||||
const int32_t SideElementIsCpe = br.getBits(1);
|
||||
const int32_t SideElementTagSelect = br.getBits(4);
|
||||
channelsNum += SideElementIsCpe ? 2 : 1;
|
||||
}
|
||||
|
||||
for (i=0; i < NumBackChannelElements; i++) {
|
||||
if (br.numBitsLeft() < 5) return ERROR_MALFORMED;
|
||||
const int32_t BackElementIsCpe = br.getBits(1);
|
||||
const int32_t BackElementTagSelect = br.getBits(4);
|
||||
channelsNum += BackElementIsCpe ? 2 : 1;
|
||||
}
|
||||
channelsEffectiveNum = channelsNum;
|
||||
|
||||
for (i=0; i < NumLfeChannelElements; i++) {
|
||||
if (br.numBitsLeft() < 4) return ERROR_MALFORMED;
|
||||
const int32_t LfeElementTagSelect = br.getBits(4);
|
||||
channelsNum += 1;
|
||||
}
|
||||
ALOGV("mpeg4 audio channelsNum = %d", channelsNum);
|
||||
ALOGV("mpeg4 audio channelsEffectiveNum = %d", channelsEffectiveNum);
|
||||
numChannels = channelsNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2588,9 +2782,9 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
|
||||
return ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (!mLastTrack) {
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
if (mLastTrack == NULL)
|
||||
return ERROR_MALFORMED;
|
||||
|
||||
int32_t prevSampleRate;
|
||||
CHECK(mLastTrack->meta->findInt32(kKeySampleRate, &prevSampleRate));
|
||||
|
||||
|
@ -121,7 +121,7 @@ void Fake_AudioStreamSource::Periodic() {
|
||||
segment.AppendFrames(samples.forget(),
|
||||
channels,
|
||||
AUDIO_BUFFER_SIZE,
|
||||
mozilla::PRINCIPAL_HANDLE_NONE);
|
||||
PRINCIPAL_HANDLE_NONE);
|
||||
|
||||
for(std::set<RefPtr<Fake_MediaStreamListener>>::iterator it = mListeners.begin();
|
||||
it != mListeners.end(); ++it) {
|
||||
|
@ -169,10 +169,11 @@ struct VariantImplementation<N, T> {
|
||||
return aLhs.template as<T>() == aRhs.template as<T>();
|
||||
}
|
||||
|
||||
template<typename Matcher, typename ConcreteVariant,
|
||||
typename ReturnType = typename RemoveReference<Matcher>::Type::ReturnType>
|
||||
static ReturnType
|
||||
match(Matcher&& aMatcher, ConcreteVariant& aV) {
|
||||
template<typename Matcher, typename ConcreteVariant>
|
||||
static auto
|
||||
match(Matcher&& aMatcher, ConcreteVariant& aV)
|
||||
-> decltype(aMatcher.match(aV.template as<T>()))
|
||||
{
|
||||
return aMatcher.match(aV.template as<T>());
|
||||
}
|
||||
};
|
||||
@ -226,10 +227,10 @@ struct VariantImplementation<N, T, Ts...>
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Matcher, typename ConcreteVariant,
|
||||
typename ReturnType = typename RemoveReference<Matcher>::Type::ReturnType>
|
||||
static ReturnType
|
||||
template<typename Matcher, typename ConcreteVariant>
|
||||
static auto
|
||||
match(Matcher&& aMatcher, ConcreteVariant& aV)
|
||||
-> decltype(aMatcher.match(aV.template as<T>()))
|
||||
{
|
||||
if (aV.template is<T>()) {
|
||||
return aMatcher.match(aV.template as<T>());
|
||||
@ -243,7 +244,7 @@ struct VariantImplementation<N, T, Ts...>
|
||||
// initialize return object of type <...> with an rvalue of type
|
||||
// <...>" then that means that the Matcher::match(T&) overloads
|
||||
// are returning different types. They must all return the same
|
||||
// Matcher::ReturnType type.
|
||||
// type.
|
||||
return Next::match(aMatcher, aV);
|
||||
}
|
||||
}
|
||||
@ -370,11 +371,11 @@ struct AsVariantTemporary
|
||||
* // Good!
|
||||
* struct FooMatcher
|
||||
* {
|
||||
* using ReturnType = char*;
|
||||
* ReturnType match(A& a) { ... }
|
||||
* ReturnType match(B& b) { ... }
|
||||
* ReturnType match(C& c) { ... }
|
||||
* ReturnType match(D& d) { ... } // Compile-time error to forget D!
|
||||
* // The return type of all matchers must be idential.
|
||||
* char* match(A& a) { ... }
|
||||
* char* match(B& b) { ... }
|
||||
* char* match(C& c) { ... }
|
||||
* char* match(D& d) { ... } // Compile-time error to forget D!
|
||||
* }
|
||||
* char* foo(Variant<A, B, C, D>& v) {
|
||||
* return v.match(FooMatcher());
|
||||
@ -558,15 +559,15 @@ public:
|
||||
|
||||
/** Match on an immutable const reference. */
|
||||
template<typename Matcher>
|
||||
typename RemoveReference<Matcher>::Type::ReturnType
|
||||
match(Matcher&& aMatcher) const {
|
||||
auto
|
||||
match(Matcher&& aMatcher) const -> decltype(Impl::match(aMatcher, *this)) {
|
||||
return Impl::match(aMatcher, *this);
|
||||
}
|
||||
|
||||
/** Match on a mutable non-const reference. */
|
||||
template<typename Matcher>
|
||||
typename RemoveReference<Matcher>::Type::ReturnType
|
||||
match(Matcher&& aMatcher) {
|
||||
auto
|
||||
match(Matcher&& aMatcher) -> decltype(Impl::match(aMatcher, *this)) {
|
||||
return Impl::match(aMatcher, *this);
|
||||
}
|
||||
};
|
||||
|
@ -129,8 +129,6 @@ struct Describer
|
||||
static const char* medium;
|
||||
static const char* big;
|
||||
|
||||
using ReturnType = const char*;
|
||||
|
||||
const char* match(const uint8_t&) { return little; }
|
||||
const char* match(const uint32_t&) { return medium; }
|
||||
const char* match(const uint64_t&) { return big; }
|
||||
|
@ -306,6 +306,8 @@
|
||||
@BINPATH@/components/nsLoginManagerPrompter.js
|
||||
@BINPATH@/components/storage-mozStorage.js
|
||||
@BINPATH@/components/crypto-SDR.js
|
||||
@BINPATH@/components/TooltipTextProvider.js
|
||||
@BINPATH@/components/TooltipTextProvider.manifest
|
||||
@BINPATH@/components/NetworkGeolocationProvider.manifest
|
||||
@BINPATH@/components/NetworkGeolocationProvider.js
|
||||
@BINPATH@/components/extensions.manifest
|
||||
|
@ -2421,8 +2421,12 @@ pref("layout.css.scope-pseudo.enabled", true);
|
||||
// Is support for background-blend-mode enabled?
|
||||
pref("layout.css.background-blend-mode.enabled", true);
|
||||
|
||||
// Is support for background-clip:text enabled? (bug 1263516)
|
||||
// Is support for background-clip:text enabled? (bug 1264905)
|
||||
#ifdef RELEASE_BUILD
|
||||
pref("layout.css.background-clip-text.enabled", false);
|
||||
#else
|
||||
pref("layout.css.background-clip-text.enabled", true);
|
||||
#endif
|
||||
|
||||
// Is support for CSS vertical text enabled?
|
||||
pref("layout.css.vertical-text.enabled", true);
|
||||
@ -2587,7 +2591,6 @@ pref("editor.positioning.offset", 0);
|
||||
|
||||
pref("dom.use_watchdog", true);
|
||||
pref("dom.max_chrome_script_run_time", 20);
|
||||
pref("dom.max_child_script_run_time", 10);
|
||||
pref("dom.max_script_run_time", 10);
|
||||
|
||||
// If true, ArchiveReader will be enabled
|
||||
|
@ -52,6 +52,7 @@ if not CONFIG['JS_STANDALONE']:
|
||||
|
||||
DIRS += [
|
||||
'config/external/fdlibm',
|
||||
'config/external/nspr',
|
||||
'config/external/zlib',
|
||||
'memory',
|
||||
'mfbt',
|
||||
@ -61,8 +62,10 @@ DIRS += [
|
||||
if not CONFIG['JS_STANDALONE']:
|
||||
DIRS += ['xpcom/xpidl']
|
||||
|
||||
if CONFIG['USE_ICU']:
|
||||
DIRS += ['config/external/icu']
|
||||
|
||||
if CONFIG['COMPILE_ENVIRONMENT']:
|
||||
DIRS += ['config/external/nspr']
|
||||
|
||||
if not CONFIG['JS_STANDALONE']:
|
||||
DIRS += [
|
||||
@ -72,8 +75,7 @@ if CONFIG['COMPILE_ENVIRONMENT']:
|
||||
|
||||
if CONFIG['BUILD_CTYPES']:
|
||||
DIRS += ['config/external/ffi']
|
||||
if CONFIG['USE_ICU']:
|
||||
DIRS += ['config/external/icu']
|
||||
|
||||
DIRS += ['js/src']
|
||||
else:
|
||||
TEST_DIRS += ['js/src/tests']
|
||||
|
@ -1,5 +1,5 @@
|
||||
[DEFAULT]
|
||||
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # bug 1233774
|
||||
skip-if = buildapp == 'b2g'
|
||||
support-files =
|
||||
bug_502091_iframe.html
|
||||
file_bug102699.sjs
|
||||
|
@ -215,7 +215,6 @@ class LinuxArtifactJob(ArtifactJob):
|
||||
'firefox/plugin-container',
|
||||
'firefox/updater',
|
||||
'firefox/**/*.so',
|
||||
mozpath.join('firefox', buildconfig.substs.get('ICU_DATA_FILE')),
|
||||
}
|
||||
|
||||
def process_package_artifact(self, filename, processed_filename):
|
||||
@ -307,7 +306,6 @@ class MacArtifactJob(ArtifactJob):
|
||||
'gmp-clearkey/0.1/libclearkey.dylib',
|
||||
# 'gmp-fake/1.0/libfake.dylib',
|
||||
# 'gmp-fakeopenh264/1.0/libfakeopenh264.dylib',
|
||||
buildconfig.substs.get('ICU_DATA_FILE'),
|
||||
])
|
||||
|
||||
with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
|
||||
@ -348,7 +346,6 @@ class WinArtifactJob(ArtifactJob):
|
||||
'firefox/application.ini',
|
||||
'firefox/**/*.dll',
|
||||
'firefox/*.exe',
|
||||
mozpath.join('firefox', buildconfig.substs.get('ICU_DATA_FILE')),
|
||||
}
|
||||
# These are a subset of TEST_HARNESS_BINS in testing/mochitest/Makefile.in.
|
||||
test_artifact_patterns = {
|
||||
|
@ -28,10 +28,12 @@ from mozbuild.configure.util import (
|
||||
LineIO,
|
||||
)
|
||||
from mozbuild.util import (
|
||||
exec_,
|
||||
memoize,
|
||||
ReadOnlyDict,
|
||||
ReadOnlyNamespace,
|
||||
)
|
||||
|
||||
import mozpack.path as mozpath
|
||||
|
||||
|
||||
@ -93,14 +95,16 @@ class ConfigureSandbox(dict):
|
||||
BUILTINS = ReadOnlyDict({
|
||||
b: __builtins__[b]
|
||||
for b in ('None', 'False', 'True', 'int', 'bool', 'any', 'all', 'len',
|
||||
'list', 'tuple', 'set', 'dict', 'isinstance')
|
||||
'list', 'tuple', 'set', 'dict', 'isinstance', 'getattr',
|
||||
'hasattr', 'enumerate', 'range', 'zip')
|
||||
}, __import__=forbidden_import, str=unicode)
|
||||
|
||||
# Expose a limited set of functions from os.path
|
||||
OS = ReadOnlyNamespace(path=ReadOnlyNamespace(**{
|
||||
k: getattr(mozpath, k, getattr(os.path, k))
|
||||
for k in ('abspath', 'basename', 'dirname', 'exists', 'isabs', 'isdir',
|
||||
'isfile', 'join', 'normpath', 'realpath', 'relpath')
|
||||
'isfile', 'join', 'normcase', 'normpath', 'realpath',
|
||||
'relpath')
|
||||
}))
|
||||
|
||||
def __init__(self, config, environ=os.environ, argv=sys.argv,
|
||||
@ -198,7 +202,7 @@ class ConfigureSandbox(dict):
|
||||
|
||||
code = compile(source, path, 'exec')
|
||||
|
||||
exec(code, self)
|
||||
exec_(code, self)
|
||||
|
||||
self._paths.pop(-1)
|
||||
|
||||
@ -495,6 +499,14 @@ class ConfigureSandbox(dict):
|
||||
for k, v in kwargs.iteritems()}
|
||||
ret = template(*args, **kwargs)
|
||||
if isfunction(ret):
|
||||
# We can't expect the sandboxed code to think about all the
|
||||
# details of implementing decorators, so do some of the
|
||||
# work for them. If the function takes exactly one function
|
||||
# as argument and returns a function, it must be a
|
||||
# decorator, so mark the returned function as wrapping the
|
||||
# function passed in.
|
||||
if len(args) == 1 and not kwargs and isfunction(args[0]):
|
||||
ret = wraps(args[0])(ret)
|
||||
return wrap_template(ret)
|
||||
return ret
|
||||
return wrapper
|
||||
@ -560,10 +572,7 @@ class ConfigureSandbox(dict):
|
||||
import_line += 'import %s' % _import
|
||||
if _as:
|
||||
import_line += ' as %s' % _as
|
||||
# Some versions of python fail with "SyntaxError: unqualified exec
|
||||
# is not allowed in function '_apply_imports' it contains a nested
|
||||
# function with free variable" when using the exec function.
|
||||
exec import_line in {}, glob
|
||||
exec_(import_line, {}, glob)
|
||||
|
||||
def _resolve_and_set(self, data, name, value):
|
||||
# Don't set anything when --help was on the command line
|
||||
@ -697,7 +706,6 @@ class ConfigureSandbox(dict):
|
||||
os=self.OS,
|
||||
log=self.log_impl,
|
||||
)
|
||||
self._apply_imports(func, glob)
|
||||
|
||||
# The execution model in the sandbox doesn't guarantee the execution
|
||||
# order will always be the same for a given function, and if it uses
|
||||
@ -717,12 +725,17 @@ class ConfigureSandbox(dict):
|
||||
closure = tuple(makecell(cell.cell_contents)
|
||||
for cell in func.func_closure)
|
||||
|
||||
func = wraps(func)(types.FunctionType(
|
||||
new_func = wraps(func)(types.FunctionType(
|
||||
func.func_code,
|
||||
glob,
|
||||
func.__name__,
|
||||
func.func_defaults,
|
||||
closure
|
||||
))
|
||||
self._prepared_functions.add(func)
|
||||
return func, glob
|
||||
@wraps(new_func)
|
||||
def wrapped(*args, **kwargs):
|
||||
self._apply_imports(func, glob)
|
||||
return new_func(*args, **kwargs)
|
||||
|
||||
self._prepared_functions.add(wrapped)
|
||||
return wrapped, glob
|
||||
|
@ -23,7 +23,10 @@ import os
|
||||
import sys
|
||||
import weakref
|
||||
|
||||
from mozbuild.util import ReadOnlyDict
|
||||
from mozbuild.util import (
|
||||
exec_,
|
||||
ReadOnlyDict,
|
||||
)
|
||||
from .context import Context
|
||||
from mozpack.files import FileFinder
|
||||
|
||||
@ -174,11 +177,7 @@ class Sandbox(dict):
|
||||
old_source = self._current_source
|
||||
self._current_source = source
|
||||
try:
|
||||
# Ideally, we'd use exec(code, self), but that yield the
|
||||
# following error:
|
||||
# SyntaxError: unqualified exec is not allowed in function
|
||||
# 'execute' it is a nested function.
|
||||
exec code in self
|
||||
exec_(code, self)
|
||||
finally:
|
||||
self._current_source = old_source
|
||||
|
||||
|
@ -160,7 +160,6 @@ set_config('IS_FILE', with_imports)
|
||||
# It is also possible to cherry-pick builtins.
|
||||
@depends('--with-imports')
|
||||
@imports('os.path')
|
||||
@imports(_from='__builtin__', _import='hasattr')
|
||||
def with_imports(value):
|
||||
if len(value):
|
||||
return hasattr(os.path, 'getatime')
|
||||
@ -168,7 +167,6 @@ def with_imports(value):
|
||||
set_config('HAS_GETATIME', with_imports)
|
||||
|
||||
@depends('--with-imports')
|
||||
@imports(_from='__builtin__', _import='hasattr')
|
||||
def with_imports(value):
|
||||
if len(value):
|
||||
return hasattr(os.path, 'getatime')
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file contains miscellaneous utility functions that don't belong anywhere
|
||||
# in particular.
|
||||
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
@ -42,6 +42,22 @@ if sys.platform == 'win32':
|
||||
_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x2000
|
||||
|
||||
|
||||
def exec_(object, globals=None, locals=None):
|
||||
"""Wrapper around the exec statement to avoid bogus errors like:
|
||||
|
||||
SyntaxError: unqualified exec is not allowed in function ...
|
||||
it is a nested function.
|
||||
|
||||
or
|
||||
|
||||
SyntaxError: unqualified exec is not allowed in function ...
|
||||
it contains a nested function with free variable
|
||||
|
||||
which happen with older versions of python 2.7.
|
||||
"""
|
||||
exec(object, globals, locals)
|
||||
|
||||
|
||||
def hash_file(path, hasher=None):
|
||||
"""Hashes a file specified by the path given and returns the hex digest."""
|
||||
|
||||
|
@ -117,6 +117,8 @@ var ContentMessageListener = {
|
||||
ContentTask._testScope.ok(data.condition, data.name, null, data.stack);
|
||||
} else if (aMessage.name == "content-task:test-info") {
|
||||
ContentTask._testScope.info(aMessage.data.name);
|
||||
} else if (aMessage.name == "content-task:test-todo") {
|
||||
ContentTask._testScope.todo(aMessage.data.expr, aMessage.data.name);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -35,6 +35,10 @@ addMessageListener("content-task:spawn", function (msg) {
|
||||
var is = Assert.equal.bind(Assert);
|
||||
var isnot = Assert.notEqual.bind(Assert);
|
||||
|
||||
function todo(expr, name) {
|
||||
sendAsyncMessage("content-task:test-todo", {id, expr, name});
|
||||
}
|
||||
|
||||
function info(name) {
|
||||
sendAsyncMessage("content-task:test-info", {id, name});
|
||||
}
|
||||
|
@ -2,13 +2,12 @@ config = {
|
||||
"log_name": "bump_esr",
|
||||
"version_files": [
|
||||
{"file": "browser/config/version.txt", "suffix": ""},
|
||||
# TODO: add the following line when ESR is 45
|
||||
# {"file": "browser/config/version_display.txt", "suffix": ""},
|
||||
{"file": "browser/config/version_display.txt", "suffix": ""},
|
||||
{"file": "config/milestone.txt", "suffix": ""},
|
||||
],
|
||||
"tools_repo_url": "https://hg.mozilla.org/build/tools",
|
||||
"tools_repo_revision": "default",
|
||||
"to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-esr38",
|
||||
"to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-esr45",
|
||||
|
||||
"migration_behavior": "bump_second_digit",
|
||||
"require_remove_locales": False,
|
||||
|
@ -14,7 +14,6 @@ user_pref("dom.forms.color", true); // on for testing
|
||||
user_pref("dom.max_script_run_time", 0); // no slow script dialogs
|
||||
user_pref("hangmonitor.timeout", 0); // no hang monitor
|
||||
user_pref("dom.max_chrome_script_run_time", 0);
|
||||
user_pref("dom.max_child_script_run_time", 0);
|
||||
user_pref("dom.ipc.reportProcessHangs", false); // process hang monitor
|
||||
user_pref("dom.popup_maximum", -1);
|
||||
user_pref("dom.send_after_paint_to_content", true);
|
||||
|
@ -28745,6 +28745,10 @@
|
||||
"path": "web-animations/animation-effect-timing/duration.html",
|
||||
"url": "/web-animations/animation-effect-timing/duration.html"
|
||||
},
|
||||
{
|
||||
"path": "web-animations/animation-effect-timing/easing.html",
|
||||
"url": "/web-animations/animation-effect-timing/easing.html"
|
||||
},
|
||||
{
|
||||
"path": "web-animations/animation-effect-timing/endDelay.html",
|
||||
"url": "/web-animations/animation-effect-timing/endDelay.html"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user