Граф коммитов

25 Коммитов

Автор SHA1 Сообщение Дата
Tom Ritter 88fc3fb4ea Bug 1440195 Address CSS Animations r=birtles
For now, we are going to make _all_ CSS Animations related timer fuzzing
only applicable in Resist Fingerprinting Mode (addressing the last couple
that had not already been configured that way.)

We hardcode their content mix-ins as zero, but leave comments indicating
how they should behave.

MozReview-Commit-ID: KhmV7wO8Pt5

--HG--
extra : rebase_source : 3b087d40b6332d447b442b435ed6fee8993e0145
2018-03-05 15:58:46 -06:00
Tooru Fujisawa 9a81f2437f Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:

1. GlobalObject::CallerType(), that is ultimately passed to
   nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
   to decide whether to copy mIterationComposite/mComposite to
   KeyframeEffectParams.

   GlobalObject::CallerType() can now be different than the target window's one,
   if the caller has the system principal and the target is web content, and
   in that case nsDocument::IsWebAnimationsEnabled there always returns true
   while Web Animations can be disabled on web content.

   honoring the mIterationComposite/mComposite properties is OK, since it just
   changes the animation behavior, and this is disabled by default until
   remaining spec issues are resolved.

2. GlobalObject::Context(), that is ultimately passed to
   KeyframeUtils::GetKeyframesFromObject and used while extracting information
   from passed-in keyframe object, with iterable/iterator protocols.

   Performing that operation in the caller side is okay, since the same thing
   can be done on caller, and the operation doesn't perform any GCThing
   allocation on the target window global.
2018-02-17 17:21:13 +09:00
Tooru Fujisawa d70a10cbd8 Backed out changeset c3f16a179c93 (bug 1414674) 2018-02-18 01:24:08 +09:00
Tooru Fujisawa d58a217b1c Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:

