Commit graph

828 commits

Author SHA1 Message Date
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
Srujan Gaddam b42103c9d1 Remove some SVG types from bindings map
Our maps are string-based and assume there's only one one @Native
class with a given name. This isn't true for these four classes,
where there are two types with the same name for each one.
This then results in us dropping the definition of one of the
two types.

Since one of the two types is essentially unused, we should choose
to drop that one instead for now. Long-term, we should deprecate
the unused types or change our conformance handling to handle
multiple types with the same name. We could also choose to unify
both definitions, but this may lead to either false positives or
renames of members being dropped.

This allows us to catch uses of the types that are actually used.

Change-Id: I9386cad5b014bee60cd72d21cdf0546640138704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341331
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-13 01:59:37 +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
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
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
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
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
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 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
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
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
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
Srujan Gaddam 0ec4c3a1b5 [dart:html] Expose scrollIntoViewIfNeeded
`scrollIntoViewIfNeeded` is nested within `scrollIntoView`. The latter
method is outdated and the way to access the different ways to call
`scrollIntoViewIfNeeded`. Instead of using that method, this CL
directly exposes `scrollIntoViewIfNeeded`.

Change-Id: I38d7876a7923768ae165c29a98e514e90182b77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-02-02 20:46:59 +00:00
Srujan Gaddam 01642c2122 [dart:html] Add different bindings for FileSystem APIs
Closes https://github.com/dart-lang/sdk/issues/45036

The FileSystem API has different bindings for different browsers,
and the values are all taken directly from the MDN:
https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API
Along with this, some APIs that need to expose these bindings are modified to
expose all possible bindings.

Change-Id: I18ce6d1208349eb9d5bd9d802d17dda1ddae2dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225323
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-12-23 00:11:03 +00:00
Riley Porter 8e0d5f98a3 [dart:html] Remove deprecated gridRowGap and gridColumnGap
After chatting offline, we decided we don't actually need
gridRowGap and gridColumnGap since the rowGap and columnGap
properties are the preferred names. Removing the deprecated
grid versions before it becomes a breaking change to do so,
and to keep dart:html bloat minimal.

Change-Id: I75a7de40a4bb1a5479723600987d19e7e42bf69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-12-20 18:21:03 +00:00
Riley Porter fc8a65d4c8 [dart:html] Add gap, rowGap, gridRowGap, and gridColumnGap properties.
Adds gap, rowGap, gridRowGap, and gridColumnGap CSS style properties.
The columnGap property was already included through WebKit.

Relevant bugs:
https://github.com/dart-lang/sdk/issues/46077
https://github.com/dart-lang/sdk/issues/45789


Verified properties are accessible with this `foo.dart` file:
https://paste.googleplex.com/6379738705690624
Loaded with ddb in Chrome:
https://screenshot.googleplex.com/9hN4MTCFxY5EYQn.png

Change-Id: Ia62807a6588cd0fd21b204a2a98a120fa4c4b07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224500
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-12-16 18:47:11 +00:00
Srujan Gaddam 6f4f2f5f12 [dart:html] Make Native web classes extend JavaScriptObject
Now that JavaScriptObject is the new parent class of the old
JavaScriptObject (now called LegacyJavaScriptObject), web classes
should extend it instead.

Change-Id: I94613177bd073e131bff70d8e00e4e6ae8e8949f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216275
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-12-10 18:36:00 +00:00
Riley Porter d7a0cb74b1 [dart:html] Remove old scripts to generate docs.json
The scripts in tools/dom/docs were using Mirrors to
scrape the dart:html related libraries and generate
the docs.json file, which is also used for docs in
generating dart:html. With these scripts being out
of date and our general migration plans for dart:html,
we don't need these scripts anymore. We may still
generate our dart:html documentation in the future,
but it will involve a difference process.

No change to dart:html when running `go.sh`

Change-Id: Ie10af41b5dcff192be8961aa20c1ed493efa4593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221027
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-29 20:13:54 +00:00
Sigmund Cherem 38b5a841de [dart-web] Remove dart:web_sql library.
The WebSQL standard was abandoned more than 10 years ago and is not
supported by many browsers.

The `dart:web_sql` library was marked as deprecated in Dart 2.14. This
CL makes the library inaccesible, removes support for `dart:web_sql` imports,
and removes the `Window.openDatabase` API. The old code for `dart:web_sql` is
still generated by the html generators. Removing that will be handled by a
separate change.

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

Change-Id: I892107396b3b227b4f33344377585aa5e5328288
Bug: https://github.com/dart-lang/sdk/issues/46316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216080
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-10-19 01:00:08 +00:00
Srujan Gaddam d87a545a6a [dart:html] Update changes in idl_parser location
Simply adds the new location to the sys.path so it can be found
and filters idl files within idl_parser so it doesn't affect
codegen. Also removes a stale comment to finalize the python3
migration.

