| 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', |
| 11 'DOMApplicationCache': 'ApplicationCache', | 11 'DOMApplicationCache': 'ApplicationCache', |
| 12 'DOMCoreException': 'DomException', | 12 'DOMCoreException': 'DomException', |
| 13 'DOMFileSystem': 'FileSystem', | 13 'DOMFileSystem': 'FileSystem', |
| 14 'DOMFileSystemSync': 'FileSystemSync', | 14 'DOMFileSystemSync': 'FileSystemSync', |
| 15 'DOMFormData': 'FormData', | 15 'DOMFormData': 'FormData', |
| 16 'DOMURL': 'Url', | 16 'DOMURL': 'Url', |
| 17 'DOMWindow': 'Window', | 17 'DOMWindow': 'Window', |
| 18 'HTMLAppletElement' : '_AppletElement', |
| 19 'HTMLBaseFontElement' : '_BaseFontElement', |
| 20 'HTMLDirectoryElement' : '_DirectoryElement', |
| 18 'HTMLDocument' : 'HtmlDocument', | 21 'HTMLDocument' : 'HtmlDocument', |
| 19 'HTMLDirectoryElement' : '_DirectoryElement', | 22 'HTMLFontElement' : '_FontElement', |
| 23 'HTMLFrameElement' : '_FrameElement', |
| 24 'HTMLFrameSetElement' : '_FrameSetElement', |
| 25 'HTMLMarqueeElement' : '_MarqueeElement', |
| 20 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. | 26 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. |
| 21 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. | 27 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. |
| 22 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. | 28 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. |
| 23 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. | 29 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. |
| 24 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. | 30 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. |
| 25 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. | 31 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. |
| 26 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', | 32 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', |
| 27 'WebKitAnimationEvent': 'AnimationEvent', | 33 'WebKitAnimationEvent': 'AnimationEvent', |
| 28 'WebKitCSSKeyframeRule': 'CssKeyframeRule', | 34 'WebKitCSSKeyframeRule': 'CssKeyframeRule', |
| 29 'WebKitCSSKeyframesRule': 'CssKeyframesRule', | 35 'WebKitCSSKeyframesRule': 'CssKeyframesRule', |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 'Document.createProcessingInstruction', | 215 'Document.createProcessingInstruction', |
| 210 'Document.createTreeWalker', | 216 'Document.createTreeWalker', |
| 211 'Document.designMode', | 217 'Document.designMode', |
| 212 'Document.dir', | 218 'Document.dir', |
| 213 'Document.evaluate', | 219 'Document.evaluate', |
| 214 'Document.fgColor', | 220 'Document.fgColor', |
| 215 'Document.get:URL', | 221 'Document.get:URL', |
| 216 'Document.get:anchors', | 222 'Document.get:anchors', |
| 217 'Document.get:characterSet', | 223 'Document.get:characterSet', |
| 218 'Document.get:compatMode', | 224 'Document.get:compatMode', |
| 219 'Document.get:compatMode', | |
| 220 'Document.get:defaultCharset', | 225 'Document.get:defaultCharset', |
| 221 'Document.get:doctype', | 226 'Document.get:doctype', |
| 222 'Document.get:documentURI', | 227 'Document.get:documentURI', |
| 223 'Document.get:embeds', | 228 'Document.get:embeds', |
| 224 'Document.get:forms', | 229 'Document.get:forms', |
| 225 'Document.get:height', | 230 'Document.get:height', |
| 226 'Document.get:inputEncoding', | 231 'Document.get:inputEncoding', |
| 227 'Document.get:links', | 232 'Document.get:links', |
| 228 'Document.get:plugins', | 233 'Document.get:plugins', |
| 229 'Document.get:scripts', | 234 'Document.get:scripts', |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 'Element.set:outerHTML', | 290 'Element.set:outerHTML', |
| 286 'Element.setAttributeNode', | 291 'Element.setAttributeNode', |
| 287 'Element.setAttributeNodeNS', | 292 'Element.setAttributeNodeNS', |
| 288 'Event.srcElement', | 293 'Event.srcElement', |
| 289 'EventSource.URL', | 294 'EventSource.URL', |
| 290 'HTMLAnchorElement.charset', | 295 'HTMLAnchorElement.charset', |
| 291 'HTMLAnchorElement.coords', | 296 'HTMLAnchorElement.coords', |
| 292 'HTMLAnchorElement.rev', | 297 'HTMLAnchorElement.rev', |
| 293 'HTMLAnchorElement.shape', | 298 'HTMLAnchorElement.shape', |
| 294 'HTMLAnchorElement.text', | 299 'HTMLAnchorElement.text', |
| 300 'HTMLAppletElement.*', |
| 295 'HTMLAreaElement.noHref', | 301 'HTMLAreaElement.noHref', |
| 296 'HTMLBRElement.clear', | 302 'HTMLBRElement.clear', |
| 303 'HTMLBaseFontElement.*', |
| 297 'HTMLBodyElement.aLink', | 304 'HTMLBodyElement.aLink', |
| 298 'HTMLBodyElement.background', | 305 'HTMLBodyElement.background', |
| 299 'HTMLBodyElement.bgColor', | 306 'HTMLBodyElement.bgColor', |
| 300 'HTMLBodyElement.bgColor', | |
| 301 'HTMLBodyElement.link', | 307 'HTMLBodyElement.link', |
| 302 'HTMLBodyElement.text', | 308 'HTMLBodyElement.text', |
| 303 'HTMLBodyElement.text', | |
| 304 'HTMLBodyElement.vLink', | 309 'HTMLBodyElement.vLink', |
| 305 'HTMLDListElement.compact', | 310 'HTMLDListElement.compact', |
| 306 'HTMLDirectoryElement.*', | 311 'HTMLDirectoryElement.*', |
| 307 'HTMLDivElement.align', | 312 'HTMLDivElement.align', |
| 313 'HTMLFontElement.*', |
| 308 'HTMLFormElement.get:elements', | 314 'HTMLFormElement.get:elements', |
| 309 'HTMLFrameElement.*', | 315 'HTMLFrameElement.*', |
| 310 'HTMLFrameSetElement.*', | 316 'HTMLFrameSetElement.*', |
| 311 'HTMLHRElement.align', | 317 'HTMLHRElement.align', |
| 312 'HTMLHRElement.noShade', | 318 'HTMLHRElement.noShade', |
| 313 'HTMLHRElement.size', | 319 'HTMLHRElement.size', |
| 314 'HTMLHRElement.width', | 320 'HTMLHRElement.width', |
| 315 'HTMLHeadElement.profile', | 321 'HTMLHeadElement.profile', |
| 316 'HTMLHeadingElement.align', | 322 'HTMLHeadingElement.align', |
| 317 'HTMLHtmlElement.manifest', | 323 'HTMLHtmlElement.manifest', |
| 318 'HTMLHtmlElement.version', | 324 'HTMLHtmlElement.version', |
| 319 'HTMLHtmlElement.version', | |
| 320 'HTMLIFrameElement.align', | 325 'HTMLIFrameElement.align', |
| 321 'HTMLIFrameElement.frameBorder', | 326 'HTMLIFrameElement.frameBorder', |
| 322 'HTMLIFrameElement.longDesc', | 327 'HTMLIFrameElement.longDesc', |
| 323 'HTMLIFrameElement.marginHeight', | 328 'HTMLIFrameElement.marginHeight', |
| 324 'HTMLIFrameElement.marginWidth', | 329 'HTMLIFrameElement.marginWidth', |
| 325 'HTMLIFrameElement.scrolling', | 330 'HTMLIFrameElement.scrolling', |
| 326 'HTMLImageElement.align', | 331 'HTMLImageElement.align', |
| 327 'HTMLImageElement.hspace', | 332 'HTMLImageElement.hspace', |
| 328 'HTMLImageElement.longDesc', | 333 'HTMLImageElement.longDesc', |
| 329 'HTMLImageElement.name', | 334 'HTMLImageElement.name', |
| 330 'HTMLImageElement.vspace', | 335 'HTMLImageElement.vspace', |
| 331 'HTMLInputElement.align', | 336 'HTMLInputElement.align', |
| 332 'HTMLLegendElement.align', | 337 'HTMLLegendElement.align', |
| 333 'HTMLLinkElement.charset', | 338 'HTMLLinkElement.charset', |
| 334 'HTMLLinkElement.rev', | 339 'HTMLLinkElement.rev', |
| 335 'HTMLLinkElement.target', | 340 'HTMLLinkElement.target', |
| 341 'HTMLMarqueeElement.*', |
| 336 'HTMLMenuElement.compact', | 342 'HTMLMenuElement.compact', |
| 337 'HTMLMetaElement.scheme', | 343 'HTMLMetaElement.scheme', |
| 338 'HTMLOListElement.compact', | 344 'HTMLOListElement.compact', |
| 339 'HTMLObjectElement.align', | 345 'HTMLObjectElement.align', |
| 340 'HTMLObjectElement.archive', | 346 'HTMLObjectElement.archive', |
| 341 'HTMLObjectElement.border', | 347 'HTMLObjectElement.border', |
| 342 'HTMLObjectElement.codeBase', | 348 'HTMLObjectElement.codeBase', |
| 343 'HTMLObjectElement.codeType', | 349 'HTMLObjectElement.codeType', |
| 344 'HTMLObjectElement.declare', | 350 'HTMLObjectElement.declare', |
| 345 'HTMLObjectElement.hspace', | 351 'HTMLObjectElement.hspace', |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 522 |
| 517 # We're looking for a sequence of letters which start with capital letter | 523 # We're looking for a sequence of letters which start with capital letter |
| 518 # then a series of caps and finishes with either the end of the string or | 524 # then a series of caps and finishes with either the end of the string or |
| 519 # a capital letter. | 525 # a capital letter. |
| 520 # The [0-9] check is for names such as 2D or 3D | 526 # The [0-9] check is for names such as 2D or 3D |
| 521 # The following test cases should match as: | 527 # The following test cases should match as: |
| 522 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 528 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 523 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 529 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 524 # IFrameElement: (I)()(F)rameElement (no change) | 530 # IFrameElement: (I)()(F)rameElement (no change) |
| 525 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 531 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |