| OLD | NEW |
| 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 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { | 9 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { |
| 10 'CDATASection': 'CDataSection', | 10 'CDATASection': 'CDataSection', |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 'WheelEvent.wheelDelta', | 610 'WheelEvent.wheelDelta', |
| 611 'WorkerContext.webkitIndexedDB', | 611 'WorkerContext.webkitIndexedDB', |
| 612 # TODO(jacobr): should these be removed? | 612 # TODO(jacobr): should these be removed? |
| 613 'Document.close', | 613 'Document.close', |
| 614 'Document.hasFocus', | 614 'Document.hasFocus', |
| 615 ]) | 615 ]) |
| 616 | 616 |
| 617 # Manual dart: library name lookup. | 617 # Manual dart: library name lookup. |
| 618 _library_names = monitored.Dict('htmlrenamer._library_names', { | 618 _library_names = monitored.Dict('htmlrenamer._library_names', { |
| 619 'DOMWindow': 'html', | 619 'DOMWindow': 'html', |
| 620 'Database': 'web_sql', |
| 620 'Navigator': 'html', | 621 'Navigator': 'html', |
| 621 'WorkerContext': 'html', | 622 'WorkerContext': 'html', |
| 622 }) | 623 }) |
| 623 | 624 |
| 624 class HtmlRenamer(object): | 625 class HtmlRenamer(object): |
| 625 def __init__(self, database): | 626 def __init__(self, database): |
| 626 self._database = database | 627 self._database = database |
| 627 | 628 |
| 628 def RenameInterface(self, interface): | 629 def RenameInterface(self, interface): |
| 629 if 'Callback' in interface.ext_attrs: | 630 if 'Callback' in interface.ext_attrs: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 698 |
| 698 def GetLibraryName(self, interface): | 699 def GetLibraryName(self, interface): |
| 699 # Some types have attributes merged in from many other interfaces. | 700 # Some types have attributes merged in from many other interfaces. |
| 700 if interface.id in _library_names: | 701 if interface.id in _library_names: |
| 701 return _library_names[interface.id] | 702 return _library_names[interface.id] |
| 702 | 703 |
| 703 # TODO(ager, blois): The conditional has been removed from indexed db, | 704 # TODO(ager, blois): The conditional has been removed from indexed db, |
| 704 # so we can no longer determine the library based on the conditionals. | 705 # so we can no longer determine the library based on the conditionals. |
| 705 if interface.id.startswith("IDB"): | 706 if interface.id.startswith("IDB"): |
| 706 return 'indexed_db' | 707 return 'indexed_db' |
| 708 if interface.id.startswith("SQL"): |
| 709 return 'web_sql' |
| 707 | 710 |
| 708 if 'Conditional' in interface.ext_attrs: | 711 if 'Conditional' in interface.ext_attrs: |
| 709 if 'WEB_AUDIO' in interface.ext_attrs['Conditional']: | 712 if 'WEB_AUDIO' in interface.ext_attrs['Conditional']: |
| 710 return 'web_audio' | 713 return 'web_audio' |
| 711 if 'SVG' in interface.ext_attrs['Conditional']: | 714 if 'SVG' in interface.ext_attrs['Conditional']: |
| 712 return 'svg' | 715 return 'svg' |
| 713 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']: | 716 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']: |
| 714 return 'indexed_db' | 717 return 'indexed_db' |
| 715 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']: | 718 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']: |
| 716 return 'web_sql' | 719 return 'web_sql' |
| (...skipping 27 matching lines...) Expand all Loading... |
| 744 | 747 |
| 745 # We're looking for a sequence of letters which start with capital letter | 748 # We're looking for a sequence of letters which start with capital letter |
| 746 # then a series of caps and finishes with either the end of the string or | 749 # then a series of caps and finishes with either the end of the string or |
| 747 # a capital letter. | 750 # a capital letter. |
| 748 # The [0-9] check is for names such as 2D or 3D | 751 # The [0-9] check is for names such as 2D or 3D |
| 749 # The following test cases should match as: | 752 # The following test cases should match as: |
| 750 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 753 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 751 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 754 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 752 # IFrameElement: (I)()(F)rameElement (no change) | 755 # IFrameElement: (I)()(F)rameElement (no change) |
| 753 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 756 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |