Class: Dommy::ViewTransition
- Inherits:
-
Object
- Object
- Dommy::ViewTransition
- Defined in:
- lib/dommy/document.rb
Overview
‘ViewTransition` — return value of `document.startViewTransition()`. All three Promises (`finished` / `ready` / `updateCallbackDone`) resolve immediately since dommy has no actual paint phase.
Constant Summary collapse
- JS_METHOD_NAMES =
Methods routed through js_call (keep in sync with its when-arms).
%w[skipTransition].freeze
Instance Attribute Summary collapse
-
#finished ⇒ Object
readonly
Returns the value of attribute finished.
-
#ready ⇒ Object
readonly
Returns the value of attribute ready.
Instance Method Summary collapse
- #__js_call__(method, _args) ⇒ Object
- #__js_get__(key) ⇒ Object
- #__js_method_names__ ⇒ Object
-
#initialize(window) ⇒ ViewTransition
constructor
A new instance of ViewTransition.
- #skip_transition ⇒ Object (also: #skipTransition)
- #update_callback_done ⇒ Object (also: #updateCallbackDone)
Constructor Details
#initialize(window) ⇒ ViewTransition
Returns a new instance of ViewTransition.
788 789 790 791 792 |
# File 'lib/dommy/document.rb', line 788 def initialize(window) @finished = PromiseValue.resolve(window, nil) @ready = PromiseValue.resolve(window, nil) @update_callback_done = PromiseValue.resolve(window, nil) end |
Instance Attribute Details
#finished ⇒ Object (readonly)
Returns the value of attribute finished.
794 795 796 |
# File 'lib/dommy/document.rb', line 794 def finished @finished end |
#ready ⇒ Object (readonly)
Returns the value of attribute ready.
794 795 796 |
# File 'lib/dommy/document.rb', line 794 def ready @ready end |
Instance Method Details
#__js_call__(method, _args) ⇒ Object
825 826 827 828 829 830 |
# File 'lib/dommy/document.rb', line 825 def __js_call__(method, _args) case method when "skipTransition" skip_transition end end |
#__js_get__(key) ⇒ Object
808 809 810 811 812 813 814 815 816 817 |
# File 'lib/dommy/document.rb', line 808 def __js_get__(key) case key when "finished" @finished when "ready" @ready when "updateCallbackDone" @update_callback_done end end |
#__js_method_names__ ⇒ Object
821 822 823 |
# File 'lib/dommy/document.rb', line 821 def __js_method_names__ JS_METHOD_NAMES end |
#skip_transition ⇒ Object Also known as: skipTransition
802 803 804 |
# File 'lib/dommy/document.rb', line 802 def skip_transition nil end |
#update_callback_done ⇒ Object Also known as: updateCallbackDone
796 797 798 |
# File 'lib/dommy/document.rb', line 796 def update_callback_done @update_callback_done end |