From 55f29d2b1efcec2f24203d2abe096709900ddb1d Mon Sep 17 00:00:00 2001 From: Bramus! Date: Wed, 13 Sep 2023 21:28:34 +0200 Subject: [PATCH] Stop processing ScrollTimeline props if no animation-related properties have been declared (#154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don’t bother extracting data from animation-related properties if there are none declared * Code formatting --- src/scroll-timeline-css-parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scroll-timeline-css-parser.js b/src/scroll-timeline-css-parser.js index f1fc1ad2..ed6512a3 100644 --- a/src/scroll-timeline-css-parser.js +++ b/src/scroll-timeline-css-parser.js @@ -212,6 +212,10 @@ export class StyleParser { this.saveSourceSelectorToScrollTimeline(rule); this.saveSubjectSelectorToViewTimeline(rule); + if (!hasAnimationTimeline && !hasAnimationName && !hasAnimation) { + return; + } + let timelineNames = []; let animationNames = []; let shouldReplacePart = false;