Skip to content

Commit e96cf0a

Browse files
committed
Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows a transition to "start", and then finish (on the next frame always, for now) or timeout, appropriately. I think it's in a reviewable shape, given that. There's one known divergence from the spec, which is described in w3c/csswg-drafts#10822 Differential Revision: https://phabricator.services.mozilla.com/D220843 UltraBlame original commit: cadf4f0266df277312b21c23e63fef2366d0518e
1 parent 76c2880 commit e96cf0a

File tree

78 files changed

+1840
-795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1840
-795
lines changed

dom/base/Document.cpp

+186-1
Original file line numberDiff line numberDiff line change
@@ -2259,6 +2259,17 @@ mozilla
22592259
/
22602260
dom
22612261
/
2262+
ViewTransition
2263+
.
2264+
h
2265+
"
2266+
#
2267+
include
2268+
"
2269+
mozilla
2270+
/
2271+
dom
2272+
/
22622273
WakeLockJS
22632274
.
22642275
h
@@ -14359,6 +14370,10 @@ mAll
1435914370
)
1436014371
NS_IMPL_CYCLE_COLLECTION_TRAVERSE
1436114372
(
14373+
mActiveViewTransition
14374+
)
14375+
NS_IMPL_CYCLE_COLLECTION_TRAVERSE
14376+
(
1436214377
mDocGroup
1436314378
)
1436414379
NS_IMPL_CYCLE_COLLECTION_TRAVERSE
@@ -14982,6 +14997,10 @@ mAll
1498214997
)
1498314998
NS_IMPL_CYCLE_COLLECTION_UNLINK
1498414999
(
15000+
mActiveViewTransition
15001+
)
15002+
NS_IMPL_CYCLE_COLLECTION_UNLINK
15003+
(
1498515004
mReferrerInfo
1498615005
)
1498715006
NS_IMPL_CYCLE_COLLECTION_UNLINK
@@ -83971,8 +83990,10 @@ root
8397183990
;
8397283991
}
8397383992
}
83993+
already_AddRefed
83994+
<
8397483995
ViewTransition
83975-
*
83996+
>
8397683997
Document
8397783998
:
8397883999
:
@@ -83987,12 +84008,176 @@ ViewTransitionUpdateCallback
8398784008
>
8398884009
>
8398984010
&
84011+
aCallback
84012+
)
84013+
{
84014+
RefPtr
84015+
transition
84016+
=
84017+
new
84018+
ViewTransition
84019+
(
84020+
*
84021+
this
84022+
aCallback
84023+
.
84024+
WasPassed
84025+
(
84026+
)
84027+
?
84028+
&
84029+
aCallback
84030+
.
84031+
Value
84032+
(
84033+
)
84034+
:
84035+
nullptr
84036+
)
84037+
;
84038+
if
84039+
(
84040+
Hidden
84041+
(
84042+
)
8399084043
)
8399184044
{
84045+
transition
84046+
-
84047+
>
84048+
SkipTransition
84049+
(
84050+
SkipTransitionReason
84051+
:
84052+
:
84053+
DocumentHidden
84054+
)
84055+
;
8399284056
return
84057+
transition
84058+
.
84059+
forget
84060+
(
84061+
)
84062+
;
84063+
}
84064+
if
84065+
(
84066+
mActiveViewTransition
84067+
)
84068+
{
84069+
mActiveViewTransition
84070+
-
84071+
>
84072+
SkipTransition
84073+
(
84074+
SkipTransitionReason
84075+
:
84076+
:
84077+
ClobberedActiveTransition
84078+
)
84079+
;
84080+
}
84081+
mActiveViewTransition
84082+
=
84083+
transition
84084+
;
84085+
if
84086+
(
84087+
mPresShell
84088+
)
84089+
{
84090+
if
84091+
(
84092+
nsRefreshDriver
84093+
*
84094+
rd
84095+
=
84096+
mPresShell
84097+
-
84098+
>
84099+
GetRefreshDriver
84100+
(
84101+
)
84102+
)
84103+
{
84104+
rd
84105+
-
84106+
>
84107+
EnsureViewTransitionOperationsHappen
84108+
(
84109+
)
84110+
;
84111+
}
84112+
}
84113+
return
84114+
transition
84115+
.
84116+
forget
84117+
(
84118+
)
84119+
;
84120+
}
84121+
void
84122+
Document
84123+
:
84124+
:
84125+
ClearActiveViewTransition
84126+
(
84127+
)
84128+
{
84129+
mActiveViewTransition
84130+
=
8399384131
nullptr
8399484132
;
8399584133
}
84134+
void
84135+
Document
84136+
:
84137+
:
84138+
PerformPendingViewTransitionOperations
84139+
(
84140+
)
84141+
{
84142+
if
84143+
(
84144+
mActiveViewTransition
84145+
)
84146+
{
84147+
mActiveViewTransition
84148+
-
84149+
>
84150+
PerformPendingOperations
84151+
(
84152+
)
84153+
;
84154+
}
84155+
EnumerateSubDocuments
84156+
(
84157+
[
84158+
]
84159+
(
84160+
Document
84161+
&
84162+
aDoc
84163+
)
84164+
{
84165+
aDoc
84166+
.
84167+
PerformPendingViewTransitionOperations
84168+
(
84169+
)
84170+
;
84171+
return
84172+
CallState
84173+
:
84174+
:
84175+
Continue
84176+
;
84177+
}
84178+
)
84179+
;
84180+
}
8399684181
Selection
8399784182
*
8399884183
Document

dom/base/Document.h

+30-1
Original file line numberDiff line numberDiff line change
@@ -11246,8 +11246,10 @@ DetermineProximityToViewportAndNotifyResizeObservers
1124611246
(
1124711247
)
1124811248
;
11249+
already_AddRefed
11250+
<
1124911251
ViewTransition
11250-
*
11252+
>
1125111253
StartViewTransition
1125211254
(
1125311255
const
@@ -11261,6 +11263,27 @@ ViewTransitionUpdateCallback
1126111263
&
1126211264
)
1126311265
;
11266+
ViewTransition
11267+
*
11268+
GetActiveViewTransition
11269+
(
11270+
)
11271+
const
11272+
{
11273+
return
11274+
mActiveViewTransition
11275+
;
11276+
}
11277+
void
11278+
ClearActiveViewTransition
11279+
(
11280+
)
11281+
;
11282+
void
11283+
PerformPendingViewTransitionOperations
11284+
(
11285+
)
11286+
;
1126411287
PermissionDelegateHandler
1126511288
*
1126611289
GetPermissionDelegateHandler
@@ -14727,6 +14750,12 @@ HTMLAllCollection
1472714750
>
1472814751
mAll
1472914752
;
14753+
RefPtr
14754+
<
14755+
ViewTransition
14756+
>
14757+
mActiveViewTransition
14758+
;
1473014759
nsTHashSet
1473114760
<
1473214761
RefPtr

0 commit comments

Comments
 (0)