Class: Dommy::ViewTransition

Inherits:
Object
  • Object
show all
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.

Spec: drafts.csswg.org/css-view-transitions/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window) ⇒ ViewTransition

Returns a new instance of ViewTransition.



728
729
730
731
732
# File 'lib/dommy/document.rb', line 728

def initialize(window)
  @finished = PromiseValue.resolve(window, nil)
  @ready = PromiseValue.resolve(window, nil)
  @update_callback_done = PromiseValue.resolve(window, nil)
end

Instance Attribute Details

#finishedObject (readonly)

Returns the value of attribute finished.



734
735
736
# File 'lib/dommy/document.rb', line 734

def finished
  @finished
end

#readyObject (readonly)

Returns the value of attribute ready.



734
735
736
# File 'lib/dommy/document.rb', line 734

def ready
  @ready
end

Instance Method Details

#__js_call__(method, _args) ⇒ Object



759
760
761
762
763
764
# File 'lib/dommy/document.rb', line 759

def __js_call__(method, _args)
  case method
  when "skipTransition"
    skip_transition
  end
end

#__js_get__(key) ⇒ Object



748
749
750
751
752
753
754
755
756
757
# File 'lib/dommy/document.rb', line 748

def __js_get__(key)
  case key
  when "finished"
    @finished
  when "ready"
    @ready
  when "updateCallbackDone"
    @update_callback_done
  end
end

#skip_transitionObject Also known as: skipTransition



742
743
744
# File 'lib/dommy/document.rb', line 742

def skip_transition
  nil
end

#update_callback_doneObject Also known as: updateCallbackDone



736
737
738
# File 'lib/dommy/document.rb', line 736

def update_callback_done
  @update_callback_done
end