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

Unified Diff: sdk/lib/html/scripts/htmlrenamer.py

Issue 11419300: Dartifying dart:html type names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback. Created 8 years 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
Index: sdk/lib/html/scripts/htmlrenamer.py
diff --git a/sdk/lib/html/scripts/htmlrenamer.py b/sdk/lib/html/scripts/htmlrenamer.py
index 9c43084c8a516ff39cbfbb2a5deb6e99eb3b9fb6..cb6e5e32e2f75c75b12d187c0ff2c5f570684faf 100644
--- a/sdk/lib/html/scripts/htmlrenamer.py
+++ b/sdk/lib/html/scripts/htmlrenamer.py
@@ -5,24 +5,30 @@
import re
html_interface_renames = {
- 'DOMCoreException': 'DOMException',
+ 'CDATASection': 'CDataSection',
+ 'DOMApplicationCache': 'ApplicationCache',
+ 'DOMCoreException': 'DomException',
+ 'DOMFileSystem': 'FileSystem',
+ 'DOMFileSystemSync': 'FileSystemSync',
'DOMFormData': 'FormData',
'DOMURL': 'Url',
'DOMWindow': 'LocalWindow',
'History': 'LocalHistory',
'HTMLDocument' : 'HtmlDocument',
+ 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts.
'Location': 'LocalLocation',
'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts.
'SVGElement': 'SvgElement', # Manual to avoid name conflicts.
'SVGException': 'SvgException', # Manual of avoid conflict with Exception.
'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts.
+ 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject',
'WebKitAnimation': 'Animation',
'WebKitAnimationEvent': 'AnimationEvent',
'WebKitBlobBuilder': 'BlobBuilder',
- 'WebKitCSSKeyframeRule': 'CSSKeyframeRule',
- 'WebKitCSSKeyframesRule': 'CSSKeyframesRule',
- 'WebKitCSSMatrix': 'CSSMatrix',
- 'WebKitCSSTransformValue': 'CSSTransformValue',
+ 'WebKitCSSKeyframeRule': 'CssKeyframeRule',
+ 'WebKitCSSKeyframesRule': 'CssKeyframesRule',
+ 'WebKitCSSMatrix': 'CssMatrix',
+ 'WebKitCSSTransformValue': 'CssTransformValue',
'WebKitFlags': 'Flags',
'WebKitLoseContext': 'LoseContext',
'WebKitPoint': 'Point',
@@ -305,8 +311,10 @@ _removed_html_members = set([
"LocalWindow.get:length",
"LocalWindow.focus",
"LocalWindow.prompt",
+ "LocalWindow.webkitIndexedDB",
"LocalWindow.webkitCancelRequestAnimationFrame",
"WheelEvent.wheelDelta",
+ "WorkerContext.webkitIndexedDB",
])
class HtmlRenamer(object):
@@ -367,6 +375,10 @@ class HtmlRenamer(object):
"""
if idl_type_name.startswith('SVG'):
return 'svg'
+
+ if idl_type_name.startswith('IDB'):
+ return 'indexed_db'
+
if 'Audio' in idl_type_name:
return 'web_audio'
@@ -382,12 +394,11 @@ class HtmlRenamer(object):
def DartifyTypeName(self, type_name):
"""Converts a DOM name to a Dart-friendly class name. """
library_name = self._GetLibraryName(type_name)
- # Only renaming SVG for now.
- if library_name != 'svg':
- return type_name
- # Strip off the SVG prefix.
+ # Strip off any standard prefixes.
name = re.sub(r'^SVG', '', type_name)
+ name = re.sub(r'^IDB', '', name)
+
return self._CamelCaseName(name)
def _DartifyMemberName(self, member_name):

Powered by Google App Engine
This is Rietveld 408576698