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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9109032: Make most native types hidden. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/generated/src/frog/UIEvent.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index db04d4e1da3faccbd74c4532c408ccbc02ba7c15..b0711cfe5102d0e5a083663dc6fb2923f402c4ac 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -116,204 +116,9 @@ _frog_dom_custom_native_specs = {
# DOMWindow aliased with global scope.
'DOMWindow': '@*DOMWindow',
-
- # Temporary hack: make these be 'hidden'.
- 'SVGPathSeg': '*SVGPathSeg',
}
#
-# Publically visible types common across all supported browsers.
-#
-_BROWSER_SHARED_TYPES = [
- 'Attr',
- 'CDATASection',
- 'CSSFontFaceRule',
- 'CSSImportRule',
- 'CSSMediaRule',
- 'CSSPageRule',
- 'CSSRule',
- 'CSSRuleList',
- 'CSSStyleDeclaration',
- 'CSSStyleRule',
- 'CSSStyleSheet',
- 'CanvasRenderingContext2D',
- 'CharacterData',
- 'ClientRect',
- 'ClientRectList',
- 'Comment',
- 'DOMException',
- 'DOMImplementation',
- 'DOMParser',
- 'Document',
- 'DocumentFragment',
- 'DocumentType',
- 'Element',
- 'Event',
- 'EventException',
- 'HTMLAnchorElement',
- 'HTMLAppletElement',
- 'HTMLAreaElement',
- 'HTMLAudioElement',
- 'HTMLBRElement',
- 'HTMLBaseElement',
- 'HTMLBodyElement',
- 'HTMLButtonElement',
- 'HTMLCanvasElement',
- 'HTMLCollection',
- 'HTMLDListElement',
- 'HTMLDirectoryElement',
- 'HTMLDivElement',
- 'HTMLElement',
- 'HTMLEmbedElement',
- 'HTMLFieldSetElement',
- 'HTMLFontElement',
- 'HTMLFormElement',
- 'HTMLFrameElement',
- 'HTMLFrameSetElement',
- 'HTMLHRElement',
- 'HTMLHeadElement',
- 'HTMLHeadingElement',
- 'HTMLHtmlElement',
- 'HTMLIFrameElement',
- 'HTMLImageElement',
- 'HTMLInputElement',
- 'HTMLLIElement',
- 'HTMLLabelElement',
- 'HTMLLegendElement',
- 'HTMLLinkElement',
- 'HTMLMapElement',
- 'HTMLMediaElement',
- 'HTMLMenuElement',
- 'HTMLMetaElement',
- 'HTMLModElement',
- 'HTMLOListElement',
- 'HTMLObjectElement',
- 'HTMLOptGroupElement',
- 'HTMLOptionElement',
- 'HTMLParagraphElement',
- 'HTMLParamElement',
- 'HTMLPreElement',
- 'HTMLQuoteElement',
- 'HTMLScriptElement',
- 'HTMLSelectElement',
- 'HTMLStyleElement',
- 'HTMLTableCaptionElement',
- 'HTMLTableCellElement',
- 'HTMLTableColElement',
- 'HTMLTableElement',
- 'HTMLTableRowElement',
- 'HTMLTableSectionElement',
- 'HTMLTextAreaElement',
- 'HTMLTitleElement',
- 'HTMLUListElement',
- 'HTMLVideoElement',
- 'KeyboardEvent',
- 'MediaError',
- 'MediaList',
- 'MessageEvent',
- 'MouseEvent',
- 'MutationEvent',
- 'NamedNodeMap',
- 'Node',
- 'NodeFilter',
- 'NodeList',
- 'ProcessingInstruction',
- 'Range',
- 'RangeException',
- 'SVGAElement',
- 'SVGAngle',
- 'SVGAnimatedAngle',
- 'SVGAnimatedBoolean',
- 'SVGAnimatedEnumeration',
- 'SVGAnimatedInteger',
- 'SVGAnimatedLength',
- 'SVGAnimatedLengthList',
- 'SVGAnimatedNumber',
- 'SVGAnimatedNumberList',
- 'SVGAnimatedPreserveAspectRatio',
- 'SVGAnimatedRect',
- 'SVGAnimatedString',
- 'SVGAnimatedTransformList',
- 'SVGCircleElement',
- 'SVGClipPathElement',
- 'SVGDefsElement',
- 'SVGDescElement',
- 'SVGElement',
- 'SVGEllipseElement',
- 'SVGException',
- 'SVGGElement',
- 'SVGGradientElement',
- 'SVGImageElement',
- 'SVGLength',
- 'SVGLengthList',
- 'SVGLineElement',
- 'SVGLinearGradientElement',
- 'SVGMarkerElement',
- 'SVGMaskElement',
- 'SVGMatrix',
- 'SVGMetadataElement',
- 'SVGNumber',
- 'SVGNumberList',
- 'SVGPathElement',
- 'SVGPathSeg',
- 'SVGPathSegArcAbs',
- 'SVGPathSegArcRel',
- 'SVGPathSegClosePath',
- 'SVGPathSegCurvetoCubicAbs',
- 'SVGPathSegCurvetoCubicRel',
- 'SVGPathSegCurvetoCubicSmoothAbs',
- 'SVGPathSegCurvetoCubicSmoothRel',
- 'SVGPathSegCurvetoQuadraticAbs',
- 'SVGPathSegCurvetoQuadraticRel',
- 'SVGPathSegCurvetoQuadraticSmoothAbs',
- 'SVGPathSegCurvetoQuadraticSmoothRel',
- 'SVGPathSegLinetoAbs',
- 'SVGPathSegLinetoHorizontalAbs',
- 'SVGPathSegLinetoHorizontalRel',
- 'SVGPathSegLinetoRel',
- 'SVGPathSegLinetoVerticalAbs',
- 'SVGPathSegLinetoVerticalRel',
- 'SVGPathSegList',
- 'SVGPathSegMovetoAbs',
- 'SVGPathSegMovetoRel',
- 'SVGPatternElement',
- 'SVGPoint',
- 'SVGPointList',
- 'SVGPolygonElement',
- 'SVGPolylineElement',
- 'SVGPreserveAspectRatio',
- 'SVGRadialGradientElement',
- 'SVGRect',
- 'SVGRectElement',
- 'SVGSVGElement',
- 'SVGScriptElement',
- 'SVGStopElement',
- 'SVGStyleElement',
- 'SVGSwitchElement',
- 'SVGSymbolElement',
- 'SVGTSpanElement',
- 'SVGTextContentElement',
- 'SVGTextElement',
- 'SVGTextPathElement',
- 'SVGTextPositioningElement',
- 'SVGTitleElement',
- 'SVGTransform',
- 'SVGTransformList',
- 'SVGUnitTypes',
- 'SVGUseElement',
- 'SVGZoomEvent',
- 'Storage',
- 'StorageEvent',
- 'StyleSheet',
- 'StyleSheetList',
- 'Text',
- 'TextMetrics',
- 'UIEvent',
- 'XMLHttpRequest',
- 'XMLSerializer',
-]
-
-#
# Simple method substitution when one method had different names on different
# browsers, but are otherwise identical. The alternates are tried in order and
# the first one defined is used.
@@ -2012,17 +1817,10 @@ class FrogInterfaceGenerator(object):
if interface_name in _frog_dom_custom_native_specs:
native_spec = _frog_dom_custom_native_specs[interface_name]
else:
- # Is the type's JavaScript constructor accessible from the global scope?
- # If so, we can directly patch the prototype. We don't really want to do
- # this yet because the dynamic patching mechanism is tricky and we want to
- # test it a lot. But patching is currently broken on FireFox for non-leaf
- # types, so 'hide' only the leaf types.
- is_hidden = interface_name not in _BROWSER_SHARED_TYPES
- if interface_name not in self._interfaces_with_subtypes:
- is_hidden = True
-
- native_spec = '*' if is_hidden else ''
- native_spec += interface_name
+ # Make the class 'hidden' so it is dynamically patched at runtime. This
+ # is useful not only for browser compat, but to allow code that links
+ # against dart:dom to load in a worker isolate.
+ native_spec = '*' + interface_name
# TODO: Include all implemented interfaces, including other Lists.
implements = ''
« no previous file with comments | « client/dom/generated/src/frog/UIEvent.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698