Commit graph

1686 commits

Author SHA1 Message Date
Parker Lougheed 78dbc184b1 [sdk/js_interop] Clean up and add a few minimal API docs
CoreLibraryReviewExempt: Only touches JS core library documentation.
Change-Id: I7d7f0a2b646f95de8340e9e77d8207cd99c9a1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351940
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-02-12 14:44:54 +00:00
Sigmund Cherem 5941ee7560 [dart:html] minor fix to clearWatch.
This is a fix to not include a null assert when it's
possible the value was null.

Fixes https://github.com/dart-lang/sdk/issues/49972

CoreLibraryReviewExempt: bug fix only affecting html library implementation
Change-Id: I26e6ebf3dc2d1ea3f9f458a32f519c5235e6d273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350982
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-02-08 23:23:20 +00:00
Devon Carew 335a9b0c68 [docs] update the messaging for dart:html and related libraries
Change-Id: Idca54c94a583d688e3f2470f1e062e9f44f0d131
CoreLibraryReviewExempt: doc only change to the web libraries
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347387
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-01-22 21:28:02 +00:00
Graciliano Monteiro Passos 5d18799eae HTMLSelectElement: fix selectedOptions when selectedIndex < 0
Closes https://github.com/dart-lang/sdk/pull/54618

Also adds a comment to go.sh mentioning vpython3 comes with
depot_tools.

