Class: Dommy::ViewTransition

Inherits:
Object
  • Object
show all
Includes:
Bridge::Methods
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: https://drafts.csswg.org/css-view-transitions/

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bridge::Methods

included

Constructor Details

#initialize(window) ⇒ ViewTransition

Returns a new instance of ViewTransition.



1983
1984
1985
1986
1987
# File 'lib/dommy/document.rb', line 1983

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.



1989
1990
1991
# File 'lib/dommy/document.rb', line 1989

def finished
  @finished
end

#readyObject (readonly)

Returns the value of attribute ready.



1989
1990
1991
# File 'lib/dommy/document.rb', line 1989

def ready
  @ready
end

Instance Method Details

#__js_call__(method, _args) ⇒ Object



2018
2019
2020
2021
2022
2023
# File 'lib/dommy/document.rb', line 2018

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

#__js_get__(key) ⇒ Object



2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
# File 'lib/dommy/document.rb', line 2003

def __js_get__(key)
  case key
  when "finished"
    @finished
  when "ready"
    @ready
  when "updateCallbackDone"
    @update_callback_done
  else
    Bridge::ABSENT
  end
end

#skip_transitionObject Also known as: skipTransition



1997
1998
1999
# File 'lib/dommy/document.rb', line 1997

def skip_transition
  nil
end

#update_callback_doneObject Also known as: updateCallbackDone



1991
1992
1993
# File 'lib/dommy/document.rb', line 1991

def update_callback_done
  @update_callback_done
end