Commit 384c9d45 authored by Majid Valipour's avatar Majid Valipour Committed by Commit Bot

[animation-worklet] Integrate AnimationWorklet with origin trial infra

Intent to Experiment:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/AZ-PYPMS7EA/DEqbe2u5BQAJ

Bug: 811922
Change-Id: I967df8e38d55cffc985ca8982f3762e95aa08ae7
Reviewed-on: https://chromium-review.googlesource.com/917125
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539299}
parent 5c8f1b53
<!DOCTYPE html>
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 AnimationWorklet --expire-timestamp=2000000000
-->
<meta http-equiv="origin-trial" content="AnRfiFGg50a1+vvDBVfbBNiiRFBBQDy+3oMlJw2pUNRb8tPyN2XX0kAJxiA0itCLJTM0DrsIfVYuv4ni0Lu6bQgAAABYeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQW5pbWF0aW9uV29ya2xldCIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ==" />
<title>AnimationWorklet - interfaces exposed by origin trial</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/origin-trials-helper.js"></script>
<script>
test(t => {
OriginTrialsHelper.check_interfaces(this,
['WorkletAnimation', 'ScrollTimeline']);
}, 'AnimationWorklet related interfaces in Origin-Trial enabled document.');
test(t => {
OriginTrialsHelper.check_properties(this,
{'global': ['animationWorklet'],
'WorkletAnimation': ['play', 'cancel', 'playState'],
'ScrollTimeline': ['scrollSource', 'orientation', 'timeRange'],
});
}, 'AnimationWorklet related properties in Origin-Trial enabled document.');
</script>
...@@ -57,7 +57,6 @@ ScrollTimeline::ScrollTimeline(const Document& document, ...@@ -57,7 +57,6 @@ ScrollTimeline::ScrollTimeline(const Document& document,
: scroll_source_(scroll_source), : scroll_source_(scroll_source),
orientation_(orientation), orientation_(orientation),
time_range_(time_range) { time_range_(time_range) {
DCHECK(RuntimeEnabledFeatures::AnimationWorkletEnabled());
} }
double ScrollTimeline::currentTime(bool& is_null) { double ScrollTimeline::currentTime(bool& is_null) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
ConstructorCallWith=Document, ConstructorCallWith=Document,
MeasureAs=ScrollTimelineConstructor, MeasureAs=ScrollTimelineConstructor,
RaisesException=Constructor, RaisesException=Constructor,
RuntimeEnabled=AnimationWorklet OriginTrialEnabled=AnimationWorklet
] interface ScrollTimeline : AnimationTimeline { ] interface ScrollTimeline : AnimationTimeline {
readonly attribute Element? scrollSource; readonly attribute Element? scrollSource;
readonly attribute ScrollDirection orientation; readonly attribute ScrollDirection orientation;
......
...@@ -79,9 +79,7 @@ InternalSettings::Backup::Backup(Settings* settings) ...@@ -79,9 +79,7 @@ InternalSettings::Backup::Backup(Settings* settings)
default_video_poster_url_(settings->GetDefaultVideoPosterURL()), default_video_poster_url_(settings->GetDefaultVideoPosterURL()),
original_image_animation_policy_(settings->GetImageAnimationPolicy()), original_image_animation_policy_(settings->GetImageAnimationPolicy()),
original_scroll_top_left_interop_enabled_( original_scroll_top_left_interop_enabled_(
RuntimeEnabledFeatures::ScrollTopLeftInteropEnabled()), RuntimeEnabledFeatures::ScrollTopLeftInteropEnabled()) {}
original_animation_worklet_enabled_(
RuntimeEnabledFeatures::AnimationWorkletEnabled()) {}
void InternalSettings::Backup::RestoreTo(Settings* settings) { void InternalSettings::Backup::RestoreTo(Settings* settings) {
RuntimeEnabledFeatures::SetExperimentalContentSecurityPolicyFeaturesEnabled( RuntimeEnabledFeatures::SetExperimentalContentSecurityPolicyFeaturesEnabled(
...@@ -505,13 +503,6 @@ void InternalSettings::SetPreloadLogging(bool enabled, ...@@ -505,13 +503,6 @@ void InternalSettings::SetPreloadLogging(bool enabled,
GetSettings()->SetLogPreload(enabled); GetSettings()->SetLogPreload(enabled);
} }
void InternalSettings::setAnimationWorkletEnabled(
bool enabled,
ExceptionState& exception_state) {
InternalSettingsGuardForSettings();
RuntimeEnabledFeatures::SetAnimationWorkletEnabled(enabled);
}
void InternalSettings::setPresentationReceiver( void InternalSettings::setPresentationReceiver(
bool enabled, bool enabled,
ExceptionState& exception_state) { ExceptionState& exception_state) {
......
...@@ -73,7 +73,6 @@ class InternalSettings final : public InternalSettingsGenerated, ...@@ -73,7 +73,6 @@ class InternalSettings final : public InternalSettingsGenerated,
String default_video_poster_url_; String default_video_poster_url_;
ImageAnimationPolicy original_image_animation_policy_; ImageAnimationPolicy original_image_animation_policy_;
bool original_scroll_top_left_interop_enabled_; bool original_scroll_top_left_interop_enabled_;
bool original_animation_worklet_enabled_;
}; };
static InternalSettings* Create(Page& page) { static InternalSettings* Create(Page& page) {
...@@ -125,7 +124,6 @@ class InternalSettings final : public InternalSettingsGenerated, ...@@ -125,7 +124,6 @@ class InternalSettings final : public InternalSettingsGenerated,
void setViewportEnabled(bool, ExceptionState&); void setViewportEnabled(bool, ExceptionState&);
void setViewportMetaEnabled(bool, ExceptionState&); void setViewportMetaEnabled(bool, ExceptionState&);
void setViewportStyle(const String& preference, ExceptionState&); void setViewportStyle(const String& preference, ExceptionState&);
void setAnimationWorkletEnabled(bool, ExceptionState&);
void setPresentationReceiver(bool, ExceptionState&); void setPresentationReceiver(bool, ExceptionState&);
void setAutoplayPolicy(const String&, ExceptionState&); void setAutoplayPolicy(const String&, ExceptionState&);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
[ [
Exposed=AnimationWorklet, Exposed=AnimationWorklet,
Global=(Worklet,AnimationWorklet), Global=(Worklet,AnimationWorklet),
RuntimeEnabled=AnimationWorklet OriginTrialEnabled=AnimationWorklet
] interface AnimationWorkletGlobalScope : WorkletGlobalScope { ] interface AnimationWorkletGlobalScope : WorkletGlobalScope {
[MeasureAs=AnimationWorkletRegisterAnimator, RaisesException] void registerAnimator(DOMString name, Function animatorConstructor); [MeasureAs=AnimationWorkletRegisterAnimator, RaisesException] void registerAnimator(DOMString name, Function animatorConstructor);
}; };
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
[ [
Exposed=AnimationWorklet, Exposed=AnimationWorklet,
Global=(AnimationWorklet), Global=(AnimationWorklet),
RuntimeEnabled=AnimationWorklet OriginTrialEnabled=AnimationWorklet
] interface EffectProxy { ] interface EffectProxy {
attribute unrestricted double localTime; attribute unrestricted double localTime;
}; };
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
[ [
ImplementedAs=WindowAnimationWorklet, ImplementedAs=WindowAnimationWorklet,
RuntimeEnabled=AnimationWorklet, OriginTrialEnabled=AnimationWorklet,
SecureContext SecureContext
] partial interface Window { ] partial interface Window {
readonly attribute Worklet animationWorklet; readonly attribute Worklet animationWorklet;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
SerializedScriptValue options), SerializedScriptValue options),
RaisesException=Constructor, RaisesException=Constructor,
MeasureAs=WorkletAnimationConstructor, MeasureAs=WorkletAnimationConstructor,
RuntimeEnabled=AnimationWorklet OriginTrialEnabled=AnimationWorklet
] interface WorkletAnimation { ] interface WorkletAnimation {
readonly attribute AnimationPlayState playState; readonly attribute AnimationPlayState playState;
void play(); void play();
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
}, },
{ {
name: "AnimationWorklet", name: "AnimationWorklet",
origin_trial_feature_name: "AnimationWorklet",
status: "experimental", status: "experimental",
}, },
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment