Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 1417363003: Fixed improper construction of custom elements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/html_common/conversions_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 73e0a053f3af89cf3c5293e7a4d398edf9dda564..8ac51db7efaa345264307582d2494ce1e7b75fd1 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -20228,6 +20228,13 @@ class HtmlDocument extends Document {
//
// See https://github.com/dart-lang/sdk/issues/23666
int creating = 0;
+
+ // If any JS code is hooked we want to call it too.
+ var oldCreatedCallback = elemProto['createdCallback'];
+ var oldAttributeChangedCallback = elemProto['attributeChangedCallback'];
+ var oldAttachedCallback = elemProto['attachedCallback'];
+ var oldDetachedCallback = elemProto['detachedCallback'];
+
// TODO(jacobr): warning:
elemProto['createdCallback'] = js.JsNative.withThis(($this) {
if (_getJSClassName(reflectClass(customElementClass).superclass) != null && creating < 2) {
@@ -20266,15 +20273,27 @@ class HtmlDocument extends Document {
creating--;
}
}
+
+ if (oldCreatedCallback != null)
+ oldCreatedCallback.apply([], thisArg: unwrap_jso($this));
});
elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, attrName, oldVal, newVal) {
$this.attributeChanged(attrName, oldVal, newVal);
+
+ if (oldAttributeChangedCallback != null)
+ oldAttributeChangedCallback.apply([], thisArg: unwrap_jso($this));
});
elemProto['attachedCallback'] = new js.JsFunction.withThis(($this) {
$this.attached();
+
+ if (oldAttachedCallback != null)
+ oldAttachedCallback.apply([], thisArg: unwrap_jso($this));
});
elemProto['detachedCallback'] = new js.JsFunction.withThis(($this) {
$this.detached();
+
+ if (oldDetachedCallback != null)
+ oldDetachedCallback.apply([], thisArg: unwrap_jso($this));
});
// document.registerElement('x-foo', {prototype: elemProto, extends: extendsTag});
var jsMap = new js.JsObject.jsify({'prototype': elemProto, 'extends': extendsTag});
@@ -36962,10 +36981,10 @@ class Url extends DartHtmlDomObject implements UrlUtils {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
- if ((blob_OR_source_OR_stream is MediaSource)) {
+ if ((blob_OR_source_OR_stream is MediaStream)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
- if ((blob_OR_source_OR_stream is MediaStream)) {
+ if ((blob_OR_source_OR_stream is MediaSource)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
throw new ArgumentError("Incorrect number or type of arguments");
« no previous file with comments | « no previous file | sdk/lib/html/html_common/conversions_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698