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

38 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Tom Tung b34fac17ed Bug 1586761 - P7 - Revert a few incorrect changes on P2; r=tjr
P2 removed IsTimerPrecisionReductionEnabled and thus removed the check for RFP
pref. While most ReduceTimePrecision* functions are fine with that because
GetTimerPrecisionType checks that, the two ReduceTimePrecision*RFP functions
miss the check.

This patch mainly cover the check for that two functions and rename them to
*RFPOnly since they only use RFP when the pref is on.

Depends on D64324

Differential Revision: https://phabricator.services.mozilla.com/D66734

--HG--
extra : moz-landing-system : lando
2020-04-07 07:36:52 +00:00
Tom Tung 94183661ac Bug 1586761 - P2 - Introduce new TimerPrecisionTypes and a set of new Reduce methods to decide the TimerPrecisionType in the nsRFPService; r=tjr
To support checking CrossOriginIsolated in performance.now(), we need to:
- Add new types to TimerPrecisionType for nsRFPService
  - System, HighResAllowed are added
  - All is renamed to Normal
- Introduce a set of Reduce methods which require isSystemPrincipal and
CrossOriginIsolated to be passed and decide the TimerPrecisionType later
  - Original Reduce methods should only be called when callsites know the
  TimerPrecisionType. Otherwise, they should call the new methods.
- The following patches will use new methods

Differential Revision: https://phabricator.services.mozilla.com/D63293

--HG--
extra : moz-landing-system : lando
2020-03-25 14:09:55 +00:00
Kristen Wright dbfec5d2b0 Bug 1622111 - Convert dom.animations.offscreen-throttling to static pref. r=njn
Converts dom.animations.offscreen-throttling to a static pref and removes the static function used to create the varcache pref.

Differential Revision: https://phabricator.services.mozilla.com/D67182

--HG--
extra : moz-landing-system : lando
2020-03-23 19:43:34 +00:00
Stefan Hindli 5f419e4b50 Backed out 9 changesets (bug 1622111) for causing mochitest failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
Backed out changeset c244160797f8 (bug 1622111)
Backed out changeset dd9209f6bd8b (bug 1622111)
Backed out changeset d694c9e7061f (bug 1622111)
Backed out changeset 486aae809f6d (bug 1622111)
Backed out changeset 709266168c41 (bug 1622111)
Backed out changeset ca0d47bb86a8 (bug 1622111)
Backed out changeset caa735c8bb91 (bug 1622111)
Backed out changeset 12397711ab25 (bug 1622111)
Backed out changeset b66002fd1480 (bug 1622111)
2020-03-19 02:47:51 +02:00
Kristen Wright e29d6cd395 Bug 1622111 - Convert dom.animations.offscreen-throttling to static pref. r=njn
Converts dom.animations.offscreen-throttling to a static pref and removes the static function used to create the varcache pref.

Differential Revision: https://phabricator.services.mozilla.com/D67182

--HG--
extra : moz-landing-system : lando
2020-03-18 20:46:07 +00:00
Masayuki Nakano e705b3211c Bug 1540015 - part 1: Make Document.h stop including nsIPresShell.h r=smaug
If `Document::GetShell()` returns `PresShell*` rather than `nsIPresShell`, it's
a good step to deCOMTaminate `PresShell`.

This patch makes `Document.h` stop including `nsIPresShell.h` since
`nsIPresShell.h` includes `Document.h` indirectly and that causes bustage
when we make `Document::GetShell()` return `PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25332

--HG--
extra : moz-landing-system : lando
2019-03-29 15:11:04 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 854606257b Bug 1540015 - part 1: Make Document.h stop including nsIPresShell.h r=smaug
If `Document::GetShell()` returns `PresShell*` rather than `nsIPresShell`, it's
a good step to deCOMTaminate `PresShell`.

This patch makes `Document.h` stop including `nsIPresShell.h` since
`nsIPresShell.h` includes `Document.h` indirectly and that causes bustage
when we make `Document::GetShell()` return `PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25332

--HG--
extra : moz-landing-system : lando
2019-03-29 12:12:20 +00:00
Brian Birtles 15d4d3276b Bug 1518816 - Rework AnimationUtils::EffectSetContainsAnimatedScale to handle looking up the effect set correctly; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D23284

--HG--
extra : moz-landing-system : lando
2019-03-18 04:12:10 +00:00
Brian Birtles fb706f4828 Bug 1518816 - Replace nsLayoutUtils::HasCurrentTransition with something that takes an element/pseudo pair; r=hiro
The trouble with utility functions that take an nsIFrame is it's not clear what
the caller's intention is. For example, with
nsLayoutUtils::HasCurrentTransition, is the caller asking for transitions on
that frame? Or animations on _both_ that frame and its corresponding
style/primary frame?

Probably the caller hasn't even thought about it and there are likely to be bugs
when display:table content is encountered.

Where practical it's much better to take an element/pseudo pair since it's clear
that the caller is concerned with all animations (or transitions in this case)
on the element regardless of how it is represented in the frame tree.

This patch updates nsLayoutUtils::HasCurrentTransition to take an element/pseudo
pair and moves it to mozilla::AnimationUtils at the same time.

Differential Revision: https://phabricator.services.mozilla.com/D23280

--HG--
extra : moz-landing-system : lando
2019-03-18 04:09:55 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
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