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

Side by Side Diff: tools/dom/scripts/htmlrenamer.py

Issue 54913005: Fixing the BeforeUnloadEvent (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 import logging 5 import logging
6 import monitored 6 import monitored
7 import re 7 import re
8 8
9 typed_array_renames = { 9 typed_array_renames = {
10 'ArrayBuffer': 'ByteBuffer', 10 'ArrayBuffer': 'ByteBuffer',
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 'Element.innerText', 587 'Element.innerText',
588 'Element.on:wheel', 588 'Element.on:wheel',
589 'Element.outerText', 589 'Element.outerText',
590 'Element.removeAttributeNode', 590 'Element.removeAttributeNode',
591 'Element.set:outerHTML', 591 'Element.set:outerHTML',
592 'Element.setAttributeNode', 592 'Element.setAttributeNode',
593 'Element.setAttributeNodeNS', 593 'Element.setAttributeNodeNS',
594 'Element.webkitCreateShadowRoot', 594 'Element.webkitCreateShadowRoot',
595 'Element.webkitPseudo', 595 'Element.webkitPseudo',
596 'Element.webkitShadowRoot', 596 'Element.webkitShadowRoot',
597 'Event.returnValue', 597 '!Event.returnValue',
Emily Fortuna 2013/10/31 22:03:42 accidental?
blois 2013/10/31 22:09:21 Nope- need to suppress returnValue on Event, but n
vsm 2013/10/31 22:15:41 Maybe '=Event' - I think the JS magic function has
blois 2013/10/31 22:36:09 Done.
598 'Event.srcElement', 598 'Event.srcElement',
599 'EventSource.URL', 599 'EventSource.URL',
600 'FontFaceSet.load', 600 'FontFaceSet.load',
601 'FontFaceSet.ready', 601 'FontFaceSet.ready',
602 'HTMLAnchorElement.charset', 602 'HTMLAnchorElement.charset',
603 'HTMLAnchorElement.coords', 603 'HTMLAnchorElement.coords',
604 'HTMLAnchorElement.rev', 604 'HTMLAnchorElement.rev',
605 'HTMLAnchorElement.shape', 605 'HTMLAnchorElement.shape',
606 'HTMLAnchorElement.text', 606 'HTMLAnchorElement.text',
607 'HTMLAppletElement.*', 607 'HTMLAppletElement.*',
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 if self._metadata.IsDeprecated(interface, metadata_member): 838 if self._metadata.IsDeprecated(interface, metadata_member):
839 return True 839 return True
840 return False 840 return False
841 841
842 def ShouldSuppressInterface(self, interface): 842 def ShouldSuppressInterface(self, interface):
843 """ Returns true if the interface should be suppressed.""" 843 """ Returns true if the interface should be suppressed."""
844 if interface.id in _removed_html_interfaces: 844 if interface.id in _removed_html_interfaces:
845 return True 845 return True
846 846
847 def _FindMatch(self, interface, member, member_prefix, candidates): 847 def _FindMatch(self, interface, member, member_prefix, candidates):
848 for interface in self._database.Hierarchy(interface): 848 def find_match(interface_id):
849 member_name = interface.id + '.' + member 849 member_name = interface_id + '.' + member
850 if member_name in candidates: 850 if member_name in candidates:
851 return member_name 851 return member_name
852 member_name = interface.id + '.' + member_prefix + member 852 member_name = interface_id + '.' + member_prefix + member
853 if member_name in candidates: 853 if member_name in candidates:
854 return member_name 854 return member_name
855 member_name = interface.id + '.*' 855 member_name = interface_id + '.*'
856 if member_name in candidates: 856 if member_name in candidates:
857 return member_name 857 return member_name
858 858
859 # Check direct matches first
860 match = find_match('!%s' % interface.id)
861 if match:
862 return match
863
864 for interface in self._database.Hierarchy(interface):
865 match = find_match(interface.id)
866 if match:
867 return match
868
859 def GetLibraryName(self, interface): 869 def GetLibraryName(self, interface):
860 # Some types have attributes merged in from many other interfaces. 870 # Some types have attributes merged in from many other interfaces.
861 if interface.id in _library_names: 871 if interface.id in _library_names:
862 return _library_names[interface.id] 872 return _library_names[interface.id]
863 873
864 # TODO(ager, blois): The conditional has been removed from indexed db, 874 # TODO(ager, blois): The conditional has been removed from indexed db,
865 # so we can no longer determine the library based on the conditionals. 875 # so we can no longer determine the library based on the conditionals.
866 if interface.id.startswith("IDB"): 876 if interface.id.startswith("IDB"):
867 return 'indexed_db' 877 return 'indexed_db'
868 if interface.id.startswith("SQL"): 878 if interface.id.startswith("SQL"):
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 955
946 # We're looking for a sequence of letters which start with capital letter 956 # We're looking for a sequence of letters which start with capital letter
947 # then a series of caps and finishes with either the end of the string or 957 # then a series of caps and finishes with either the end of the string or
948 # a capital letter. 958 # a capital letter.
949 # The [0-9] check is for names such as 2D or 3D 959 # The [0-9] check is for names such as 2D or 3D
950 # The following test cases should match as: 960 # The following test cases should match as:
951 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 961 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
952 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 962 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
953 # IFrameElement: (I)()(F)rameElement (no change) 963 # IFrameElement: (I)()(F)rameElement (no change)
954 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 964 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698