GitOrigin-RevId: 5e057703067c24d9d41bac75b6251c8f3a2fddd3
Change-Id: I937d8618c24602b4c0844d8a52ff00095836bca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-22 20:15:26 +00:00
Devon Carew 8379b85eab [docs] move several older dart: web libraries into a 'legacy' category
Change-Id: Ie4c3413191c14976f85614fab11ee94830a25aab
CoreLibraryReviewExempt: documentation only change in the web libraries
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345566
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-11 18:18:59 +00:00
Brian Quinlan f494e771a2 [doc/io] Add a strong caution against using HttpClient and HttpRequest directly.
CoreLibraryReviewExempt: documentation-only change
Bug:https://github.com/dart-lang/sdk/issues/52023
Change-Id: I9d4b4bde676f2c85acb95e872fdaf7b5a92c6de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340283
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-12-12 00:45:45 +00:00
Daco Harkes acad65713c [vm] Mark NativeFieldWrapperClasses as base
TEST=build SDK (modified patch files)
TEST=tests/ffi/*
TEST=runtime/vm/*_test.cc
TEST=runtime/tests/vm/dart/*

Closes: https://github.com/dart-lang/sdk/issues/51896
CoreLibraryReviewExempt: VM only.
Change-Id: I349849001adf8f3a62f3d4f94d4bdd295c36ef4d
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,vm-aot-linux-debug-x64c-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291761
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-31 10:23:12 +00:00
Parker Lougheed a0d8796c94 [dart:html] Fix incorrect parameter mention in drawImageScaledFromSource docs
Closes https://github.com/dart-lang/site-www/issues/5138

Bug: https://github.com/dart-lang/site-www/issues/5138
CoreLibraryReviewExempt: Only updating a doc comment in dart:html which is web specific.
Change-Id: I58bd36764a6a86cfb7c30dbc60070025dfb2e51c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322181
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-08-23 00:25:29 +00:00
Alexander Aprelev 40894511bb [vm/compiler] Tag non-ffi force-optimized functions idempotent.
This is follow-up to https://dart.googlesource.com/sdk/+/54234979a32368c2e6fe5a45468aae939ccc7700

BUG=https://github.com/dart-lang/sdk/issues/38985
TEST=ci
CoreLibraryReviewExempt: vm-specific pragma
Change-Id: Ib24d283634708902bbabfc750c7a4496745e69ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321300
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-18 18:27:58 +00:00
Oleh Prypin 9f0f33c676 Revert "[analyzer] simplify the libraries.dart file"
This reverts commit 1948b0a9fe.

Reason for revert: causes `promiseToFuture` to become undefined - b/295129286

Original change's description:
> [analyzer] simplify the libraries.dart file
>
> Change-Id: I86bc196eaddd9a80c02f38c8d947d3c0f4c63394
> CoreLibraryReviewExempt: the sdk_library_metadata/libraries.dart is only used by the analyzer
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317803
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

Change-Id: I4810c408b996cefd46c0a40cc36818d34aa86071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319402
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-08-09 10:27:47 +00:00
Devon Carew 1948b0a9fe [analyzer] simplify the libraries.dart file
Change-Id: I86bc196eaddd9a80c02f38c8d947d3c0f4c63394
CoreLibraryReviewExempt: the sdk_library_metadata/libraries.dart is only used by the analyzer
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317803
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-08-08 21:00:01 +00:00
Dom Jocubeit f53a1f1cdd Correct example code in docs for DivElement class
Closes https://github.com/dart-lang/sdk/pull/53128

GitOrigin-RevId: 52d7b08f3b94439de5752655f06988f63ec24144
Change-Id: I8d87eacc961a7899509c8244f1a0efe4d9a9a8b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318580
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-08 17:25:35 +00:00
Srujan Gaddam b859e00908 Reland "[dart:html] Throw exception if Window.open opens null window" and
"[dart:html] Move NullWindowException to implementation"

This is a revert of bd3e6fa1a3 and
2b250992f9.

This adds some small code change to avoid a null-assertion being emitted
that would lead to a browser SecurityError.

CoreLibraryReviewExempt: Reland.
Change-Id: Iab52bb728b14fd0b2378b8923b0e1ea8ea930b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-06 15:50:48 +00:00
Srujan Gaddam bd3e6fa1a3 Revert "[dart:html] Throw exception if Window.open opens null window"
This reverts commit a356f71b71.

Reason for revert: This should be handled by throwing an exception when
the methods of the returned window are called, not when it is opened.
This would be a noisy breaking change that we don't want for 3.1. For
now, revert until the change that affects the individual methods is
landed.

Original change's description:
> [dart:html] Throw exception if Window.open opens null window
>
> Window.open silently allows a null window to be opened, and
> issues arise later when users try to use the non-null wrapper.
> This CL changes that to throw an exception if the window is null.
> This exception can be caught and recovered from. This avoids the
> larger breaking change of making this API nullable.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I9a53a477cb370c3bc6bc26b2162ce66c5af166aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306910
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

CoreLibraryReviewExempt: Revert in backend-specific library.
Change-Id: I5007b7d7aa608bfc8e5827b5f967af5573d0b758
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309000
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-28 23:21:32 +00:00
Ivan Inozemtsev 2b250992f9 Revert "[dart:html] Move NullWindowException to implementation"
This reverts commit 14a3051552.

Reason for revert: b/289195983

Original change's description:
> [dart:html] Move NullWindowException to implementation
>
> Window.open may open a null window in more cases than expected.
> Users may not care that the window they get back is invalid if
> they never use it. Therefore, this CL moves the exception to
> the implementation of the returned window in order to reduce
> noise, but still give a way for users to recover if they wish
> to do so.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: Id7c514a80fdcaa18a7eb0acdcb7f36477a04d966
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311843
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2023-06-28 23:21:32 +00:00
Srujan Gaddam 14a3051552 [dart:html] Move NullWindowException to implementation
Window.open may open a null window in more cases than expected.
Users may not care that the window they get back is invalid if
they never use it. Therefore, this CL moves the exception to
the implementation of the returned window in order to reduce
noise, but still give a way for users to recover if they wish
to do so.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-26 22:58:08 +00:00
Srujan Gaddam a356f71b71 [dart:html] Throw exception if Window.open opens null window
Window.open silently allows a null window to be opened, and
issues arise later when users try to use the non-null wrapper.
This CL changes that to throw an exception if the window is null.
This exception can be caught and recovered from. This avoids the
larger breaking change of making this API nullable.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I9a53a477cb370c3bc6bc26b2162ce66c5af166aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306910
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-12 18:29:56 +00:00
Nicholas Shahan 15903b76fe [dart:html] Delete unused private methods
The outdated custom element support has already been removed so these
methods are no longer needed.

Removes an access of `.__proto__`.

Issue: https://github.com/dart-lang/sdk/issues/52372
CoreLibraryReviewExempt: Change in web only library
Change-Id: Ia55c3be7f6c19433234c02b90981424e973866aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304781
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-05-23 21:40:32 +00:00
Srujan Gaddam e95b84ed41 [dart2js] Fix native null assertions for Dart 3
Allows the following semantics:
- If the disable flag is passed, never check
- If we're in non-sound mode, never check to avoid a breaking
change (this was the behavior before)
- If the enable flag was passed and we're in sound mode,
always check
- If we're in sound mode and with >= -03, don't check

Discussion in https://github.com/dart-lang/sdk/issues/50710

Change-Id: If83aaebb2745e4c8bcaa3f5a38ff41d79a869b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289451
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-04-03 18:05:28 +00:00
Srujan Gaddam 8ebed3d806 [dart:html] Add webkitSpeechRecognition to SpeechRecognition class
In Safari, the prototype of a SpeechRecognition object returns a
webkitSpeechRecognition prototype. This name is different than the
one in the @Native annotation, so dart2js fails to recognize it. We
should it to the annotation so we properly intercept it.

CoreLibraryReviewExempt: Changing bindings of dart:html, no change to API.
Change-Id: Ic533e1208dd28e521403998e43009e0f651e2dfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291961
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-03-31 17:32:54 +00:00
Srujan Gaddam 9231c6182c [dart:html] Remove duplicate switch case
Fixes https://github.com/dart-lang/sdk/issues/51754

META and WIN_KEY_LEFT have the same value. The switch case for the
second value is never triggered, so we should remove it.

CoreLibraryReviewExempt: No functional change, just silencing warnings.
Change-Id: I51afe53a3d41e2c2fa820c2bb16e1bdea4583fac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290702
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-23 00:57:57 +00:00
Lasse R.H. Nielsen 162ff41b0e Add class modifiers to dart:async.
* Pure interfaces marked `interface`. That's most public classes.
* `Stream` made `mixin class`, as a proper skeleton/base implementation.
* `Zone` classes made all `final`.

Added some `<void>` to raw `Future` types.

CoreLibraryReviewExempt: Aske is away.
Tested: No functionality change, only added restrictions.
Change-Id: I91d09fbcdba7d0dfdff3887bc7c9d54364c88b05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289221
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 12:12:46 +00:00
Devon Carew a548eb9bd2 [sdk docs] update sdk libraries to use triple slash docs
Change-Id: I9ee4d630763042031a06d05fb477f79deb32885b
CoreLibraryReviewExempt: dartdoc only changes, mostly to web libraries (web team reviewed)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288323
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-03-14 19:10:25 +00:00
Lasse R.H. Nielsen cc736dfb65 [flip-modifiers]: Reapply "Enforce current library restrictions."
This reapplies commit 0c05e33836
and reverts the revert 029e0cec71.

Tested: Added few new tests, updated existing. Mainly regression testing.
CoreLibraryReviewExempt: Reviewed in original CL.
Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 09:37:38 +00:00
Ilya Yanok 029e0cec71 Revert "Enforce current library restrictions."
This reverts commit 0c05e33836.

Reason for revert: breaks ~10% of G3 smoke suite.

Original change's description:
> Enforce current library restrictions.
>
> Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
> Mark all current classes intended as mixins as `mixin class`.
>
> More additions and cleanup will follow,
> but this change should make everything keep working as today
> if we flip the switch.
>
> TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.
>
> Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib0cb5b7ec1a8c392bbf9bf4af8dc3efc0b27991d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284187
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-20 15:29:41 +00:00
Lasse R.H. Nielsen 0c05e33836 Enforce current library restrictions.
Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
Mark all current classes intended as mixins as `mixin class`.

More additions and cleanup will follow,
but this change should make everything keep working as today
if we flip the switch.

TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.

Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-02-18 12:37:40 +00:00
Ahmed Ashour 63180b95ed Remove superfluous words.
Fixes #51095

TEST=ci

CoreLibraryReviewExempt: There are no API changes, just removal of superfluous words in the comments.
Change-Id: Ib1020c62fe6baed5ca68f0074323f025cc90e9f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279500
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-01-30 15:58:38 +00:00
Josh Soref ef42a0b110 Spelling pkg analyzer lib
Closes https://github.com/dart-lang/sdk/pull/50860

GitOrigin-RevId: b27066c37f93c8c6d1123d6ebd6a4c0afcf59844
Change-Id: I15fa4aea1dad45daf168e34d1c4450320ec9b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277742
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-25 14:08:27 +00:00
Josh Soref be43ba609b spelling: favorites
Closes https://github.com/dart-lang/sdk/pull/50806

GitOrigin-RevId: 797ea37d9d727ff9db80733e4f5ce2807ace611e
Change-Id: Iee4885232d0874ff7949b96779634943ced3ea35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276773
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-01-09 13:22:09 +00:00
Srujan Gaddam 27b4e28495 [dart:html] Rename emitters and regenerate dart:html
emitter is a module name, so we use a different name here to avoid
a collision when using the module name. This CL regenerates dart:html
after accounting for https://dart-review.googlesource.com/c/sdk/+/276560.

Change-Id: I1c9d3a54a5f37a5e42cd5b79bbc3d635b98c198e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276763
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-12-21 17:26:48 +00:00
Sigmund Cherem c91b73eaf7 [3.0 alpha] Remove dart:html's deprecated document.registerElement & registerElement2 APIs
Change-Id: I07fc124c55d1aeb678f39a4d72d3b4f581025a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273541
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-09 16:02:02 +00:00
Ahmed Ashour 9bea89246a Fix grammar
Fixes #50509

TEST=ci

Change-Id: I7ca115bbe6f436e9df126afddcc08eaba79af2f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270740
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-21 20:07:29 +00:00
Kallen Tu 63b49dfc8e Deprecate checkValidIndex and avoid using it in the core library.
TEST=No new behaviour, existing tests pass.

Change-Id: Ia7a8e58543bd5e1d8dd14bd46c5083759333845b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259104
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-11-08 19:02:35 +00:00
nullrocket 263b163f47 [dart2js] Exempt native SharedArrayBuffer from structured clone.
Ensure SharedArrayBuffer is exempt from the structured clone aglorithm.

Closes https://github.com/dart-lang/sdk/issues/49610#

Change-Id: I2e541e4e0e1f3b421f76a7ad9bb670b8d60f740f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255765
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-10-17 21:48:13 +00:00
Kallen Tu 80c6f0e824 Clean up dynamic invocations in dart2js core library files.
Change-Id: I3967a13585b2e3c8e0859bef9d08f181f88bf1f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260450
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-26 22:26:37 +00:00
Kallen Tu 7578614639 Remove dynamic invocations from custom elements in html_dart2js.
Registering custom elements are already broken -- see: https://github.com/dart-lang/sdk/issues/49536. There are plans on deleting this code at some point. This current change cleans up dynamic invocations in the deprecated code.

Removes cruft on already-deprecated code and doing it now because I assume dynamic clean up will finish before the issue resolves.

Change-Id: Ic6250c139c5d9b08d88650110f55442a7bf5dd42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259247
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-09-20 16:16:06 +00:00
Kallen Tu 586efdfe59 Add ignores for dynamic calls in html_dart2js sanitizing code.
Avoid removing dynamic invocations in sanitizing code as we don't know what type the element and its attributes may be.

Change-Id: I057d908027befe7fd284bf4ec6c68bd1d0e977f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259108
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-14 20:35:04 +00:00
Kallen Tu 7e13c388fe Clean up - unused typedef and lint ignore for html.
Change-Id: I50f89a2d59478c8e2a63a81d106e0943b496ad46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257427
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-09-08 20:59:24 +00:00
Kallen Tu 8264bd94d1 Revert "Eliminate dynamic call() in html_dart2js in _EventStreamSubscription."
This reverts commit f630a7c07d.

Reason for revert: Remove the `is` check since it's more costly than removing a dynamic call for web.

Original change's description:
> Eliminate dynamic call() in html_dart2js in _EventStreamSubscription.
>
> Change-Id: Ia4a300c210bc505f71cc3bfb1a1b911c96c1aa53
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256703
> Commit-Queue: Kallen Tu <kallentu@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I36b2f8cedc5f8b5235832ea29ea5eb40e2e8dc92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257421
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-02 18:44:53 +00:00
Kallen Tu f630a7c07d Eliminate dynamic call() in html_dart2js in _EventStreamSubscription.
Change-Id: Ia4a300c210bc505f71cc3bfb1a1b911c96c1aa53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256703
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-01 00:27:29 +00:00
Kallen Tu e0884c91f1 Eliminate dynamic call of .createElement in html_dart2js.
Change-Id: I76ab0063eee4213f20483172c16f86e651536945
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256740
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-08-30 15:48:40 +00:00
Kallen Tu 2bb03e4344 Eliminate .style and ._initKeyboardEvent from html_dart2js.
Change-Id: I16ea832e8eff2b2aea02fb73e1cf7ee9702923af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256581
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-08-29 20:06:45 +00:00
Lasse R.H. Nielsen be70a6dc13 Change : to = for default values in sdk/
Change-Id: I1939b0998343c36eab162a015fcf9eeb7e1dd7bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256123
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-08-23 13:53:30 +00:00
Kallen Tu 64c3ea27da Eliminate dynamic calls to remove and tagName.
Additionally, fixed the template for html_dart2js so the generator would generate the correct code.

Change-Id: I2172bb10db413169b86690faa027365ff72e3d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255763
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-08-22 17:27:39 +00:00
Kallen Tu add88f24c2 Eliminate dynamic calls to firstChild, remove and _innerHtml.
Change-Id: If984af54620727929ea8deb182226ce8d6514bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255581
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-08-18 21:50:14 +00:00
Srujan Gaddam 409b426cfc [dart:html] Add SharedArrayBuffer constructor and slice
Fixes https://github.com/dart-lang/sdk/issues/35344

Change-Id: I5742adddf1fe01bfe40860a734a4c930091d8472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253563
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-08-03 01:04:25 +00:00
Sigmund Cherem b62e612dc8 [dart:html] Deprecate custom element registration APIs.
The `registerElement` APIs in `dart:html` are legacy APIs based on a
deprecated Web Components v0.5 specification. These methods don't work
on modern browsers and can only be used with a polyfill.

The latest Web Components specification is supported indirectly via
JSInterop and doesn't have an explicit API in the `dart:html` library.

This change marks these APIs as deprecated. We intend to remove them in
the future (see https://github.com/dart-lang/sdk/issues/49536)

Fixes https://github.com/dart-lang/sdk/issues/48973

Change-Id: I2e96d36e95c9971b59cde80bc4da49b63d12b17c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252840
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-07-28 16:07:30 +00:00
Srujan Gaddam fe93b161e0 [dart:html] Add MathMLElement
Fixes b/236721367

Per https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement,
MathMLElement is in the Element type hierarchy. This adds an empty
class so that type-checking against Element can pass.

Change-Id: Ie0c2e33c2236bedd5627ed8624437d24d9fbac2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249945
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-06-27 23:10:12 +00:00
Emmanuel Pellereau d9d7d30820 Revert "Make nullFuture be per-zone."
This reverts commit 4d750a862d.

Reason for revert: breaks google3 (b/236665701)

Original change's description:
> Make `nullFuture` be per-zone.
>
> We introduced a `nullFuture` during the null-safety migration where
> we changed some methods to no longer allow returning `null`,
> and they therefore had to return a `Future`.
> That affected timing, because returning `null` was processed
> synchronously, and that change in timing made some tests fail.
> Rather that fix the fragile tests, we made the function return
> a recognizable future, a canonical `Future<Null>.value(null)`,
> and then recognized it and took a synchronous path for it.
>
> That caused other issues, because the future was created in the
> root zone. (Well, originally, it was created in the first zone
> which needed one, that was worse. Now it's created in the root zone.)
> Some code tries to contain asynchrony inside a custom zone, and
> then the get a `nullFuture` and calls `then` on it, and that
> schedules a microtask in the root zone.
> (It should probably have used the listener's zone, and not store
> a zone in the future at all, but that's how it was first done,
> and now people rely on that behavior too.)
>
> This change creates a `null` future *per zone* (lazily initialized
> when asked for). That should be sufficient because the code recognizing
> a returned `null` future is generally running in the same zone,
> but if any other code gets the `nullFuture`, it will be in the
> expected zone for where it was requested.
>
> This is a reland of commit a247b158d6
>
> Change-Id: Ia113756de1f6d50af4b1abfec219d6b4dcd5d59b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249488
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,nbosch@google.com

Change-Id: I02d62d58bae33d6a606a80eb3eee2e8e721a8e20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249620
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-06-24 06:48:49 +00:00
Lasse R.H. Nielsen 4d750a862d Make nullFuture be per-zone.
We introduced a `nullFuture` during the null-safety migration where
we changed some methods to no longer allow returning `null`,
and they therefore had to return a `Future`.
That affected timing, because returning `null` was processed
synchronously, and that change in timing made some tests fail.
Rather that fix the fragile tests, we made the function return
a recognizable future, a canonical `Future<Null>.value(null)`,
and then recognized it and took a synchronous path for it.

That caused other issues, because the future was created in the
root zone. (Well, originally, it was created in the first zone
which needed one, that was worse. Now it's created in the root zone.)
Some code tries to contain asynchrony inside a custom zone, and
then the get a `nullFuture` and calls `then` on it, and that
schedules a microtask in the root zone.
(It should probably have used the listener's zone, and not store
a zone in the future at all, but that's how it was first done,
and now people rely on that behavior too.)

This change creates a `null` future *per zone* (lazily initialized
when asked for). That should be sufficient because the code recognizing
a returned `null` future is generally running in the same zone,
but if any other code gets the `nullFuture`, it will be in the
expected zone for where it was requested.

This is a reland of commit a247b158d6

Change-Id: Ia113756de1f6d50af4b1abfec219d6b4dcd5d59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249488
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-06-23 09:19:45 +00:00