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

Unified Diff: tools/dom/scripts/htmldartgenerator.py

Issue 11887006: Changed @domName annotation in comment to full fledge @DomName annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 11 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 | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 26bda0c719bcc1d5d916c0737d54016d29d6952a..d4c2e8f68907e4b5e5431cc8c5870ed775ace671 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -8,7 +8,7 @@ dart:html APIs from the IDL database."""
from generator import AnalyzeOperation, ConstantOutputOrder, \
DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \
- IsPureInterface, TypeOrNothing
+ IsPureInterface, TypeOrNothing, FindCommonAnnotations
# Types that are accessible cross-frame in a limited fashion.
# In these cases, the base type (e.g., WindowBase) provides restricted access
@@ -40,26 +40,35 @@ class HtmlDartGenerator(object):
def EmitAttributeDocumentation(self, attribute):
""" Emits the MDN dartdoc comment for an attribute.
"""
+
dom_name = DartDomNameOfAttribute(attribute)
- self._members_emitter.Emit('\n /// @domName $DOMINTERFACE.$DOMNAME;'
- ' @docsEditable true',
+
+ annotations = FindCommonAnnotations(dom_name)
+ annotations_str = ''
+ if annotations:
+ annotations_str = '\n' + '\n'.join(annotations)
+ self._members_emitter.Emit('\n /// @docsEditable true',
DOMINTERFACE=attribute.doc_js_interface_name,
- DOMNAME=dom_name)
+ ANNOTATIONS=annotations)
def EmitOperationDocumentation(self, operation):
""" Emits the MDN dartdoc comment for an operation.
"""
- self._members_emitter.Emit('\n /// @domName $DOMINTERFACE.$DOMNAME;'
- ' @docsEditable true',
+
+ annotations = FindCommonAnnotations(operation.name)
+ annotations_str = ''
+ if annotations:
+ annotations_str = '\n' + '\n'.join(annotations)
+ self._members_emitter.Emit('\n /// @docsEditable true',
DOMINTERFACE=operation.overloads[0].doc_js_interface_name,
- DOMNAME=operation.name)
+ ANNOTATIONS=annotations)
def EmitEventGetter(self, events_class_name):
self._members_emitter.Emit(
- '\n /// @domName EventTarget.addEventListener, '
- 'EventTarget.removeEventListener, EventTarget.dispatchEvent;'
- ' @docsEditable true'
- '\n $TYPE get on =>\n new $TYPE(this);\n',
+ "\n /// @docsEditable true"
+ "\n @DomName('EventTarget.addEventListener, "
+ "EventTarget.removeEventListener, EventTarget.dispatchEvent')"
+ "\n $TYPE get on =>\n new $TYPE(this);\n",
TYPE=events_class_name)
def AddMembers(self, interface, declare_only=False):
@@ -293,7 +302,7 @@ class HtmlDartGenerator(object):
def _AddConstructor(self,
constructor_info, factory_name, factory_constructor_name):
- self._members_emitter.Emit('\n ///@docsEditable true');
+ self._members_emitter.Emit('\n /// @docsEditable true');
if not factory_constructor_name:
factory_constructor_name = '_create'
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698