From fe93b161e0a920d59cff1742c8340b9d9155484e Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Mon, 27 Jun 2022 23:10:12 +0000 Subject: [PATCH] [dart:html] Add MathMLElement Fixes b/236721367 Per https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement, MathMLElement is in the Element type hierarchy. This adds an empty class so that type-checking against Element can pass. Change-Id: Ie0c2e33c2236bedd5627ed8624437d24d9fbac2d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249945 Commit-Queue: Srujan Gaddam Reviewed-by: Sigmund Cherem --- sdk/lib/html/dart2js/html_dart2js.dart | 17 +++++++++++++++++ tools/dom/dom.json | 4 ++++ tools/dom/idl/dart/dart.idl | 2 ++ 3 files changed, 23 insertions(+) diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index 671f68a0a53..cf06901ea5c 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -20555,6 +20555,23 @@ class MapElement extends HtmlElement { // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +@Native("MathMLElement") +class MathMLElement extends Element { + // To suppress missing implicit constructor warnings. + factory MathMLElement._() { + throw new UnsupportedError("Not supported"); + } + /** + * Constructor instantiated by the DOM when a custom element has been created. + * + * This can only be called by subclasses from their created constructor. + */ + MathMLElement.created() : super.created(); +} +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + @Native("MediaCapabilities") class MediaCapabilities extends JavaScriptObject { // To suppress missing implicit constructor warnings. diff --git a/tools/dom/dom.json b/tools/dom/dom.json index 295e1376698..4b3eb87399e 100644 --- a/tools/dom/dom.json +++ b/tools/dom/dom.json @@ -12423,6 +12423,10 @@ }, "support_level": "untriaged" }, + "MathMLElement": { + "members": {}, + "support_level": "untriaged" + }, "Matrix": { "members": { "Matrix": {}, diff --git a/tools/dom/idl/dart/dart.idl b/tools/dom/idl/dart/dart.idl index 0021d664a70..4665656376e 100644 --- a/tools/dom/idl/dart/dart.idl +++ b/tools/dom/idl/dart/dart.idl @@ -681,3 +681,5 @@ interface NoncedElement { // PositionCallback can be used on a deprecated Position object, // a GeolocationPosition object, or a Firefox-specific object. callback PositionCallback = void(object position); + +interface MathMLElement : Element {};