Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add CSSAnimation and CSSTransition interfaces #1013

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,19 @@ declare var CDATASection: {
new(): CDATASection;
};

interface CSSAnimation extends Animation {
readonly animationName: string;
addEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}

declare var CSSAnimation: {
prototype: CSSAnimation;
new(): CSSAnimation;
};

/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */
interface CSSConditionRule extends CSSGroupingRule {
conditionText: string;
Expand Down Expand Up @@ -3273,6 +3286,19 @@ declare var CSSSupportsRule: {
new(): CSSSupportsRule;
};

interface CSSTransition extends Animation {
readonly transitionProperty: string;
addEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}

declare var CSSTransition: {
prototype: CSSTransition;
new(): CSSTransition;
};

/** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
interface Cache {
add(request: RequestInfo): Promise<void>;
Expand Down
9 changes: 9 additions & 0 deletions inputfiles/idl/CSS Animations Level 2.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Exposed=Window]
interface CSSAnimation : Animation {
readonly attribute CSSOMString animationName;
};

partial interface CSSStyleDeclaration {
[CEReactions] attribute [LegacyNullToEmptyString] CSSOMString animationComposition;
[CEReactions] attribute [LegacyNullToEmptyString] CSSOMString animationTimeline;
};
4 changes: 4 additions & 0 deletions inputfiles/idl/CSS Transitions Level 2.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Exposed=Window]
interface CSSTransition : Animation {
readonly attribute CSSOMString transitionProperty;
};
8 changes: 8 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"url": "https://www.w3.org/TR/css-animations-1/",
"title": "CSS Animations"
},
{
"url": "https://drafts.csswg.org/css-animations-2/",
"title": "CSS Animations Level 2"
},
{
"url": "https://www.w3.org/TR/css-backgrounds-3/",
"title": "CSS Backgrounds and Borders"
Expand Down Expand Up @@ -128,6 +132,10 @@
"url": "https://www.w3.org/TR/css-transitions-1/",
"title": "CSS Transitions"
},
{
"url": "https://drafts.csswg.org/css-transitions-2/",
"title": "CSS Transitions Level 2"
},
{
"url": "https://www.w3.org/TR/css-transforms-1/",
"title": "CSS Transforms"
Expand Down
2 changes: 2 additions & 0 deletions inputfiles/removedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"CSSStyleDeclaration": {
"properties": {
"property": {
"animationComposition": null,
"animationTimeline": null,
"backgroundPositionBlock": null,
"backgroundPositionInline": null,
"baselineSource": null,
Expand Down