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

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

Issue 11956021: Removing redundant event streams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Suppressing events on classes which are ignored. 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/htmleventgenerator.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/htmlrenamer.py
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index 0561c2777518e52d70f8109a27d5aefef10443c9..8ea9d6190a0084097fa8d6045f19061a61d90d18 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -167,7 +167,7 @@ _renamed_html_members = monitored.Dict('htmlrenamer._renamed_html_members', {
# Members and classes from the dom that should be removed completely from
# dart:html. These could be expressed in the IDL instead but expressing this
# as a simple table instead is more concise.
-# Syntax is: ClassName.(get\.|set\.)?MemberName
+# Syntax is: ClassName.(get\:|set\:|call\:|on\:)?MemberName
# Using get: and set: is optional and should only be used when a getter needs
# to be suppressed but not the setter, etc.
# TODO(jacobr): cleanup and augment this list.
@@ -184,9 +184,9 @@ _removed_html_members = monitored.Set('htmlrenamer._removed_html_members', [
'CanvasRenderingContext2D.setMiterLimit',
'CanvasRenderingContext2D.setShadow',
'CanvasRenderingContext2D.setStrokeColor',
- 'DOMWindow.blur',
+ 'DOMWindow.call:blur',
'DOMWindow.clientInformation',
- 'DOMWindow.focus',
+ 'DOMWindow.call:focus',
'DOMWindow.get:frames',
'DOMWindow.get:length',
'DOMWindow.prompt',
@@ -454,7 +454,7 @@ class HtmlRenamer(object):
"""
interface = self._database.GetInterface(interface_name)
- if self._FindMatch(interface, member, member_prefix, _removed_html_members):
+ if self.ShouldSuppressMember(interface, member, member_prefix):
return None
if 'CheckSecurityForNode' in member_node.ext_attrs:
@@ -472,6 +472,13 @@ class HtmlRenamer(object):
target_name = self._DartifyMemberName(target_name)
return target_name
+ def ShouldSuppressMember(self, interface, member, member_prefix=''):
+ """ Returns true if the member should be suppressed."""
+ if self._FindMatch(interface, member, member_prefix,
+ _removed_html_members):
+ return True
+ return False
+
def _FindMatch(self, interface, member, member_prefix, candidates):
for interface in self._database.Hierarchy(interface):
member_name = interface.id + '.' + member
« no previous file with comments | « tools/dom/scripts/htmleventgenerator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698