Merge mozilla-central to autoland

This commit is contained in:
arthur.iakab 2018-12-25 11:55:20 +02:00
Родитель 3fc2d93d35 da45a6b1c5
Коммит 1d0ef1721f
20 изменённых файлов: 249 добавлений и 87 удалений

Просмотреть файл

@ -60,7 +60,7 @@ skip-if = (debug && os == 'linux' && bits == 32) || (os == 'win' && !debug) # Bu
[browser_ext_browserAction_popup_preload.js] [browser_ext_browserAction_popup_preload.js]
skip-if = (os == 'win' && !debug) || (verify && debug && (os == 'mac')) # bug 1352668 skip-if = (os == 'win' && !debug) || (verify && debug && (os == 'mac')) # bug 1352668
[browser_ext_browserAction_popup_resize.js] [browser_ext_browserAction_popup_resize.js]
skip-if = (os == 'mac' && debug) # Bug 1482004, also fails in test-verify skip-if = (os == 'mac' || os == 'win' || os == 'linux') || (verify && debug) #Bug 1482004,1483701
[browser_ext_browserAction_simple.js] [browser_ext_browserAction_simple.js]
[browser_ext_browserAction_telemetry.js] [browser_ext_browserAction_telemetry.js]
[browser_ext_browserAction_theme_icons.js] [browser_ext_browserAction_theme_icons.js]

Просмотреть файл

@ -757,26 +757,14 @@ def vc_compiler_path(host, target, vs_major_version, env, vs_release_name):
return paths return paths
@dependable @depends(vc_compiler_path)
@imports(_from='os', _import='environ')
def original_path():
return environ['PATH']
@depends(vc_compiler_path, original_path)
@imports('os') @imports('os')
@imports(_from='os', _import='environ') @imports(_from='os', _import='environ')
def toolchain_search_path(vc_compiler_path, original_path): def toolchain_search_path(vc_compiler_path):
result = [original_path] result = [environ.get('PATH')]
if vc_compiler_path: if vc_compiler_path:
# The second item, if there is one, is necessary to have in $PATH for result.extend(vc_compiler_path)
# Windows to load the required DLLs from there.
if len(vc_compiler_path) > 1:
environ['PATH'] = os.pathsep.join(result + vc_compiler_path[1:])
# The first item is where the programs are going to be
result.append(vc_compiler_path[0])
# Also add in the location to which `mach bootstrap` or # Also add in the location to which `mach bootstrap` or
# `mach artifact toolchain` installs clang. # `mach artifact toolchain` installs clang.
@ -788,25 +776,15 @@ def toolchain_search_path(vc_compiler_path, original_path):
bootstrap_cbindgen_path = os.path.join(mozbuild_state_dir, 'cbindgen') bootstrap_cbindgen_path = os.path.join(mozbuild_state_dir, 'cbindgen')
result.append(bootstrap_cbindgen_path) result.append(bootstrap_cbindgen_path)
if vc_compiler_path:
# We're going to alter PATH for good in windows.configure, but we also
# need to do it for the valid_compiler() check below. This is only needed
# on Windows, where MSVC needs PATH set to find dlls.
environ['PATH'] = os.pathsep.join(result)
return result return result
# If we modified the PATH environment variable for Windows DLLs, set the PATH
# variable for the build.
@depends(toolchain_search_path, original_path)
@imports(_from='os', _import='environ')
def altered_path(toolchain_search_path, original_path):
# Touch the dependency for the linter. We don't actually need the value,
# only its side effects.
toolchain_search_path
if environ['PATH'] != original_path:
return environ['PATH']
set_config('PATH', altered_path)
@template @template
def default_c_compilers(host_or_target, other_c_compiler=None): def default_c_compilers(host_or_target, other_c_compiler=None):
'''Template defining the set of default C compilers for the host and '''Template defining the set of default C compilers for the host and
@ -1021,6 +999,26 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
if not flags and macos_sdk and host_or_target.os == 'OSX': if not flags and macos_sdk and host_or_target.os == 'OSX':
flags = ['-isysroot', macos_sdk] flags = ['-isysroot', macos_sdk]
# Ideally, we'd always use the absolute path, but unfortunately, on
# Windows, the compiler is very often in a directory containing spaces.
# Unfortunately, due to the way autoconf does its compiler tests with
# eval, that doesn't work out. So in that case, check that the
# compiler can still be found in $PATH, and use the file name instead
# of the full path.
if quote(compiler) != compiler:
full_path = os.path.abspath(compiler)
compiler = os.path.basename(compiler)
found_compiler = find_program(compiler)
if not found_compiler:
die('%s is not in your $PATH'
% quote(os.path.dirname(full_path)))
if os.path.normcase(find_program(compiler)) != os.path.normcase(
full_path):
die('Found `%s` before `%s` in your $PATH. '
'Please reorder your $PATH.',
quote(os.path.dirname(found_compiler)),
quote(os.path.dirname(full_path)))
info = check_compiler(wrapper + [compiler] + flags, language, info = check_compiler(wrapper + [compiler] + flags, language,
host_or_target) host_or_target)
@ -1467,8 +1465,7 @@ set_config('PROFILE_USE_CFLAGS', pgo_flags.use_cflags)
set_config('PROFILE_USE_LDFLAGS', pgo_flags.use_ldflags) set_config('PROFILE_USE_LDFLAGS', pgo_flags.use_ldflags)
llvm_profdata = check_prog('LLVM_PROFDATA', ['llvm-profdata'], llvm_profdata = check_prog('LLVM_PROFDATA', ['llvm-profdata'],
allow_missing=True, allow_missing=True)
paths=toolchain_search_path)
add_old_configure_assignment('LLVM_PROFDATA', llvm_profdata) add_old_configure_assignment('LLVM_PROFDATA', llvm_profdata)
@ -1960,8 +1957,7 @@ def as_info(target, c_compiler):
# `provided_compiler`. # `provided_compiler`.
provided_assembler = provided_program('AS') provided_assembler = provided_program('AS')
assembler = check_prog('_AS', input=provided_assembler.program, assembler = check_prog('_AS', input=provided_assembler.program,
what='the assembler', progs=as_info.names, what='the assembler', progs=as_info.names)
paths=toolchain_search_path)
@depends(as_info, assembler, provided_assembler, c_compiler) @depends(as_info, assembler, provided_assembler, c_compiler)
def as_with_flags(as_info, assembler, provided_assembler, c_compiler): def as_with_flags(as_info, assembler, provided_assembler, c_compiler):