Change-Id: I31d93fd8de22e38a0e968587149546565f86e3ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212630
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-09-08 22:18:37 +00:00
Srujan Gaddam f34eef5b91 [dart:html] Migrate python scripts to python 3
Migrates syntax and semantics from python 2.7.

Major changes include:

- filters
- sorting
- print statements
- higher-order functions
- hashing and comparison

and other misc changes. go.sh consistently gives the libraries
in this and the previous commits with these changes.

Change-Id: I66365739887158d8f321015d36e556447da1bcd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211542
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-09-08 22:10:53 +00:00
Srujan Gaddam 8100b4de02 [dart:html] Fix implements order for classes
Using a set does not guarantee a consistent order from python 3
onwards, so use a OrderedDict to get a consistent order while
removing any duplicates.

Change-Id: I02d9aae2a82fd119f22b3a5e353b9445ffca963b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211541
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-09-08 18:45:02 +00:00
Gabriel Castro fc4d4144fb Added js_util import to html_dart2js
Change-Id: Ic643e3bbf521fa116984a27f504a2642f2052f36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210100
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-08-13 23:13:31 +00:00
Gabriel Castro 799b39ad42 dart:html static extension members generation
Initial changes to add functionality to the dart:html generation
script to generate classes with the JSInterop static extension pattern

Change-Id: I9dca21db7500ab25ac96b16eda11fe605f915abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208461
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
2021-08-10 18:15:30 +00:00
Srujan Gaddam 2628eaa88c Modify go.sh to use dart format
`dartfmt` is deprecated in favor of `dart format`.

