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: 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.



1359
1360
1361
1362
1363
# File 'lib/dommy/document.rb', line 1359

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.



1365
1366
1367
# File 'lib/dommy/document.rb', line 1365

def finished
  @finished
end

#readyObject (readonly)

Returns the value of attribute ready.



1365
1366
1367
# File 'lib/dommy/document.rb', line 1365

def ready
  @ready
end

Instance Method Details

#__js_call__(method, _args) ⇒ Object



1392
1393
1394
1395
1396
1397
# File 'lib/dommy/document.rb', line 1392

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

#__js_get__(key) ⇒ Object



1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
# File 'lib/dommy/document.rb', line 1379

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



1373
1374
1375
# File 'lib/dommy/document.rb', line 1373

def skip_transition
  nil
end

#update_callback_doneObject Also known as: updateCallbackDone



1367
1368
1369
# File 'lib/dommy/document.rb', line 1367

def update_callback_done
  @update_callback_done
end