Commit graph

1640 commits

Author SHA1 Message Date
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 7349385185 [dart:html] Changes to template/src to handle compat data
Mostly null-assertions to make code compatible with compat
data changes.

Change-Id: I8f7c6c2421d6427851a44588978910deae8440bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam 76d7739cf7 [dart:html] Add compatiblity to manually written native getters
Native getters in src/template files are modified to reflect the info
in the compatibility data.

Change-Id: I98f96737e21c7b4ce6bd17ea398e9806c61122b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152046
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@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 34bf6742d4 [dart:html] Make browser-incompatible attributes nullable
Bug: https://github.com/dart-lang/sdk/issues/41905

Addresses browser incompatibilities for attributes that are
blocking dart2js tests.

Change-Id: I2c7af57e236ba6122cce4c0e98efc04d5e11b525
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148320
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-16 03:47:12 +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 d1a100012c [dart:html] Label Navigator.deviceMemory as nullable
Navigator.deviceMemory is not supported on some browsers and
therefore the native call returns null on undefined.

Change-Id: I529ae29cf8c875d8c62146e7f59c173c3c3523ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147810
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-13 00:21:47 +00:00
Srujan Gaddam 0afd7a6907 [dart:html] Unsuppress MediaDevices.getUserMedia
Bug: https://github.com/dart-lang/sdk/issues/35253

This API was suppressed initially due to issues with conversions
between promises and futures. Now that that has been resolved, this
should be unsuppressed. Tests have been refactored to use both
navigator.getUserMedia and navigator.mediaDevices.getUserMedia.

Change-Id: Ia131b303192c7eaa3f08475cf700a53665ab3584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-12 16:59:49 +00:00
Srujan Gaddam efdb1c5cd6 [dart:html] Use 'null' when html is null
createContextualFragment accepts a non-nullable string, so if html
is null, it's called with 'null'.

Change-Id: If11a4c397c939017f501707130385d967ee05910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146691
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-06 02:18:12 +00:00
Srujan Gaddam f7e0859415 [dart:html] Return null for cancel in weak mode
Bug: https://github.com/dart-lang/sdk/issues/41653

Since StreamSubscription.cancel now returns a non-nullable Future,
EventStreamSubscription.cancel checks for strong mode and returns null
in weak mode and a void future in strong mode. This preserves synchronous
behavior in weak mode.

Change-Id: Ifc7a6b565e99061d30e42a005bdd5fc3578b0e91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146680
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-05 22:57:46 +00:00
Srujan Gaddam 99ad809e06 [dart:html] Add missing change to dart2js_KeyEvent
https://dart-review.googlesource.com/c/sdk/+/145502 introduced
a change to html_dart2js.dart that should be copied over to the
source file from which it's generated.

Change-Id: Iafc24d16dd0f905c3a127ecede4cbc6e9d062940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146681
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-05 20:06:57 +00:00
Srujan Gaddam e35f398779 [dart:html] Modify createFragment to take nullable html str
Closes https://github.com/dart-lang/sdk/issues/41699

createFragment should accept a nullable html string in its
implementation. As such, usages of createFragment within dart:html
are modified as well so the html string does not have to be
non-nullable.

Change-Id: Ia04ad2da9e2a48cabda8774f0af75559fb03a7d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145570
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-30 16:50:52 +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 01da93f053 [dart:html] Change visualViewport to be nullable
Closes https://github.com/dart-lang/sdk/issues/41612

visualViewport can be nullable on Firefox. This is a workaround
until https://github.com/dart-lang/sdk/issues/41616 is addressed.

Change-Id: I386d8fc8716026191bace912e46a2c56358d079a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144350
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2020-04-22 02:34:54 +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 544fc4627f [dart:html] Add insertAll to ChildrenElementList
Bug: https://github.com/dart-lang/sdk/issues/41275

insertAll should be unimplemented. It was previously relying
on a call to ChildrenElementList.length in the List mixin to
throw an UnsupportedError.

Change-Id: Ie8e5b126ea75a538e9db8b939bff0be012814efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-02 20:16:39 +00:00
Srujan Gaddam 0764c70cd9 [dart:html] Remove nullability from CssClassSet funcs
Pre-nnbd, add and toggle were allowed to return null, but with the
change in the Set interface, they must return a non-nullable bool.

Change-Id: I1dfcb43d8c816f46f847d22d6f62507c6a77e4a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141500
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-04-02 19:29:09 +00:00
Srujan Gaddam bc65eafd3b [dart:html] Fix nullability for vars with null checks
There are several instances where there are non-nullable
variables with null checks associated with them that should
be converted back to nullable. Attribute functions in Element
are clarified as well.

Change-Id: I23cf020f02f3d4b512e041f0339daafb46fdd7f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140909
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-02 19:28:59 +00:00
Srujan Gaddam 61adacd71d [dart:html] Add bool type to supportsTypedData
Allows it to be used as a boolean expression.

Change-Id: Id638eba4d1b0f745bfabc038f92fe930b5f454f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141641
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-03-30 23:33:54 +00:00
Srujan Gaddam b213b4ff58 [dart:html] Nullability fixes based on JS call
Changes types of return values depending on if the
call allows a Null type.

Change-Id: Id9b3d69eee1008d46a6b3b16f217a6b9c892fc6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141260
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-03-30 22:06:01 +00:00
Srujan Gaddam fcc43457b3 [dart:html] Add nullability to EventTarget conversion
initMouseEvent uses this conversion to call the native function,
and it is allowed for the EventTarget to be null in the native
call.

Change-Id: I345e82fa00f4cca72e15f713cd7a271d306b7d37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141040
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-26 16:36:14 +00:00
Srujan Gaddam ed41036d2f [dart:html] Migrate NodeValidator fix to NNBD
Addresses failure in api_dynamic_test, and copies the
vulnerability fix from src to nnbd_src.

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

Change-Id: Ic1c6766c066174f4d0504e429ed70f1ce0a487e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140645
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-03-24 00:46:55 +00:00
Kevin Moore 6a5d73dfe7 Address a vulnerability in node validator
Related to DOM clobbering of previousSibling

Change-Id: Ib4ed1cdba4217c351804b0689a999b73713f79ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-23 20:01:58 +00:00
Joshua Litt 44669206b3 [dart2js] Fix html_dart2js to handle null argument.
Change-Id: I711261840fd733ecf640586b82da54d6f61c6bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-03-17 17:11:36 +00:00
Srujan Gaddam 5b23373f7e Modify fields in some abstract and native classes
Since we transitioned to natives for dart:html, manually written native
fields should be rewritten. Similarly, if there are fields in abstract
classes that represent interfaces, they should be converted. Fields in
abstract classes that are used in that class are left alone.

Change-Id: I924363639a4430b88b810b7348815bbc3f040e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137642
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +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 6d051311b6 Add back in null assertions for legacy weak mode
These assertions need to be added back into the nnbd sdk in order to be
compatible with weak mode.

Change-Id: Ie774fffda1fb0e79dbc7fe13cb75b9d28e4268fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-21 19:13:31 +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
Robert Nystrom 156c503620 Change indexOf() and lastIndexOf() back to Object.
In the legacy SDK these two methods in ListMixin take Object, not E.
When I migrated them to NNBD, I changed them to E to match the
declaration of the methods in List. This was an unintended breaking
change.

Fix that by changing them to "Object?", which is the NNBD equivalent of
the declarations in the legacy SDK.

Change-Id: I2a75e9f26a8198e4f51cb32a55055d5e64a69ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136412
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-20 09:00:17 +00:00
Srujan Gaddam 59370f29c5 Fix html methods without returns
Several method bodies did not return a value conditionally or at all.

Change-Id: I01ca87e2e0501597bacb49bcddd10668b59026b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135626
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-19 20:43:34 +00:00
Srujan Gaddam e2ff83724b Fix nullability for some templates
Addresses discrepancies between IDL and template files for some
operations. There's probably more I'm missing since this was
from a cursory check through all the templates.

Change-Id: Id79710b343f4a5fe0b5529f64c341d4f63d69b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-11 20:28:54 +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