New issue
Advanced search Search tips

Issue 658644 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

property elapsedTime from transitionend event should not include delay

Reported by f.o.th...@gmail.com, Oct 24 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

Steps to reproduce the problem:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Transition Test</title>

  <style type="text/css">
    .test {
      background: #FFF;
      height: 100px;
    }
    .test-appear {
      background: #F00;
      transition: all 2s 1s;
    }
  </style>
</head>
<body>
  <div id="div" class="test"></div>
  <button id="bt">Transition</button>

  <script>
    var div = document.getElementById('div');
    div.addEventListener('transitionend', function(e) {
      console.log(e.elapsedTime);
    });
    var bt = document.getElementById('bt');
    bt.addEventListener('click', function(e) {
      div.className += ' test-appear';
    });
  </script>
</body>
</html>

What is the expected behavior?
I don't know if a should report issues related to specs that are not yet complete, so let me know if I shouldn't.

According to the specs
https://drafts.csswg.org/css-transitions/#transition-events
the elapsedTime property from the transitionend event should not include any time related to the delay specified in the transition.

What went wrong?
The value of the delay is being added to the elapsed time.

Did this work before? N/A 

Chrome version: 53.0.2785.143  Channel: n/a
OS Version: OS X 10.12.0
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by e...@chromium.org, Oct 24 2016

Components: -Blink Blink>CSS
Components: -Blink>CSS Blink>Animation

Comment 3 by meade@chromium.org, Oct 25 2016

Cc: suzyh@chromium.org
Labels: -OS-Mac OS-All
Status: Available (was: Unconfirmed)
Confirmed this is an issue. Clicky version of the repro case (open the dev tools console for best results): https://jsfiddle.net/xcd4gn03. Observe that 3 is printed, which is the duration (2s) + the delay (1s), according to syntax transition: <propertyName> <duration> <delay>. We'd expect 2 to be printed.

https://developer.mozilla.org/en-US/docs/Web/CSS/transition

cc-ing. Suzy for animations.
Blockedon: 442163
Labels: Update-Monthly
This is an artefact of a change to transitions for the DevTools animations timeline.
All transitions from A to B are converted into a 3 keyframe animation:
A ---delay--- A ---duration--- B
The resulting duration of the transition becomes the sum of the delay and the duration.

To fix this we should perform a reverse computation in CSSAnimations::TransitionEventDelegate::onEventCondition() to get the originally specified duration.

Note: The refactor work to make transitions use InterpolationTypes in  issue 442163  would also fix this bug.

Comment 5 by meade@chromium.org, Oct 25 2016

Labels: Hotlist-Interop
The behaviour is correct on Firefox nightly, FWIW.
Labels: -Update-Monthly Update-Quarterly
Blockedon: -442163
The refactor we used to move CSS Transitions away from AnimatableValues ended up not fixing this issue.
Unblocking bug on irrelevant work.

Comment 8 by suzyh@chromium.org, Jun 13 2017

Cc: -suzyh@chromium.org
Project Member

Comment 9 by sheriffbot@chromium.org, Jun 13 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 10 by yigu@chromium.org, Jun 14 2018

Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)

Sign in to add a comment