Просмотреть файл

@ -256,9 +256,9 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env, c_compiler):
) )
@depends(c_compiler, toolchain_search_path) @depends(c_compiler)
@imports('os') @imports('os')
def vc_path(c_compiler, toolchain_search_path): def vc_path(c_compiler):
vc_path_env = os.environ.get('VC_PATH') vc_path_env = os.environ.get('VC_PATH')
if vc_path_env: if vc_path_env:
return os.path.normpath(vc_path_env) return os.path.normpath(vc_path_env)
@ -266,13 +266,17 @@ def vc_path(c_compiler, toolchain_search_path):
if c_compiler.type not in ('msvc', 'clang-cl'): if c_compiler.type not in ('msvc', 'clang-cl'):
return return
# Normally, we'd start from c_compiler.compiler, but for now, it's not the
# ideal full path to the compiler. At least, we're guaranteed find_program
# will get us the one we found in toolchain.configure.
vc_program = c_compiler.compiler vc_program = c_compiler.compiler
# In clang-cl builds, we use the headers and libraries from an MSVC installation. # In clang-cl builds, we use the headers and libraries from an MSVC installation.
if c_compiler.type == 'clang-cl': if c_compiler.type == 'clang-cl':
vc_program = find_program('cl.exe', paths=toolchain_search_path) vc_program = 'cl.exe'
result = os.path.dirname(vc_program) cl = find_program(vc_program)
result = os.path.dirname(cl)
while True: while True:
next, p = os.path.split(result) next, p = os.path.split(result)
if next == result: if next == result:
@ -464,6 +468,20 @@ host_link = check_prog('HOST_LINKER', ('lld-link.exe', 'link.exe'),
add_old_configure_assignment('LINKER', link) add_old_configure_assignment('LINKER', link)
# Normally, we'd just have CC, etc. set to absolute paths, but the build system
# doesn't currently handle properly the case where the paths contain spaces.
# Additionally, there's the issue described in toolchain.configure, in
# valid_compiler().
@depends(sdk_bin_path)
@imports('os')
def alter_path(sdk_bin_path):
path = os.pathsep.join(sdk_bin_path)
os.environ['PATH'] = path
return path
set_config('PATH', alter_path)
check_prog('MAKECAB', ('makecab.exe',)) check_prog('MAKECAB', ('makecab.exe',))

Просмотреть файл

@ -45,10 +45,3 @@ if [ -d "${VSPATH}" ]; then
fi fi
. $topsrcdir/build/mozconfig.vs-common . $topsrcdir/build/mozconfig.vs-common
mk_export_correct_style WINDOWSSDKDIR
mk_export_correct_style WIN32_REDIST_DIR
mk_export_correct_style WIN_DIA_SDK_BIN_DIR
mk_export_correct_style PATH
mk_export_correct_style INCLUDE
mk_export_correct_style LIB

Просмотреть файл

@ -592,6 +592,7 @@ support-files =
examples/fetch.js examples/fetch.js
examples/doc-xhr.html examples/doc-xhr.html
examples/doc-xhr-run-to-completion.html examples/doc-xhr-run-to-completion.html
examples/doc-scroll-run-to-completion.html
examples/sum/sum.js examples/sum/sum.js
examples/sum/sum.min.js examples/sum/sum.min.js
examples/sum/sum.min.js.map examples/sum/sum.min.js.map
@ -650,6 +651,8 @@ support-files =
examples/script-switching-02.js examples/script-switching-02.js
examples/script-switching-01.js examples/script-switching-01.js
examples/times2.js examples/times2.js
examples/doc-windowless-workers.html
examples/simple-worker.js
examples/doc_rr_basic.html examples/doc_rr_basic.html
examples/doc_rr_continuous.html examples/doc_rr_continuous.html
examples/doc_rr_logs.html examples/doc_rr_logs.html
@ -662,6 +665,7 @@ support-files =
skip-if = (os == "win" && ccov) # Bug 1453549 skip-if = (os == "win" && ccov) # Bug 1453549
[browser_dbg-xhr-breakpoints.js] [browser_dbg-xhr-breakpoints.js]
[browser_dbg-xhr-run-to-completion.js] [browser_dbg-xhr-run-to-completion.js]
[browser_dbg-scroll-run-to-completion.js]
[browser_dbg-sourcemapped-scopes.js] [browser_dbg-sourcemapped-scopes.js]
skip-if = ccov || (verify && debug && (os == 'linux')) # Bug 1441545 skip-if = ccov || (verify && debug && (os == 'linux')) # Bug 1441545
[browser_dbg-sourcemapped-stepping.js] [browser_dbg-sourcemapped-stepping.js]
@ -762,6 +766,7 @@ skip-if = os == "win"
skip-if = os == "win" skip-if = os == "win"
[browser_dbg-wasm-sourcemaps.js] [browser_dbg-wasm-sourcemaps.js]
skip-if = true skip-if = true
[browser_dbg-windowless-workers.js]
[browser_dbg_rr_breakpoints-01.js] [browser_dbg_rr_breakpoints-01.js]
skip-if = os != "mac" || debug || !nightly_build skip-if = os != "mac" || debug || !nightly_build
[browser_dbg_rr_breakpoints-02.js] [browser_dbg_rr_breakpoints-02.js]

Просмотреть файл

@ -0,0 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
add_task(async function() {
const dbg = await initDebugger("doc-scroll-run-to-completion.html");
invokeInTab("pauseOnce", "doc-scroll-run-to-completion.html");
await waitForPaused(dbg);
assertPausedLocation(dbg);
const threadClient = dbg.toolbox.threadClient;
await checkEvaluateInTopFrame(threadClient, 'window.scrollBy(0, 10);', undefined);
// checkEvaluateInTopFrame does an implicit resume for some reason.
await waitForPaused(dbg);
resume(dbg);
await once(Services.ppmm, "test passed");
});

Просмотреть файл

@ -0,0 +1,45 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test basic windowless worker functionality: the main thread and worker can be
// separately controlled from the same debugger.
add_task(async function() {
await pushPref("devtools.debugger.features.windowless-workers", true);
const dbg = await initDebugger("doc-windowless-workers.html");
const mainThread = dbg.toolbox.threadClient.actor;
const workers = await getWorkers(dbg);
ok(workers.length == 1, "Got one worker");
const workerThread = workers[0].actor;
const mainThreadSource = findSource(dbg, "doc-windowless-workers.html");
const workerSource = findSource(dbg, "simple-worker.js");
assertNotPaused(dbg);
await dbg.actions.breakOnNext();
await waitForPaused(dbg, "doc-windowless-workers.html");
// We should be paused at the timer in doc-windowless-workers.html
assertPausedAtSourceAndLine(dbg, mainThreadSource.id, 9);
await dbg.actions.selectThread(workerThread);
assertNotPaused(dbg);
await dbg.actions.breakOnNext();
await waitForPaused(dbg, "simple-worker.js");
// We should be paused at the timer in simple-worker.js
assertPausedAtSourceAndLine(dbg, workerSource.id, 3);
await stepOver(dbg);
assertPausedAtSourceAndLine(dbg, workerSource.id, 4);
await dbg.actions.selectThread(mainThread);
await stepOver(dbg);
assertPausedAtSourceAndLine(dbg, mainThreadSource.id, 10);
});

Просмотреть файл

@ -0,0 +1,27 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html>
<meta charset=UTF-8>
<body></body>
<script>
const cpmm = SpecialPowers.Services.cpmm;
var result;
for (var i = 0; i < 100; i++) {
var div = document.createElement("div");
div.innerHTML = "Hello World!";
document.body.insertBefore(div, document.body.firstChild);
}
async function pauseOnce() {
window.addEventListener('scroll', done);
result = "test failed";
debugger;
result = "test passed";
}
function done() {
cpmm.sendAsyncMessage(result);
}
</script>

Просмотреть файл

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<script>
var worker = new Worker("simple-worker.js");
var count = 0;
function timer() {
var n = ++count;
console.log("MAIN THREAD SAYS HELLO! " + n);
}
setInterval(timer, 1000);
</script>
<body>
Hello World!
</body>
</html>

Просмотреть файл

@ -0,0 +1,7 @@
var count = 0;
function timer() {
var n = ++count;
console.log("WORKER SAYS HELLO! " + n);
}
setInterval(timer, 1000);

Просмотреть файл

@ -405,6 +405,34 @@ function isPaused(dbg) {
return !!isPaused(getState()); return !!isPaused(getState());
} }
// Make sure the debugger is paused at a certain source ID and line.
function assertPausedAtSourceAndLine(dbg, expectedSourceId, expectedLine) {
assertPaused(dbg);
const {
selectors: { getWorkers, getFrames },
getState
} = dbg;
const frames = getFrames(getState());
ok(frames.length >= 1, "Got at least one frame");
const { sourceId, line } = frames[0].location;
ok(sourceId == expectedSourceId, "Frame has correct source");
ok(line == expectedLine, "Frame has correct line");
}
// Get any workers associated with the debugger.
async function getWorkers(dbg) {
await dbg.actions.updateWorkers();
const {
selectors: { getWorkers },
getState
} = dbg;
return getWorkers(getState()).toJS();
}
async function waitForLoadedScopes(dbg) { async function waitForLoadedScopes(dbg) {
const scopes = await waitForElement(dbg, "scopes"); const scopes = await waitForElement(dbg, "scopes");
// Since scopes auto-expand, we can assume they are loaded when there is a tree node // Since scopes auto-expand, we can assume they are loaded when there is a tree node

Просмотреть файл

@ -168,7 +168,7 @@ support-files =
skip-if = true # Bug 1437843 skip-if = true # Bug 1437843
[browser_console_consolejsm_output.js] [browser_console_consolejsm_output.js]
[browser_console_context_menu_entries.js] [browser_console_context_menu_entries.js]
skip-if = (os == "linux" && (debug || ccov)) # Bug 1440059 skip-if = os == "linux" # Bug 1440059, disabled for all build types
[browser_console_dead_objects.js] [browser_console_dead_objects.js]
[browser_console_devtools_loader_exception.js] [browser_console_devtools_loader_exception.js]
[browser_console_error_source_click.js] [browser_console_error_source_click.js]

Просмотреть файл

@ -8202,7 +8202,7 @@ bool nsContentUtils::IsThirdPartyWindowOrChannel(nsPIDOMWindowInner* aWindow,
if (aWindow) { if (aWindow) {
nsresult rv = thirdPartyUtil->IsThirdPartyWindow(aWindow->GetOuterWindow(), nsresult rv = thirdPartyUtil->IsThirdPartyWindow(aWindow->GetOuterWindow(),
aURI, &thirdParty); aURI, &thirdParty);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_FAILED(rv)) {
// Ideally we would do something similar to the channel code path here, // Ideally we would do something similar to the channel code path here,
// but existing code depends on this behaviour. // but existing code depends on this behaviour.
return false; return false;

Просмотреть файл

@ -536,7 +536,7 @@ skip-if = toolkit == 'android' #bug 811644
[test_bug340017.xhtml] [test_bug340017.xhtml]
[test_bug359657.html] [test_bug359657.html]
[test_bug369370.html] [test_bug369370.html]
skip-if = toolkit == "android" || toolkit == "windows" # disabled on Windows because of bug 1234520 skip-if = toolkit == "android" || toolkit == "windows" || os == 'linux' # disabled on Windows because of bug 1234520, disabled on linux bug 1258103
[test_bug380383.html] [test_bug380383.html]
[test_bug402680.html] [test_bug402680.html]
[test_bug403868.html] [test_bug403868.html]

Просмотреть файл

@ -4,51 +4,52 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsSMILFloatType.h" #include "SMILFloatType.h"
#include "nsSMILValue.h" #include "nsSMILValue.h"
#include "nsDebug.h" #include "nsDebug.h"
#include <math.h> #include <math.h>
void nsSMILFloatType::Init(nsSMILValue& aValue) const { namespace mozilla {
void SMILFloatType::Init(nsSMILValue& aValue) const {
MOZ_ASSERT(aValue.IsNull(), "Unexpected value type"); MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
aValue.mU.mDouble = 0.0; aValue.mU.mDouble = 0.0;
aValue.mType = this; aValue.mType = this;
} }
void nsSMILFloatType::Destroy(nsSMILValue& aValue) const { void SMILFloatType::Destroy(nsSMILValue& aValue) const {
MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
aValue.mU.mDouble = 0.0; aValue.mU.mDouble = 0.0;
aValue.mType = nsSMILNullType::Singleton(); aValue.mType = nsSMILNullType::Singleton();
} }
nsresult nsSMILFloatType::Assign(nsSMILValue& aDest, nsresult SMILFloatType::Assign(nsSMILValue& aDest,
const nsSMILValue& aSrc) const { const nsSMILValue& aSrc) const {
MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types"); MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value"); MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
aDest.mU.mDouble = aSrc.mU.mDouble; aDest.mU.mDouble = aSrc.mU.mDouble;
return NS_OK; return NS_OK;
} }
bool nsSMILFloatType::IsEqual(const nsSMILValue& aLeft, bool SMILFloatType::IsEqual(const nsSMILValue& aLeft,
const nsSMILValue& aRight) const { const nsSMILValue& aRight) const {
MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types"); MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value"); MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
return aLeft.mU.mDouble == aRight.mU.mDouble; return aLeft.mU.mDouble == aRight.mU.mDouble;
} }
nsresult nsSMILFloatType::Add(nsSMILValue& aDest, nsresult SMILFloatType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
const nsSMILValue& aValueToAdd, uint32_t aCount) const {
uint32_t aCount) const {
MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types"); MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type"); MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
aDest.mU.mDouble += aValueToAdd.mU.mDouble * aCount; aDest.mU.mDouble += aValueToAdd.mU.mDouble * aCount;
return NS_OK; return NS_OK;
} }
nsresult nsSMILFloatType::ComputeDistance(const nsSMILValue& aFrom, nsresult SMILFloatType::ComputeDistance(const nsSMILValue& aFrom,
const nsSMILValue& aTo, const nsSMILValue& aTo,
double& aDistance) const { double& aDistance) const {
MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types"); MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
MOZ_ASSERT(aFrom.mType == this, "Unexpected source type"); MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
@ -60,10 +61,10 @@ nsresult nsSMILFloatType::ComputeDistance(const nsSMILValue& aFrom,
return NS_OK; return NS_OK;
} }
nsresult nsSMILFloatType::Interpolate(const nsSMILValue& aStartVal, nsresult SMILFloatType::Interpolate(const nsSMILValue& aStartVal,
const nsSMILValue& aEndVal, const nsSMILValue& aEndVal,
double aUnitDistance, double aUnitDistance,
nsSMILValue& aResult) const { nsSMILValue& aResult) const {
MOZ_ASSERT(aStartVal.mType == aEndVal.mType, MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
"Trying to interpolate different types"); "Trying to interpolate different types");
MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation"); MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
@ -76,3 +77,5 @@ nsresult nsSMILFloatType::Interpolate(const nsSMILValue& aStartVal,
return NS_OK; return NS_OK;
} }
} // namespace mozilla

Просмотреть файл

@ -10,11 +10,13 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsISMILType.h" #include "nsISMILType.h"
class nsSMILFloatType : public nsISMILType { namespace mozilla {
class SMILFloatType : public nsISMILType {
public: public:
// Singleton for nsSMILValue objects to hold onto. // Singleton for nsSMILValue objects to hold onto.
static nsSMILFloatType* Singleton() { static SMILFloatType* Singleton() {
static nsSMILFloatType sSingleton; static SMILFloatType sSingleton;
return &sSingleton; return &sSingleton;
} }
@ -38,7 +40,9 @@ class nsSMILFloatType : public nsISMILType {
private: private:
// Private constructor: prevent instances beyond my singleton. // Private constructor: prevent instances beyond my singleton.
constexpr nsSMILFloatType() {} constexpr SMILFloatType() {}
}; };
} // namespace mozilla
#endif // NS_SMILFLOATTYPE_H_ #endif // NS_SMILFLOATTYPE_H_

Просмотреть файл

@ -44,7 +44,6 @@ UNIFIED_SOURCES += [
'nsSMILCompositor.cpp', 'nsSMILCompositor.cpp',
'nsSMILCSSProperty.cpp', 'nsSMILCSSProperty.cpp',
'nsSMILCSSValueType.cpp', 'nsSMILCSSValueType.cpp',
'nsSMILFloatType.cpp',
'nsSMILInstanceTime.cpp', 'nsSMILInstanceTime.cpp',
'nsSMILInterval.cpp', 'nsSMILInterval.cpp',
'nsSMILKeySpline.cpp', 'nsSMILKeySpline.cpp',
@ -59,6 +58,7 @@ UNIFIED_SOURCES += [
'nsSMILValue.cpp', 'nsSMILValue.cpp',
'SMILBoolType.cpp', 'SMILBoolType.cpp',
'SMILEnumType.cpp', 'SMILEnumType.cpp',
'SMILFloatType.cpp',
'SMILIntegerType.cpp', 'SMILIntegerType.cpp',
'SMILStringType.cpp', 'SMILStringType.cpp',
'TimeEvent.cpp', 'TimeEvent.cpp',

Просмотреть файл

@ -11,7 +11,7 @@
#include "mozilla/dom/SVGViewportElement.h" #include "mozilla/dom/SVGViewportElement.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE #include "nsContentUtils.h" // NS_ENSURE_FINITE
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsSMILFloatType.h" #include "SMILFloatType.h"
#include "nsSMILValue.h" #include "nsSMILValue.h"
#include "nsSVGAttrTearoffTable.h" #include "nsSVGAttrTearoffTable.h"
#include "nsSVGIntegrationUtils.h" #include "nsSVGIntegrationUtils.h"
@ -436,7 +436,7 @@ nsresult nsSVGLength2::SMILLength::ValueFromString(
return NS_ERROR_DOM_SYNTAX_ERR; return NS_ERROR_DOM_SYNTAX_ERR;
} }
nsSMILValue val(nsSMILFloatType::Singleton()); nsSMILValue val(SMILFloatType::Singleton());
val.mU.mDouble = value * mVal->GetPixelsPerUnit(mSVGElement, unitType); val.mU.mDouble = value * mVal->GetPixelsPerUnit(mSVGElement, unitType);
aValue = val; aValue = val;
aPreventCachingOfSandwich = aPreventCachingOfSandwich =
@ -448,7 +448,7 @@ nsresult nsSVGLength2::SMILLength::ValueFromString(
} }
nsSMILValue nsSVGLength2::SMILLength::GetBaseValue() const { nsSMILValue nsSVGLength2::SMILLength::GetBaseValue() const {
nsSMILValue val(nsSMILFloatType::Singleton()); nsSMILValue val(SMILFloatType::Singleton());
val.mU.mDouble = mVal->GetBaseValue(mSVGElement); val.mU.mDouble = mVal->GetBaseValue(mSVGElement);
return val; return val;
} }
@ -462,9 +462,9 @@ void nsSVGLength2::SMILLength::ClearAnimValue() {
} }
nsresult nsSVGLength2::SMILLength::SetAnimValue(const nsSMILValue& aValue) { nsresult nsSVGLength2::SMILLength::SetAnimValue(const nsSMILValue& aValue) {
NS_ASSERTION(aValue.mType == nsSMILFloatType::Singleton(), NS_ASSERTION(aValue.mType == SMILFloatType::Singleton(),
"Unexpected type to assign animated value"); "Unexpected type to assign animated value");
if (aValue.mType == nsSMILFloatType::Singleton()) { if (aValue.mType == SMILFloatType::Singleton()) {
return mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement); return mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement);
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -7,7 +7,7 @@
#include "nsSVGNumber2.h" #include "nsSVGNumber2.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsContentUtils.h" // NS_ENSURE_FINITE #include "nsContentUtils.h" // NS_ENSURE_FINITE
#include "nsSMILFloatType.h" #include "SMILFloatType.h"
#include "nsSMILValue.h" #include "nsSMILValue.h"
#include "nsSVGAttrTearoffTable.h" #include "nsSVGAttrTearoffTable.h"
#include "SVGContentUtils.h" #include "SVGContentUtils.h"
@ -126,7 +126,7 @@ nsresult nsSVGNumber2::SMILNumber::ValueFromString(
return NS_ERROR_DOM_SYNTAX_ERR; return NS_ERROR_DOM_SYNTAX_ERR;
} }
nsSMILValue val(nsSMILFloatType::Singleton()); nsSMILValue val(SMILFloatType::Singleton());
val.mU.mDouble = value; val.mU.mDouble = value;
aValue = val; aValue = val;
aPreventCachingOfSandwich = false; aPreventCachingOfSandwich = false;
@ -135,7 +135,7 @@ nsresult nsSVGNumber2::SMILNumber::ValueFromString(
} }
nsSMILValue nsSVGNumber2::SMILNumber::GetBaseValue() const { nsSMILValue nsSVGNumber2::SMILNumber::GetBaseValue() const {
nsSMILValue val(nsSMILFloatType::Singleton()); nsSMILValue val(SMILFloatType::Singleton());
val.mU.mDouble = mVal->mBaseVal; val.mU.mDouble = mVal->mBaseVal;
return val; return val;
} }
@ -149,9 +149,9 @@ void nsSVGNumber2::SMILNumber::ClearAnimValue() {
} }
nsresult nsSVGNumber2::SMILNumber::SetAnimValue(const nsSMILValue& aValue) { nsresult nsSVGNumber2::SMILNumber::SetAnimValue(const nsSMILValue& aValue) {
NS_ASSERTION(aValue.mType == nsSMILFloatType::Singleton(), NS_ASSERTION(aValue.mType == SMILFloatType::Singleton(),
"Unexpected type to assign animated value"); "Unexpected type to assign animated value");
if (aValue.mType == nsSMILFloatType::Singleton()) { if (aValue.mType == SMILFloatType::Singleton()) {
mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement); mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement);
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -1088,8 +1088,7 @@ def check_for_midl(target, compile_environment):
return True return True
midl = check_prog('MIDL', midl_names, when=check_for_midl, allow_missing=True, midl = check_prog('MIDL', midl_names, when=check_for_midl, allow_missing=True)
paths=sdk_bin_path)
@depends(c_compiler, target, when=depends(midl, target)(lambda m, t: m and t.kernel == 'WINNT')) @depends(c_compiler, target, when=depends(midl, target)(lambda m, t: m and t.kernel == 'WINNT'))
@ -1276,8 +1275,7 @@ set_config('MOZ_LAYOUT_DEBUGGER', depends_if('--enable-layout-debugger')(lambda
with only_when(compile_environment): with only_when(compile_environment):
fxc = check_prog('FXC', ('fxc.exe', 'fxc2.exe'), when=depends(target) fxc = check_prog('FXC', ('fxc.exe', 'fxc2.exe'), when=depends(target)
(lambda t: t.kernel == 'WINNT'), (lambda t: t.kernel == 'WINNT'))
paths=sdk_bin_path)
wine = check_prog('WINE', ['wine'], when=depends(target, host) wine = check_prog('WINE', ['wine'], when=depends(target, host)
(lambda t, h: t.kernel == 'WINNT' and h.kernel == 'Linux')) (lambda t, h: t.kernel == 'WINNT' and h.kernel == 'Linux'))