diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index d63f67b2639..a5f4536f7e4 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -27430,24 +27430,6 @@ class XsltProcessor native "*XSLTProcessor" { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('HTMLAppletElement') -class _AppletElement extends Element native "*HTMLAppletElement" { -} -// 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. - - -@DocsEditable -@DomName('HTMLBaseFontElement') -class _BaseFontElement extends Element native "*HTMLBaseFontElement" { -} -// 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. - - @DocsEditable @DomName('ClientRectList') class _ClientRectList implements JavaScriptIndexingBehavior, List native "*ClientRectList" { @@ -28039,15 +28021,6 @@ class _CssValueList extends CssValue implements List, JavaScriptIndexi // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('HTMLDirectoryElement') -class _DirectoryElement extends Element native "*HTMLDirectoryElement" { -} -// 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. - - @DocsEditable @DomName('EntryArray') class _EntryArray implements JavaScriptIndexingBehavior, List native "*EntryArray" { @@ -28442,85 +28415,6 @@ class _EntryArraySync implements JavaScriptIndexingBehavior, List nat // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('HTMLFontElement') -class _FontElement extends Element native "*HTMLFontElement" { -} -// 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. - - -@DocsEditable -@DomName('HTMLFrameElement') -class _FrameElement extends Element native "*HTMLFrameElement" { -} -// 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. - - -@DocsEditable -@DomName('HTMLFrameSetElement') -class _FrameSetElement extends Element native "*HTMLFrameSetElement" { - - @DocsEditable - @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent') - @deprecated - _FrameSetElementEvents get on => - new _FrameSetElementEvents(this); -} - -@DocsEditable -@deprecated -class _FrameSetElementEvents extends ElementEvents { - @DocsEditable - _FrameSetElementEvents(EventTarget _ptr) : super(_ptr); - - @DocsEditable - EventListenerList get beforeUnload => this['beforeunload']; - - @DocsEditable - EventListenerList get blur => this['blur']; - - @DocsEditable - EventListenerList get error => this['error']; - - @DocsEditable - EventListenerList get focus => this['focus']; - - @DocsEditable - EventListenerList get hashChange => this['hashchange']; - - @DocsEditable - EventListenerList get load => this['load']; - - @DocsEditable - EventListenerList get message => this['message']; - - @DocsEditable - EventListenerList get offline => this['offline']; - - @DocsEditable - EventListenerList get online => this['online']; - - @DocsEditable - EventListenerList get popState => this['popstate']; - - @DocsEditable - EventListenerList get resize => this['resize']; - - @DocsEditable - EventListenerList get storage => this['storage']; - - @DocsEditable - EventListenerList get unload => this['unload']; -} -// 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. - - @DocsEditable @DomName('GamepadList') class _GamepadList implements JavaScriptIndexingBehavior, List native "*GamepadList" { @@ -28718,9 +28612,115 @@ class _GamepadList implements JavaScriptIndexingBehavior, List native " // BSD-style license that can be found in the LICENSE file. +@DocsEditable +@DomName('HTMLAppletElement') +class _HTMLAppletElement extends Element native "*HTMLAppletElement" { +} +// 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. + + +@DocsEditable +@DomName('HTMLBaseFontElement') +class _HTMLBaseFontElement extends Element native "*HTMLBaseFontElement" { +} +// 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. + + +@DocsEditable +@DomName('HTMLDirectoryElement') +class _HTMLDirectoryElement extends Element native "*HTMLDirectoryElement" { +} +// 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. + + +@DocsEditable +@DomName('HTMLFontElement') +class _HTMLFontElement extends Element native "*HTMLFontElement" { +} +// 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. + + +@DocsEditable +@DomName('HTMLFrameElement') +class _HTMLFrameElement extends Element native "*HTMLFrameElement" { +} +// 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. + + +@DocsEditable +@DomName('HTMLFrameSetElement') +class _HTMLFrameSetElement extends Element native "*HTMLFrameSetElement" { + + @DocsEditable + @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent') + @deprecated + _HTMLFrameSetElementEvents get on => + new _HTMLFrameSetElementEvents(this); +} + +@DocsEditable +@deprecated +class _HTMLFrameSetElementEvents extends ElementEvents { + @DocsEditable + _HTMLFrameSetElementEvents(EventTarget _ptr) : super(_ptr); + + @DocsEditable + EventListenerList get beforeUnload => this['beforeunload']; + + @DocsEditable + EventListenerList get blur => this['blur']; + + @DocsEditable + EventListenerList get error => this['error']; + + @DocsEditable + EventListenerList get focus => this['focus']; + + @DocsEditable + EventListenerList get hashChange => this['hashchange']; + + @DocsEditable + EventListenerList get load => this['load']; + + @DocsEditable + EventListenerList get message => this['message']; + + @DocsEditable + EventListenerList get offline => this['offline']; + + @DocsEditable + EventListenerList get online => this['online']; + + @DocsEditable + EventListenerList get popState => this['popstate']; + + @DocsEditable + EventListenerList get resize => this['resize']; + + @DocsEditable + EventListenerList get storage => this['storage']; + + @DocsEditable + EventListenerList get unload => this['unload']; +} +// 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. + + @DocsEditable @DomName('HTMLMarqueeElement') -class _MarqueeElement extends Element native "*HTMLMarqueeElement" { +class _HTMLMarqueeElement extends Element native "*HTMLMarqueeElement" { } // 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 diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart index 234dcf18bcc..1bbf9e9a487 100644 --- a/sdk/lib/html/dartium/html_dartium.dart +++ b/sdk/lib/html/dartium/html_dartium.dart @@ -10050,6 +10050,7 @@ abstract class Element extends Node implements ElementTraversal { @DomName('Element.webkitMatchesSelector') @DocsEditable + @Experimental() bool matches(String selectors) native "Element_webkitMatchesSelector_Callback"; @DomName('Element.webkitRequestFullScreen') @@ -29843,32 +29844,6 @@ class XsltProcessor extends NativeFieldWrapperClass1 { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('HTMLAppletElement') -class _AppletElement extends _Element_Merged { - _AppletElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('HTMLBaseFontElement') -class _BaseFontElement extends _Element_Merged { - _BaseFontElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('ClientRectList') class _ClientRectList extends NativeFieldWrapperClass1 implements List { @@ -30472,19 +30447,6 @@ class _CssValueList extends CssValue implements List { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('HTMLDirectoryElement') -class _DirectoryElement extends _Element_Merged { - _DirectoryElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('HTMLElement') class _Element_Merged extends Element { @@ -31024,97 +30986,6 @@ class _EntryArraySync extends NativeFieldWrapperClass1 implements List - new _FrameSetElementEvents(this); - -} - -@DocsEditable -@deprecated -class _FrameSetElementEvents extends ElementEvents { - @DocsEditable - _FrameSetElementEvents(EventTarget _ptr) : super(_ptr); - - @DocsEditable - EventListenerList get beforeUnload => this['beforeunload']; - - @DocsEditable - EventListenerList get blur => this['blur']; - - @DocsEditable - EventListenerList get error => this['error']; - - @DocsEditable - EventListenerList get focus => this['focus']; - - @DocsEditable - EventListenerList get hashChange => this['hashchange']; - - @DocsEditable - EventListenerList get load => this['load']; - - @DocsEditable - EventListenerList get message => this['message']; - - @DocsEditable - EventListenerList get offline => this['offline']; - - @DocsEditable - EventListenerList get online => this['online']; - - @DocsEditable - EventListenerList get popState => this['popstate']; - - @DocsEditable - EventListenerList get resize => this['resize']; - - @DocsEditable - EventListenerList get storage => this['storage']; - - @DocsEditable - EventListenerList get unload => this['unload']; -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('GamepadList') class _GamepadList extends NativeFieldWrapperClass1 implements List { @@ -31316,10 +31187,140 @@ class _GamepadList extends NativeFieldWrapperClass1 implements List { // WARNING: Do not edit - generated code. +@DocsEditable +@DomName('HTMLAppletElement') +class _HTMLAppletElement extends _Element_Merged { + _HTMLAppletElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('HTMLBaseFontElement') +class _HTMLBaseFontElement extends _Element_Merged { + _HTMLBaseFontElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('HTMLDirectoryElement') +class _HTMLDirectoryElement extends _Element_Merged { + _HTMLDirectoryElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('HTMLFontElement') +class _HTMLFontElement extends _Element_Merged { + _HTMLFontElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('HTMLFrameElement') +class _HTMLFrameElement extends _Element_Merged { + _HTMLFrameElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('HTMLFrameSetElement') +class _HTMLFrameSetElement extends _Element_Merged { + _HTMLFrameSetElement.internal() : super.internal(); + + @DocsEditable + @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent') + @deprecated + _HTMLFrameSetElementEvents get on => + new _HTMLFrameSetElementEvents(this); + +} + +@DocsEditable +@deprecated +class _HTMLFrameSetElementEvents extends ElementEvents { + @DocsEditable + _HTMLFrameSetElementEvents(EventTarget _ptr) : super(_ptr); + + @DocsEditable + EventListenerList get beforeUnload => this['beforeunload']; + + @DocsEditable + EventListenerList get blur => this['blur']; + + @DocsEditable + EventListenerList get error => this['error']; + + @DocsEditable + EventListenerList get focus => this['focus']; + + @DocsEditable + EventListenerList get hashChange => this['hashchange']; + + @DocsEditable + EventListenerList get load => this['load']; + + @DocsEditable + EventListenerList get message => this['message']; + + @DocsEditable + EventListenerList get offline => this['offline']; + + @DocsEditable + EventListenerList get online => this['online']; + + @DocsEditable + EventListenerList get popState => this['popstate']; + + @DocsEditable + EventListenerList get resize => this['resize']; + + @DocsEditable + EventListenerList get storage => this['storage']; + + @DocsEditable + EventListenerList get unload => this['unload']; +} +// 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. + +// WARNING: Do not edit - generated code. + + @DocsEditable @DomName('HTMLMarqueeElement') -class _MarqueeElement extends _Element_Merged { - _MarqueeElement.internal() : super.internal(); +class _HTMLMarqueeElement extends _Element_Merged { + _HTMLMarqueeElement.internal() : super.internal(); } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart index 8a37de0d22b..1c7f4ea8a20 100644 --- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart +++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart @@ -930,5 +930,5 @@ class VersionChangeRequestEvents extends RequestEvents { @DocsEditable @DomName('IDBAny') -class _Any native "*IDBAny" { +class _IDBAny native "*IDBAny" { } diff --git a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart index 184fb005c82..316afb6a722 100644 --- a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart +++ b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart @@ -1056,7 +1056,7 @@ class VersionChangeRequestEvents extends RequestEvents { @DocsEditable @DomName('IDBAny') -class _Any extends NativeFieldWrapperClass1 { - _Any.internal(); +class _IDBAny extends NativeFieldWrapperClass1 { + _IDBAny.internal(); } diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart index c49a2858254..b663c052d94 100644 --- a/sdk/lib/svg/dart2js/svg_dart2js.dart +++ b/sdk/lib/svg/dart2js/svg_dart2js.dart @@ -149,19 +149,19 @@ class AElement extends StyledElement implements UriReference, Tests, Transformab // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGAltGlyphDefElement') -class AltGlyphDefElement extends SvgElement native "*SVGAltGlyphDefElement" { -} -// 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. - - @DocsEditable @DomName('SVGAltGlyphElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AltGlyphElement extends TextPositioningElement implements UriReference native "*SVGAltGlyphElement" { + @DocsEditable + factory AltGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("altGlyph"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('altGlyph') && (new SvgElement.tag('altGlyph') is AltGlyphElement); + @DomName('SVGAltGlyphElement.format') @DocsEditable String format; @@ -181,15 +181,6 @@ class AltGlyphElement extends TextPositioningElement implements UriReference nat // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGAltGlyphItemElement') -class AltGlyphItemElement extends SvgElement native "*SVGAltGlyphItemElement" { -} -// 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. - - @DocsEditable @DomName('SVGAngle') class Angle native "*SVGAngle" { @@ -233,24 +224,18 @@ class Angle native "*SVGAngle" { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGAnimateColorElement') -class AnimateColorElement extends AnimationElement native "*SVGAnimateColorElement" { - - @DocsEditable - factory AnimateColorElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateColor"); -} -// 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. - - @DocsEditable @DomName('SVGAnimateElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateElement extends AnimationElement native "*SVGAnimateElement" { @DocsEditable factory AnimateElement() => _SvgElementFactoryProvider.createSvgElement_tag("animate"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('animate') && (new SvgElement.tag('animate') is AnimateElement); } // 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 @@ -259,10 +244,16 @@ class AnimateElement extends AnimationElement native "*SVGAnimateElement" { @DocsEditable @DomName('SVGAnimateMotionElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateMotionElement extends AnimationElement native "*SVGAnimateMotionElement" { @DocsEditable factory AnimateMotionElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateMotion"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('animateMotion') && (new SvgElement.tag('animateMotion') is AnimateMotionElement); } // 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 @@ -271,10 +262,16 @@ class AnimateMotionElement extends AnimationElement native "*SVGAnimateMotionEle @DocsEditable @DomName('SVGAnimateTransformElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateTransformElement extends AnimationElement native "*SVGAnimateTransformElement" { @DocsEditable factory AnimateTransformElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateTransform"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('animateTransform') && (new SvgElement.tag('animateTransform') is AnimateTransformElement); } // 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 @@ -770,105 +767,6 @@ class Color extends CssValue native "*SVGColor" { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGComponentTransferFunctionElement') -class ComponentTransferFunctionElement extends SvgElement native "*SVGComponentTransferFunctionElement" { - - static const int SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0; - - @DomName('SVGComponentTransferFunctionElement.amplitude') - @DocsEditable - final AnimatedNumber amplitude; - - @DomName('SVGComponentTransferFunctionElement.exponent') - @DocsEditable - final AnimatedNumber exponent; - - @DomName('SVGComponentTransferFunctionElement.intercept') - @DocsEditable - final AnimatedNumber intercept; - - @DomName('SVGComponentTransferFunctionElement.offset') - @DocsEditable - final AnimatedNumber offset; - - @DomName('SVGComponentTransferFunctionElement.slope') - @DocsEditable - final AnimatedNumber slope; - - @DomName('SVGComponentTransferFunctionElement.tableValues') - @DocsEditable - final AnimatedNumberList tableValues; - - @DomName('SVGComponentTransferFunctionElement.type') - @DocsEditable - final AnimatedEnumeration type; -} -// 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. - - -@DocsEditable -@DomName('SVGCursorElement') -class CursorElement extends SvgElement implements UriReference, Tests, ExternalResourcesRequired native "*SVGCursorElement" { - - @DocsEditable - factory CursorElement() => _SvgElementFactoryProvider.createSvgElement_tag("cursor"); - - @DomName('SVGCursorElement.x') - @DocsEditable - final AnimatedLength x; - - @DomName('SVGCursorElement.y') - @DocsEditable - final AnimatedLength y; - - // From SVGExternalResourcesRequired - - @DomName('SVGCursorElement.externalResourcesRequired') - @DocsEditable - final AnimatedBoolean externalResourcesRequired; - - // From SVGTests - - @DomName('SVGCursorElement.requiredExtensions') - @DocsEditable - final StringList requiredExtensions; - - @DomName('SVGCursorElement.requiredFeatures') - @DocsEditable - final StringList requiredFeatures; - - @DomName('SVGCursorElement.systemLanguage') - @DocsEditable - final StringList systemLanguage; - - @DomName('SVGCursorElement.hasExtension') - @DocsEditable - bool hasExtension(String extension) native; - - // From SVGURIReference - - @DomName('SVGCursorElement.href') - @DocsEditable - final AnimatedString href; -} -// 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. - - @DocsEditable @DomName('SVGDefsElement') class DefsElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGDefsElement" { @@ -1579,10 +1477,16 @@ class EllipseElement extends StyledElement implements Transformable, Tests, Exte // BSD-style license that can be found in the LICENSE file. +@DocsEditable @DomName('SVGExternalResourcesRequired') -abstract class ExternalResourcesRequired { +class ExternalResourcesRequired native "*SVGExternalResourcesRequired" { - AnimatedBoolean externalResourcesRequired; + /// Checks if this type is supported on the current platform. + static bool supported(SvgElement element) => JS('bool', '#.externalResourcesRequired !== undefined && #.externalResourcesRequired.animVal !== undefined', element, element); + + @DomName('SVGExternalResourcesRequired.externalResourcesRequired') + @DocsEditable + final AnimatedBoolean externalResourcesRequired; } // 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 @@ -1591,8 +1495,18 @@ abstract class ExternalResourcesRequired { @DocsEditable @DomName('SVGFEBlendElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEBlendElement" { + @DocsEditable + factory FEBlendElement() => _SvgElementFactoryProvider.createSvgElement_tag("feBlend"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feBlend') && (new SvgElement.tag('feBlend') is FEBlendElement); + static const int SVG_FEBLEND_MODE_DARKEN = 4; static const int SVG_FEBLEND_MODE_LIGHTEN = 5; @@ -1646,8 +1560,18 @@ class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEColorMatrixElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEColorMatrixElement" { + @DocsEditable + factory FEColorMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feColorMatrix') && (new SvgElement.tag('feColorMatrix') is FEColorMatrixElement); + static const int SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3; static const int SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4; @@ -1699,8 +1623,18 @@ class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStand @DocsEditable @DomName('SVGFEComponentTransferElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEComponentTransferElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEComponentTransferElement" { + @DocsEditable + factory FEComponentTransferElement() => _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feComponentTransfer') && (new SvgElement.tag('feComponentTransfer') is FEComponentTransferElement); + @DomName('SVGFEComponentTransferElement.in1') @DocsEditable final AnimatedString in1; @@ -1807,8 +1741,18 @@ class FECompositeElement extends StyledElement implements FilterPrimitiveStandar @DocsEditable @DomName('SVGFEConvolveMatrixElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEConvolveMatrixElement" { + @DocsEditable + factory FEConvolveMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feConvolveMatrix') && (new SvgElement.tag('feConvolveMatrix') is FEConvolveMatrixElement); + static const int SVG_EDGEMODE_DUPLICATE = 1; static const int SVG_EDGEMODE_NONE = 3; @@ -1894,8 +1838,18 @@ class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveSt @DocsEditable @DomName('SVGFEDiffuseLightingElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDiffuseLightingElement" { + @DocsEditable + factory FEDiffuseLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feDiffuseLighting') && (new SvgElement.tag('feDiffuseLighting') is FEDiffuseLightingElement); + @DomName('SVGFEDiffuseLightingElement.diffuseConstant') @DocsEditable final AnimatedNumber diffuseConstant; @@ -1945,8 +1899,18 @@ class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveS @DocsEditable @DomName('SVGFEDisplacementMapElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDisplacementMapElement" { + @DocsEditable + factory FEDisplacementMapElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feDisplacementMap') && (new SvgElement.tag('feDisplacementMap') is FEDisplacementMapElement); + static const int SVG_CHANNEL_A = 4; static const int SVG_CHANNEL_B = 3; @@ -2006,8 +1970,18 @@ class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveS @DocsEditable @DomName('SVGFEDistantLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDistantLightElement extends SvgElement native "*SVGFEDistantLightElement" { + @DocsEditable + factory FEDistantLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feDistantLight') && (new SvgElement.tag('feDistantLight') is FEDistantLightElement); + @DomName('SVGFEDistantLightElement.azimuth') @DocsEditable final AnimatedNumber azimuth; @@ -2021,65 +1995,20 @@ class FEDistantLightElement extends SvgElement native "*SVGFEDistantLightElement // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGFEDropShadowElement') -class FEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDropShadowElement" { - - @DomName('SVGFEDropShadowElement.dx') - @DocsEditable - final AnimatedNumber dx; - - @DomName('SVGFEDropShadowElement.dy') - @DocsEditable - final AnimatedNumber dy; - - @DomName('SVGFEDropShadowElement.in1') - @DocsEditable - final AnimatedString in1; - - @DomName('SVGFEDropShadowElement.stdDeviationX') - @DocsEditable - final AnimatedNumber stdDeviationX; - - @DomName('SVGFEDropShadowElement.stdDeviationY') - @DocsEditable - final AnimatedNumber stdDeviationY; - - @DomName('SVGFEDropShadowElement.setStdDeviation') - @DocsEditable - void setStdDeviation(num stdDeviationX, num stdDeviationY) native; - - // From SVGFilterPrimitiveStandardAttributes - - @DomName('SVGFEDropShadowElement.height') - @DocsEditable - final AnimatedLength height; - - @DomName('SVGFEDropShadowElement.result') - @DocsEditable - final AnimatedString result; - - @DomName('SVGFEDropShadowElement.width') - @DocsEditable - final AnimatedLength width; - - @DomName('SVGFEDropShadowElement.x') - @DocsEditable - final AnimatedLength x; - - @DomName('SVGFEDropShadowElement.y') - @DocsEditable - final AnimatedLength y; -} -// 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. - - @DocsEditable @DomName('SVGFEFloodElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEFloodElement" { + @DocsEditable + factory FEFloodElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFlood"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feFlood') && (new SvgElement.tag('feFlood') is FEFloodElement); + // From SVGFilterPrimitiveStandardAttributes @DomName('SVGFEFloodElement.height') @@ -2109,7 +2038,17 @@ class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEFuncAElement') -class FEFuncAElement extends ComponentTransferFunctionElement native "*SVGFEFuncAElement" { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncAElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncAElement" { + + @DocsEditable + factory FEFuncAElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncA"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feFuncA') && (new SvgElement.tag('feFuncA') is FEFuncAElement); } // 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 @@ -2118,7 +2057,17 @@ class FEFuncAElement extends ComponentTransferFunctionElement native "*SVGFEFunc @DocsEditable @DomName('SVGFEFuncBElement') -class FEFuncBElement extends ComponentTransferFunctionElement native "*SVGFEFuncBElement" { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncBElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncBElement" { + + @DocsEditable + factory FEFuncBElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncB"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feFuncB') && (new SvgElement.tag('feFuncB') is FEFuncBElement); } // 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 @@ -2127,7 +2076,17 @@ class FEFuncBElement extends ComponentTransferFunctionElement native "*SVGFEFunc @DocsEditable @DomName('SVGFEFuncGElement') -class FEFuncGElement extends ComponentTransferFunctionElement native "*SVGFEFuncGElement" { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncGElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncGElement" { + + @DocsEditable + factory FEFuncGElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncG"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feFuncG') && (new SvgElement.tag('feFuncG') is FEFuncGElement); } // 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 @@ -2136,7 +2095,17 @@ class FEFuncGElement extends ComponentTransferFunctionElement native "*SVGFEFunc @DocsEditable @DomName('SVGFEFuncRElement') -class FEFuncRElement extends ComponentTransferFunctionElement native "*SVGFEFuncRElement" { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncRElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncRElement" { + + @DocsEditable + factory FEFuncRElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncR"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feFuncR') && (new SvgElement.tag('feFuncR') is FEFuncRElement); } // 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 @@ -2145,8 +2114,18 @@ class FEFuncRElement extends ComponentTransferFunctionElement native "*SVGFEFunc @DocsEditable @DomName('SVGFEGaussianBlurElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEGaussianBlurElement" { + @DocsEditable + factory FEGaussianBlurElement() => _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feGaussianBlur') && (new SvgElement.tag('feGaussianBlur') is FEGaussianBlurElement); + @DomName('SVGFEGaussianBlurElement.in1') @DocsEditable final AnimatedString in1; @@ -2192,8 +2171,18 @@ class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStan @DocsEditable @DomName('SVGFEImageElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEImageElement extends StyledElement implements FilterPrimitiveStandardAttributes, UriReference, ExternalResourcesRequired, LangSpace native "*SVGFEImageElement" { + @DocsEditable + factory FEImageElement() => _SvgElementFactoryProvider.createSvgElement_tag("feImage"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feImage') && (new SvgElement.tag('feImage') is FEImageElement); + @DomName('SVGFEImageElement.preserveAspectRatio') @DocsEditable final AnimatedPreserveAspectRatio preserveAspectRatio; @@ -2249,8 +2238,18 @@ class FEImageElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEMergeElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEMergeElement" { + @DocsEditable + factory FEMergeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMerge"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feMerge') && (new SvgElement.tag('feMerge') is FEMergeElement); + // From SVGFilterPrimitiveStandardAttributes @DomName('SVGFEMergeElement.height') @@ -2280,8 +2279,18 @@ class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEMergeNodeElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEMergeNodeElement extends SvgElement native "*SVGFEMergeNodeElement" { + @DocsEditable + factory FEMergeNodeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feMergeNode') && (new SvgElement.tag('feMergeNode') is FEMergeNodeElement); + @DomName('SVGFEMergeNodeElement.in1') @DocsEditable final AnimatedString in1; @@ -2350,8 +2359,18 @@ class FEMorphologyElement extends StyledElement implements FilterPrimitiveStanda @DocsEditable @DomName('SVGFEOffsetElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEOffsetElement" { + @DocsEditable + factory FEOffsetElement() => _SvgElementFactoryProvider.createSvgElement_tag("feOffset"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feOffset') && (new SvgElement.tag('feOffset') is FEOffsetElement); + @DomName('SVGFEOffsetElement.dx') @DocsEditable final AnimatedNumber dx; @@ -2393,8 +2412,18 @@ class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAt @DocsEditable @DomName('SVGFEPointLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEPointLightElement extends SvgElement native "*SVGFEPointLightElement" { + @DocsEditable + factory FEPointLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("fePointLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('fePointLight') && (new SvgElement.tag('fePointLight') is FEPointLightElement); + @DomName('SVGFEPointLightElement.x') @DocsEditable final AnimatedNumber x; @@ -2414,8 +2443,18 @@ class FEPointLightElement extends SvgElement native "*SVGFEPointLightElement" { @DocsEditable @DomName('SVGFESpecularLightingElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FESpecularLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFESpecularLightingElement" { + @DocsEditable + factory FESpecularLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feSpecularLighting') && (new SvgElement.tag('feSpecularLighting') is FESpecularLightingElement); + @DomName('SVGFESpecularLightingElement.in1') @DocsEditable final AnimatedString in1; @@ -2461,8 +2500,18 @@ class FESpecularLightingElement extends StyledElement implements FilterPrimitive @DocsEditable @DomName('SVGFESpotLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FESpotLightElement extends SvgElement native "*SVGFESpotLightElement" { + @DocsEditable + factory FESpotLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feSpotLight') && (new SvgElement.tag('feSpotLight') is FESpotLightElement); + @DomName('SVGFESpotLightElement.limitingConeAngle') @DocsEditable final AnimatedNumber limitingConeAngle; @@ -2502,8 +2551,18 @@ class FESpotLightElement extends SvgElement native "*SVGFESpotLightElement" { @DocsEditable @DomName('SVGFETileElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FETileElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFETileElement" { + @DocsEditable + factory FETileElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTile"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feTile') && (new SvgElement.tag('feTile') is FETileElement); + @DomName('SVGFETileElement.in1') @DocsEditable final AnimatedString in1; @@ -2537,8 +2596,18 @@ class FETileElement extends StyledElement implements FilterPrimitiveStandardAttr @DocsEditable @DomName('SVGFETurbulenceElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FETurbulenceElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFETurbulenceElement" { + @DocsEditable + factory FETurbulenceElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('feTurbulence') && (new SvgElement.tag('feTurbulence') is FETurbulenceElement); + static const int SVG_STITCHTYPE_NOSTITCH = 2; static const int SVG_STITCHTYPE_STITCH = 1; @@ -2604,11 +2673,18 @@ class FETurbulenceElement extends StyledElement implements FilterPrimitiveStanda @DocsEditable @DomName('SVGFilterElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FilterElement extends StyledElement implements UriReference, ExternalResourcesRequired, LangSpace native "*SVGFilterElement" { @DocsEditable factory FilterElement() => _SvgElementFactoryProvider.createSvgElement_tag("filter"); + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('filter') && (new SvgElement.tag('filter') is FilterElement); + @DomName('SVGFilterElement.filterResX') @DocsEditable final AnimatedInteger filterResX; @@ -2702,85 +2778,19 @@ abstract class FitToViewBox { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGFontElement') -class FontElement extends SvgElement native "*SVGFontElement" { - - @DocsEditable - factory FontElement() => _SvgElementFactoryProvider.createSvgElement_tag("font"); -} -// 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. - - -@DocsEditable -@DomName('SVGFontFaceElement') -class FontFaceElement extends SvgElement native "*SVGFontFaceElement" { - - @DocsEditable - factory FontFaceElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face"); -} -// 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. - - -@DocsEditable -@DomName('SVGFontFaceFormatElement') -class FontFaceFormatElement extends SvgElement native "*SVGFontFaceFormatElement" { - - @DocsEditable - factory FontFaceFormatElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-format"); -} -// 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. - - -@DocsEditable -@DomName('SVGFontFaceNameElement') -class FontFaceNameElement extends SvgElement native "*SVGFontFaceNameElement" { - - @DocsEditable - factory FontFaceNameElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-name"); -} -// 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. - - -@DocsEditable -@DomName('SVGFontFaceSrcElement') -class FontFaceSrcElement extends SvgElement native "*SVGFontFaceSrcElement" { - - @DocsEditable - factory FontFaceSrcElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-src"); -} -// 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. - - -@DocsEditable -@DomName('SVGFontFaceUriElement') -class FontFaceUriElement extends SvgElement native "*SVGFontFaceUriElement" { - - @DocsEditable - factory FontFaceUriElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-uri"); -} -// 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. - - @DocsEditable @DomName('SVGForeignObjectElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class ForeignObjectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGForeignObjectElement" { @DocsEditable factory ForeignObjectElement() => _SvgElementFactoryProvider.createSvgElement_tag("foreignObject"); + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('foreignObject') && (new SvgElement.tag('foreignObject') is ForeignObjectElement); + @DomName('SVGForeignObjectElement.height') @DocsEditable final AnimatedLength height; @@ -2950,110 +2960,6 @@ class GElement extends StyledElement implements Transformable, Tests, ExternalRe // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGGlyphElement') -class GlyphElement extends SvgElement native "*SVGGlyphElement" { - - @DocsEditable - factory GlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("glyph"); -} -// 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. - - -@DocsEditable -@DomName('SVGGlyphRefElement') -class GlyphRefElement extends StyledElement implements UriReference native "*SVGGlyphRefElement" { - - @DomName('SVGGlyphRefElement.dx') - @DocsEditable - num dx; - - @DomName('SVGGlyphRefElement.dy') - @DocsEditable - num dy; - - @DomName('SVGGlyphRefElement.format') - @DocsEditable - String format; - - @DomName('SVGGlyphRefElement.glyphRef') - @DocsEditable - String glyphRef; - - @DomName('SVGGlyphRefElement.x') - @DocsEditable - num x; - - @DomName('SVGGlyphRefElement.y') - @DocsEditable - num y; - - // From SVGURIReference - - @DomName('SVGGlyphRefElement.href') - @DocsEditable - final AnimatedString href; -} -// 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. - - -@DocsEditable -@DomName('SVGGradientElement') -class GradientElement extends StyledElement implements UriReference, ExternalResourcesRequired native "*SVGGradientElement" { - - static const int SVG_SPREADMETHOD_PAD = 1; - - static const int SVG_SPREADMETHOD_REFLECT = 2; - - static const int SVG_SPREADMETHOD_REPEAT = 3; - - static const int SVG_SPREADMETHOD_UNKNOWN = 0; - - @DomName('SVGGradientElement.gradientTransform') - @DocsEditable - final AnimatedTransformList gradientTransform; - - @DomName('SVGGradientElement.gradientUnits') - @DocsEditable - final AnimatedEnumeration gradientUnits; - - @DomName('SVGGradientElement.spreadMethod') - @DocsEditable - final AnimatedEnumeration spreadMethod; - - // From SVGExternalResourcesRequired - - @DomName('SVGGradientElement.externalResourcesRequired') - @DocsEditable - final AnimatedBoolean externalResourcesRequired; - - // From SVGURIReference - - @DomName('SVGGradientElement.href') - @DocsEditable - final AnimatedString href; -} -// 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. - - -@DocsEditable -@DomName('SVGHKernElement') -class HKernElement extends SvgElement native "*SVGHKernElement" { - - @DocsEditable - factory HKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("hkern"); -} -// 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. - - @DocsEditable @DomName('SVGImageElement') class ImageElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "*SVGImageElement" { @@ -3160,11 +3066,19 @@ class ImageElement extends StyledElement implements UriReference, Tests, Transfo // BSD-style license that can be found in the LICENSE file. +@DocsEditable @DomName('SVGLangSpace') -abstract class LangSpace { +class LangSpace native "*SVGLangSpace" { + /// Checks if this type is supported on the current platform. + static bool supported(SvgElement element) => JS('bool', '#.xmlspace !== undefined && #.xmllang !== undefined', element, element); + + @DomName('SVGLangSpace.xmllang') + @DocsEditable String xmllang; + @DomName('SVGLangSpace.xmlspace') + @DocsEditable String xmlspace; } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -3546,7 +3460,7 @@ class LineElement extends StyledElement implements Transformable, Tests, Externa @DocsEditable @DomName('SVGLinearGradientElement') -class LinearGradientElement extends GradientElement native "*SVGLinearGradientElement" { +class LinearGradientElement extends _SVGGradientElement native "*SVGLinearGradientElement" { @DocsEditable factory LinearGradientElement() => _SvgElementFactoryProvider.createSvgElement_tag("linearGradient"); @@ -3592,30 +3506,6 @@ abstract class Locatable { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGMPathElement') -class MPathElement extends SvgElement implements UriReference, ExternalResourcesRequired native "*SVGMPathElement" { - - @DocsEditable - factory MPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("mpath"); - - // From SVGExternalResourcesRequired - - @DomName('SVGMPathElement.externalResourcesRequired') - @DocsEditable - final AnimatedBoolean externalResourcesRequired; - - // From SVGURIReference - - @DomName('SVGMPathElement.href') - @DocsEditable - final AnimatedString href; -} -// 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. - - @DocsEditable @DomName('SVGMarkerElement') class MarkerElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace native "*SVGMarkerElement" { @@ -3858,15 +3748,6 @@ class MetadataElement extends SvgElement native "*SVGMetadataElement" { // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGMissingGlyphElement') -class MissingGlyphElement extends StyledElement native "*SVGMissingGlyphElement" { -} -// 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. - - @DocsEditable @DomName('SVGNumber') class Number native "*SVGNumber" { @@ -5409,7 +5290,7 @@ class PreserveAspectRatio native "*SVGPreserveAspectRatio" { @DocsEditable @DomName('SVGRadialGradientElement') -class RadialGradientElement extends GradientElement native "*SVGRadialGradientElement" { +class RadialGradientElement extends _SVGGradientElement native "*SVGRadialGradientElement" { @DocsEditable factory RadialGradientElement() => _SvgElementFactoryProvider.createSvgElement_tag("radialGradient"); @@ -5623,10 +5504,16 @@ class ScriptElement extends SvgElement implements UriReference, ExternalResource @DocsEditable @DomName('SVGSetElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class SetElement extends AnimationElement native "*SVGSetElement" { @DocsEditable factory SetElement() => _SvgElementFactoryProvider.createSvgElement_tag("set"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('set') && (new SvgElement.tag('set') is SetElement); } // 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 @@ -6056,6 +5943,15 @@ class SvgElement extends Element native "*SVGElement" { throw new UnsupportedError("Cannot invoke click SVG."); } + /** + * Checks to see if the SVG element type is supported by the current platform. + * + * The tag should be a valid SVG element tag name. + */ + static bool isTagSupported(String tag) { + var e = new SvgElement.tag(tag); + return e is SvgElement && !(e is UnknownElement); + } // Shadowing definition. String get id => JS("String", "#.id", this); @@ -6491,24 +6387,6 @@ class SymbolElement extends StyledElement implements FitToViewBox, ExternalResou // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGTRefElement') -class TRefElement extends TextPositioningElement implements UriReference native "*SVGTRefElement" { - - @DocsEditable - factory TRefElement() => _SvgElementFactoryProvider.createSvgElement_tag("tref"); - - // From SVGURIReference - - @DomName('SVGTRefElement.href') - @DocsEditable - final AnimatedString href; -} -// 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. - - @DocsEditable @DomName('SVGTSpanElement') class TSpanElement extends TextPositioningElement native "*SVGTSpanElement" { @@ -7214,18 +7092,6 @@ class UseElement extends StyledElement implements UriReference, Tests, Transform // BSD-style license that can be found in the LICENSE file. -@DocsEditable -@DomName('SVGVKernElement') -class VKernElement extends SvgElement native "*SVGVKernElement" { - - @DocsEditable - factory VKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("vkern"); -} -// 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. - - @DocsEditable @DomName('SVGViewElement') class ViewElement extends SvgElement implements FitToViewBox, ExternalResourcesRequired, ZoomAndPan native "*SVGViewElement" { @@ -7546,3 +7412,408 @@ class _ElementInstanceList implements JavaScriptIndexingBehavior, List _SvgElementFactoryProvider.createSvgElement_tag("cursor"); + + /// Checks if this type is supported on the current platform. + static bool get supported => SvgElement.isTagSupported('cursor') && (new SvgElement.tag('cursor') is _SVGCursorElement); + + @DomName('SVGCursorElement.x') + @DocsEditable + final AnimatedLength x; + + @DomName('SVGCursorElement.y') + @DocsEditable + final AnimatedLength y; + + // From SVGExternalResourcesRequired + + @DomName('SVGCursorElement.externalResourcesRequired') + @DocsEditable + final AnimatedBoolean externalResourcesRequired; + + // From SVGTests + + @DomName('SVGCursorElement.requiredExtensions') + @DocsEditable + final StringList requiredExtensions; + + @DomName('SVGCursorElement.requiredFeatures') + @DocsEditable + final StringList requiredFeatures; + + @DomName('SVGCursorElement.systemLanguage') + @DocsEditable + final StringList systemLanguage; + + @DomName('SVGCursorElement.hasExtension') + @DocsEditable + bool hasExtension(String extension) native; + + // From SVGURIReference + + @DomName('SVGCursorElement.href') + @DocsEditable + final AnimatedString href; +} +// 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. + + +@DocsEditable +@DomName('SVGFEDropShadowElement') +class _SVGFEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDropShadowElement" { + + @DomName('SVGFEDropShadowElement.dx') + @DocsEditable + final AnimatedNumber dx; + + @DomName('SVGFEDropShadowElement.dy') + @DocsEditable + final AnimatedNumber dy; + + @DomName('SVGFEDropShadowElement.in1') + @DocsEditable + final AnimatedString in1; + + @DomName('SVGFEDropShadowElement.stdDeviationX') + @DocsEditable + final AnimatedNumber stdDeviationX; + + @DomName('SVGFEDropShadowElement.stdDeviationY') + @DocsEditable + final AnimatedNumber stdDeviationY; + + @DomName('SVGFEDropShadowElement.setStdDeviation') + @DocsEditable + void setStdDeviation(num stdDeviationX, num stdDeviationY) native; + + // From SVGFilterPrimitiveStandardAttributes + + @DomName('SVGFEDropShadowElement.height') + @DocsEditable + final AnimatedLength height; + + @DomName('SVGFEDropShadowElement.result') + @DocsEditable + final AnimatedString result; + + @DomName('SVGFEDropShadowElement.width') + @DocsEditable + final AnimatedLength width; + + @DomName('SVGFEDropShadowElement.x') + @DocsEditable + final AnimatedLength x; + + @DomName('SVGFEDropShadowElement.y') + @DocsEditable + final AnimatedLength y; +} +// 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. + + +@DocsEditable +@DomName('SVGFontElement') +class _SVGFontElement extends SvgElement native "*SVGFontElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGFontFaceElement') +class _SVGFontFaceElement extends SvgElement native "*SVGFontFaceElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGFontFaceFormatElement') +class _SVGFontFaceFormatElement extends SvgElement native "*SVGFontFaceFormatElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGFontFaceNameElement') +class _SVGFontFaceNameElement extends SvgElement native "*SVGFontFaceNameElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGFontFaceSrcElement') +class _SVGFontFaceSrcElement extends SvgElement native "*SVGFontFaceSrcElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGFontFaceUriElement') +class _SVGFontFaceUriElement extends SvgElement native "*SVGFontFaceUriElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGGlyphElement') +class _SVGGlyphElement extends SvgElement native "*SVGGlyphElement" { + + @DocsEditable + factory _SVGGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("glyph"); +} +// 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. + + +@DocsEditable +@DomName('SVGGlyphRefElement') +class _SVGGlyphRefElement extends StyledElement implements UriReference native "*SVGGlyphRefElement" { + + @DomName('SVGGlyphRefElement.dx') + @DocsEditable + num dx; + + @DomName('SVGGlyphRefElement.dy') + @DocsEditable + num dy; + + @DomName('SVGGlyphRefElement.format') + @DocsEditable + String format; + + @DomName('SVGGlyphRefElement.glyphRef') + @DocsEditable + String glyphRef; + + @DomName('SVGGlyphRefElement.x') + @DocsEditable + num x; + + @DomName('SVGGlyphRefElement.y') + @DocsEditable + num y; + + // From SVGURIReference + + @DomName('SVGGlyphRefElement.href') + @DocsEditable + final AnimatedString href; +} +// 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. + + +@DocsEditable +@DomName('SVGGradientElement') +class _SVGGradientElement extends StyledElement implements UriReference, ExternalResourcesRequired native "*SVGGradientElement" { + + static const int SVG_SPREADMETHOD_PAD = 1; + + static const int SVG_SPREADMETHOD_REFLECT = 2; + + static const int SVG_SPREADMETHOD_REPEAT = 3; + + static const int SVG_SPREADMETHOD_UNKNOWN = 0; + + @DomName('SVGGradientElement.gradientTransform') + @DocsEditable + final AnimatedTransformList gradientTransform; + + @DomName('SVGGradientElement.gradientUnits') + @DocsEditable + final AnimatedEnumeration gradientUnits; + + @DomName('SVGGradientElement.spreadMethod') + @DocsEditable + final AnimatedEnumeration spreadMethod; + + // From SVGExternalResourcesRequired + + @DomName('SVGGradientElement.externalResourcesRequired') + @DocsEditable + final AnimatedBoolean externalResourcesRequired; + + // From SVGURIReference + + @DomName('SVGGradientElement.href') + @DocsEditable + final AnimatedString href; +} +// 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. + + +@DocsEditable +@DomName('SVGHKernElement') +class _SVGHKernElement extends SvgElement native "*SVGHKernElement" { + + @DocsEditable + factory _SVGHKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("hkern"); +} +// 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. + + +@DocsEditable +@DomName('SVGMPathElement') +class _SVGMPathElement extends SvgElement implements UriReference, ExternalResourcesRequired native "*SVGMPathElement" { + + @DocsEditable + factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("mpath"); + + // From SVGExternalResourcesRequired + + @DomName('SVGMPathElement.externalResourcesRequired') + @DocsEditable + final AnimatedBoolean externalResourcesRequired; + + // From SVGURIReference + + @DomName('SVGMPathElement.href') + @DocsEditable + final AnimatedString href; +} +// 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. + + +@DocsEditable +@DomName('SVGMissingGlyphElement') +class _SVGMissingGlyphElement extends StyledElement native "*SVGMissingGlyphElement" { +} +// 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. + + +@DocsEditable +@DomName('SVGTRefElement') +class _SVGTRefElement extends TextPositioningElement implements UriReference native "*SVGTRefElement" { + + @DocsEditable + factory _SVGTRefElement() => _SvgElementFactoryProvider.createSvgElement_tag("tref"); + + // From SVGURIReference + + @DomName('SVGTRefElement.href') + @DocsEditable + final AnimatedString href; +} +// 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. + + +@DocsEditable +@DomName('SVGVKernElement') +class _SVGVKernElement extends SvgElement native "*SVGVKernElement" { + + @DocsEditable + factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("vkern"); +} diff --git a/sdk/lib/svg/dartium/svg_dartium.dart b/sdk/lib/svg/dartium/svg_dartium.dart index e12bd91e945..46abbf3e3d8 100644 --- a/sdk/lib/svg/dartium/svg_dartium.dart +++ b/sdk/lib/svg/dartium/svg_dartium.dart @@ -147,24 +147,20 @@ class AElement extends StyledElement implements UriReference, Tests, Transformab // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGAltGlyphDefElement') -class AltGlyphDefElement extends SvgElement { - AltGlyphDefElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGAltGlyphElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AltGlyphElement extends TextPositioningElement implements UriReference { AltGlyphElement.internal() : super.internal(); + @DocsEditable + factory AltGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("altGlyph"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGAltGlyphElement.format') @DocsEditable String get format native "SVGAltGlyphElement_format_Getter"; @@ -193,19 +189,6 @@ class AltGlyphElement extends TextPositioningElement implements UriReference { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGAltGlyphItemElement') -class AltGlyphItemElement extends SvgElement { - AltGlyphItemElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGAngle') class Angle extends NativeFieldWrapperClass1 { @@ -265,30 +248,20 @@ class Angle extends NativeFieldWrapperClass1 { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGAnimateColorElement') -class AnimateColorElement extends AnimationElement { - AnimateColorElement.internal() : super.internal(); - - @DocsEditable - factory AnimateColorElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateColor"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGAnimateElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateElement extends AnimationElement { AnimateElement.internal() : super.internal(); @DocsEditable factory AnimateElement() => _SvgElementFactoryProvider.createSvgElement_tag("animate"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -299,12 +272,18 @@ class AnimateElement extends AnimationElement { @DocsEditable @DomName('SVGAnimateMotionElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateMotionElement extends AnimationElement { AnimateMotionElement.internal() : super.internal(); @DocsEditable factory AnimateMotionElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateMotion"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -315,12 +294,18 @@ class AnimateMotionElement extends AnimationElement { @DocsEditable @DomName('SVGAnimateTransformElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class AnimateTransformElement extends AnimationElement { AnimateTransformElement.internal() : super.internal(); @DocsEditable factory AnimateTransformElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateTransform"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -886,107 +871,6 @@ class Color extends CssValue { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGComponentTransferFunctionElement') -class ComponentTransferFunctionElement extends SvgElement { - ComponentTransferFunctionElement.internal() : super.internal(); - - static const int SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2; - - static const int SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0; - - @DomName('SVGComponentTransferFunctionElement.amplitude') - @DocsEditable - AnimatedNumber get amplitude native "SVGComponentTransferFunctionElement_amplitude_Getter"; - - @DomName('SVGComponentTransferFunctionElement.exponent') - @DocsEditable - AnimatedNumber get exponent native "SVGComponentTransferFunctionElement_exponent_Getter"; - - @DomName('SVGComponentTransferFunctionElement.intercept') - @DocsEditable - AnimatedNumber get intercept native "SVGComponentTransferFunctionElement_intercept_Getter"; - - @DomName('SVGComponentTransferFunctionElement.offset') - @DocsEditable - AnimatedNumber get offset native "SVGComponentTransferFunctionElement_offset_Getter"; - - @DomName('SVGComponentTransferFunctionElement.slope') - @DocsEditable - AnimatedNumber get slope native "SVGComponentTransferFunctionElement_slope_Getter"; - - @DomName('SVGComponentTransferFunctionElement.tableValues') - @DocsEditable - AnimatedNumberList get tableValues native "SVGComponentTransferFunctionElement_tableValues_Getter"; - - @DomName('SVGComponentTransferFunctionElement.type') - @DocsEditable - AnimatedEnumeration get type native "SVGComponentTransferFunctionElement_type_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGCursorElement') -class CursorElement extends SvgElement implements UriReference, Tests, ExternalResourcesRequired { - CursorElement.internal() : super.internal(); - - @DocsEditable - factory CursorElement() => _SvgElementFactoryProvider.createSvgElement_tag("cursor"); - - @DomName('SVGCursorElement.x') - @DocsEditable - AnimatedLength get x native "SVGCursorElement_x_Getter"; - - @DomName('SVGCursorElement.y') - @DocsEditable - AnimatedLength get y native "SVGCursorElement_y_Getter"; - - @DomName('SVGCursorElement.externalResourcesRequired') - @DocsEditable - AnimatedBoolean get externalResourcesRequired native "SVGCursorElement_externalResourcesRequired_Getter"; - - @DomName('SVGCursorElement.requiredExtensions') - @DocsEditable - StringList get requiredExtensions native "SVGCursorElement_requiredExtensions_Getter"; - - @DomName('SVGCursorElement.requiredFeatures') - @DocsEditable - StringList get requiredFeatures native "SVGCursorElement_requiredFeatures_Getter"; - - @DomName('SVGCursorElement.systemLanguage') - @DocsEditable - StringList get systemLanguage native "SVGCursorElement_systemLanguage_Getter"; - - @DomName('SVGCursorElement.hasExtension') - @DocsEditable - bool hasExtension(String extension) native "SVGCursorElement_hasExtension_Callback"; - - @DomName('SVGCursorElement.href') - @DocsEditable - AnimatedString get href native "SVGCursorElement_href_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGDefsElement') class DefsElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace { @@ -1727,6 +1611,9 @@ class EllipseElement extends StyledElement implements Transformable, Tests, Exte class ExternalResourcesRequired extends NativeFieldWrapperClass1 { ExternalResourcesRequired.internal(); + /// Checks if this type is supported on the current platform. + static bool supported(SvgElement element) => JS('bool', '#.externalResourcesRequired !== undefined && #.externalResourcesRequired.animVal !== undefined', element, element); + @DomName('SVGExternalResourcesRequired.externalResourcesRequired') @DocsEditable AnimatedBoolean get externalResourcesRequired native "SVGExternalResourcesRequired_externalResourcesRequired_Getter"; @@ -1741,9 +1628,19 @@ class ExternalResourcesRequired extends NativeFieldWrapperClass1 { @DocsEditable @DomName('SVGFEBlendElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEBlendElement.internal() : super.internal(); + @DocsEditable + factory FEBlendElement() => _SvgElementFactoryProvider.createSvgElement_tag("feBlend"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + static const int SVG_FEBLEND_MODE_DARKEN = 4; static const int SVG_FEBLEND_MODE_LIGHTEN = 5; @@ -1798,9 +1695,19 @@ class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEColorMatrixElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEColorMatrixElement.internal() : super.internal(); + @DocsEditable + factory FEColorMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + static const int SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3; static const int SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4; @@ -1853,9 +1760,19 @@ class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStand @DocsEditable @DomName('SVGFEComponentTransferElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEComponentTransferElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEComponentTransferElement.internal() : super.internal(); + @DocsEditable + factory FEComponentTransferElement() => _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEComponentTransferElement.in1') @DocsEditable AnimatedString get in1 native "SVGFEComponentTransferElement_in1_Getter"; @@ -1965,9 +1882,19 @@ class FECompositeElement extends StyledElement implements FilterPrimitiveStandar @DocsEditable @DomName('SVGFEConvolveMatrixElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEConvolveMatrixElement.internal() : super.internal(); + @DocsEditable + factory FEConvolveMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + static const int SVG_EDGEMODE_DUPLICATE = 1; static const int SVG_EDGEMODE_NONE = 3; @@ -2054,9 +1981,19 @@ class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveSt @DocsEditable @DomName('SVGFEDiffuseLightingElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEDiffuseLightingElement.internal() : super.internal(); + @DocsEditable + factory FEDiffuseLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEDiffuseLightingElement.diffuseConstant') @DocsEditable AnimatedNumber get diffuseConstant native "SVGFEDiffuseLightingElement_diffuseConstant_Getter"; @@ -2107,9 +2044,19 @@ class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveS @DocsEditable @DomName('SVGFEDisplacementMapElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEDisplacementMapElement.internal() : super.internal(); + @DocsEditable + factory FEDisplacementMapElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + static const int SVG_CHANNEL_A = 4; static const int SVG_CHANNEL_B = 3; @@ -2170,9 +2117,19 @@ class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveS @DocsEditable @DomName('SVGFEDistantLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEDistantLightElement extends SvgElement { FEDistantLightElement.internal() : super.internal(); + @DocsEditable + factory FEDistantLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEDistantLightElement.azimuth') @DocsEditable AnimatedNumber get azimuth native "SVGFEDistantLightElement_azimuth_Getter"; @@ -2189,68 +2146,21 @@ class FEDistantLightElement extends SvgElement { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGFEDropShadowElement') -class FEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes { - FEDropShadowElement.internal() : super.internal(); - - @DomName('SVGFEDropShadowElement.dx') - @DocsEditable - AnimatedNumber get dx native "SVGFEDropShadowElement_dx_Getter"; - - @DomName('SVGFEDropShadowElement.dy') - @DocsEditable - AnimatedNumber get dy native "SVGFEDropShadowElement_dy_Getter"; - - @DomName('SVGFEDropShadowElement.in1') - @DocsEditable - AnimatedString get in1 native "SVGFEDropShadowElement_in1_Getter"; - - @DomName('SVGFEDropShadowElement.stdDeviationX') - @DocsEditable - AnimatedNumber get stdDeviationX native "SVGFEDropShadowElement_stdDeviationX_Getter"; - - @DomName('SVGFEDropShadowElement.stdDeviationY') - @DocsEditable - AnimatedNumber get stdDeviationY native "SVGFEDropShadowElement_stdDeviationY_Getter"; - - @DomName('SVGFEDropShadowElement.setStdDeviation') - @DocsEditable - void setStdDeviation(num stdDeviationX, num stdDeviationY) native "SVGFEDropShadowElement_setStdDeviation_Callback"; - - @DomName('SVGFEDropShadowElement.height') - @DocsEditable - AnimatedLength get height native "SVGFEDropShadowElement_height_Getter"; - - @DomName('SVGFEDropShadowElement.result') - @DocsEditable - AnimatedString get result native "SVGFEDropShadowElement_result_Getter"; - - @DomName('SVGFEDropShadowElement.width') - @DocsEditable - AnimatedLength get width native "SVGFEDropShadowElement_width_Getter"; - - @DomName('SVGFEDropShadowElement.x') - @DocsEditable - AnimatedLength get x native "SVGFEDropShadowElement_x_Getter"; - - @DomName('SVGFEDropShadowElement.y') - @DocsEditable - AnimatedLength get y native "SVGFEDropShadowElement_y_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGFEFloodElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEFloodElement.internal() : super.internal(); + @DocsEditable + factory FEFloodElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFlood"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEFloodElement.height') @DocsEditable AnimatedLength get height native "SVGFEFloodElement_height_Getter"; @@ -2281,9 +2191,19 @@ class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEFuncAElement') -class FEFuncAElement extends ComponentTransferFunctionElement { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncAElement extends _SVGComponentTransferFunctionElement { FEFuncAElement.internal() : super.internal(); + @DocsEditable + factory FEFuncAElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncA"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -2294,9 +2214,19 @@ class FEFuncAElement extends ComponentTransferFunctionElement { @DocsEditable @DomName('SVGFEFuncBElement') -class FEFuncBElement extends ComponentTransferFunctionElement { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncBElement extends _SVGComponentTransferFunctionElement { FEFuncBElement.internal() : super.internal(); + @DocsEditable + factory FEFuncBElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncB"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -2307,9 +2237,19 @@ class FEFuncBElement extends ComponentTransferFunctionElement { @DocsEditable @DomName('SVGFEFuncGElement') -class FEFuncGElement extends ComponentTransferFunctionElement { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncGElement extends _SVGComponentTransferFunctionElement { FEFuncGElement.internal() : super.internal(); + @DocsEditable + factory FEFuncGElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncG"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -2320,9 +2260,19 @@ class FEFuncGElement extends ComponentTransferFunctionElement { @DocsEditable @DomName('SVGFEFuncRElement') -class FEFuncRElement extends ComponentTransferFunctionElement { +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) +class FEFuncRElement extends _SVGComponentTransferFunctionElement { FEFuncRElement.internal() : super.internal(); + @DocsEditable + factory FEFuncRElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncR"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -2333,9 +2283,19 @@ class FEFuncRElement extends ComponentTransferFunctionElement { @DocsEditable @DomName('SVGFEGaussianBlurElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEGaussianBlurElement.internal() : super.internal(); + @DocsEditable + factory FEGaussianBlurElement() => _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEGaussianBlurElement.in1') @DocsEditable AnimatedString get in1 native "SVGFEGaussianBlurElement_in1_Getter"; @@ -2382,9 +2342,19 @@ class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStan @DocsEditable @DomName('SVGFEImageElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEImageElement extends StyledElement implements FilterPrimitiveStandardAttributes, UriReference, ExternalResourcesRequired, LangSpace { FEImageElement.internal() : super.internal(); + @DocsEditable + factory FEImageElement() => _SvgElementFactoryProvider.createSvgElement_tag("feImage"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEImageElement.preserveAspectRatio') @DocsEditable AnimatedPreserveAspectRatio get preserveAspectRatio native "SVGFEImageElement_preserveAspectRatio_Getter"; @@ -2443,9 +2413,19 @@ class FEImageElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEMergeElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEMergeElement.internal() : super.internal(); + @DocsEditable + factory FEMergeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMerge"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEMergeElement.height') @DocsEditable AnimatedLength get height native "SVGFEMergeElement_height_Getter"; @@ -2476,9 +2456,19 @@ class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAtt @DocsEditable @DomName('SVGFEMergeNodeElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEMergeNodeElement extends SvgElement { FEMergeNodeElement.internal() : super.internal(); + @DocsEditable + factory FEMergeNodeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEMergeNodeElement.in1') @DocsEditable AnimatedString get in1 native "SVGFEMergeNodeElement_in1_Getter"; @@ -2552,9 +2542,19 @@ class FEMorphologyElement extends StyledElement implements FilterPrimitiveStanda @DocsEditable @DomName('SVGFEOffsetElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAttributes { FEOffsetElement.internal() : super.internal(); + @DocsEditable + factory FEOffsetElement() => _SvgElementFactoryProvider.createSvgElement_tag("feOffset"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEOffsetElement.dx') @DocsEditable AnimatedNumber get dx native "SVGFEOffsetElement_dx_Getter"; @@ -2597,9 +2597,19 @@ class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAt @DocsEditable @DomName('SVGFEPointLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FEPointLightElement extends SvgElement { FEPointLightElement.internal() : super.internal(); + @DocsEditable + factory FEPointLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("fePointLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFEPointLightElement.x') @DocsEditable AnimatedNumber get x native "SVGFEPointLightElement_x_Getter"; @@ -2622,9 +2632,19 @@ class FEPointLightElement extends SvgElement { @DocsEditable @DomName('SVGFESpecularLightingElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FESpecularLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes { FESpecularLightingElement.internal() : super.internal(); + @DocsEditable + factory FESpecularLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFESpecularLightingElement.in1') @DocsEditable AnimatedString get in1 native "SVGFESpecularLightingElement_in1_Getter"; @@ -2671,9 +2691,19 @@ class FESpecularLightingElement extends StyledElement implements FilterPrimitive @DocsEditable @DomName('SVGFESpotLightElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FESpotLightElement extends SvgElement { FESpotLightElement.internal() : super.internal(); + @DocsEditable + factory FESpotLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFESpotLightElement.limitingConeAngle') @DocsEditable AnimatedNumber get limitingConeAngle native "SVGFESpotLightElement_limitingConeAngle_Getter"; @@ -2716,9 +2746,19 @@ class FESpotLightElement extends SvgElement { @DocsEditable @DomName('SVGFETileElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FETileElement extends StyledElement implements FilterPrimitiveStandardAttributes { FETileElement.internal() : super.internal(); + @DocsEditable + factory FETileElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTile"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFETileElement.in1') @DocsEditable AnimatedString get in1 native "SVGFETileElement_in1_Getter"; @@ -2753,9 +2793,19 @@ class FETileElement extends StyledElement implements FilterPrimitiveStandardAttr @DocsEditable @DomName('SVGFETurbulenceElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FETurbulenceElement extends StyledElement implements FilterPrimitiveStandardAttributes { FETurbulenceElement.internal() : super.internal(); + @DocsEditable + factory FETurbulenceElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + static const int SVG_STITCHTYPE_NOSTITCH = 2; static const int SVG_STITCHTYPE_STITCH = 1; @@ -2822,12 +2872,19 @@ class FETurbulenceElement extends StyledElement implements FilterPrimitiveStanda @DocsEditable @DomName('SVGFilterElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.IE, '10') +@SupportedBrowser(SupportedBrowser.SAFARI) class FilterElement extends StyledElement implements UriReference, ExternalResourcesRequired, LangSpace { FilterElement.internal() : super.internal(); @DocsEditable factory FilterElement() => _SvgElementFactoryProvider.createSvgElement_tag("filter"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGFilterElement.filterResX') @DocsEditable AnimatedInteger get filterResX native "SVGFilterElement_filterResX_Getter"; @@ -2950,110 +3007,20 @@ class FitToViewBox extends NativeFieldWrapperClass1 { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGFontElement') -class FontElement extends SvgElement { - FontElement.internal() : super.internal(); - - @DocsEditable - factory FontElement() => _SvgElementFactoryProvider.createSvgElement_tag("font"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGFontFaceElement') -class FontFaceElement extends SvgElement { - FontFaceElement.internal() : super.internal(); - - @DocsEditable - factory FontFaceElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGFontFaceFormatElement') -class FontFaceFormatElement extends SvgElement { - FontFaceFormatElement.internal() : super.internal(); - - @DocsEditable - factory FontFaceFormatElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-format"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGFontFaceNameElement') -class FontFaceNameElement extends SvgElement { - FontFaceNameElement.internal() : super.internal(); - - @DocsEditable - factory FontFaceNameElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-name"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGFontFaceSrcElement') -class FontFaceSrcElement extends SvgElement { - FontFaceSrcElement.internal() : super.internal(); - - @DocsEditable - factory FontFaceSrcElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-src"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGFontFaceUriElement') -class FontFaceUriElement extends SvgElement { - FontFaceUriElement.internal() : super.internal(); - - @DocsEditable - factory FontFaceUriElement() => _SvgElementFactoryProvider.createSvgElement_tag("font-face-uri"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGForeignObjectElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class ForeignObjectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace { ForeignObjectElement.internal() : super.internal(); @DocsEditable factory ForeignObjectElement() => _SvgElementFactoryProvider.createSvgElement_tag("foreignObject"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + @DomName('SVGForeignObjectElement.height') @DocsEditable AnimatedLength get height native "SVGForeignObjectElement_height_Getter"; @@ -3222,144 +3189,6 @@ class GElement extends StyledElement implements Transformable, Tests, ExternalRe // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGGlyphElement') -class GlyphElement extends SvgElement { - GlyphElement.internal() : super.internal(); - - @DocsEditable - factory GlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("glyph"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGGlyphRefElement') -class GlyphRefElement extends StyledElement implements UriReference { - GlyphRefElement.internal() : super.internal(); - - @DomName('SVGGlyphRefElement.dx') - @DocsEditable - num get dx native "SVGGlyphRefElement_dx_Getter"; - - @DomName('SVGGlyphRefElement.dx') - @DocsEditable - void set dx(num value) native "SVGGlyphRefElement_dx_Setter"; - - @DomName('SVGGlyphRefElement.dy') - @DocsEditable - num get dy native "SVGGlyphRefElement_dy_Getter"; - - @DomName('SVGGlyphRefElement.dy') - @DocsEditable - void set dy(num value) native "SVGGlyphRefElement_dy_Setter"; - - @DomName('SVGGlyphRefElement.format') - @DocsEditable - String get format native "SVGGlyphRefElement_format_Getter"; - - @DomName('SVGGlyphRefElement.format') - @DocsEditable - void set format(String value) native "SVGGlyphRefElement_format_Setter"; - - @DomName('SVGGlyphRefElement.glyphRef') - @DocsEditable - String get glyphRef native "SVGGlyphRefElement_glyphRef_Getter"; - - @DomName('SVGGlyphRefElement.glyphRef') - @DocsEditable - void set glyphRef(String value) native "SVGGlyphRefElement_glyphRef_Setter"; - - @DomName('SVGGlyphRefElement.x') - @DocsEditable - num get x native "SVGGlyphRefElement_x_Getter"; - - @DomName('SVGGlyphRefElement.x') - @DocsEditable - void set x(num value) native "SVGGlyphRefElement_x_Setter"; - - @DomName('SVGGlyphRefElement.y') - @DocsEditable - num get y native "SVGGlyphRefElement_y_Getter"; - - @DomName('SVGGlyphRefElement.y') - @DocsEditable - void set y(num value) native "SVGGlyphRefElement_y_Setter"; - - @DomName('SVGGlyphRefElement.href') - @DocsEditable - AnimatedString get href native "SVGGlyphRefElement_href_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGGradientElement') -class GradientElement extends StyledElement implements UriReference, ExternalResourcesRequired { - GradientElement.internal() : super.internal(); - - static const int SVG_SPREADMETHOD_PAD = 1; - - static const int SVG_SPREADMETHOD_REFLECT = 2; - - static const int SVG_SPREADMETHOD_REPEAT = 3; - - static const int SVG_SPREADMETHOD_UNKNOWN = 0; - - @DomName('SVGGradientElement.gradientTransform') - @DocsEditable - AnimatedTransformList get gradientTransform native "SVGGradientElement_gradientTransform_Getter"; - - @DomName('SVGGradientElement.gradientUnits') - @DocsEditable - AnimatedEnumeration get gradientUnits native "SVGGradientElement_gradientUnits_Getter"; - - @DomName('SVGGradientElement.spreadMethod') - @DocsEditable - AnimatedEnumeration get spreadMethod native "SVGGradientElement_spreadMethod_Getter"; - - @DomName('SVGGradientElement.externalResourcesRequired') - @DocsEditable - AnimatedBoolean get externalResourcesRequired native "SVGGradientElement_externalResourcesRequired_Getter"; - - @DomName('SVGGradientElement.href') - @DocsEditable - AnimatedString get href native "SVGGradientElement_href_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - -@DocsEditable -@DomName('SVGHKernElement') -class HKernElement extends SvgElement { - HKernElement.internal() : super.internal(); - - @DocsEditable - factory HKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("hkern"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGImageElement') class ImageElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace { @@ -3469,6 +3298,9 @@ class ImageElement extends StyledElement implements UriReference, Tests, Transfo class LangSpace extends NativeFieldWrapperClass1 { LangSpace.internal(); + /// Checks if this type is supported on the current platform. + static bool supported(SvgElement element) => JS('bool', '#.xmlspace !== undefined && #.xmllang !== undefined', element, element); + @DomName('SVGLangSpace.xmllang') @DocsEditable String get xmllang native "SVGLangSpace_xmllang_Getter"; @@ -3887,7 +3719,7 @@ class LineElement extends StyledElement implements Transformable, Tests, Externa @DocsEditable @DomName('SVGLinearGradientElement') -class LinearGradientElement extends GradientElement { +class LinearGradientElement extends _SVGGradientElement { LinearGradientElement.internal() : super.internal(); @DocsEditable @@ -3954,30 +3786,6 @@ class Locatable extends NativeFieldWrapperClass1 { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGMPathElement') -class MPathElement extends SvgElement implements UriReference, ExternalResourcesRequired { - MPathElement.internal() : super.internal(); - - @DocsEditable - factory MPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("mpath"); - - @DomName('SVGMPathElement.externalResourcesRequired') - @DocsEditable - AnimatedBoolean get externalResourcesRequired native "SVGMPathElement_externalResourcesRequired_Getter"; - - @DomName('SVGMPathElement.href') - @DocsEditable - AnimatedString get href native "SVGMPathElement_href_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGMarkerElement') class MarkerElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace { @@ -4264,19 +4072,6 @@ class MetadataElement extends SvgElement { // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGMissingGlyphElement') -class MissingGlyphElement extends StyledElement { - MissingGlyphElement.internal() : super.internal(); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGNumber') class Number extends NativeFieldWrapperClass1 { @@ -6162,7 +5957,7 @@ class PreserveAspectRatio extends NativeFieldWrapperClass1 { @DocsEditable @DomName('SVGRadialGradientElement') -class RadialGradientElement extends GradientElement { +class RadialGradientElement extends _SVGGradientElement { RadialGradientElement.internal() : super.internal(); @DocsEditable @@ -6408,12 +6203,18 @@ class ScriptElement extends SvgElement implements UriReference, ExternalResource @DocsEditable @DomName('SVGSetElement') +@SupportedBrowser(SupportedBrowser.CHROME) +@SupportedBrowser(SupportedBrowser.FIREFOX) +@SupportedBrowser(SupportedBrowser.SAFARI) class SetElement extends AnimationElement { SetElement.internal() : super.internal(); @DocsEditable factory SetElement() => _SvgElementFactoryProvider.createSvgElement_tag("set"); + /// Checks if this type is supported on the current platform. + static bool get supported => true; + } // 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 @@ -6883,6 +6684,15 @@ class SvgElement extends Element { throw new UnsupportedError("Cannot invoke click SVG."); } + /** + * Checks to see if the SVG element type is supported by the current platform. + * + * The tag should be a valid SVG element tag name. + */ + static bool isTagSupported(String tag) { + var e = new SvgElement.tag(tag); + return e is SvgElement && !(e is UnknownElement); + } SvgElement.internal() : super.internal(); @DomName('SVGElement.id') @@ -7332,26 +7142,6 @@ class SymbolElement extends StyledElement implements FitToViewBox, ExternalResou // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGTRefElement') -class TRefElement extends TextPositioningElement implements UriReference { - TRefElement.internal() : super.internal(); - - @DocsEditable - factory TRefElement() => _SvgElementFactoryProvider.createSvgElement_tag("tref"); - - @DomName('SVGTRefElement.href') - @DocsEditable - AnimatedString get href native "SVGTRefElement_href_Getter"; - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGTSpanElement') class TSpanElement extends TextPositioningElement { @@ -8127,22 +7917,6 @@ class UseElement extends StyledElement implements UriReference, Tests, Transform // WARNING: Do not edit - generated code. -@DocsEditable -@DomName('SVGVKernElement') -class VKernElement extends SvgElement { - VKernElement.internal() : super.internal(); - - @DocsEditable - factory VKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("vkern"); - -} -// 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. - -// WARNING: Do not edit - generated code. - - @DocsEditable @DomName('SVGViewElement') class ViewElement extends SvgElement implements FitToViewBox, ExternalResourcesRequired, ZoomAndPan { @@ -8490,3 +8264,492 @@ class _ElementInstanceList extends NativeFieldWrapperClass1 implements List _SvgElementFactoryProvider.createSvgElement_tag("cursor"); + + /// Checks if this type is supported on the current platform. + static bool get supported => true; + + @DomName('SVGCursorElement.x') + @DocsEditable + AnimatedLength get x native "SVGCursorElement_x_Getter"; + + @DomName('SVGCursorElement.y') + @DocsEditable + AnimatedLength get y native "SVGCursorElement_y_Getter"; + + @DomName('SVGCursorElement.externalResourcesRequired') + @DocsEditable + AnimatedBoolean get externalResourcesRequired native "SVGCursorElement_externalResourcesRequired_Getter"; + + @DomName('SVGCursorElement.requiredExtensions') + @DocsEditable + StringList get requiredExtensions native "SVGCursorElement_requiredExtensions_Getter"; + + @DomName('SVGCursorElement.requiredFeatures') + @DocsEditable + StringList get requiredFeatures native "SVGCursorElement_requiredFeatures_Getter"; + + @DomName('SVGCursorElement.systemLanguage') + @DocsEditable + StringList get systemLanguage native "SVGCursorElement_systemLanguage_Getter"; + + @DomName('SVGCursorElement.hasExtension') + @DocsEditable + bool hasExtension(String extension) native "SVGCursorElement_hasExtension_Callback"; + + @DomName('SVGCursorElement.href') + @DocsEditable + AnimatedString get href native "SVGCursorElement_href_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFEDropShadowElement') +class _SVGFEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes { + _SVGFEDropShadowElement.internal() : super.internal(); + + @DomName('SVGFEDropShadowElement.dx') + @DocsEditable + AnimatedNumber get dx native "SVGFEDropShadowElement_dx_Getter"; + + @DomName('SVGFEDropShadowElement.dy') + @DocsEditable + AnimatedNumber get dy native "SVGFEDropShadowElement_dy_Getter"; + + @DomName('SVGFEDropShadowElement.in1') + @DocsEditable + AnimatedString get in1 native "SVGFEDropShadowElement_in1_Getter"; + + @DomName('SVGFEDropShadowElement.stdDeviationX') + @DocsEditable + AnimatedNumber get stdDeviationX native "SVGFEDropShadowElement_stdDeviationX_Getter"; + + @DomName('SVGFEDropShadowElement.stdDeviationY') + @DocsEditable + AnimatedNumber get stdDeviationY native "SVGFEDropShadowElement_stdDeviationY_Getter"; + + @DomName('SVGFEDropShadowElement.setStdDeviation') + @DocsEditable + void setStdDeviation(num stdDeviationX, num stdDeviationY) native "SVGFEDropShadowElement_setStdDeviation_Callback"; + + @DomName('SVGFEDropShadowElement.height') + @DocsEditable + AnimatedLength get height native "SVGFEDropShadowElement_height_Getter"; + + @DomName('SVGFEDropShadowElement.result') + @DocsEditable + AnimatedString get result native "SVGFEDropShadowElement_result_Getter"; + + @DomName('SVGFEDropShadowElement.width') + @DocsEditable + AnimatedLength get width native "SVGFEDropShadowElement_width_Getter"; + + @DomName('SVGFEDropShadowElement.x') + @DocsEditable + AnimatedLength get x native "SVGFEDropShadowElement_x_Getter"; + + @DomName('SVGFEDropShadowElement.y') + @DocsEditable + AnimatedLength get y native "SVGFEDropShadowElement_y_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontElement') +class _SVGFontElement extends SvgElement { + _SVGFontElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontFaceElement') +class _SVGFontFaceElement extends SvgElement { + _SVGFontFaceElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontFaceFormatElement') +class _SVGFontFaceFormatElement extends SvgElement { + _SVGFontFaceFormatElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontFaceNameElement') +class _SVGFontFaceNameElement extends SvgElement { + _SVGFontFaceNameElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontFaceSrcElement') +class _SVGFontFaceSrcElement extends SvgElement { + _SVGFontFaceSrcElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGFontFaceUriElement') +class _SVGFontFaceUriElement extends SvgElement { + _SVGFontFaceUriElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGGlyphElement') +class _SVGGlyphElement extends SvgElement { + _SVGGlyphElement.internal() : super.internal(); + + @DocsEditable + factory _SVGGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("glyph"); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGGlyphRefElement') +class _SVGGlyphRefElement extends StyledElement implements UriReference { + _SVGGlyphRefElement.internal() : super.internal(); + + @DomName('SVGGlyphRefElement.dx') + @DocsEditable + num get dx native "SVGGlyphRefElement_dx_Getter"; + + @DomName('SVGGlyphRefElement.dx') + @DocsEditable + void set dx(num value) native "SVGGlyphRefElement_dx_Setter"; + + @DomName('SVGGlyphRefElement.dy') + @DocsEditable + num get dy native "SVGGlyphRefElement_dy_Getter"; + + @DomName('SVGGlyphRefElement.dy') + @DocsEditable + void set dy(num value) native "SVGGlyphRefElement_dy_Setter"; + + @DomName('SVGGlyphRefElement.format') + @DocsEditable + String get format native "SVGGlyphRefElement_format_Getter"; + + @DomName('SVGGlyphRefElement.format') + @DocsEditable + void set format(String value) native "SVGGlyphRefElement_format_Setter"; + + @DomName('SVGGlyphRefElement.glyphRef') + @DocsEditable + String get glyphRef native "SVGGlyphRefElement_glyphRef_Getter"; + + @DomName('SVGGlyphRefElement.glyphRef') + @DocsEditable + void set glyphRef(String value) native "SVGGlyphRefElement_glyphRef_Setter"; + + @DomName('SVGGlyphRefElement.x') + @DocsEditable + num get x native "SVGGlyphRefElement_x_Getter"; + + @DomName('SVGGlyphRefElement.x') + @DocsEditable + void set x(num value) native "SVGGlyphRefElement_x_Setter"; + + @DomName('SVGGlyphRefElement.y') + @DocsEditable + num get y native "SVGGlyphRefElement_y_Getter"; + + @DomName('SVGGlyphRefElement.y') + @DocsEditable + void set y(num value) native "SVGGlyphRefElement_y_Setter"; + + @DomName('SVGGlyphRefElement.href') + @DocsEditable + AnimatedString get href native "SVGGlyphRefElement_href_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGGradientElement') +class _SVGGradientElement extends StyledElement implements UriReference, ExternalResourcesRequired { + _SVGGradientElement.internal() : super.internal(); + + static const int SVG_SPREADMETHOD_PAD = 1; + + static const int SVG_SPREADMETHOD_REFLECT = 2; + + static const int SVG_SPREADMETHOD_REPEAT = 3; + + static const int SVG_SPREADMETHOD_UNKNOWN = 0; + + @DomName('SVGGradientElement.gradientTransform') + @DocsEditable + AnimatedTransformList get gradientTransform native "SVGGradientElement_gradientTransform_Getter"; + + @DomName('SVGGradientElement.gradientUnits') + @DocsEditable + AnimatedEnumeration get gradientUnits native "SVGGradientElement_gradientUnits_Getter"; + + @DomName('SVGGradientElement.spreadMethod') + @DocsEditable + AnimatedEnumeration get spreadMethod native "SVGGradientElement_spreadMethod_Getter"; + + @DomName('SVGGradientElement.externalResourcesRequired') + @DocsEditable + AnimatedBoolean get externalResourcesRequired native "SVGGradientElement_externalResourcesRequired_Getter"; + + @DomName('SVGGradientElement.href') + @DocsEditable + AnimatedString get href native "SVGGradientElement_href_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGHKernElement') +class _SVGHKernElement extends SvgElement { + _SVGHKernElement.internal() : super.internal(); + + @DocsEditable + factory _SVGHKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("hkern"); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGMPathElement') +class _SVGMPathElement extends SvgElement implements UriReference, ExternalResourcesRequired { + _SVGMPathElement.internal() : super.internal(); + + @DocsEditable + factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("mpath"); + + @DomName('SVGMPathElement.externalResourcesRequired') + @DocsEditable + AnimatedBoolean get externalResourcesRequired native "SVGMPathElement_externalResourcesRequired_Getter"; + + @DomName('SVGMPathElement.href') + @DocsEditable + AnimatedString get href native "SVGMPathElement_href_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGMissingGlyphElement') +class _SVGMissingGlyphElement extends StyledElement { + _SVGMissingGlyphElement.internal() : super.internal(); + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGTRefElement') +class _SVGTRefElement extends TextPositioningElement implements UriReference { + _SVGTRefElement.internal() : super.internal(); + + @DocsEditable + factory _SVGTRefElement() => _SvgElementFactoryProvider.createSvgElement_tag("tref"); + + @DomName('SVGTRefElement.href') + @DocsEditable + AnimatedString get href native "SVGTRefElement_href_Getter"; + +} +// 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. + +// WARNING: Do not edit - generated code. + + +@DocsEditable +@DomName('SVGVKernElement') +class _SVGVKernElement extends SvgElement { + _SVGVKernElement.internal() : super.internal(); + + @DocsEditable + factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("vkern"); + +} diff --git a/tests/html/html.status b/tests/html/html.status index 2c2e4406d05..f99117dd0b0 100644 --- a/tests/html/html.status +++ b/tests/html/html.status @@ -85,9 +85,14 @@ notifications_test/supported: Fail serialized_script_value_test: Fail shadow_dom_test/supported: Fail speechrecognition_test/supported: Fail -storage_test: Fail, Pass -svgelement_test/additionalConstructors: Fail -svgelement2_test: Fail +storage_test: Fail, Pas +svgelement_test/supported_altGlyph: Fail +svgelement_test/supported_animate: Fail +svgelement_test/supported_animateTransform: Fail +svgelement_test/supported_animateMotion: Fail +svgelement_test/supported_foreignObject: Fail +svgelement_test/supported_set: Fail +svgelement2_test/supported: Fail touchevent_test/supported: Fail webgl_1_test/supported: Fail websql_test/supported: Fail @@ -156,9 +161,37 @@ postmessage_structured_test: Skip # BUG(5685): times out. serialized_script_value_test: Fail shadow_dom_test/supported: Fail speechrecognition_test/supported: Fail -svg_3_test: Fail -svgelement_test/additionalConstructors: Fail -svgelement2_test: Fail +svg_test/supported_externalResourcesRequired: Fail +svgelement_test/supported_altGlyph: Fail +svgelement_test/supported_animate: Fail +svgelement_test/supported_animateTransform: Fail +svgelement_test/supported_animateMotion: Fail +svgelement_test/supported_feBlend: Fail +svgelement_test/supported_feColorMatrix: Fail +svgelement_test/supported_feComponentTransfer: Fail +svgelement_test/supported_feConvolveMatrix: Fail +svgelement_test/supported_feDiffuseLighting: Fail +svgelement_test/supported_feDisplacementMap: Fail +svgelement_test/supported_feDistantLight: Fail +svgelement_test/supported_feFlood: Fail +svgelement_test/supported_feFuncA: Fail +svgelement_test/supported_feFuncB: Fail +svgelement_test/supported_feFuncG: Fail +svgelement_test/supported_feFuncR: Fail +svgelement_test/supported_feGaussianBlur: Fail +svgelement_test/supported_feImage: Fail +svgelement_test/supported_feMerge: Fail +svgelement_test/supported_feMergeNode: Fail +svgelement_test/supported_feOffset: Fail +svgelement_test/supported_fePointLight: Fail +svgelement_test/supported_feSpecularLighting: Fail +svgelement_test/supported_feSpotLight: Fail +svgelement_test/supported_feTile: Fail +svgelement_test/supported_feTurbulence: Fail +svgelement_test/supported_filter: Fail +svgelement_test/supported_foreignObject: Fail +svgelement_test/supported_set: Fail +svgelement2_test/supported: Fail touchevent_test/supported: Fail url_test: Fail # IE9 does not support createObjectURL (it is supported in IE10) websocket_test/supported: Fail @@ -227,9 +260,8 @@ notifications_test/supported: Fail performance_api_test/supported: Fail serialized_script_value_test: Fail speechrecognition_test/supported: Fail -svg_3_test: Fail -svgelement_test/additionalConstructors: Fail -svgelement2_test: Fail +svg_test/supported_externalResourcesRequired: Fail +svg_test/supported_langSpace: Fail typed_arrays_arraybuffer_test: Fail url_test: Fail fileapi_test: Skip # Timeout. @@ -268,10 +300,8 @@ media_stream_test/supported_MediaStreamTrackEvent: Fail notifications_test/supported: Fail shadow_dom_test/supported: Fail speechrecognition_test/supported: Fail -# Interfaces not implemented: SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable -svg_3_test: Fail -svgelement_test/additionalConstructors: Fail -svgelement2_test: Fail +svg_test/supported_externalResourcesRequired: Fail +svg_test/supported_langSpace: Fail touchevent_test/supported: Fail transferables_test: Fail # Issue 3392. webgl_1_test: Pass, Fail # Issue 8219 @@ -300,4 +330,3 @@ isolates_test: Skip # Timeout because leg does not support web workers. [ $compiler == dart2js && $runtime == ff ] inner_frame_test: Skip # Timeout -svg_3_test: Skip # Timeout diff --git a/tests/html/svg_1_test.dart b/tests/html/svg_1_test.dart deleted file mode 100644 index d5033c4fb3f..00000000000 --- a/tests/html/svg_1_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -library SVG1Test; -import '../../pkg/unittest/lib/unittest.dart'; -import '../../pkg/unittest/lib/html_config.dart'; -import 'dart:html'; -import 'dart:svg' as svg; - -// Test that SVG is present in dart:html API - -main() { - useHtmlConfiguration(); - - var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement'); - - test('simpleRect', () { - var div = new Element.tag('div'); - document.body.nodes.add(div); - div.innerHtml = r''' - - - - -'''; - - var e = document.query('#svg1'); - expect(e, isNotNull); - - svg.RectElement r = document.query('#rect1'); - expect(r.x.baseVal.value, 10); - expect(r.y.baseVal.value, 20); - expect(r.height.baseVal.value, 40); - expect(r.width.baseVal.value, 130); - expect(r.rx.baseVal.value, 5); - }); - - test('trailing newline', () { - // Ensures that we handle SVG with trailing newlines. - var logo = new svg.SvgElement.svg(""" - - - - """); - - expect(logo, isSvgElement); - - }); -} diff --git a/tests/html/svg_2_test.dart b/tests/html/svg_2_test.dart deleted file mode 100644 index b2c4547ad4d..00000000000 --- a/tests/html/svg_2_test.dart +++ /dev/null @@ -1,65 +0,0 @@ -library SVG2Test; -import '../../pkg/unittest/lib/unittest.dart'; -import '../../pkg/unittest/lib/html_config.dart'; -import 'dart:html'; -import 'dart:svg' as svg; - -// Test that SVG elements explicitly implement the IDL interfaces (is-checks -// only, see SVGTest3 for behavioural tests). - -main() { - - insertTestDiv() { - var element = new Element.tag('div'); - element.innerHtml = r''' - - - -'''; - document.body.nodes.add(element); - return element; - } - - useHtmlConfiguration(); - - var isElement = predicate((x) => x is Element, 'is an Element'); - var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement'); - var isSvgSvgElement = - predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement'); - var isNode = predicate((x) => x is Node, 'is a Node'); - var isSvgTests = predicate((x) => x is svg.Tests, 'is a svg.Tests'); - var isSvgLangSpace = predicate((x) => x is svg.LangSpace, 'is a svg.LangSpace'); - var isSvgExternalResourcesRequired = - predicate((x) => x is svg.ExternalResourcesRequired, - 'is a svg.ExternalResourcesRequired'); - var isSvgTransformable = - predicate((x) => x is svg.Transformable, 'is a svg.Transformable'); - var isSvgLocatable = - predicate((x) => x is svg.Locatable, 'is a svg.Locatable'); - var isSvgNumber = predicate((x) => x is svg.Number, 'is a svg.Number'); - var isSvgRect = predicate((x) => x is svg.Rect, 'is a svg.Rect'); - - test('rect_isChecks', () { - var div = insertTestDiv(); - var r = document.query('#rect1'); - - // Direct inheritance chain - expect(r, isSvgElement); - expect(r, isElement); - expect(r, isNode); - - // Other implemented interfaces. - expect(r, isSvgTests); - expect(r, isSvgLangSpace); - expect(r, isSvgExternalResourcesRequired); - expect(r, isSvgTransformable); - expect(r, isSvgLocatable); - - // Interfaces not implemented. - expect(r, isNot(isSvgNumber)); - expect(r, isNot(isSvgRect)); - expect(r, isNot(isSvgSvgElement)); - - div.remove(); - }); -} diff --git a/tests/html/svg_3_test.dart b/tests/html/svg_3_test.dart deleted file mode 100644 index 91e2eee02c9..00000000000 --- a/tests/html/svg_3_test.dart +++ /dev/null @@ -1,129 +0,0 @@ -library SVG3Test; -import '../../pkg/unittest/lib/unittest.dart'; -import '../../pkg/unittest/lib/html_config.dart'; -import 'dart:html'; -import 'dart:svg' as svg; - -// Test that SVG elements have the operations advertised through all the IDL -// interfaces. This is a 'duck typing' test, and does not explicitly use 'is' -// checks on the expected interfaces (that is in SVGTest2). - -main() { - - var isString = predicate((x) => x is String, 'is a String'); - var isStringList = predicate((x) => x is List, 'is a List'); - var isSvgMatrix = predicate((x) => x is svg.Matrix, 'is a svg.Matrix'); - var isSvgAnimatedBoolean = - predicate((x) => x is svg.AnimatedBoolean, 'is an svg.AnimatedBoolean'); - var isSvgAnimatedString = - predicate((x) => x is svg.AnimatedString, 'is an svg.AnimatedString'); - var isSvgRect = predicate((x) => x is svg.Rect, 'is a svg.Rect'); - var isSvgAnimatedTransformList = - predicate((x) => x is svg.AnimatedTransformList, - 'is an svg.AnimatedTransformList'); - var isCssStyleDeclaration = - predicate((x) => x is CssStyleDeclaration, 'is a CssStyleDeclaration'); - var isCssValue = predicate((x) => x is CssValue, 'is a CssValue'); - - insertTestDiv() { - var element = new Element.tag('div'); - element.innerHtml = r''' - - - -'''; - document.body.nodes.add(element); - return element; - } - - useHtmlConfiguration(); - - /** - * Verifies that [e] supports the operations on the svg.Tests interface. - */ - checkSvgTests(e) { - // Just check that the operations seem to exist. - var rx = e.requiredExtensions; - expect(rx, isStringList); - var rf = e.requiredFeatures; - expect(rf, isStringList); - var sl = e.systemLanguage; - expect(sl, isStringList); - - bool hasDoDo = e.hasExtension("DoDo"); - expect(hasDoDo, isFalse); - } - - /** - * Verifies that [e] supports the operations on the svg.LangSpace interface. - */ - checkSvgLangSpace(e) { - // Just check that the attribtes seem to exist. - var lang = e.xmllang; - e.xmllang = lang; - - String space = e.xmlspace; - e.xmlspace = space; - - expect(lang, isString); - expect(space, isString); - } - - /** - * Verifies that [e] supports the operations on the - * svg.ExternalResourcesRequired interface. - */ - checkSvgExternalResourcesRequired(e) { - var b = e.externalResourcesRequired; - expect(b, isSvgAnimatedBoolean); - expect(b.baseVal, isFalse); - expect(b.animVal, isFalse); - } - - /** - * Verifies that [e] supports the operations on the svg.Locatable interface. - */ - checkSvgLocatable(e) { - var v1 = e.farthestViewportElement; - var v2 = e.nearestViewportElement; - expect(v1, same(v2)); - - var bbox = e.getBBox(); - expect(bbox, isSvgRect); - - var ctm = e.getCtm(); - expect(ctm, isSvgMatrix); - - var sctm = e.getScreenCtm(); - expect(sctm, isSvgMatrix); - - var xf2e = e.getTransformToElement(e); - expect(xf2e, isSvgMatrix); - } - - /** - * Verifies that [e] supports the operations on the svg.Transformable - * interface. - */ - checkSvgTransformable(e) { - var trans = e.transform; - expect(trans, isSvgAnimatedTransformList); - } - - testRect(name, checker) { - test(name, () { - var div = insertTestDiv(); - var r = document.query('#rect1'); - checker(r); - div.remove(); - }); - } - - testRect('rect_SvgTests', checkSvgTests); - testRect('rect_SvgLangSpace', checkSvgLangSpace); - testRect('rect_SvgExternalResourcesRequired', - checkSvgExternalResourcesRequired); - testRect('rect_SvgLocatable', checkSvgLocatable); - testRect('rect_SvgTransformable', checkSvgTransformable); - -} diff --git a/tests/html/svg_test.dart b/tests/html/svg_test.dart new file mode 100644 index 00000000000..0c6071271a2 --- /dev/null +++ b/tests/html/svg_test.dart @@ -0,0 +1,247 @@ +// Copyright (c) 2013, 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. + +library SVGTest; +import '../../pkg/unittest/lib/unittest.dart'; +import '../../pkg/unittest/lib/html_individual_config.dart'; +import 'dart:html'; +import 'dart:svg' as svg; + +main() { + useHtmlIndividualConfiguration(); + + group('svgPresence', () { + var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement'); + + test('simpleRect', () { + var div = new Element.tag('div'); + document.body.nodes.add(div); + div.innerHtml = r''' + + + + +'''; + + var e = document.query('#svg1'); + expect(e, isNotNull); + + svg.RectElement r = document.query('#rect1'); + expect(r.x.baseVal.value, 10); + expect(r.y.baseVal.value, 20); + expect(r.height.baseVal.value, 40); + expect(r.width.baseVal.value, 130); + expect(r.rx.baseVal.value, 5); + }); + + test('trailing newline', () { + // Ensures that we handle SVG with trailing newlines. + var logo = new svg.SvgElement.svg(""" + + + + """); + + expect(logo, isSvgElement); + + }); + }); + + group('svgInterfaceMatch', () { + // Test that SVG elements explicitly implement the IDL interfaces (is-checks + // only, see SVGTest3 for behavioural tests). + insertTestDiv() { + var element = new Element.tag('div'); + element.innerHtml = r''' + + + +'''; + document.body.nodes.add(element); + return element; + } + + + var isElement = predicate((x) => x is Element, 'is an Element'); + var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement'); + var isSvgSvgElement = + predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement'); + var isNode = predicate((x) => x is Node, 'is a Node'); + var isSvgTests = predicate((x) => x is svg.Tests, 'is a svg.Tests'); + var isSvgLangSpace = predicate((x) => x is svg.LangSpace, 'is a svg.LangSpace'); + var isSvgExternalResourcesRequired = + predicate((x) => x is svg.ExternalResourcesRequired, + 'is a svg.ExternalResourcesRequired'); + var isSvgTransformable = + predicate((x) => x is svg.Transformable, 'is a svg.Transformable'); + var isSvgLocatable = + predicate((x) => x is svg.Locatable, 'is a svg.Locatable'); + var isSvgNumber = predicate((x) => x is svg.Number, 'is a svg.Number'); + var isSvgRect = predicate((x) => x is svg.Rect, 'is a svg.Rect'); + + test('rect_isChecks', () { + var div = insertTestDiv(); + var r = document.query('#rect1'); + + // Direct inheritance chain + expect(r, isSvgElement); + expect(r, isElement); + expect(r, isNode); + + // Other implemented interfaces. + expect(r, isSvgTests); + expect(r, isSvgLangSpace); + expect(r, isSvgExternalResourcesRequired); + expect(r, isSvgTransformable); + expect(r, isSvgLocatable); + + // Interfaces not implemented. + expect(r, isNot(isSvgNumber)); + expect(r, isNot(isSvgRect)); + expect(r, isNot(isSvgSvgElement)); + + div.remove(); + }); + }); + + insertTestDiv() { + var element = new Element.tag('div'); + element.innerHtml = r''' + + + +'''; + document.body.nodes.add(element); + return element; + } + + group('supported_externalResourcesRequired', () { + test('supported', () { + var div = insertTestDiv(); + var r = document.query('#rect1'); + expect(svg.ExternalResourcesRequired.supported(r), true); + div.remove(); + }); + }); + + group('supported_langSpace', () { + test('supported', () { + var div = insertTestDiv(); + var r = document.query('#rect1'); + expect(svg.LangSpace.supported(r), true); + div.remove(); + }); + }); + + group('svgBehavioral', () { + + // Test that SVG elements have the operations advertised through all the IDL + // interfaces. This is a 'duck typing' test, and does not explicitly use + // 'is' checks on the expected interfaces (that is in the test group above). + + var isString = predicate((x) => x is String, 'is a String'); + var isStringList = predicate((x) => x is List, 'is a List'); + var isSvgMatrix = predicate((x) => x is svg.Matrix, 'is a svg.Matrix'); + var isSvgAnimatedBoolean = + predicate((x) => x is svg.AnimatedBoolean, 'is an svg.AnimatedBoolean'); + var isSvgAnimatedString = + predicate((x) => x is svg.AnimatedString, 'is an svg.AnimatedString'); + var isSvgRect = predicate((x) => x is svg.Rect, 'is a svg.Rect'); + var isSvgAnimatedTransformList = + predicate((x) => x is svg.AnimatedTransformList, + 'is an svg.AnimatedTransformList'); + var isCssStyleDeclaration = + predicate((x) => x is CssStyleDeclaration, 'is a CssStyleDeclaration'); + var isCssValue = predicate((x) => x is CssValue, 'is a CssValue'); + + /// Verifies that [e] supports the operations on the svg.Tests interface. + checkSvgTests(e) { + // Just check that the operations seem to exist. + var rx = e.requiredExtensions; + expect(rx, isStringList); + var rf = e.requiredFeatures; + expect(rf, isStringList); + var sl = e.systemLanguage; + expect(sl, isStringList); + + bool hasDoDo = e.hasExtension("DoDo"); + expect(hasDoDo, isFalse); + } + + /// Verifies that [e] supports the operations on the svg.Locatable interface. + checkSvgLocatable(e) { + var v1 = e.farthestViewportElement; + var v2 = e.nearestViewportElement; + expect(v1, same(v2)); + + var bbox = e.getBBox(); + expect(bbox, isSvgRect); + + var ctm = e.getCtm(); + expect(ctm, isSvgMatrix); + + var sctm = e.getScreenCtm(); + expect(sctm, isSvgMatrix); + + var xf2e = e.getTransformToElement(e); + expect(xf2e, isSvgMatrix); + } + + /** + * Verifies that [e] supports the operations on the svg.Transformable + * interface. + */ + checkSvgTransformable(e) { + var trans = e.transform; + expect(trans, isSvgAnimatedTransformList); + } + + testRect(name, checker) { + test(name, () { + var div = insertTestDiv(); + var r = document.query('#rect1'); + checker(r); + div.remove(); + }); + } + + /** + * Verifies that [e] supports the operations on the svg.LangSpace interface. + */ + checkSvgLangSpace(e) { + if (svg.LangSpace.supported(e)) { + // Just check that the attributes seem to exist. + var lang = e.xmllang; + e.xmllang = lang; + + String space = e.xmlspace; + e.xmlspace = space; + + expect(lang, isString); + expect(space, isString); + } + } + + /** + * Verifies that [e] supports the operations on the + * svg.ExternalResourcesRequired interface. + */ + checkSvgExternalResourcesRequired(e) { + if (svg.ExternalResourcesRequired.supported(e)) { + var b = e.externalResourcesRequired; + expect(b, isSvgAnimatedBoolean); + expect(b.baseVal, isFalse); + expect(b.animVal, isFalse); + } + } + + testRect('rect_SvgTests', checkSvgTests); + testRect('rect_SvgLangSpace', checkSvgLangSpace); + testRect('rect_SvgExternalResourcesRequired', + checkSvgExternalResourcesRequired); + testRect('rect_SvgLocatable', checkSvgLocatable); + testRect('rect_SvgTransformable', checkSvgTransformable); + }); + +} diff --git a/tests/html/svgelement2_test.dart b/tests/html/svgelement2_test.dart index 468b61a4016..15ded5ce5ed 100644 --- a/tests/html/svgelement2_test.dart +++ b/tests/html/svgelement2_test.dart @@ -4,7 +4,7 @@ library SVGElement2Test; import '../../pkg/unittest/lib/unittest.dart'; -import '../../pkg/unittest/lib/html_config.dart'; +import '../../pkg/unittest/lib/html_individual_config.dart'; import 'svgelement_test.dart' as originalTest; class A { @@ -13,9 +13,13 @@ class A { } main() { - // The svgelement_test requires the field "_this" to map to "_this". In this - // test-case we use another library's '_this' first (see issue 3039 and - // _ChildNodeListLazy.first). - expect(new A(499)._this, 499); - originalTest.main(); + useHtmlIndividualConfiguration(); + + group('supported', () { + // The svgelement_test requires the field "_this" to map to "_this". In this + // test-case we use another library's '_this' first (see issue 3039 and + // _ChildNodeListLazy.first). + expect(new A(499)._this, 499); + originalTest.main(); + }); } diff --git a/tests/html/svgelement_test.dart b/tests/html/svgelement_test.dart index 333bca8f001..52787a2f8cb 100644 --- a/tests/html/svgelement_test.dart +++ b/tests/html/svgelement_test.dart @@ -27,126 +27,316 @@ main() { return out; }; - testConstructor(String tagName, Function isExpectedClass) { + testConstructor(String tagName, Function isExpectedClass, + [bool expectation = true]) { test(tagName, () { - expect(isExpectedClass(new svg.SvgElement.tag(tagName)), isTrue); + expect(isExpectedClass(new svg.SvgElement.tag(tagName)), expectation); expect(isExpectedClass( - new svg.SvgElement.svg('<$tagName>')), isTrue); + new svg.SvgElement.svg('<$tagName>')), expectation); }); } group('additionalConstructors', () { - group('svg', () { - test('valid', () { - final svgContent = """ + test('valid', () { + final svgContent = """ """; - final el = new svg.SvgElement.svg(svgContent); - expect(el, isSvgSvgElement); - expect(el.innerHtml, ""); - expect(el.outerHtml, svgContent); - }); - - test('has no parent', () => - expect(new svg.SvgElement.svg('').parent, isNull) - ); - - test('empty', () { - expect(() => new svg.SvgElement.svg(""), throwsArgumentError); - }); - - test('too many elements', () { - expect(() => new svg.SvgElement.svg(""), - throwsArgumentError); - }); + final el = new svg.SvgElement.svg(svgContent); + expect(el, isSvgSvgElement); + expect(el.innerHtml, anyOf("", '')); + expect(el.outerHtml, anyOf(svgContent, + '\n ' + '\n \n')); + }); + + test('has no parent', () => + expect(new svg.SvgElement.svg('').parent, isNull) + ); + + test('empty', () { + expect(() => new svg.SvgElement.svg(""), throwsArgumentError); + }); + + test('too many elements', () { + expect(() => new svg.SvgElement.svg(""), + throwsArgumentError); + }); + }); + + // Unfortunately, because the filtering mechanism in unitttest is a regex done + group('supported_altGlyph', () { + test('supported', () { + expect(svg.AltGlyphElement.supported, true); + }); + }); + + group('supported_animate', () { + test('supported', () { + expect(svg.AnimateElement.supported, true); + }); + }); + + group('supported_animateMotion', () { + test('supported', () { + expect(svg.AnimateMotionElement.supported, true); + }); + }); + + group('supported_animateTransform', () { + test('supported', () { + expect(svg.AnimateTransformElement.supported, true); + }); + }); + + group('supported_feBlend', () { + test('supported', () { + expect(svg.FEBlendElement.supported, true); + }); + }); + + group('supported_feColorMatrix', () { + test('supported', () { + expect(svg.FEColorMatrixElement.supported, true); + }); + }); + + group('supported_feComponentTransfer', () { + test('supported', () { + expect(svg.FEComponentTransferElement.supported, true); + }); + }); + + group('supported_feConvolveMatrix', () { + test('supported', () { + expect(svg.FEConvolveMatrixElement.supported, true); + }); + }); + + group('supported_feDiffuseLighting', () { + test('supported', () { + expect(svg.FEDiffuseLightingElement.supported, true); + }); + }); + + group('supported_feDisplacementMap', () { + test('supported', () { + expect(svg.FEDisplacementMapElement.supported, true); + }); + }); + + group('supported_feDistantLight', () { + test('supported', () { + expect(svg.FEDistantLightElement.supported, true); + }); + }); + + group('supported_feFlood', () { + test('supported', () { + expect(svg.FEFloodElement.supported, true); + }); + }); + + group('supported_feFuncA', () { + test('supported', () { + expect(svg.FEFuncAElement.supported, true); + }); + }); + + group('supported_feFuncB', () { + test('supported', () { + expect(svg.FEFuncBElement.supported, true); + }); + }); + + group('supported_feFuncG', () { + test('supported', () { + expect(svg.FEFuncGElement.supported, true); + }); + }); + + group('supported_feFuncR', () { + test('supported', () { + expect(svg.FEFuncRElement.supported, true); + }); + }); + + group('supported_feGaussianBlur', () { + test('supported', () { + expect(svg.FEGaussianBlurElement.supported, true); + }); + }); + + group('supported_feImage', () { + test('supported', () { + expect(svg.FEImageElement.supported, true); + }); + }); + + group('supported_feMerge', () { + test('supported', () { + expect(svg.FEMergeElement.supported, true); + }); + }); + + group('supported_feMergeNode', () { + test('supported', () { + expect(svg.FEMergeNodeElement.supported, true); + }); + }); + + group('supported_feOffset', () { + test('supported', () { + expect(svg.FEOffsetElement.supported, true); + }); + }); + + group('supported_feComponentTransfer', () { + test('supported', () { + expect(svg.FEPointLightElement.supported, true); + }); + }); + + group('supported_feSpecularLighting', () { + test('supported', () { + expect(svg.FESpecularLightingElement.supported, true); + }); + }); + + group('supported_feComponentTransfer', () { + test('supported', () { + expect(svg.FESpotLightElement.supported, true); + }); + }); + + group('supported_feTile', () { + test('supported', () { + expect(svg.FETileElement.supported, true); + }); + }); + + group('supported_feTurbulence', () { + test('supported', () { + expect(svg.FETurbulenceElement.supported, true); + }); + }); + + group('supported_filter', () { + test('supported', () { + expect(svg.FilterElement.supported, true); + }); + }); + + group('supported_foreignObject', () { + test('supported', () { + expect(svg.ForeignObjectElement.supported, true); + }); + }); + + group('supported_set', () { + test('supported', () { + expect(svg.SetElement.supported, true); }); - testConstructor('altGlyphDef', (e) => e is svg.AltGlyphDefElement); - testConstructor('altGlyph', (e) => e is svg.AltGlyphElement); - testConstructor('animateColor', (e) => e is svg.AnimateColorElement); - testConstructor('animate', (e) => e is svg.AnimateElement); - // WebKit doesn't recognize animateMotion - // testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement); - testConstructor('animateTransform', (e) => e is svg.AnimateTransformElement); - testConstructor('cursor', (e) => e is svg.CursorElement); - testConstructor('feBlend', (e) => e is svg.FEBlendElement); - testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement); - testConstructor('feComponentTransfer', - (e) => e is svg.FEComponentTransferElement); - testConstructor('feConvolveMatrix', (e) => e is svg.FEConvolveMatrixElement); - testConstructor('feDiffuseLighting', - (e) => e is svg.FEDiffuseLightingElement); - testConstructor('feDisplacementMap', - (e) => e is svg.FEDisplacementMapElement); - testConstructor('feDistantLight', (e) => e is svg.FEDistantLightElement); - testConstructor('feDropShadow', (e) => e is svg.FEDropShadowElement); - testConstructor('feFlood', (e) => e is svg.FEFloodElement); - testConstructor('feFuncA', (e) => e is svg.FEFuncAElement); - testConstructor('feFuncB', (e) => e is svg.FEFuncBElement); - testConstructor('feFuncG', (e) => e is svg.FEFuncGElement); - testConstructor('feFuncR', (e) => e is svg.FEFuncRElement); - testConstructor('feGaussianBlur', (e) => e is svg.FEGaussianBlurElement); - testConstructor('feImage', (e) => e is svg.FEImageElement); - testConstructor('feMerge', (e) => e is svg.FEMergeElement); - testConstructor('feMergeNode', (e) => e is svg.FEMergeNodeElement); - testConstructor('feOffset', (e) => e is svg.FEOffsetElement); - testConstructor('fePointLight', (e) => e is svg.FEPointLightElement); - testConstructor('feSpecularLighting', - (e) => e is svg.FESpecularLightingElement); - testConstructor('feSpotLight', (e) => e is svg.FESpotLightElement); - testConstructor('feTile', (e) => e is svg.FETileElement); - testConstructor('feTurbulence', (e) => e is svg.FETurbulenceElement); - testConstructor('filter', (e) => e is svg.FilterElement); - testConstructor('font', (e) => e is svg.FontElement); - testConstructor('font-face', (e) => e is svg.FontFaceElement); - testConstructor('font-face-format', (e) => e is svg.FontFaceFormatElement); - testConstructor('font-face-name', (e) => e is svg.FontFaceNameElement); - testConstructor('font-face-src', (e) => e is svg.FontFaceSrcElement); - testConstructor('font-face-uri', (e) => e is svg.FontFaceUriElement); - testConstructor('foreignObject', (e) => e is svg.ForeignObjectElement); - testConstructor('glyph', (e) => e is svg.GlyphElement); - testConstructor('glyphRef', (e) => e is svg.GlyphRefElement); - testConstructor('metadata', (e) => e is svg.MetadataElement); - testConstructor('missing-glyph', (e) => e is svg.MissingGlyphElement); - testConstructor('set', (e) => e is svg.SetElement); - testConstructor('tref', (e) => e is svg.TRefElement); - testConstructor('vkern', (e) => e is svg.VKernElement); }); group('constructors', () { - testConstructor('a', (e) => e is svg.AElement); - testConstructor('circle', (e) => e is svg.CircleElement); - testConstructor('clipPath', (e) => e is svg.ClipPathElement); - testConstructor('defs', (e) => e is svg.DefsElement); - testConstructor('desc', (e) => e is svg.DescElement); - testConstructor('ellipse', (e) => e is svg.EllipseElement); - testConstructor('g', (e) => e is svg.GElement); - // WebKit doesn't recognize hkern - // testConstructor('hkern', (e) => e is svg.HKernElement); - testConstructor('image', (e) => e is svg.ImageElement); - testConstructor('line', (e) => e is svg.LineElement); - testConstructor('linearGradient', (e) => e is svg.LinearGradientElement); - // WebKit doesn't recognize mpath - // testConstructor('mpath', (e) => e is svg.MPathElement); - testConstructor('marker', (e) => e is svg.MarkerElement); - testConstructor('mask', (e) => e is svg.MaskElement); - testConstructor('path', (e) => e is svg.PathElement); - testConstructor('pattern', (e) => e is svg.PatternElement); - testConstructor('polygon', (e) => e is svg.PolygonElement); - testConstructor('polyline', (e) => e is svg.PolylineElement); - testConstructor('radialGradient', (e) => e is svg.RadialGradientElement); - testConstructor('rect', (e) => e is svg.RectElement); - testConstructor('script', (e) => e is svg.ScriptElement); - testConstructor('stop', (e) => e is svg.StopElement); - testConstructor('style', (e) => e is svg.StyleElement); - testConstructor('switch', (e) => e is svg.SwitchElement); - testConstructor('symbol', (e) => e is svg.SymbolElement); - testConstructor('tspan', (e) => e is svg.TSpanElement); - testConstructor('text', (e) => e is svg.TextElement); - testConstructor('textPath', (e) => e is svg.TextPathElement); - testConstructor('title', (e) => e is svg.TitleElement); - testConstructor('use', (e) => e is svg.UseElement); - testConstructor('view', (e) => e is svg.ViewElement); + test('supported', () { + testConstructor('a', (e) => e is svg.AElement); + testConstructor('circle', (e) => e is svg.CircleElement); + testConstructor('clipPath', (e) => e is svg.ClipPathElement); + testConstructor('defs', (e) => e is svg.DefsElement); + testConstructor('desc', (e) => e is svg.DescElement); + testConstructor('ellipse', (e) => e is svg.EllipseElement); + testConstructor('g', (e) => e is svg.GElement); + testConstructor('image', (e) => e is svg.ImageElement); + testConstructor('line', (e) => e is svg.LineElement); + testConstructor('linearGradient', (e) => e is svg.LinearGradientElement); + testConstructor('marker', (e) => e is svg.MarkerElement); + testConstructor('mask', (e) => e is svg.MaskElement); + testConstructor('path', (e) => e is svg.PathElement); + testConstructor('pattern', (e) => e is svg.PatternElement); + testConstructor('polygon', (e) => e is svg.PolygonElement); + testConstructor('polyline', (e) => e is svg.PolylineElement); + testConstructor('radialGradient', (e) => e is svg.RadialGradientElement); + testConstructor('rect', (e) => e is svg.RectElement); + testConstructor('script', (e) => e is svg.ScriptElement); + testConstructor('stop', (e) => e is svg.StopElement); + testConstructor('style', (e) => e is svg.StyleElement); + testConstructor('switch', (e) => e is svg.SwitchElement); + testConstructor('symbol', (e) => e is svg.SymbolElement); + testConstructor('tspan', (e) => e is svg.TSpanElement); + testConstructor('text', (e) => e is svg.TextElement); + testConstructor('textPath', (e) => e is svg.TextPathElement); + testConstructor('title', (e) => e is svg.TitleElement); + testConstructor('use', (e) => e is svg.UseElement); + testConstructor('view', (e) => e is svg.ViewElement); + testConstructor('altGlyph', (e) => e is svg.AltGlyphElement, + svg.AltGlyphElement.supported); + testConstructor('animate', (e) => e is svg.AnimateElement, + svg.AnimateElement.supported); + testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement, + svg.AnimateMotionElement.supported); + testConstructor('animateTransform', (e) => e is svg.AnimateTransformElement, + svg.AnimateTransformElement.supported); + testConstructor('feBlend', (e) => e is svg.FEBlendElement, + svg.FEBlendElement.supported); + testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement, + svg.FEColorMatrixElement.supported); + testConstructor('feComponentTransfer', + (e) => e is svg.FEComponentTransferElement, + svg.FEComponentTransferElement.supported); + testConstructor('feConvolveMatrix', + (e) => e is svg.FEConvolveMatrixElement, + svg.FEConvolveMatrixElement.supported); + testConstructor('feDiffuseLighting', + (e) => e is svg.FEDiffuseLightingElement, + svg.FEDiffuseLightingElement.supported); + testConstructor('feDisplacementMap', + (e) => e is svg.FEDisplacementMapElement, + svg.FEDisplacementMapElement.supported); + testConstructor('feDistantLight', (e) => e is svg.FEDistantLightElement, + svg.FEDistantLightElement.supported); + testConstructor('feFlood', (e) => e is svg.FEFloodElement, + svg.FEFloodElement.supported); + testConstructor('feFuncA', (e) => e is svg.FEFuncAElement, + svg.FEFuncAElement.supported); + testConstructor('feFuncB', (e) => e is svg.FEFuncBElement, + svg.FEFuncBElement.supported); + testConstructor('feFuncG', (e) => e is svg.FEFuncGElement, + svg.FEFuncGElement.supported); + testConstructor('feFuncR', (e) => e is svg.FEFuncRElement, + svg.FEFuncRElement.supported); + testConstructor('feGaussianBlur', (e) => e is svg.FEGaussianBlurElement, + svg.FEGaussianBlurElement.supported); + testConstructor('feImage', (e) => e is svg.FEImageElement, + svg.FEImageElement.supported); + testConstructor('feMerge', (e) => e is svg.FEMergeElement, + svg.FEMergeElement.supported); + testConstructor('feMergeNode', (e) => e is svg.FEMergeNodeElement, + svg.FEMergeNodeElement.supported); + testConstructor('feOffset', (e) => e is svg.FEOffsetElement, + svg.FEOffsetElement.supported); + testConstructor('fePointLight', (e) => e is svg.FEPointLightElement, + svg.FEPointLightElement.supported); + testConstructor('feSpecularLighting', + (e) => e is svg.FESpecularLightingElement, + svg.FESpecularLightingElement.supported); + testConstructor('feSpotLight', (e) => e is svg.FESpotLightElement, + svg.FESpotLightElement.supported); + testConstructor('feTile', (e) => e is svg.FETileElement, + svg.FETileElement.supported); + testConstructor('feTurbulence', (e) => e is svg.FETurbulenceElement, + svg.FETurbulenceElement.supported); + testConstructor('filter', (e) => e is svg.FilterElement, + svg.FilterElement.supported); + testConstructor('foreignObject', (e) => e is svg.ForeignObjectElement, + svg.ForeignObjectElement.supported); + testConstructor('metadata', (e) => e is svg.MetadataElement); + testConstructor('set', (e) => e is svg.SetElement, + svg.SetElement.supported); + }); }); group('outerHtml', () { diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py index 65694934863..8e09d8fd218 100644 --- a/tools/dom/scripts/generator.py +++ b/tools/dom/scripts/generator.py @@ -26,10 +26,8 @@ _pure_interfaces = set([ 'MediaQueryListListener', 'MutationCallback', 'NodeSelector', - 'SVGExternalResourcesRequired', 'SVGFilterPrimitiveStandardAttributes', 'SVGFitToViewBox', - 'SVGLangSpace', 'SVGLocatable', 'SVGTests', 'SVGTransformable', @@ -654,12 +652,6 @@ dart2js_annotations = { ], } -# Placeholder to add experimental flag, implementation for this is -# pending in a separate CL. -dart_annotations = { - 'Element.webkitMatchesSelector': ['@Experimental'], -} - _indexed_db_annotations = [ "@SupportedBrowser(SupportedBrowser.CHROME)", "@SupportedBrowser(SupportedBrowser.FIREFOX, '15')", @@ -687,6 +679,12 @@ _webkit_experimental_annotations = [ _history_annotations = _all_but_ie9_annotations +_no_ie_annotations = [ + "@SupportedBrowser(SupportedBrowser.CHROME)", + "@SupportedBrowser(SupportedBrowser.FIREFOX)", + "@SupportedBrowser(SupportedBrowser.SAFARI)", +] + _performance_annotations = [ "@SupportedBrowser(SupportedBrowser.CHROME)", "@SupportedBrowser(SupportedBrowser.FIREFOX)", @@ -698,6 +696,8 @@ _speech_recognition_annotations = [ "@Experimental", ] +_svg_annotations = _all_but_ie9_annotations; + _web_sql_annotations = [ "@SupportedBrowser(SupportedBrowser.CHROME)", "@SupportedBrowser(SupportedBrowser.SAFARI)", @@ -734,6 +734,9 @@ dart_annotations = { 'DOMWindow.webkitNotifications': _webkit_experimental_annotations, 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, + # Placeholder to add experimental flag, implementation for this is + # pending in a separate CL. + 'Element.webkitMatchesSelector': ['@Experimental()'], 'Element.webkitCreateShadowRoot': [ "@SupportedBrowser(SupportedBrowser.CHROME, '25')", "@Experimental", @@ -759,21 +762,9 @@ dart_annotations = { "@SupportedBrowser(SupportedBrowser.SAFARI)", ], 'HTMLKeygenElement': _webkit_experimental_annotations, - 'HTMLMeterElement': [ - "@SupportedBrowser(SupportedBrowser.CHROME)", - "@SupportedBrowser(SupportedBrowser.FIREFOX)", - "@SupportedBrowser(SupportedBrowser.SAFARI)", - ], - 'HTMLObjectElement': [ - "@SupportedBrowser(SupportedBrowser.CHROME)", - "@SupportedBrowser(SupportedBrowser.FIREFOX)", - "@SupportedBrowser(SupportedBrowser.SAFARI)", - ], - 'HTMLOutputElement': [ - "@SupportedBrowser(SupportedBrowser.CHROME)", - "@SupportedBrowser(SupportedBrowser.FIREFOX)", - "@SupportedBrowser(SupportedBrowser.SAFARI)", - ], + 'HTMLMeterElement': _no_ie_annotations, + 'HTMLObjectElement': _no_ie_annotations, + 'HTMLOutputElement': _no_ie_annotations, 'HTMLProgressElement': _all_but_ie9_annotations, 'HTMLShadowElement': [ "@SupportedBrowser(SupportedBrowser.CHROME, '25')", @@ -804,6 +795,36 @@ dart_annotations = { 'SpeechRecognitionError': _speech_recognition_annotations, 'SpeechRecognitionEvent': _speech_recognition_annotations, 'SpeechRecognitionResult': _speech_recognition_annotations, + 'SVGAltGlyphElement': _no_ie_annotations, + 'SVGAnimateElement': _no_ie_annotations, + 'SVGAnimateMotionElement': _no_ie_annotations, + 'SVGAnimateTransformElement': _no_ie_annotations, + 'SVGFEBlendElement': _svg_annotations, + 'SVGFEColorMatrixElement': _svg_annotations, + 'SVGFEComponentTransferElement': _svg_annotations, + 'SVGFEConvolveMatrixElement': _svg_annotations, + 'SVGFEDiffuseLightingElement': _svg_annotations, + 'SVGFEDisplacementMapElement': _svg_annotations, + 'SVGFEDistantLightElement': _svg_annotations, + 'SVGFEFloodElement': _svg_annotations, + 'SVGFEFuncAElement': _svg_annotations, + 'SVGFEFuncBElement': _svg_annotations, + 'SVGFEFuncGElement': _svg_annotations, + 'SVGFEFuncRElement': _svg_annotations, + 'SVGFEGaussianBlurElement': _svg_annotations, + 'SVGFEImageElement': _svg_annotations, + 'SVGFEMergeElement': _svg_annotations, + 'SVGFEMergeNodeElement': _svg_annotations, + 'SVGFEMorphology': _svg_annotations, + 'SVGFEOffsetElement': _svg_annotations, + 'SVGFEPointLightElement': _svg_annotations, + 'SVGFESpecularLightingElement': _svg_annotations, + 'SVGFESpotLightElement': _svg_annotations, + 'SVGFETileElement': _svg_annotations, + 'SVGFETurbulenceElement': _svg_annotations, + 'SVGFilterElement': _svg_annotations, + 'SVGForeignObjectElement': _no_ie_annotations, + 'SVGSetElement': _no_ie_annotations, 'SQLTransaction': _web_sql_annotations, 'SQLTransactionSync': _web_sql_annotations, 'WebGLRenderingContext': _webgl_annotations, diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py index 5d18f07d233..20b7d936eca 100644 --- a/tools/dom/scripts/htmldartgenerator.py +++ b/tools/dom/scripts/htmldartgenerator.py @@ -32,11 +32,16 @@ class HtmlDartGenerator(object): def EmitSupportCheck(self): if self.HasSupportCheck(): - support_check = self.GetSupportCheck() + check = self.GetSupportCheck() + if type(check) != tuple: + signature = 'get supported' + else: + signature = check[0] + check = check[1] self._members_emitter.Emit('\n' ' /// Checks if this type is supported on the current platform.\n' - ' static bool get supported => $SUPPORT_CHECK;\n', - SUPPORT_CHECK=support_check) + ' static bool $SIGNATURE => $SUPPORT_CHECK;\n', + SIGNATURE=signature, SUPPORT_CHECK=check) def EmitEventGetter(self, events_class_name): self._members_emitter.Emit( diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py index 6fb4c86d603..69b90af774e 100644 --- a/tools/dom/scripts/htmlrenamer.py +++ b/tools/dom/scripts/htmlrenamer.py @@ -16,15 +16,7 @@ html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { 'DOMFormData': 'FormData', 'DOMURL': 'Url', 'DOMWindow': 'Window', - 'HTMLAppletElement' : '_AppletElement', - 'HTMLBaseFontElement' : '_BaseFontElement', - 'HTMLDirectoryElement' : '_DirectoryElement', 'HTMLDocument' : 'HtmlDocument', - 'HTMLFontElement' : '_FontElement', - 'HTMLFrameElement' : '_FrameElement', - 'HTMLFrameSetElement' : '_FrameSetElement', - 'HTMLMarqueeElement' : '_MarqueeElement', - 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. 'NavigatorUserMediaErrorCallback': '_NavigatorUserMediaErrorCallback', 'NavigatorUserMediaSuccessCallback': '_NavigatorUserMediaSuccessCallback', @@ -46,6 +38,42 @@ html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { 'XMLHttpRequestUpload': 'HttpRequestUpload', }) +# Interfaces that are suppressed, but need to still exist for Dartium and to +# properly wrap DOM objects if/when encountered. +_removed_html_interfaces = [ + 'HTMLAppletElement', + 'HTMLBaseFontElement', + 'HTMLDirectoryElement', + 'HTMLFontElement', + 'HTMLFrameElement', + 'HTMLFrameSetElement', + 'HTMLMarqueeElement', + 'IDBAny', + 'SVGAltGlyphDefElement', # Webkit only. + 'SVGAltGlyphItemElement', # Webkit only. + 'SVGAnimateColorElement', # Deprecated. Use AnimateElement instead. + 'SVGComponentTransferFunctionElement', # Currently not supported anywhere. + 'SVGCursorElement', # Webkit only. + 'SVGGradientElement', # Currently not supported anywhere. + 'SVGFEDropShadowElement', # Webkit only for the following: + 'SVGFontElement', + 'SVGFontFaceElement', + 'SVGFontFaceFormatElement', + 'SVGFontFaceNameElement', + 'SVGFontFaceSrcElement', + 'SVGFontFaceUriElement', + 'SVGGlyphElement', + 'SVGGlyphRefElement', + 'SVGHKernElement', + 'SVGMissingGlyphElement', + 'SVGMPathElement', + 'SVGTRefElement', + 'SVGVKernElement', +] + +for interface in _removed_html_interfaces: + html_interface_renames[interface] = '_' + interface + # Members from the standard dom that should not be exposed publicly in dart:html # but need to be exposed internally to implement dart:html on top of a standard # browser. diff --git a/tools/dom/scripts/monitored.py b/tools/dom/scripts/monitored.py index aa265022685..e90330ae7c6 100644 --- a/tools/dom/scripts/monitored.py +++ b/tools/dom/scripts/monitored.py @@ -29,6 +29,9 @@ class Dict(MonitoredCollection): self._used_keys.add(key) return self._map[key] + def __setitem__(self, key, value): + self._map[key] = value + def __contains__(self, key): self._used_keys.add(key) return key in self._map diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py index 36cf9e55d2a..14e22858470 100644 --- a/tools/dom/scripts/systemhtml.py +++ b/tools/dom/scripts/systemhtml.py @@ -69,40 +69,6 @@ _js_custom_members = set([ 'WorkerContext.indexedDB', ]) -js_support_checks = { - 'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')", - 'Database': "JS('bool', '!!(window.openDatabase)')", - 'DOMApplicationCache': "JS('bool', '!!(window.applicationCache)')", - 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", - 'HashChangeEvent': "Event._isTypeSupported('HashChangeEvent')", - 'HTMLContentElement': "Element.isTagSupported('content')", - 'HTMLDataListElement': "Element.isTagSupported('datalist')", - 'HTMLDetailsElement': "Element.isTagSupported('details')", - 'HTMLEmbedElement': "Element.isTagSupported('embed')", - # IE creates keygen as Block elements - 'HTMLKeygenElement': "Element.isTagSupported('keygen') " - "&& (new Element.tag('keygen') is KeygenElement)", - 'HTMLMeterElement': "Element.isTagSupported('meter')", - 'HTMLObjectElement': "Element.isTagSupported('object')", - 'HTMLOutputElement': "Element.isTagSupported('output')", - 'HTMLProgressElement': "Element.isTagSupported('progress')", - 'HTMLShadowElement': "Element.isTagSupported('shadow')", - 'HTMLTrackElement': "Element.isTagSupported('track')", - 'MediaStreamEvent': "Event._isTypeSupported('MediaStreamEvent')", - 'MediaStreamTrackEvent': "Event._isTypeSupported('MediaStreamTrackEvent')", - 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", - 'Performance': "JS('bool', '!!(window.performance)')", - 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " - "window.webkitSpeechRecognition)')", - 'XMLHttpRequestProgressEvent': - "Event._isTypeSupported('XMLHttpRequestProgressEvent')", - 'WebGLRenderingContext': "JS('bool', '!!(window.WebGLRenderingContext)')", - 'WebKitCSSMatrix': "JS('bool', '!!(window.WebKitCSSMatrix)')", - 'WebKitPoint': "JS('bool', '!!(window.WebKitPoint)')", - 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", - 'XSLTProcessor': "JS('bool', '!!(window.XSLTProcessor)')", -} - # Classes that offer only static methods, and therefore we should suppress # constructor creation. _static_classes = set(['Url']) @@ -140,122 +106,139 @@ class ElementConstructorInfo(object): return info _html_element_constructors = { - 'AnchorElement' : + 'HTMLAnchorElement' : ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]), - 'AreaElement': 'area', - 'ButtonElement': 'button', - 'BRElement': 'br', - 'BaseElement': 'base', - 'BodyElement': 'body', - 'ButtonElement': 'button', - 'CanvasElement': + 'HTMLAreaElement': 'area', + 'HTMLButtonElement': 'button', + 'HTMLBRElement': 'br', + 'HTMLBaseElement': 'base', + 'HTMLBodyElement': 'body', + 'HTMLButtonElement': 'button', + 'HTMLCanvasElement': ElementConstructorInfo(tag='canvas', opt_params=[('int', 'width'), ('int', 'height')]), - 'ContentElement': 'content', - 'DataListElement': 'datalist', - 'DListElement': 'dl', - 'DetailsElement': 'details', - 'DivElement': 'div', - 'EmbedElement': 'embed', - 'FieldSetElement': 'fieldset', - 'FormElement': 'form', - 'HRElement': 'hr', - 'HeadElement': 'head', - 'HeadingElement': [ElementConstructorInfo('h1'), + 'HTMLContentElement': 'content', + 'HTMLDataListElement': 'datalist', + 'HTMLDListElement': 'dl', + 'HTMLDetailsElement': 'details', + 'HTMLDivElement': 'div', + 'HTMLEmbedElement': 'embed', + 'HTMLFieldSetElement': 'fieldset', + 'HTMLFormElement': 'form', + 'HTMLHRElement': 'hr', + 'HTMLHeadElement': 'head', + 'HTMLHeadingElement': [ElementConstructorInfo('h1'), ElementConstructorInfo('h2'), ElementConstructorInfo('h3'), ElementConstructorInfo('h4'), ElementConstructorInfo('h5'), ElementConstructorInfo('h6')], - 'HtmlElement': 'html', - 'IFrameElement': 'iframe', - 'ImageElement': + 'HTMLHtmlElement': 'html', + 'HTMLIFrameElement': 'iframe', + 'HTMLImageElement': ElementConstructorInfo(tag='img', opt_params=[('DOMString', 'src'), ('int', 'width'), ('int', 'height')]), - 'KeygenElement': 'keygen', - 'LIElement': 'li', - 'LabelElement': 'label', - 'LegendElement': 'legend', - 'LinkElement': 'link', - 'MapElement': 'map', - 'MenuElement': 'menu', - 'MeterElement': 'meter', - 'OListElement': 'ol', - 'ObjectElement': 'object', - 'OptGroupElement': 'optgroup', - 'OutputElement': 'output', - 'ParagraphElement': 'p', - 'ParamElement': 'param', - 'PreElement': 'pre', - 'ProgressElement': 'progress', - 'ScriptElement': 'script', - 'SelectElement': 'select', - 'SourceElement': 'source', - 'SpanElement': 'span', - 'StyleElement': 'style', - 'TableCaptionElement': 'caption', - 'TableCellElement': 'td', - 'TableColElement': 'col', - 'TableElement': 'table', - 'TableRowElement': 'tr', - #'TableSectionElement' - 'TextAreaElement': 'textarea', - 'TitleElement': 'title', - 'TrackElement': 'track', - 'UListElement': 'ul', - 'VideoElement': 'video' + 'HTMLKeygenElement': 'keygen', + 'HTMLLIElement': 'li', + 'HTMLLabelElement': 'label', + 'HTMLLegendElement': 'legend', + 'HTMLLinkElement': 'link', + 'HTMLMapElement': 'map', + 'HTMLMenuElement': 'menu', + 'HTMLMeterElement': 'meter', + 'HTMLOListElement': 'ol', + 'HTMLObjectElement': 'object', + 'HTMLOptGroupElement': 'optgroup', + 'HTMLOutputElement': 'output', + 'HTMLParagraphElement': 'p', + 'HTMLParamElement': 'param', + 'HTMLPreElement': 'pre', + 'HTMLProgressElement': 'progress', + 'HTMLScriptElement': 'script', + 'HTMLSelectElement': 'select', + 'HTMLSourceElement': 'source', + 'HTMLSpanElement': 'span', + 'HTMLStyleElement': 'style', + 'HTMLTableCaptionElement': 'caption', + 'HTMLTableCellElement': 'td', + 'HTMLTableColElement': 'col', + 'HTMLTableElement': 'table', + 'HTMLTableRowElement': 'tr', + #'HTMLTableSectionElement' + 'HTMLTextAreaElement': 'textarea', + 'HTMLTitleElement': 'title', + 'HTMLTrackElement': 'track', + 'HTMLUListElement': 'ul', + 'HTMLVideoElement': 'video' } _svg_element_constructors = { - 'AElement': 'a', - 'AnimateColorElement': 'animateColor', - 'AnimateElement': 'animate', - 'AnimateMotionElement': 'animateMotion', - 'AnimateTransformElement': 'animateTransform', - 'AnimationElement': 'animation', - 'CircleElement': 'circle', - 'ClipPathElement': 'clipPath', - 'CursorElement': 'cursor', - 'DefsElement': 'defs', - 'DescElement': 'desc', - 'EllipseElement': 'ellipse', - 'FilterElement': 'filter', - 'FontElement': 'font', - 'FontFaceElement': 'font-face', - 'FontFaceFormatElement': 'font-face-format', - 'FontFaceNameElement': 'font-face-name', - 'FontFaceSrcElement': 'font-face-src', - 'FontFaceUriElement': 'font-face-uri', - 'ForeignObjectElement': 'foreignObject', - 'GlyphElement': 'glyph', - 'GElement': 'g', - 'HKernElement': 'hkern', - 'ImageElement': 'image', - 'LinearGradientElement': 'linearGradient', - 'LineElement': 'line', - 'MarkerElement': 'marker', - 'MaskElement': 'mask', - 'MPathElement': 'mpath', - 'PathElement': 'path', - 'PatternElement': 'pattern', - 'PolygonElement': 'polygon', - 'PolylineElement': 'polyline', - 'RadialGradientElement': 'radialGradient', - 'RectElement': 'rect', - 'ScriptElement': 'script', - 'SetElement': 'set', - 'StopElement': 'stop', - 'StyleElement': 'style', - 'SwitchElement': 'switch', - 'SymbolElement': 'symbol', - 'TextElement': 'text', - 'TitleElement': 'title', - 'TRefElement': 'tref', - 'TSpanElement': 'tspan', - 'UseElement': 'use', - 'ViewElement': 'view', - 'VKernElement': 'vkern', + 'SVGAElement': 'a', + 'SVGAltGlyphElement': 'altGlyph', + 'SVGAnimateElement': 'animate', + 'SVGAnimateMotionElement': 'animateMotion', + 'SVGAnimateTransformElement': 'animateTransform', + 'SVGAnimationElement': 'animation', + 'SVGCircleElement': 'circle', + 'SVGClipPathElement': 'clipPath', + 'SVGCursorElement': 'cursor', + 'SVGDefsElement': 'defs', + 'SVGDescElement': 'desc', + 'SVGEllipseElement': 'ellipse', + 'SVGFEBlendElement': 'feBlend', + 'SVGFEColorMatrixElement': 'feColorMatrix', + 'SVGFEComponentTransferElement': 'feComponentTransfer', + 'SVGFEConvolveMatrixElement': 'feConvolveMatrix', + 'SVGFEDiffuseLightingElement': 'feDiffuseLighting', + 'SVGFEDisplacementMapElement': 'feDisplacementMap', + 'SVGFEDistantLightElement': 'feDistantLight', + 'SVGFEFloodElement': 'feFlood', + 'SVGFEFuncAElement': 'feFuncA', + 'SVGFEFuncBElement': 'feFuncB', + 'SVGFEFuncGElement': 'feFuncG', + 'SVGFEFuncRElement': 'feFuncR', + 'SVGFEGaussianBlurElement': 'feGaussianBlur', + 'SVGFEImageElement': 'feImage', + 'SVGFEMergeElement': 'feMerge', + 'SVGFEMergeNodeElement': 'feMergeNode', + 'SVGFEMorphology': 'feMorphology', + 'SVGFEOffsetElement': 'feOffset', + 'SVGFEPointLightElement': 'fePointLight', + 'SVGFESpecularLightingElement': 'feSpecularLighting', + 'SVGFESpotLightElement': 'feSpotLight', + 'SVGFETileElement': 'feTile', + 'SVGFETurbulenceElement': 'feTurbulence', + 'SVGFilterElement': 'filter', + 'SVGForeignObjectElement': 'foreignObject', + 'SVGGlyphElement': 'glyph', + 'SVGGElement': 'g', + 'SVGHKernElement': 'hkern', + 'SVGImageElement': 'image', + 'SVGLinearGradientElement': 'linearGradient', + 'SVGLineElement': 'line', + 'SVGMarkerElement': 'marker', + 'SVGMaskElement': 'mask', + 'SVGMPathElement': 'mpath', + 'SVGPathElement': 'path', + 'SVGPatternElement': 'pattern', + 'SVGPolygonElement': 'polygon', + 'SVGPolylineElement': 'polyline', + 'SVGRadialGradientElement': 'radialGradient', + 'SVGRectElement': 'rect', + 'SVGScriptElement': 'script', + 'SVGSetElement': 'set', + 'SVGStopElement': 'stop', + 'SVGStyleElement': 'style', + 'SVGSwitchElement': 'switch', + 'SVGSymbolElement': 'symbol', + 'SVGTextElement': 'text', + 'SVGTitleElement': 'title', + 'SVGTRefElement': 'tref', + 'SVGTSpanElement': 'tspan', + 'SVGUseElement': 'use', + 'SVGViewElement': 'view', + 'SVGVKernElement': 'vkern', } _element_constructors = { @@ -300,6 +283,94 @@ def ElementConstructorInfos(typename, element_constructors, return infos # ------------------------------------------------------------------------------ +def SvgSupportStr(tagName): + return 'Svg%s' % ElemSupportStr(tagName) + +def ElemSupportStr(tagName): + return "Element.isTagSupported('%s')" % tagName + +_js_support_checks_basic_element = [ + 'HTMLContentElement', + 'HTMLDataListElement', + 'HTMLDetailsElement', + 'HTMLEmbedElement', + 'HTMLMeterElement', + 'HTMLObjectElement', + 'HTMLOutputElement', + 'HTMLProgressElement', + 'HTMLTrackElement', +] + +_js_support_checks_additional_element = [ + # IE creates keygen as Block elements + 'HTMLKeygenElement', + 'SVGAltGlyphElement', + 'SVGAnimateElement', + 'SVGAnimateMotionElement', + 'SVGAnimateTransformElement', + 'SVGCursorElement', + 'SVGFEBlendElement', + 'SVGFEColorMatrixElement', + 'SVGFEComponentTransferElement', + 'SVGFEConvolveMatrixElement', + 'SVGFEDiffuseLightingElement', + 'SVGFEDisplacementMapElement', + 'SVGFEDistantLightElement', + 'SVGFEFloodElement', + 'SVGFEFuncAElement', + 'SVGFEFuncBElement', + 'SVGFEFuncGElement', + 'SVGFEFuncRElement', + 'SVGFEGaussianBlurElement', + 'SVGFEImageElement', + 'SVGFEMergeElement', + 'SVGFEMergeNodeElement', + 'SVGFEMorphology', + 'SVGFEOffsetElement', + 'SVGFEPointLightElement', + 'SVGFESpecularLightingElement', + 'SVGFESpotLightElement', + 'SVGFETileElement', + 'SVGFETurbulenceElement', + 'SVGFilterElement', + 'SVGForeignObjectElement', + 'SVGSetElement', +] + +js_support_checks = dict({ + 'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')", + 'Database': "JS('bool', '!!(window.openDatabase)')", + 'DOMApplicationCache': "JS('bool', '!!(window.applicationCache)')", + 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", + 'HashChangeEvent': "Event._isTypeSupported('HashChangeEvent')", + 'HTMLShadowElement': ElemSupportStr('shadow'), + 'MediaStreamEvent': "Event._isTypeSupported('MediaStreamEvent')", + 'MediaStreamTrackEvent': "Event._isTypeSupported('MediaStreamTrackEvent')", + 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", + 'Performance': "JS('bool', '!!(window.performance)')", + 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " + "window.webkitSpeechRecognition)')", + 'SVGExternalResourcesRequired': ('supported(SvgElement element)', + "JS('bool', '#.externalResourcesRequired !== undefined && " + "#.externalResourcesRequired.animVal !== undefined', " + "element, element)"), + 'SVGLangSpace': ('supported(SvgElement element)', + "JS('bool', '#.xmlspace !== undefined && #.xmllang !== undefined', " + "element, element)"), + 'XMLHttpRequestProgressEvent': + "Event._isTypeSupported('XMLHttpRequestProgressEvent')", + 'WebGLRenderingContext': "JS('bool', '!!(window.WebGLRenderingContext)')", + 'WebKitCSSMatrix': "JS('bool', '!!(window.WebKitCSSMatrix)')", + 'WebKitPoint': "JS('bool', '!!(window.WebKitPoint)')", + 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", + 'XSLTProcessor': "JS('bool', '!!(window.XSLTProcessor)')", + }.items() + + dict((key, + SvgSupportStr(_svg_element_constructors[key]) if key.startswith('SVG') + else ElemSupportStr(_html_element_constructors[key])) for key in + _js_support_checks_basic_element + + _js_support_checks_additional_element).items()) +# ------------------------------------------------------------------------------ class HtmlDartInterfaceGenerator(object): """Generates dart interface and implementation for the DOM IDL interface.""" @@ -359,7 +430,7 @@ class HtmlDartInterfaceGenerator(object): factory_provider = interface_name # HTML Elements and SVG Elements have convenience constructors. - infos = ElementConstructorInfos(interface_name, + infos = ElementConstructorInfos(self._interface.id, _element_constructors[self._library_name], factory_provider_name= _factory_ctr_strings[self._library_name]['provider_name']) @@ -521,6 +592,19 @@ class Dart2JSBackend(HtmlDartGenerator): return self._interface.doc_js_name in js_support_checks def GetSupportCheck(self): + """Return a tuple of the support check function signature and the support + test itself. If no parameters are supplied, we assume the default.""" + if self._interface.doc_js_name in _js_support_checks_additional_element: + if self._interface.doc_js_name in _svg_element_constructors: + lib_prefix = 'Svg' + constructors = _svg_element_constructors + else: + lib_prefix = '' + constructors = _html_element_constructors + return (js_support_checks.get(self._interface.doc_js_name) + + " && (new %sElement.tag('%s') is %s)" % (lib_prefix, + constructors[self._interface.doc_js_name], + self._renamer.RenameInterface(self._interface))) return js_support_checks.get(self._interface.doc_js_name) def GenerateCustomFactory(self, constructor_info): diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py index c82e8618cb1..94e700e8d48 100644 --- a/tools/dom/scripts/systemnative.py +++ b/tools/dom/scripts/systemnative.py @@ -235,7 +235,11 @@ class DartiumBackend(HtmlDartGenerator): def GetSupportCheck(self): # Assume that everything is supported on Dartium. - return 'true' + value = js_support_checks.get(self._interface.doc_js_name) + if type(value) == tuple: + return value + else: + return 'true' def FinishInterface(self): self._GenerateCPPHeader() diff --git a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate index 42ad4508420..86c34093a90 100644 --- a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate +++ b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate @@ -111,5 +111,14 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { throw new UnsupportedError("Cannot invoke click SVG."); } + /** + * Checks to see if the SVG element type is supported by the current platform. + * + * The tag should be a valid SVG element tag name. + */ + static bool isTagSupported(String tag) { + var e = new $CLASSNAME.tag(tag); + return e is $CLASSNAME && !(e is UnknownElement); + } $!MEMBERS }