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>
This commit is contained in:
Kallen Tu 2022-08-29 20:06:45 +00:00 committed by Commit Bot
parent bcb9fd28fb
commit 2bb03e4344
5 changed files with 25 additions and 27 deletions

View file

@ -27,9 +27,7 @@
"Dynamic invocation of 'toJson'.": 1
},
"org-dartlang-sdk:///lib/html/dart2js/html_dart2js.dart": {
"Dynamic access of 'style'.": 1,
"Dynamic invocation of 'call'.": 2,
"Dynamic invocation of 'dart.dom.html::_initKeyboardEvent'.": 1,
"Dynamic access of 'attributes'.": 1,
"Dynamic invocation of '[]'.": 1,
"Dynamic invocation of 'toLowerCase'.": 1,

View file

@ -5434,19 +5434,18 @@ class CssStyleDeclaration extends JavaScriptObject
class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
final Iterable<Element> _elementIterable;
Iterable<CssStyleDeclaration>? _elementCssStyleDeclarationSetIterable;
Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
_CssStyleDeclarationSet(this._elementIterable) {
_elementCssStyleDeclarationSetIterable =
new List.from(_elementIterable).map((e) => e.style);
}
_CssStyleDeclarationSet(this._elementIterable)
: _elementCssStyleDeclarationSetIterable =
new List.of(_elementIterable).map((e) => e.style);
String getPropertyValue(String propertyName) =>
_elementCssStyleDeclarationSetIterable!.first
_elementCssStyleDeclarationSetIterable.first
.getPropertyValue(propertyName);
void setProperty(String propertyName, String? value, [String? priority]) {
_elementCssStyleDeclarationSetIterable!
_elementCssStyleDeclarationSetIterable
.forEach((e) => e.setProperty(propertyName, value, priority));
}
@ -34638,6 +34637,7 @@ abstract class _DocumentType extends Node implements ChildNode {
}
// From ChildNode
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
@ -35752,6 +35752,7 @@ abstract class _WorkerLocation extends JavaScriptObject
}
// From URLUtilsReadOnly
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
@ -35769,6 +35770,7 @@ abstract class _WorkerNavigator extends NavigatorConcurrentHardware
// From NavigatorID
// From NavigatorOnLine
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
@ -40596,7 +40598,7 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
view = window;
}
dynamic eventObj;
KeyboardEvent eventObj;
// Currently this works on everything but Safari. Safari throws an
// "Attempting to change access mechanism for an unconfigurable property"
@ -40607,7 +40609,7 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
// initialize initKeyEvent.
eventObj = new Event.eventType('KeyboardEvent', type,
canBubble: canBubble, cancelable: cancelable);
canBubble: canBubble, cancelable: cancelable) as KeyboardEvent;
// Chromium Hack
JS(

View file

@ -232,20 +232,19 @@ $!MEMBERS
class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
final Iterable<Element> _elementIterable;
Iterable<CssStyleDeclaration>$NULLABLE _elementCssStyleDeclarationSetIterable;
Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
_CssStyleDeclarationSet(this._elementIterable) {
_elementCssStyleDeclarationSetIterable = new List.from(
_elementIterable).map((e) => e.style);
}
_CssStyleDeclarationSet(this._elementIterable)
: _elementCssStyleDeclarationSetIterable =
new List.of(_elementIterable).map((e) => e.style);
String getPropertyValue(String propertyName) =>
_elementCssStyleDeclarationSetIterable$NULLASSERT.first.getPropertyValue(
_elementCssStyleDeclarationSetIterable.first.getPropertyValue(
propertyName);
void setProperty(String propertyName, String$NULLABLE value,
[String$NULLABLE priority]) {
_elementCssStyleDeclarationSetIterable$NULLASSERT.forEach((e) =>
_elementCssStyleDeclarationSetIterable.forEach((e) =>
e.setProperty(propertyName, value, priority));
}

View file

@ -108,7 +108,7 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
view = window;
}
dynamic eventObj;
KeyboardEvent eventObj;
// Currently this works on everything but Safari. Safari throws an
// "Attempting to change access mechanism for an unconfigurable property"
@ -119,7 +119,7 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
// initialize initKeyEvent.
eventObj = new Event.eventType('KeyboardEvent', type,
canBubble: canBubble, cancelable: cancelable);
canBubble: canBubble, cancelable: cancelable) as KeyboardEvent;
// Chromium Hack
JS(

View file

@ -1373,20 +1373,19 @@ $!MEMBERS
class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
final Iterable<Element> _elementIterable;
Iterable<CssStyleDeclaration>$NULLABLE _elementCssStyleDeclarationSetIterable;
Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
_CssStyleDeclarationSet(this._elementIterable) {
_elementCssStyleDeclarationSetIterable = new List.from(
_elementIterable).map((e) => e.style);
}
_CssStyleDeclarationSet(this._elementIterable)
: _elementCssStyleDeclarationSetIterable =
new List.of(_elementIterable).map((e) => e.style);
String getPropertyValue(String propertyName) =>
_elementCssStyleDeclarationSetIterable$NULLASSERT.first.getPropertyValue(
_elementCssStyleDeclarationSetIterable.first.getPropertyValue(
propertyName);
void setProperty(String propertyName, String$NULLABLE value,
[String$NULLABLE priority]) {
_elementCssStyleDeclarationSetIterable$NULLASSERT.forEach((e) =>
_elementCssStyleDeclarationSetIterable.forEach((e) =>
e.setProperty(propertyName, value, priority));
}