Commit graph

1744 commits

Author SHA1 Message Date
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
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
Tim Sneath 578dd70fae Tighten introductory text
Closes https://github.com/dart-lang/sdk/pull/52065

GitOrigin-RevId: f1b58633b1069f129d8c88ac7fca1bc9a48f3beb
Change-Id: I4af2e3b69711e4a393c154a98b4a4e5a26e8a03e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295700
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2023-05-16 13:55:23 +00:00
Stephen Adams 45efccb5e0 Remove left-over patch declarations for List constructor.
This CL replaces https://dart-review.googlesource.com/c/sdk/+/296900

The `List` constructor is removed in Dart 3.0.
Some of the `@patch` implementations were not removed.

This is *high priority*. It seems the left-over `@patch factory List` constructor did not cause any errors, instead it *added* a constructor  to `List` that can be used in web compiled code. Even if `List` doesn't have such a constructor in the SDK code proper.
The VM and analyzer will say the invocation is an error, but dart2js happily compiles it and runs.

(It used to be that patches couldn't add public members, that security seems to have been removed.)

Also removes code which tries to detect "the unnamed List constructor",
which is no longer a thing, and a number of invocations of the constructor, where it's not clear that the test is aware that the constructor no longer exists, and is not marked as `@dart=2.x` with x < 12.

TEST=ci

Change-Id: I4ffaf3ae2c4e75ca06e7ba0bf19187b6376f3888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297100
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-22 00:38:28 +00:00
Lasse R.H. Nielsen 0386350aa7 Remove code which no longer compiles.
Probably hasn't worked in a while, so it's unlikely
that anything depends on it.

Change-Id: I7b73b92842b897b8367bf48a490a0e25cd306b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292083
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-03 23:40:05 +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 01b28894e7 Spelling pkg dev compiler
Closes https://github.com/dart-lang/sdk/pull/50861

GitOrigin-RevId: 71005e6f5bf5a151cb5c1aefb6a2a300fc40f592
Change-Id: Iadfafb5787a62e9a379437f6a3763d31f99ba7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277743
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-26 09:12:41 +00:00
Josh Soref aee77b9a33 Spelling tools
Closes https://github.com/dart-lang/sdk/pull/50880

TEST=ci

GitOrigin-RevId: ea8ecf4b7b921de0549df325be1a1f7879e86b72
Change-Id: I39315609a8390b012196a08c9ce4a9a6a50b1558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278061
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2023-01-09 15:48:57 +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
Josh Soref b48dc3af7a Spelling tools
Closes https://github.com/dart-lang/sdk/pull/50773

GitOrigin-RevId: 8f729bf80cce3c39b788a61591f14db234297186
Change-Id: I5a07bf96a2f8920560983fda504000c39e598e05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276560
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-12-21 17:26:48 +00:00
Srujan Gaddam 74bfe6c244 Add bindings emitter for web libraries
Adds a generator that reads the platform libraries dill and outputs
maps that correspond to the various bindings e.g. `@Native` values
that exist in the web libraries. These maps will be consumed during
the analyzer run for lints.

Change-Id: I5b5bf91ff0e32964b97c9e52be414ec84ff88765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-12-09 19:23:31 +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
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
Riley Porter c229ff56b2 [dart:html] Update prototype CSS properties script to match views model
Change-Id: I0bcea8e59b6d92b8a0aea82d64ca4266ec12869c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259062
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-14 18:00:52 +00:00
Riley Porter b94d9ab29b [dart:html] Add script to generate dart:html prototype legacy events
Adds a flag `--generate-prototype-events` to the dart:html generation
scripts, which causes a `prototype_events.dart` file to be generated
with EventStreamProviders and extensions for all events generated
in legacy dart:html. The generated file can be copied and pasted into `html_events.dart` to be used in the new dart:html prototype.

The script `prototype_htmleventgenerator.py` reuses as much common functionality as possible from the `htmleventgenerator.py`.

There were many edge cases to consider, like:
  - de-conflicting names with different event types (e.g. ProgressEvent onError vs SpeechRecognitionErrorEvent onError)
  - hiding deprecated types that don't appear in the Web IDL and haven't been needed in the glue code prototype yet
  - renaming extension on-types that have been renamed from the Web IDL
  - hiding custom events, which then need to be added to the prototype by hand
  - prefixing some events with the correct web library

Change-Id: I6ab944d74ede6d8a2178bbf9aa580a6ab7d67a77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259063
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-14 17:55:03 +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 b35b436cf5 Change : to = in tools/ and DOM templates.
Change-Id: Id0257e4d00ca4a7acc759d7f06fa5b64c744894b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256126
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-08-24 14:21:01 +00:00
Kallen Tu fa7ffc9ac1 Eliminate dynamic calls in SVGElement.
Change-Id: I60c48145fb8ffe5cc5d1c20f86cfa9f067c2705c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256026
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-08-23 18:21:40 +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
Riley Porter 01fafe5f28 [dart:html] Script to generate the prototype JS interop CSS properties
Generates a `tools/dom/scripts/prototype_css_properties.dart` file
with a JS interop extension with the intersection of all the dart:html
CSS property getters and setters from CssStyleDeclaration and
CssStyleDeclarationBase.

Change-Id: Ic616cdd5111eb169206a31c40e62356a7fb32150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254561
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-08-11 21:12:30 +00:00
Alexander Thomas 58c4a9f14c [dom] Pin python version to 3.8
The scripts fail when run with the latest python3 versions. This uses
vpython to pin the python version to 3.8.

Change-Id: I71217a61f577f336728f99f22a255ea9a33c3af4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254420
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-08-10 15:29:28 +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
Ahmed Ashour 99f0fb5b70 Fix typos
Fixes #49364

TEST=ci

Change-Id: Ic643819c9cdd7b56690981b96b854b1e8d622fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250160
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-07-12 19:35:22 +00:00
Janice Collins 822cd1cbd5 Remove dartanalyzer from built SDK.
Bug: https://github.com/dart-lang/sdk/issues/48457
Change-Id: Ic0d038299712989b8445859590ff870ce3bdc13a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-01 17:43:20 +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
Chris Terefinko ecbf11b8d8 [dart2js] Add missing connectionState and onConnectionStateChange to RTCPeerConnection.
Closes https://github.com/dart-lang/sdk/issues/48735

Change-Id: I04f263afa4dee1b868ad254cb54ad7c398435e03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240240
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-04-06 22:34:07 +00:00