StringBeginsWith (resp. StringEndsWith) takes a defaulted
nsStringComparator object for doing comparisons. The flexibility this
affords is great, but the cost is not: nsStringComparator has virtual
methods, so initializing that defaulted object (at every callsite)
requires a temporary object whose vtable must be initialized.
Since the overwhemingly common case is to use the default comparator
anyway, we should not use defaulted arguments and instead provide the
default comparator/user-provided comparator cases as separate overloads.
This change eliminates the virtual call for the majority of callsites
and reduces codesize as well.
Atomic's constructor is marked as constexpr, but it calls a
non-constexpr function, ToStorageTypeArgument::convert. For compilers
which require constexpr-ness on constructors to inline away the actual
constructor call, the call to ToStorageTypeArgument::convert completely
disables the constexpr-ness of the constructor. Let's fix this by
marking all relevant instances of ToStorageTypeArgument::convert as
MOZ_CONSTEXPR, thus satisfying the compiler once again.
testing/marionette/EventUtils.js has been converted to a JS module in
testing/marionette/event.js and its API has changed. It was originally
a copy of testing/mochitest/tests/SimpleTest/EventUtils.js, and it should
be fine to use the original instead.
MozReview-Commit-ID: Exi9d5rEeOz
EventUtils.js previously allowed you to override the Window object
reference through passing it as an optional argument to its functions.
This change fixes certain uses of implicit globals that reside on Window.
MozReview-Commit-ID: EJT8iIs85ej
This change removes almost all the remaining uses of loadSubScript and
global scope pollution. The only remaining use is for common.js, which
is resolved by a later bug for evaluating scripts.
MozReview-Commit-ID: 96h0yLElauq
To simplify the dependency chain and reduce the number of duplicate
functions in Marionette, a number of functions have been removed from
interactions.js and added to elements.js. This makes them more easily
re-usable and works around a circular dependency issue.
MozReview-Commit-ID: TZc3VZzHqM
Through some very clever hacking of the arguments to each of the atoms,
we are able to contain this in a JS module: Atoms normally extract their
arguments directly from the function scoped `arguments' variable, but
by explicitly naming `window' as the last argument in the functions'
prototype we are able to set the `window' variable used inside.
This is obviously a big hack, but it encapsulates the atoms and we are
moving away from atoms in the long term.
MozReview-Commit-ID: KGO77fjRN2d
testing/marionette/sendkeys.js has been merged into the
new testing/marionette/event.js module, together with
testing/marionette/EventUtils.js.
There is a lot of functionality still left in this module that we can
probably remove, as it is not in use by Marionette.
MozReview-Commit-ID: GrjNuK9VPjp
Generally, Error prototypes that are not based on WebDriverError must
be wrapped so that they can be serialised across the AsyncMessageChannel.
MozReview-Commit-ID: EtkpEOBhrST
Due to a previous programming error, error.isError only recognised
the base Error prototype. It must also test for the other built-in
prototypes, such as TypeError et al.
MozReview-Commit-ID: HLkiOAg0Jl1
This adds a substs field and cherrypicks the MOZ_ARTIFACT_BUILDS field so
we can determine whether or not an artifact build occurred.
MozReview-Commit-ID: 8aio8mP8pmR
test_value_storage.html needs floating point numbers to round trip through css
parsing and serialization, but floating point isn't exact so we should be
careful what numbers we test. It turns out the value 0.9 the test was using is
close to the border between 229 and 230 when converted to an 8 bit int, but 0.8
is safer so change to that since the test doesn't depend on the value. Note
that this does not fix the issue that numbers don't always round trip, but only
wall papers over it by changing the test.