1. The target window global is used for most operation:
     * KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
       global instead of current global.
     * KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`

   In Xray case, Web Animations API can be disabled on web content
   (currently disabled on beta/release by default), and in that case some API
   won't work even it's triggered from WebExtensions, but it should be fine.

2. GetKeyframesFromObject is executed in the caller's compartment to access
   the passed-in JSObject that is keyframe, with iterable/iterator protocols.
   This operation doesn't perform any GCThing allocation on the target window
   global.
2018-02-17 17:21:13 +09:00
Tom Ritter 8184fa2b43 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : f3d8c1f9561fbb19d1ca8594ba2b69cffd25445b
2018-02-07 16:50:57 -06:00
Csoregi Natalia 7f21ecd2bf Backed out 4 changesets (bug 1435296) for for failing devtools' browser_webconsole_check_stubs_console_api.js and mochitest's dom/smil/test/test_smilTimeEvents.xhtml. CLOSED TREE
Backed out changeset 1f07c08daa41 (bug 1435296)
Backed out changeset 89c121b45b30 (bug 1435296)
Backed out changeset be9496eff7b8 (bug 1435296)
Backed out changeset 2f94f155318e (bug 1435296)
2018-02-09 17:20:53 +02:00
Tom Ritter b5eec93654 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : 5c1a3a1bb7cb10cd5c4a608f30bf097bd7e119b9
2018-02-07 16:50:57 -06:00
Brian Birtles c64d600a96 Bug 1418220 - Drop AnimationUtils::IsCoreAPIEnabled(ForCaller) and use nsContentUtils::AnimationsAPICoreEnabled / nsDocument::IsWebAnimationsEnabled instead; r=hiro
The difference between nsDocument::IsWebAnimationsEnabled and
nsContentUtils::AnimationsAPICoreEnabled is that the former checks the caller
type and treats the preference as set for system callers which is particularly
needed for enabling things like the getProperties() API for DevTools etc.

Generally in API-facing call sites we have a JS context / CallerType and so we
want to distinguish between system callers and non-system callers. However, for
a few internal uses--specifically filling-in missing keyframes--we don't care
about the caller type and always follow the pref setting.

That may or not be quite what we want, but this patch doesn't change that except
for one call site: KeyframeUtils::GetKeyframesFromObject. This patch changes
GetKeyframesFromObject from *not* checking the caller type to checking the
caller type. That seems to be the correct behavior here since this is called
from KeyframeEffectReadOnly::SetKeyframes(JSContext*, JS::Handle<JSObject*>,
ErrorResult&) (i.e. a JS API-facing call site) where we *should* enable the full
API when the caller is chrome code.

MozReview-Commit-ID: FQJBk3zytwd

--HG--
extra : rebase_source : 577bca1e551e39fecfab309f64c993eba110337f
2017-11-20 14:18:43 +09:00
Tim Huang 5d6e73cb8d Bug 1382545 - Part 1: Rounding the time of Animation API to 100ms when 'privacy.resistFingerprinting'is true. r=arthuredelstein,birtles
Adopt from Tor #16337.

This patch makes Animation API to report a rounded time when 'privacy.resistFingerprinting'
is true. The Animation API uses AnimationUtils::TimeDurationToDouble() to convert
its time duration into a double value and reports it when someone tries to query
time through Animation API. So, we use nsRFPService::ReduceTimePrecisionAsMSecs()
inside this method to round the time in the scope of the millisecond.

MozReview-Commit-ID: 8o01G6AlAu9

--HG--
extra : rebase_source : e2d52f04c1d63accb786f6cf9b1a102607eed517
2017-08-17 22:37:29 +08:00
Hiroyuki Ikezoe 4047570520 Bug 1333846 - Part 1: Move ContainsAnimatedScale() codes into dom/animation/. r=birtles a=abillings
MozReview-Commit-ID: 6bWeTfCmjtd
2017-02-09 11:28:47 +09:00
Boris Zbarsky 59f74104a6 Bug 1321879 part 2. Stop using IsCallerChrome() in animations API. r=birtles 2016-12-06 23:47:23 -10:00
Hiroyuki Ikezoe aa1cc722cf Bug 1305325 - Part 5: Add AnimationUtils::IsCoreAPIEnabled. r=birtles
To check simulateComputeValuesFailure flag in chrome privilege, we will need
to know the core Web Animations API preference is enabled in chrome privilege.

MozReview-Commit-ID: GYRMc9Od4Bm
2016-12-04 08:07:40 +09:00
Boris Chiou cd6c2e6bff Bug 1304805 - Make spacing, iteration composite and effect composite work if the caller is chrome. r=hiro
MozReview-Commit-ID: 30BOUA8QPh8

--HG--
extra : rebase_source : 21af58ad6f27f47404affe2f87fb9a426f01b496
2016-09-23 14:31:34 +08:00
Boris Chiou 2721920a34 Bug 1293106 - Ignore 'spacing' if dom.animations-api.core.enabled is false. r=birtles
MozReview-Commit-ID: K7hbCjLP6vB

--HG--
extra : rebase_source : 0e774faec05527c2267ae1df48db55856b6b6c75
2016-08-10 17:58:49 +08:00
Hiroyuki Ikezoe fc371e8226 Bug 1166500 - Part 11: Add a preference for offscreen throttling. r=dbaron
MozReview-Commit-ID: AD34RTVZcxy
2016-05-24 12:57:43 +09:00
Brian Birtles ed5ce2394b Bug 1247004 part 1 - Drop orphaned declaration AnimationUtils::ParseEasing; r=heycam
MozReview-Commit-ID: 6FSXOXeXomG
2016-04-15 15:26:27 +09:00
Brian Birtles 3edb5638a1 Bug 1246320 part 2 - Pass document to ParseEasing; r=hiro
MozReview-Commit-ID: KWW53htO0Jj

--HG--
extra : rebase_source : 85aaa0a66cae7623fa06ebf31e0b8481ee05bbde
2016-03-11 17:21:03 +09:00
Brian Birtles 56844c08b6 Bug 1246320 part 1 - Add AnimationUtils::GetCurrentRealmDocument; r=bz
Adds a utility function for getting the document on the global associated with
a JSContext. We will need this in various situations where we want to use
the CSS parser (which requires various bits of state we pull off a document)
to parse a timing function but might not have a target element.

Strictly speaking we currently always have a target element but in future we
expect to support creating KeyframeEffects without an associated target
element. Also, we will need this for some situations in bug 1245748 where we
need to parse CSS properties on keyframe objects when we may not have a
target element.

MozReview-Commit-ID: Klku1LFoRGp

--HG--
extra : rebase_source : f2aa06aafb8fa9b212791a3e602a168f5170fcd9
2016-03-11 17:20:17 +09:00
Brian Birtles 2c723064d6 Bug 1246320 part 0 - Whitespace fixes; r=whitespace-only
MozReview-Commit-ID: CpULkfcd21R

--HG--
extra : rebase_source : 5f14fceea5fbbe64dc4076fd283125a4b51b28e9
2016-03-11 17:15:23 +09:00
Hiroyuki Ikezoe 03409db313 Bug 1216842 - Part 4: Move ParseEasing into AnimationUtils. r=cam
ParseEasing will be also used in AnimationEffectTimingReadOnly class.
2016-01-27 02:08:00 +01:00
Brian Birtles fd98de719c Bug 1226118 part 5 - Move LogAsyncAnimationFailure to AnimationUtils; r=dholbert
This patch also moves AnimationUtils out of the dom namespace since it seems
unnecessary. We typically only put actual DOM interfaces in the dom namespace.
2015-12-04 08:32:53 +09:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Jonathan Watt 69ac7e7f6d Bug 1073379, part 1 - Add an AnimationUtils::DoubleToTimeDuration helper. r=birtles 2015-02-09 10:25:51 +00:00
Ehsan Akhgari c78a04d048 Bug 1072299 - Build dom/animation in unified mode; r=baku
--HG--
extra : rebase_source : 2119739c119fddb1204f6941b19a9a3f68d49cf8
2014-09-25 10:11:43 -04:00
David Zbarsky cbd65c781b Bug 1033114 Part 3: Make mStartTime a nullable TimeDuration r=birtles 2014-08-30 02:11:57 -04:00