Change-Id: I4154ff9d863213d3925aacce892ffde06dee40f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-07-22 20:49:25 +00:00
Clement Skau 67f097a161 [tools] Update all iteritems -> items
This migrates old python2 dict.iteritems() to python3 dict.items().
iteritems was removed in python3 meaning these script will otherwise not
run.
Note that this remains backwards compatible since dict.items() also
existed in python2, though the implementation was more memory intensive
for large dicts (which these likely aren't).

This is similar to https://dart-review.googlesource.com/c/sdk/+/200184

Change-Id: I4fe5c90d21de97d0ecceb27fa6efa7d7deb14098
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200864
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-05-20 11:36:52 +00:00
Srujan Gaddam 7abaa95492 [dart:html] Fix Geoposition bindings and callbacks
Closes https://github.com/dart-lang/sdk/issues/45562
Closes https://github.com/dart-lang/sdk/issues/44324

Geoposition should be bound to GeolocationPosition as well since
Position is deprecated since Chrome 79.

Similarly, success callbacks used in the Geolocation API can accept
a Firefox-specific implementation, so the callback should accept a
dynamic instead. Doing this requires adding annotations to the APIs
so liveness of Geolocation types is maintained.

Change-Id: Id38f68d10c9cdcb7d711ef83a70df87b30be405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194325
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-29 21:32:15 +00:00
Srujan Gaddam f08e228238 [dart:html] Use python2.7 for go.sh
Due to third_party dependencies, this script can't use python3 yet.
Note that this means if we can't use python2.7 in the future, we
either need to update our copy of the IDL scripts to use python3,
update the dependency so that we use the latest IDL scripts, or
we stop using these scripts to generate dart:html.

Change-Id: I42eb7d1fc769644e358dbf26344b6c66265ce10c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196582
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-04-23 19:06:01 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

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

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Srujan Gaddam 3d52fcd250 [dart:html] Type FontFaceSet.add result as nullable
Closes https://github.com/dart-lang/sdk/issues/45676

`FontFaceSet.add` can return null on Firefox, which leads to a crash
due to native null assertions. The scripts are modified to treat
the `add` return type as nullable.

Change-Id: I8fcff8ef716e8620f04c44f5fb8b3a5884b3d1db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195167
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-14 00:00:08 +00:00
Srujan Gaddam bb2f0793b8 [dart:html] Remove added types from promise dict
Along with 'creates' types, types were added to promiseToFuture
calls. This is a breaking change for code that does not type the
resulting Future with the same type.

Change-Id: I3d107bb538545fc8f8ce3a58ed98292f415efe2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161629
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-14 23:23:47 +00:00
Srujan Gaddam 53a4a57da7 Revert "Revert "[dart:html] Add 'creates' type description to JS calls""
This reverts commit 1f92293fd5.

Reason for revert: Attempt to reland original CL with fixes.

Change-Id: I0d70f22595bd7e1fd6ae72ad4046b949c1035539
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161628
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-09-14 23:23:47 +00:00
Ivan Inozemtsev 1f92293fd5 Revert "[dart:html] Add 'creates' type description to JS calls"
This reverts commit 1a6420b883.

Reason for revert: This changes signatures of public methods to return
private types (e.g. `Future<_Cache> open` in `CacheStorage` and
`Future<_Response> fetch` in `Window`), which is a breaking change
without any workaround and it breaks some mocks in customer code.

Original change's description:
> [dart:html] Add 'creates' type description to JS calls
>
> Closes https://github.com/dart-lang/sdk/issues/43225
>
> JS calls on promises need to include a type description for types
> that may be newly live after the call. Since type parameters in a
> promise are not parsed, type dictionary for these APIs is updated
> to include any possible types created and code gen is changed to
> include them in the JS foreign function call.
>
> Change-Id: I8c977e4b33b383093e4091f1be94199b342521b6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160781
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

TBR=sra@google.com,sigmund@google.com,srujzs@google.com

Change-Id: I345053f599457eccfed0efdf68cdea4179693362
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161484
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2020-09-02 10:03:25 +00:00
Ivan Inozemtsev e44cf969c6 Fix creates value for getStats
It looks like it must match to Dart type, which has a different case
than JS type.

Change-Id: I485ef41d200fb689dd987edc757f3fcb7138ab90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161481
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2020-09-02 09:29:32 +00:00
Srujan Gaddam 1a6420b883 [dart:html] Add 'creates' type description to JS calls
Closes https://github.com/dart-lang/sdk/issues/43225

JS calls on promises need to include a type description for types
that may be newly live after the call. Since type parameters in a
promise are not parsed, type dictionary for these APIs is updated
to include any possible types created and code gen is changed to
include them in the JS foreign function call.

Change-Id: I8c977e4b33b383093e4091f1be94199b342521b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160781
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-09-01 19:11:39 +00:00
Srujan Gaddam 28b8cb34d3 [dart:html] Unify shared attribute metadata from MDN
browser-compat-data includes info on elements as both part of the
Web API and the individual tagged elements. The scripts would default
to whatever was processed last instead of trying to unify any conflicts
that may come up with the different sources of truth. This CL addresses
that issue by choosing the "stricter" of the two versions.

Change-Id: Id3437c14276faf8af3fe41d7a6eb83defc9bd0b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155844
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-25 23:48:43 +00:00
Srujan Gaddam 63a57a76ce [dart:html] Revert "[dart:html] Revert commits using MDN compatibility info"
This reverts commit f8ff12008e.

This CL is a revert of the initial revert and should be landed once
Flutter changes have been merged to handle the changes here.

Change-Id: I300a5efd776bf2a596743971f4e15ad62da77f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153368
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-14 23:18:43 +00:00
Stephen Adams f997d62a6d [html] Better code for Element / _ChildrenElementList method
Two tricks let us compile this more efficiently:

    e.children.addAll(cs);

Normally, get$children is inlined, returning a _ChildrenElementList
wrapper, generating:

     new W._ChildrenElementList(e, e.children).addAll$1(0, cs);

The two tricks:

1. Split _ChildElementList.addAll into an 'unwrap' that then calls the
   logic in '_addAll'

2. Add information about the properties of e.children that allow it to
   be removed.

With these tricks, dart2js can optimize the code to this version that
avoids allocating a wrapper or accessing the 'children' property:

     W._ChildrenElementList__addAll(e, cs);

Change-Id: Ifdf533ac4f9790f09f87302e67304b5696097266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153904
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-07-13 20:33:19 +00:00
Srujan Gaddam f8ff12008e [dart:html] Revert commits using MDN compatibility info
This reverts commits aff77e7e..e24f205d.

Due to a breakage in a Flutter roll, this CL stack needs to be
reverted. It should be reintroduced with changes to Flutter code to
compile with the changes in dart:html.

Breakage: https://github.com/flutter/engine/runs/828631927

Change-Id: I9c93c4eab823337d09d2e347015ad9ec402f2038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152910
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-07-02 01:33:18 +00:00
Srujan Gaddam e24f205d16 [dart:html] Mark setters nullable if incompatible as well
Getter types need to be a subtype of the setter type, so if getters
are nullable due to incompatibility, the setter needs to be as well.
This change makes those changes, updates documentation, and modifies
a template and test file.

Change-Id: I2130538bb4005b3553eb7951af022c1c2ed59c1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152607
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 1d97a4a375 [dart:html] Handle method overrides for MDN
Native getters that are incompatible were marked as nullable even
though they may override methods that aren't nullable. This fixes
those conflicts for various HTML methods.

Change-Id: I7c2456d5d223d825428cedb847d20139b7d271c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152045
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 45595624f1 [dart:html] Add secure context logic to mdnreader
Bug: https://github.com/dart-lang/sdk/issues/41944

Note that the compatibility data on secure contexts is fairly
sparse and has missing information. There are only two APIs that
have secure context info on them and they're already marked as
incompatible.

Change-Id: Iaf9ecb7a916c8ac20b32e1ea92ed44981f675659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152044
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00