Skip to content

webkitRequestAnimationFrame throws exception in dartium (windows) #2481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Apr 6, 2012 · 9 comments
Closed

webkitRequestAnimationFrame throws exception in dartium (windows) #2481

DartBot opened this issue Apr 6, 2012 · 9 comments

Comments

@DartBot
Copy link

DartBot commented Apr 6, 2012

This issue was originally filed by [email protected]


What steps will reproduce the problem?

I am doing this:

window.webkitRequestAnimationFrame((int ignoredCurrentTimeMs) { frame(); }, document);

This works for me when generating and running .js

What is the expected output? What do you see instead?

I updated to the new Dart Editor 6213 with Developer Build 130452 Windows embedded, and now when running my application I get this Exception:

Exception: Invalid class: expected instance of ElementImplementation
Stack Trace: 0. Function: 'DOMWindowImplementation._webkitRequestAnimationFrame@1c3f8015' url: 'e:\b\build\slave\dartium-win-full\build\src\build\Release\obj\global_intermediate\webkit\bindings\dart\dart\DOMWindowImplementation.dart' line:353 col:3
 1. Function: 'DOMWindowImplementation.webkitRequestAnimationFrame' url: 'e:\b\build\slave\dartium-win-full\build\src\build\Release\obj\global_intermediate\webkit\bindings\dart\dart\DOMWindowImplementation.dart' line:348 col:40
 2. Function: '[email protected]' url: 'dart:html' line:21228 col:50

What version of the product are you using? On what operating system?

Dart Editor 6213 with Developer Build 130452 Windows

If you are reporting a problem in the Dart Editor, please open the Help ->
About Dart Editor dialog and add the Dart SDK version number to this
report. If you prefer, you can use the 'Send Feedback' button in the Dart
Editor to file a report that will contain this information and additional
context helpful for debugging the problem.

Please provide any additional information below.

Please let me know if anyone has a workaround - right now this is kind of a show-stopper for me to use Dartium :(

@DartBot
Copy link
Author

DartBot commented Apr 9, 2012

This comment was originally written by [email protected]


Set owner to [email protected].
Added Area-Dartium, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Apr 9, 2012

This comment was originally written by [email protected]


Ross, I am not sure it's a bug in Dartium.

According to IDL the 2nd argument should be an Element, and HTMLDocument is not an element.

In JS (at least for v8) it works by just ignoring your document passed.

I'd recommend you to pass document.body. If you like, we may make webkitRequestAnimationFrame accept null as a second argument (and make it a default value).


Added NeedsInfo label.

@DartBot
Copy link
Author

DartBot commented Apr 10, 2012

This comment was originally written by [email protected]


Hi Anton,

The 2nd argument was actually removed from the spec:
http://www.w3.org/TR/animation-timing/

Also see Paul Irish's post:
http://paulirish.com/2011/requestanimationframe-for-smart-animating/

So I think that Dart(ium) should not be providing this argument in the dart:html API at all...

According to the API docs here, Document is an Element:
http://api.dartlang.org/html/Document.html

The following code prints 'its an Element!' both in .js and in dartium:
if(document is Element) print('its an Element!');

And I've actually copy/pasted that line of code from here:
https://code.google.com/p/dart/source/browse/trunk/dart/samples/ui_lib/base/AnimationScheduler.dart

My preference would be to remove this second parameter from the API ASAP since it is not spec'ed.

cheers
-Ross

@DartBot
Copy link
Author

DartBot commented Apr 10, 2012

This comment was originally written by [email protected]


I think this issue is actually jacob's TODO in the catch:

try {
          // TODO(jacobr): passing in document should not be required.
          _intervalId = window.webkitRequestAnimationFrame(
              (int ignored) { _step(); }, document);
              // TODO(jacobr) fix this odd type error.
        } catch (var e) {
          _webkitAnimationFrameMaybeAvailable = false;
        }

@DartBot
Copy link
Author

DartBot commented Apr 10, 2012

This comment was originally written by [email protected]


Ross,

for dart:dom we try to keep close to WebKit IDLs which has this second argument.

Let me reassign to dart:html folks.

Stephen, Vijay, any thooughts?


cc @rakudrama.
cc @vsmenon.
Removed the owner.
Removed Area-Dartium label.
Added Area-UI label.

@DartBot
Copy link
Author

DartBot commented Apr 11, 2012

This comment was originally written by [email protected]


Just FYI, as per http://trac.webkit.org/changeset/113573 the 2nd argument has been removed.

@vsmenon
Copy link
Member

vsmenon commented Apr 11, 2012

I just rolled to new WebKit IDL yesterday. The second arg is now gone from all dart:html and dart:dom APIs.

@DartBot
Copy link
Author

DartBot commented Apr 11, 2012

This comment was originally written by [email protected]


awesome, thanks guys!

-Ross

@vsmenon
Copy link
Member

vsmenon commented Apr 13, 2012

This should be fixed now. Please reopen if there are still issues.


Added Fixed label.

dart-bot pushed a commit that referenced this issue May 20, 2020
Includes the following changes:
a4bc2dd08630f85a94f506eab037fcaaedb42222 Rename --v2 to --dart-dev-run (#2498)
958862efa33605af3136c4bd366015bace62d869 Update outdated.dart (#2488)
2cc09730f73204afced1df606416c07d5ee1e67d outdated: work with no lock file (#2491)
7c73dae26df2b3ef3e3019d7296fd2871dd23c49 Do not fallback to bin/main.dart (#2478)
27bc4f7ef65928c95535baf51245fd5b01162d0f Preserve windows line endings in pubspec.lock if they are already there (#2489)
31cfec521db6fe607f0f0424e747dff2e4950711 pub outdated --mode=null-safety
da05bbaee8c53b769d1f90458e28b3b7f9a22187 Fix `pub run` precompilation with relative PUB_CACHE paths (#2486)
dd005e586fc17545f22fc6e75eedfc9f075f9092 Show summary count of outdated packages after running `pub upgrade`  (#2444)
1b927956e653ea74a153513e593ff417617cabf0 Outdated: If current is a prerelease, use prereleases for latest if no newer stable (#2484)
678bd84a328fabb3fee360f837ac782f2831d753 Warn first time a package version opts in to null-safety (#2465)
8e76d46a4b8180ab247ecf6382f4f7abd34591f1 Force colors when --color is given (#2481)
572a23f815a5d632a8c2b259b691792674cd8b4d Rely on terminal telling if we can use colors (#2475)
363ed6fe54c084df43bbec1704757d0d6c64cbb7 pub run --v2 for use in dartdev (#2435)
aa5bbbb7261fc492866b5d6b94357cbe8df5e09a Use a 8-bit ansi palette for grey (#2474)
3929b1138a589b4f506018d98b3005a3e76dcea6 Format with new dartfmt (#2476)
6deb457048deb435009b36a4cd2d86003d107cf4 Use line length to wrap usage (#2457)
6e2ce2e4add80c4e15c8346a976cbf760d707f6a Use gzip decoder from dart:io. (#2382)
5b5fe72a33a66e4cab7070b3248596877e3a854e Improve the `pub outdated --help` text (#2429)

Change-Id: If9a719bfc374f085bd26856330547682c14f0df4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148532
Reviewed-by: Jonas Jensen <[email protected]>
Commit-Queue: Jonas Jensen <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants