Commit graph

790 commits

Author SHA1 Message Date
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
Srujan Gaddam aff77e7ed7 [dart:html] Incorporate MDN compatibility data
Bug: https://github.com/dart-lang/sdk/issues/41905

Uses MDN information in the generator script to get a better idea
of which attributes are compatible and are not. mdnreader.py is
introduced to parse the data present in third_party.

Change-Id: I330ccf918cb42deb4c09ab97db5f3d2f0c432d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149800
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam ff8f128a76 [dart:html] Update console interface
Closes https://github.com/dart-lang/sdk/issues/42213

Adds nullability to Console, adds missing methods and cleans
cleans existing ones up, and removes a stale template. Most
modifications are derived from https://console.spec.whatwg.org/
and the rest are derived from the MDN.

Change-Id: I26a099b15e53a4748afb61c7532bdbf64d7c4d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151091
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-30 23:32:27 +00:00
Srujan Gaddam b5470ae013 [dart:html] Modify scripts to always use NNBD
Since the sdk has been unforked, scripts should be updated to
generate files by always using NNBD. As such, nnbd_src has been
moved to src and the old src has been deleted. This does not address
the nnbd tokens e.g. $NULLABLE. That will be done in a future CL.

Change-Id: I00bead16a9d19569b07ad0601f581fc14400fdce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151864
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-06-23 23:17:35 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Srujan Gaddam a39a3cd141 [dart:html] Add rename/metadata for some attributes
Some fields that were changed to native getters/setters should include
renaming/metadata whenever possible to account for name differences.
While this is already the case with most fields, this CL adds it to
some places that missed it. Annotations for
AnimationEffectTiming.duration are changed to be accurate as well.

Change-Id: Idb8b94a9b916086d127753f868e97f1a1b9db53f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148464
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-06-12 00:52:46 +00:00
Srujan Gaddam 5af38092e3 [dart:html] Add track event to RTCPeerConnection
trackEvents and onTrack were not being generated by the event
generation and should be added to the allowlist.

Change-Id: I5bc6bcc17c56b26d7fc43e69e4867532ab1b80a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151043
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-06-12 00:42:36 +00:00
Alexander Thomas 1e5b0182ca [infra] Remove obsolete buildbot paths/terms
https://github.com/dart-lang/sdk/issues/42247

Change-Id: Ia0b19677c655bc768f00be77df8b0162ac9e7bea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150629
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-06-10 20:59:46 +00:00
Srujan Gaddam c10b8dc5b2 [dart:html] Use JS name for promise call
Generated code uses the html_name, which could be a Dart rename,
in the JS call instead of the JS name associated with it.

Change-Id: I7362abf0e089705be5e532b5281f326305c96246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148180
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-19 19:47:38 +00:00
Srujan Gaddam aa018d90f3 [dart:html] Add back static attributes to getters/setters
Closes https://github.com/dart-lang/sdk/issues/41911

Fields were translated to native getters/setters, but static attributes
did not maintain their static modifier. This fixes that.

Change-Id: I52b75ecbf40c4f39d301c6aaedd2492ce7deae5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148239
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-16 01:00:32 +00:00
Srujan Gaddam b0d35855d8 [dart:html] Add nullability to node signature
Closes https://github.com/dart-lang/sdk/issues/41616

When merging interfaces, nullable and non-nullable types
should not be treated as the same. This also fixes some nullability
information that was not included in dart.idl but is part of the
Chromium IDL.

Change-Id: I6e94176d905b63364bc93dc2120d194452cf05f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144464
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-23 04:56:28 +00:00
Srujan Gaddam 2bd4858d40 [dart:html] Use TreatNullAs attribute in nullability
Closes https://github.com/dart-lang/sdk/issues/41419

Uses the external attribute TreatNullAs to allow nullable setters
and parameters.

Change-Id: I5182ac6dcfdcf78e84f204079a782aebbf128a78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143185
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-14 00:37:41 +00:00
Srujan Gaddam 5ed1850933 [dart:html] Add SubmitEvent to Event native annotation
Bug: https://github.com/dart-lang/sdk/issues/40901

Allows SubmitEvent to be treated like an Event.

Change-Id: I86d31b73eda5a0009fbd18aa4e993d0f52165d83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142882
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2020-04-08 20:27:34 +00:00
Srujan Gaddam b96cd6d755 [dart:html] Add nullability to item type for lists
Needed to type nullability for List parameters correctly.

Change-Id: I55732a34f9e221324a15312985cb83b49a6811a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142211
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-06 21:37:44 +00:00
Srujan Gaddam 9f79dfc37d Address analyzer errors in golden files in dart:html
New analyzer errors are reported for dart:html around nullability.
Non-nullable fields are translated to native getters and setters if part
of a concrete class and normal getters and setters if abstract.

Change-Id: I2fd87803a08872b2a7eae4de0af704f184997c7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137481
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 80f84e1942 Change all fields to native getters/setters
Bug: https://github.com/dart-lang/sdk/issues/40772

Attributes are translated to native getters and setters regardless of
NNBD. Some logic was removed for fields that no longer apply due to this
change.

Change-Id: Ia1a05778ff8c6f082506a1c95a3057a7c5f7f896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136880
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 3ec6ec2a2d Change getters/setters to native for nnbd
NNBD fields that were non-nullable or final were transformed to getters
so that they were compilable. They need to be transformed to natives now
for performance.

Change-Id: Ice0082f9468c542098a6d12083a826438d15eba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135860
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 55f4b1294e Change setProperty to take in nullable |value|
IDL allows |value| to be nullable.

Change-Id: I1db4a7929f0a83c4772e1a11384afb70ead53501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-22 02:22:21 +00:00
Srujan Gaddam a42c072017 Remove unnecessary null check in getPropertyValue
CSSStyleDeclaration.getPropertyValue returns a non-nullable string.
It will also return an empty string if the property is not found. Since
getPropertyValue returns the value of the native getPropertyValue, the
null check should be removed.

Change-Id: I9846553d3f9fcd68cbd15b9c39d2104cab594b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136413
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-20 20:49:26 +00:00
Srujan Gaddam e7ee11a95b Fix input and output for conversions
Fixes tests lib_2/html/event_customerevent_test
            co19_2/LibtTest/html/Document/window_A01_t01

JS inline incorrectly uses the converted html name for attributes for
getters. Similarly, dynamics do not need to be marked as nullable as
they are already nullable. This also fixes some of the nullability logic
for conversion input and output.

Change-Id: I77efde95a4e5d52461b3412f8650578e967ca5cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-11 00:27:05 +00:00
Srujan Gaddam 5e74472449 Handle optionals in DOM scripts for NNBD
Optionals were being ignored for some methods and for optionals that
have a default of Undefined or None, they should be marked nullable in
Dart syntax regardless of whether they are in the IDL.

Change-Id: Icc71300dc7d8e06fef640a5ca8d502b093c0580c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134765
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-10 22:26:35 +00:00
Srujan Gaddam 9af1ffc558 Don't generate getters/setters for read only promises
Bug: https://github.com/dart-lang/sdk/issues/40530

For attributes that return promises and are read only, we
use promiseToFuture casts that should be maintained.

Change-Id: I02e23fc9c47321ced64a152c245cbdccd7337033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134902
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-10 18:55:35 +00:00
Srujan Gaddam dae60008ab DOM script changes to handle nnbd
-Adds field for type nullability for IDL operations
-Adds field for conversions to reflect input and output type nullability
--based on implementation
-Corrects generic object types to include nullability
-Changes 'any' types to dynamics
-Adds nullability to types in various operations
-Converts finals and non-initialized non-nullable fields to getters and
setters
--TODO: convert these to native instead of JS inline
-Modifies nullability for annotations and removes annotations from
setters

Change-Id: Iab19830fd1d7f37b170a4da8672f922c3f9b0863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132967
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-07 01:05:14 +00:00
Srujan Gaddam 3776313e65 Change dart:html templates to generate null-safe code
Introduces NULLASSERT token and NNBD condition to allow code to
conditionally compile with NNBD.

Change-Id: Ib71e439f32c793e69b66c328cd7c9900358d886e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134045
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-06 23:18:24 +00:00
Srujan Gaddam f4cdc98ede Fork dom src files to nnbd version
Copies over the files from tools/dom/src to tools/dom/nnbd_src and
excludes _chrome.

Change-Id: I18c58c0adcbaddc97e72fef6b5e75442c9f5550e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130129
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-29 22:22:50 +00:00
Srujan Gaddam 151dc015c0 Add $#NAME syntax to emitter to allow subtemplates
NNBD will require explicit casts in various locations in the dart:html
libraries. To avoid taking on this overhead in the pre-nnbd dart:html
library, syntax is introduced in the emitter to allow tokens with
arguments.

Test: emitter_test.py

Change-Id: Ie6de714f491e0cda654f33ee389a91b765cacc9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133333
Reviewed-by: Stephen Adams <sra@google.com>
2020-01-29 22:22:50 +00:00
Srujan Gaddam 7db61c6b01 Changing the dart:html generator scripts to generate null-safe/nnbd code
Change-Id: I4a8b097b126864366076b1e73cf3e0296600380e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128376
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-01-29 00:20:42 +00:00
Srujan Gaddam a865b9c379 Change Future lists to use dynamic
Bug: https://github.com/dart-lang/sdk/issues/39627

Lists in a future should be typed with dynamic since they come from JS
interop.

Change-Id: I93d4da16eb27c3af23820a170cfad7cc5c3b4472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128368
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2019-12-14 00:23:54 +00:00
Srujan Gaddam b84d6ba0f8 Change type MediaDeviceInfo to dynamic in Future
Bug: https://github.com/dart-lang/sdk/issues/39627

Lists in a future should be typed with dynamic since they come from JS
interop.

Results from running tools/dom/scripts/go.sh

Change-Id: I4ed37d6f5fa570beef71652dcad17c3bcf7560ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2019-12-13 22:17:11 +00:00
Sigmund Cherem 16bc1806ea (html) remove type parameter from callback argument
This was a case missed when fixing #33891, and fixes #36798

Change-Id: I96e177a7d8020635e191d829afdec45f888658a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127500
Reviewed-by: Alan Knight <alanknight@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-06 19:02:02 +00:00
Alan Knight 752bbce46f Copy dart:html files to sdk_nnbd automatically and opt out
Change-Id: I78ab534da123afb12a31681b47ba1f2fb9567992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124202
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2019-11-06 23:59:33 +00:00
Nate Bosch 0f1d5fa7e6 Centralize functions to convert Promise
Merge the two copies of a function that convert a JS promise to a Dart
Future. Reuse this function for the specialized case of converting to a
`Future<Map>`.

- Rename `convertNativePromiseToDartFuture` to the shorter and more
  widely used `promiseToFuture`. Update one existing use of the old
  name.
- Make the method generic to match the previous implementation of
  `promiseToFuture`.
- Update the code generator template to not emit the second copy of the
  method.
- Use the existing `promiseToFuture` with a `.then` call to implement
  `promiseToFutureAsMap`. Update the doc comment to follow best
  practices.
- Duplicate all above changes to nnbd SDK copy.

Change-Id: Ib3bbf17477efec3666b24fd4019ca8ce68f0b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119174
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-08 21:33:42 +00:00
Nate Bosch 55f81f2210 Mass format python with yapf
- Add `.style.yapf` with configuration to use Google style.
- Run `yapf` on all `.py` files in this repo.
- Manually fix one trailing space in a doc string.
- Run `git cl format runtime` to satisfy presubmit.

Change-Id: I7e6bd11e91f07926b9188362599af398551eed79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111600
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-08-05 20:34:31 +00:00
Lorenz Nickel 79e478e50e Fixed some links
**I fixed some links and some other minor flaws.**

I also found the following outdated links, which I didn't fix:

- [This link](https://github.com/dart-lang/pool/tree/zone.strong) in [this file](https://github.com/dart-lang/sdk/blob/master/docs/newsletter/20170728.md) (didn't fix because don't know new location and this is some sort of archive so the link should probably stay the original)
- [This link](https://www.dartlang.org/tools/analyzer) in [this file](https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_cli/lib/src/options.dart) (didn't fix since the link is still working, it just gets redirected and the link is part of the programm, I don't want to break anything by changing it, all other links are in comments)
- [This link](https://github.com/domokit/mojo/issues/728) in [this file](https://github.com/dart-lang/sdk/blob/master/build/config/compiler/BUILD.gn) (didn't fix since probably has no new location and is part of TODO, which I don't want to change)

While doing all this I also noticed that [these tests](https://github.com/dart-lang/sdk/tree/master/tests/compiler/dart2js_extra) contain a lot of other inconsistencies in their comments and the location of the import-statements (I only fixed one which was not link-related), could be target of another PR.

Closes #36927
https://github.com/dart-lang/sdk/pull/36927

GitOrigin-RevId: 71d05d0b52d8ec5b92d077a070e066d1fdd4bbfa
Change-Id: Ide4b2424fccad8ae2e06c788efd4443dc0de997b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102222
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-01 16:21:41 +00:00
Sigmund Cherem 5192cd1008 Narrowing improvements in dart2js global inference.
* no longer narrow by selector use, only narrow by type and non-null
* check for narrow nesting
* add non-null in a couple known places

One large apps, I compared the type-masks in dump-info and all differences were improvements with non-null. We weren't doing any narrowing based on the possible targets of a selector.

Change-Id: I270f360f70fbe3171d09ccd71d10517be9140194
Reviewed-on: https://dart-review.googlesource.com/c/90340
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-02-23 00:10:11 +00:00
Terry Lucas c5cfdc5279 Expose data member 'port' for MessageEvents and automatically pull in markupsafe for go.sh script.
Fixes #35730

R=sigmund@google.com

Change-Id: I91d9622601c99bbbfaad87c24f01db2b26303744
Reviewed-on: https://dart-review.googlesource.com/c/91165
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-27 20:06:58 +00:00
Stephen Adams 6bcb017c56 Fix postmessage to treat it's input as a serializable value
Change-Id: I11744735f5e6d6a5593e6ac3f00d87813577db7e
Reviewed-on: https://dart-review.googlesource.com/c/91141
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-01-25 03:56:06 +00:00
Stephen Adams aeaf82577e dart:html: Add Element.removeAttribute
- Improve `element.attributes.remove(name)` to compile to `element.removeAttribute(name)`.
- Improve `element.getNamespacedAttributes(namespace).remove(name)` to compile to
  `element.removeAttributeNS(namespace, name)`.
- Add removeAttribute[NS].
- Add hasAttriute[NS].
- Assert attribute names are not null to prevent conversion to "null"/"undefined".
- TODO: Assert values are not null to prevent conversion to "null"/"undefined".
- namespaceURI does not need checking since null and undefined map to 'no namespace'.

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

Change-Id: Ie5bee23c88e8fb92f9d46f29fdf4b7f3175a2aa3
Reviewed-on: https://dart-review.googlesource.com/c/90160
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2019-01-18 19:06:24 +00:00
Terry Lucas edca6169c1 Fixed a number of dart:html P1 issues.
- Fixed HTML API's with callback typedef to correctly convert Dart function to JS function.
- Expose HttpStatus from dart:html
- Expose DomName ondblclick and dblclickEvent for Angular analyzer.
- Fixed removeAll should be Iterable<Object> to match Set's removeAll not Iterable<E>.
- Fixed a number of DataTransferItem, Entry, FileEntry and DiretoryEntry returning NativeJavaScriptObject needed type registered in DDC.
- Added ability to allow local file access from Chrome browser added -local in ddb.

R=vsm@google.com

Fixes #30278
Fixes #35484
Fixes #34318
Fixes #35510

Change-Id: Ide8c04716c54045e837781d489562f27b694b109
Reviewed-on: https://dart-review.googlesource.com/c/89340
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-01-15 17:21:50 +00:00