Skip to content

Commit b4b02da

Browse files
committed
Include DDC fixes to dart:html in the main version
BUG= [email protected], [email protected] Review-Url: https://codereview.chromium.org/2899173002 .
1 parent d60efa8 commit b4b02da

File tree

11 files changed

+42
-26
lines changed

11 files changed

+42
-26
lines changed

pkg/dev_compiler/tool/input_sdk/private/foreign_helper.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@ JS(String typeDescription, String codeTemplate,
118118
arg8,
119119
arg9,
120120
arg10,
121-
arg11]) {}
121+
arg11,
122+
arg12,
123+
arg13,
124+
arg14,
125+
arg15,
126+
arg16,
127+
arg17,
128+
arg18,
129+
arg19]) {}
122130

123131
/// Annotates the compiled Js name for fields and methods.
124132
/// Similar behaviour to `JS` from `package:js/js.dart` (but usable from runtime

pkg/dev_compiler/tool/input_sdk/private/js_helper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ class JSName {
788788
* objects that support integer indexing. This interface is not
789789
* visible to anyone, and is only injected into special libraries.
790790
*/
791-
abstract class JavaScriptIndexingBehavior {}
791+
abstract class JavaScriptIndexingBehavior<E> {}
792792

793793
// TODO(lrn): These exceptions should be implemented in core.
794794
// When they are, remove the 'Implementation' here.

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16862,7 +16862,7 @@ class Events {
1686216862

1686316863
Events(this._ptr);
1686416864

16865-
Stream operator [](String type) {
16865+
Stream<Event> operator [](String type) {
1686616866
return new _EventStream(_ptr, type, false);
1686716867
}
1686816868
}
@@ -16887,7 +16887,7 @@ class ElementEvents extends Events {
1688716887

1688816888
ElementEvents(Element ptr) : super(ptr);
1688916889

16890-
Stream operator [](String type) {
16890+
Stream<Event> operator [](String type) {
1689116891
if (webkitEvents.keys.contains(type.toLowerCase())) {
1689216892
if (Device.isWebKit) {
1689316893
return new _ElementEventStreamImpl(
@@ -16944,7 +16944,7 @@ class EventTarget extends Interceptor {
1694416944
@JSName('addEventListener')
1694516945
@DomName('EventTarget.addEventListener')
1694616946
@DocsEditable()
16947-
void _addEventListener(String type, EventListener listener, [Object options])
16947+
void _addEventListener(String type, EventListener listener, [bool options])
1694816948
native;
1694916949

1695016950
@DomName('EventTarget.dispatchEvent')
@@ -16954,8 +16954,8 @@ class EventTarget extends Interceptor {
1695416954
@JSName('removeEventListener')
1695516955
@DomName('EventTarget.removeEventListener')
1695616956
@DocsEditable()
16957-
void _removeEventListener(String type, EventListener listener,
16958-
[Object options]) native;
16957+
void _removeEventListener(String type, EventListener listener, [bool options])
16958+
native;
1695916959
}
1696016960
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1696116961
// for details. All rights reserved. Use of this source code is governed by a
@@ -31068,8 +31068,8 @@ class SelectElement extends HtmlElement {
3106831068
// Override default options, since IE returns SelectElement itself and it
3106931069
// does not operate as a List.
3107031070
List<OptionElement> get options {
31071-
var options = new List<OptionElement>.from(this.querySelectorAll('option'));
31072-
return new UnmodifiableListView(options);
31071+
var options = this.querySelectorAll<OptionElement>('option');
31072+
return new UnmodifiableListView(options.toList());
3107331073
}
3107431074

3107531075
List<OptionElement> get selectedOptions {
@@ -42988,7 +42988,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
4298842988
this._target, this._eventType, void onData(T event), this._useCapture)
4298942989
: _onData = onData == null
4299042990
? null
42991-
: _wrapZone/*<Event, dynamic>*/((e) => (onData as dynamic)(e)) {
42991+
: _wrapZone<Event, dynamic>((e) => (onData as dynamic)(e)) {
4299242992
_tryResume();
4299342993
}
4299442994

sdk/lib/html/dartium/html_dartium.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17859,7 +17859,7 @@ class Events {
1785917859

1786017860
Events(this._ptr);
1786117861

17862-
Stream operator [](String type) {
17862+
Stream<Event> operator [](String type) {
1786317863
return new _EventStream(_ptr, type, false);
1786417864
}
1786517865
}
@@ -17884,7 +17884,7 @@ class ElementEvents extends Events {
1788417884

1788517885
ElementEvents(Element ptr) : super(ptr);
1788617886

17887-
Stream operator [](String type) {
17887+
Stream<Event> operator [](String type) {
1788817888
if (webkitEvents.keys.contains(type.toLowerCase())) {
1788917889
if (Device.isWebKit) {
1789017890
return new _ElementEventStreamImpl(
@@ -17949,8 +17949,7 @@ class EventTarget extends DartHtmlDomObject {
1794917949

1795017950
@DomName('EventTarget.addEventListener')
1795117951
@DocsEditable()
17952-
void _addEventListener(String type, EventListener listener,
17953-
[Object options]) =>
17952+
void _addEventListener(String type, EventListener listener, [bool options]) =>
1795417953
_blink.BlinkEventTarget.instance
1795517954
.addEventListener_Callback_3_(this, type, listener, options);
1795617955

@@ -17962,7 +17961,7 @@ class EventTarget extends DartHtmlDomObject {
1796217961
@DomName('EventTarget.removeEventListener')
1796317962
@DocsEditable()
1796417963
void _removeEventListener(String type, EventListener listener,
17965-
[Object options]) =>
17964+
[bool options]) =>
1796617965
_blink.BlinkEventTarget.instance
1796717966
.removeEventListener_Callback_3_(this, type, listener, options);
1796817967
}
@@ -35792,8 +35791,8 @@ class SelectElement extends HtmlElement {
3579235791
// Override default options, since IE returns SelectElement itself and it
3579335792
// does not operate as a List.
3579435793
List<OptionElement> get options {
35795-
var options = new List<OptionElement>.from(this.querySelectorAll('option'));
35796-
return new UnmodifiableListView(options);
35794+
var options = this.querySelectorAll<OptionElement>('option');
35795+
return new UnmodifiableListView(options.toList());
3579735796
}
3579835797

3579935798
List<OptionElement> get selectedOptions {
@@ -49143,7 +49142,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
4914349142
this._target, this._eventType, void onData(T event), this._useCapture)
4914449143
: _onData = onData == null
4914549144
? null
49146-
: _wrapZone/*<Event, dynamic>*/((e) => (onData as dynamic)(e)) {
49145+
: _wrapZone<Event, dynamic>((e) => (onData as dynamic)(e)) {
4914749146
_tryResume();
4914849147
}
4914949148

sdk/lib/svg/dart2js/svg_dart2js.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4053,7 +4053,7 @@ class AttributeClassSet extends CssClassSetImpl {
40534053
Set<String> readClasses() {
40544054
var classname = _element.attributes['class'];
40554055
if (classname is AnimatedString) {
4056-
classname = classname.baseVal;
4056+
classname = (classname as AnimatedString).baseVal;
40574057
}
40584058

40594059
Set<String> s = new LinkedHashSet<String>();

sdk/lib/svg/dartium/svg_dartium.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5187,7 +5187,7 @@ class AttributeClassSet extends CssClassSetImpl {
51875187
Set<String> readClasses() {
51885188
var classname = _element.attributes['class'];
51895189
if (classname is AnimatedString) {
5190-
classname = classname.baseVal;
5190+
classname = (classname as AnimatedString).baseVal;
51915191
}
51925192

51935193
Set<String> s = new LinkedHashSet<String>();

tools/dom/idl/dart/dart.idl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,12 @@ Element implements GlobalEventHandlers;
473473
interface CSSCharsetRule : CSSRule {
474474
[MeasureAs=CSSCharsetRuleEncoding] attribute DOMString encoding;
475475
};
476+
477+
478+
[DartSupplemental]
479+
interface EventTarget {
480+
[DartSuppress] void addEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
481+
[DartSuppress] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
482+
[Custom] void addEventListener(DOMString type, EventListener? listener, optional boolean options);
483+
[Custom] void removeEventListener(DOMString type, EventListener? listener, optional boolean options);
484+
};

tools/dom/src/EventStreamProvider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
236236
this._target, this._eventType, void onData(T event), this._useCapture)
237237
: _onData = onData == null
238238
? null
239-
: _wrapZone/*<Event, dynamic>*/((e) => (onData as dynamic)(e)) {
239+
: _wrapZone<Event, dynamic>((e) => (onData as dynamic)(e)) {
240240
_tryResume();
241241
}
242242

tools/dom/templates/html/impl/impl_EventTarget.darttemplate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Events {
4646

4747
Events(this._ptr);
4848

49-
Stream operator [](String type) {
49+
Stream<Event> operator [](String type) {
5050
return new _EventStream(_ptr, type, false);
5151
}
5252
}
@@ -71,7 +71,7 @@ class ElementEvents extends Events {
7171

7272
ElementEvents(Element ptr) : super(ptr);
7373

74-
Stream operator [](String type) {
74+
Stream<Event> operator [](String type) {
7575
if (webkitEvents.keys.contains(type.toLowerCase())) {
7676
if (Device.isWebKit) {
7777
return new _ElementEventStreamImpl(

tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $!MEMBERS
1010
// Override default options, since IE returns SelectElement itself and it
1111
// does not operate as a List.
1212
List<OptionElement> get options {
13-
var options = new List<OptionElement>.from(this.querySelectorAll('option'));
14-
return new UnmodifiableListView(options);
13+
var options = this.querySelectorAll<OptionElement>('option');
14+
return new UnmodifiableListView(options.toList());
1515
}
1616

1717
List<OptionElement> get selectedOptions {

tools/dom/templates/html/impl/impl_SVGElement.darttemplate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AttributeClassSet extends CssClassSetImpl {
1212
Set<String> readClasses() {
1313
var classname = _element.attributes['class'];
1414
if (classname is AnimatedString) {
15-
classname = classname.baseVal;
15+
classname = (classname as AnimatedString).baseVal;
1616
}
1717

1818
Set<String> s = new LinkedHashSet<String>();

0 commit comments

Comments
 (0)