mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
98491d0687
- Bug 382721 - Part 1: Fix spacing of simple 2px dotted border without radius. r=jrmuizel (8e83589f45)
- Bug 382721 - Part 2: Split constants for border rendering to BorderConsts.h. r=jrmuizel (88ae5aee7f)
- Bug 1237805 part 1 - [css-grid] Remove all empty 'auto-fit' tracks, not just those at the end. r=dholbert (1c0530b87b)
- Bug 1237805 part 2 - [css-grid] 'auto-fit' reftest removing empty start/middle tracks. (3bfc688e2b)
- Bug 1239036 - [css-grid] Deal with implicit tracks when computing grid-template-{columns,rows}. r=dholbert (cf36d9193a)
- Bug 1239036 - [css-grid] Tests. (4aaec0499f)
- Bug 1238294 part 1 - [css-grid] Make GridLineEdge() a method on the Tracks class rather than a static function (idempotent change). r=dholbert (ab81994ec6)
- Bug 1238294 part 2 - [css-grid] Treat any gaps at the grid edges as "line thickness" so they behave the same as gaps between tracks for positioning areas. r=dholbert (fafdc1ceef)
- Bug 1230695 - [css-grid] More abs.pos. grid alignment reftests. (330770cf1a)
- Bug 1238294 part 3 - [css-grid] Add/tweak reftests for new behavior of gaps at the grid edges. (58ff8670a1)
- Bug 1240795 - [css-grid] Refactor GetComputedTemplateColumns/Rows to return a self-contained value. r=dholbert (9c5e68418f)
- Bug 1229739 - Use the color of shadow if available for drawing emphasis marks in shadow. r=jfkthame (c19c3deb1c)
- Bug 1191597 part 3 - Convert fullscreen-api-keys to a browser chrome test. r=smaug (ad740d4c4c)
- Bug 1174575 - Part 1: Define CSSPseudoElement interface. r=birtles, r=smaug (1a304d59c4)
- Bug 1214536 - Part 1: Use unrestricted double for iterations. r=birtles (0dbb02e423)
- Bug 1214536 - Part 2: Replace mIterationCount in layers::Animation. r=birtles (8a573046f5)
- Bug 1214536 - Part 3: Store the original value of fill. r=birtles (df548c244a)
- Bug 1214536 - Part 4: Use OwingUnrestrictedDoubleOrString for duration. r=birtles (567cfd1555)
- Bug 1214536 - Part 5: Add AnimationEffectTimingReadOnly interface. r=birtles, r=smaug (47138ec7f0)
- Bug 1214536 - Part 6: Revise AnimationTiming::operator==. r=birtles (616fc2c711)
- Bug 1214536 - Part 7: Rename AnimationTiming as TimingParams. r=birtles, r=smaug (d7de0ec72b)
- Bug 1214536 - Part 8: Add an operator=() for TimingParams. r=birtles (bfe22c6501)
- Bug 1215406 - Part 6: Test. r=birtles (3f16796304)
- Bug 1214536 - Part 9: Test. r=birtles (526419cc1d)
- Bug 1147673 - Unadjust clip before intersecting it with the scroll clip. r=botond (85cd06d2d5)
- Bug 1147673 - Determine more accurately whether an async transform affects a layer's clip rect. r=kats (8ce7d1e887)
- Bug 1096773 part 1 - Make the frames argument to the KeyframeEffectReadOnly constructor NOT optional; r=bz (6e63b08671)
- Bug 1096773 part 2 - Add a KeyframeEffectReadOnly constructor that takes a TimingParams argument; r=boris (24971306e6)
- Bug 1096773 part 3 - Implement Animatable.animate(); r=bz (9d95ea800e)
- Bug 1096773 part 4 - Add tests for Animatable.animate(); r=bz (03b866b2d8)
- Bug 1179627 - Part 1: Implement Animation.id. r=smaug, r=birtles (51bbed6e9d)
- Bug 1096774 - Part 1: Implement Animation Constructor. r=birtles, r=smaug (e09d7fbd7c)
- Bug 1179627 - Part 2: Add animation.id for CSS animations test files. r=bbirtles, r=hiikezoe (329ea31f33)
- Bug 1096774 - Part 2: Fix crash if animation has no timeline. r=birtles (d989b44866)
- Bug 1096774 - Part 3: Tests for Animation Contructor. r=birtles (23786774bc)
- Bug 1240265 - Annotate intentional switch fallthroughs in dom/. r=mrbkap (ffd9da3d5f)
- Bug 1227458. Make setAttributeNode be an alias for setAttributeNodeNS and setNamedItem on the attribute map be an alias for setNamedItemNS. r=smaug (f804d28b93)
- Bug 1226091 - Use MayHaveAnimations in Element::UnbindFromTree; r=smaug (1ec85f75b3)
125 lines
3.7 KiB
C++
125 lines
3.7 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* 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/. */
|
|
|
|
#include "PendingAnimationTracker.h"
|
|
|
|
#include "mozilla/dom/AnimationTimeline.h"
|
|
#include "nsIFrame.h"
|
|
#include "nsIPresShell.h"
|
|
|
|
using namespace mozilla;
|
|
|
|
namespace mozilla {
|
|
|
|
NS_IMPL_CYCLE_COLLECTION(PendingAnimationTracker,
|
|
mPlayPendingSet,
|
|
mPausePendingSet,
|
|
mDocument)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PendingAnimationTracker, AddRef)
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PendingAnimationTracker, Release)
|
|
|
|
void
|
|
PendingAnimationTracker::AddPending(dom::Animation& aAnimation,
|
|
AnimationSet& aSet)
|
|
{
|
|
aSet.PutEntry(&aAnimation);
|
|
|
|
// Schedule a paint. Otherwise animations that don't trigger a paint by
|
|
// themselves (e.g. CSS animations with an empty keyframes rule) won't
|
|
// start until something else paints.
|
|
EnsurePaintIsScheduled();
|
|
}
|
|
|
|
void
|
|
PendingAnimationTracker::RemovePending(dom::Animation& aAnimation,
|
|
AnimationSet& aSet)
|
|
{
|
|
aSet.RemoveEntry(&aAnimation);
|
|
}
|
|
|
|
bool
|
|
PendingAnimationTracker::IsWaiting(const dom::Animation& aAnimation,
|
|
const AnimationSet& aSet) const
|
|
{
|
|
return aSet.Contains(const_cast<dom::Animation*>(&aAnimation));
|
|
}
|
|
|
|
void
|
|
PendingAnimationTracker::TriggerPendingAnimationsOnNextTick(const TimeStamp&
|
|
aReadyTime)
|
|
{
|
|
auto triggerAnimationsAtReadyTime = [aReadyTime](AnimationSet& aAnimationSet)
|
|
{
|
|
for (auto iter = aAnimationSet.Iter(); !iter.Done(); iter.Next()) {
|
|
dom::Animation* animation = iter.Get()->GetKey();
|
|
dom::AnimationTimeline* timeline = animation->GetTimeline();
|
|
|
|
// If the animation does not have a timeline, just drop it from the map.
|
|
// The animation will detect that it is not being tracked and will trigger
|
|
// itself on the next tick where it has a timeline.
|
|
if (!timeline) {
|
|
iter.Remove();
|
|
continue;
|
|
}
|
|
|
|
// When the timeline's refresh driver is under test control, its values
|
|
// have no correspondance to wallclock times so we shouldn't try to
|
|
// convert aReadyTime (which is a wallclock time) to a timeline value.
|
|
// Instead, the animation will be started/paused when the refresh driver
|
|
// is next advanced since this will trigger a call to
|
|
// TriggerPendingAnimationsNow.
|
|
if (!timeline->TracksWallclockTime()) {
|
|
continue;
|
|
}
|
|
|
|
Nullable<TimeDuration> readyTime = timeline->ToTimelineTime(aReadyTime);
|
|
animation->TriggerOnNextTick(readyTime);
|
|
|
|
iter.Remove();
|
|
}
|
|
};
|
|
|
|
triggerAnimationsAtReadyTime(mPlayPendingSet);
|
|
triggerAnimationsAtReadyTime(mPausePendingSet);
|
|
}
|
|
|
|
void
|
|
PendingAnimationTracker::TriggerPendingAnimationsNow()
|
|
{
|
|
auto triggerAndClearAnimations = [](AnimationSet& aAnimationSet) {
|
|
for (auto iter = aAnimationSet.Iter(); !iter.Done(); iter.Next()) {
|
|
iter.Get()->GetKey()->TriggerNow();
|
|
}
|
|
aAnimationSet.Clear();
|
|
};
|
|
|
|
triggerAndClearAnimations(mPlayPendingSet);
|
|
triggerAndClearAnimations(mPausePendingSet);
|
|
}
|
|
|
|
void
|
|
PendingAnimationTracker::EnsurePaintIsScheduled()
|
|
{
|
|
if (!mDocument) {
|
|
return;
|
|
}
|
|
|
|
nsIPresShell* presShell = mDocument->GetShell();
|
|
if (!presShell) {
|
|
return;
|
|
}
|
|
|
|
nsIFrame* rootFrame = presShell->GetRootFrame();
|
|
if (!rootFrame) {
|
|
return;
|
|
}
|
|
|
|
rootFrame->SchedulePaint();
|
|
}
|
|
|
|
} // namespace mozilla
|