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 re | 5 import re |
6 | 6 |
7 html_interface_renames = { | 7 html_interface_renames = { |
8 'CDATASection': 'CDataSection', | 8 'CDATASection': 'CDataSection', |
9 'DOMApplicationCache': 'ApplicationCache', | 9 'DOMApplicationCache': 'ApplicationCache', |
10 'DOMCoreException': 'DomException', | 10 'DOMCoreException': 'DomException', |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 # Members and classes from the dom that should be removed completely from | 158 # Members and classes from the dom that should be removed completely from |
159 # dart:html. These could be expressed in the IDL instead but expressing this | 159 # dart:html. These could be expressed in the IDL instead but expressing this |
160 # as a simple table instead is more concise. | 160 # as a simple table instead is more concise. |
161 # Syntax is: ClassName.(get\.|set\.)?MemberName | 161 # Syntax is: ClassName.(get\.|set\.)?MemberName |
162 # Using get: and set: is optional and should only be used when a getter needs | 162 # Using get: and set: is optional and should only be used when a getter needs |
163 # to be suppressed but not the setter, etc. | 163 # to be suppressed but not the setter, etc. |
164 # TODO(jacobr): cleanup and augment this list. | 164 # TODO(jacobr): cleanup and augment this list. |
165 _removed_html_members = set([ | 165 _removed_html_members = set([ |
| 166 'AnchorElement.charset', |
| 167 'AnchorElement.coords', |
| 168 'AnchorElement.rev', |
| 169 'AnchorElement.shape', |
166 'AnchorElement.text', | 170 'AnchorElement.text', |
| 171 'AreaElement.noHref', |
167 'Attr.*', | 172 'Attr.*', |
| 173 'BRElement.clear', |
| 174 'BodyElement.aLink', |
| 175 'BodyElement.background', |
| 176 'BodyElement.bgColor', |
| 177 'BodyElement.bgColor', |
| 178 'BodyElement.link', |
168 'BodyElement.text', | 179 'BodyElement.text', |
| 180 'BodyElement.text', |
| 181 'BodyElement.vlink', |
169 'CanvasRenderingContext2D.clearShadow', | 182 'CanvasRenderingContext2D.clearShadow', |
170 'CanvasRenderingContext2D.drawImageFromRect', | 183 'CanvasRenderingContext2D.drawImageFromRect', |
171 'CanvasRenderingContext2D.setAlpha', | 184 'CanvasRenderingContext2D.setAlpha', |
172 'CanvasRenderingContext2D.setCompositeOperation', | 185 'CanvasRenderingContext2D.setCompositeOperation', |
173 'CanvasRenderingContext2D.setFillColor', | 186 'CanvasRenderingContext2D.setFillColor', |
174 'CanvasRenderingContext2D.setLineCap', | 187 'CanvasRenderingContext2D.setLineCap', |
175 'CanvasRenderingContext2D.setLineJoin', | 188 'CanvasRenderingContext2D.setLineJoin', |
176 'CanvasRenderingContext2D.setLineWidth', | 189 'CanvasRenderingContext2D.setLineWidth', |
177 'CanvasRenderingContext2D.setMiterLimit', | 190 'CanvasRenderingContext2D.setMiterLimit', |
178 'CanvasRenderingContext2D.setShadow', | 191 'CanvasRenderingContext2D.setShadow', |
179 'CanvasRenderingContext2D.setStrokeColor', | 192 'CanvasRenderingContext2D.setStrokeColor', |
180 'Cursor.NEXT', | 193 'Cursor.NEXT', |
181 'Cursor.NEXT_NO_DUPLICATE', | 194 'Cursor.NEXT_NO_DUPLICATE', |
182 'Cursor.PREV', | 195 'Cursor.PREV', |
183 'Cursor.PREV_NO_DUPLICATE', | 196 'Cursor.PREV_NO_DUPLICATE', |
| 197 'DListElement.compact', |
184 'DivElement.align', | 198 'DivElement.align', |
185 'Document.adoptNode', | 199 'Document.adoptNode', |
186 'Document.alinkColor', | 200 'Document.alinkColor', |
187 'Document.all', | 201 'Document.all', |
188 'Document.applets', | 202 'Document.applets', |
189 'Document.bgColor', | 203 'Document.bgColor', |
190 'Document.captureEvents', | 204 'Document.captureEvents', |
191 'Document.clear', | 205 'Document.clear', |
192 'Document.createAttribute', | 206 'Document.createAttribute', |
193 'Document.createAttributeNS', | 207 'Document.createAttributeNS', |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 'Element.itemValue', | 270 'Element.itemValue', |
257 'Element.outerText', | 271 'Element.outerText', |
258 'Element.removeAttributeNode', | 272 'Element.removeAttributeNode', |
259 'Element.scrollIntoView', | 273 'Element.scrollIntoView', |
260 'Element.set:outerHTML', | 274 'Element.set:outerHTML', |
261 'Element.setAttributeNode', | 275 'Element.setAttributeNode', |
262 'Element.setAttributeNodeNS', | 276 'Element.setAttributeNodeNS', |
263 'Event.srcElement', | 277 'Event.srcElement', |
264 'EventSource.URL', | 278 'EventSource.URL', |
265 'FormElement.get:elements', | 279 'FormElement.get:elements', |
| 280 'HRElement.align', |
| 281 'HRElement.noShade', |
| 282 'HRElement.size', |
| 283 'HRElement.width', |
266 'HTMLFrameElement.*', | 284 'HTMLFrameElement.*', |
267 'HTMLFrameSetElement.*', | 285 'HTMLFrameSetElement.*', |
268 'HTMLIsIndexElement.*', | 286 'HTMLIsIndexElement.*', |
269 'HTMLOptionsCollection.*', | 287 'HTMLOptionsCollection.*', |
270 'HTMLPropertiesCollection.*', | 288 'HTMLPropertiesCollection.*', |
| 289 'HeadElement.profile', |
| 290 'HeadingElement.align', |
271 'HtmlElement.manifest', | 291 'HtmlElement.manifest', |
272 'HtmlElement.version', | 292 'HtmlElement.version', |
| 293 'HtmlElement.version', |
| 294 'IFrameElement.align', |
| 295 'IFrameElement.frameBorder', |
| 296 'IFrameElement.longDesc', |
| 297 'IFrameElement.marginHeight', |
| 298 'IFrameElement.marginWidth', |
| 299 'IFrameElement.scrolling', |
| 300 'ImageElement.align', |
| 301 'ImageElement.hspace', |
| 302 'ImageElement.longDesc', |
| 303 'ImageElement.name', |
| 304 'ImageElement.vspace', |
| 305 'InputElement.align', |
| 306 'Legend.align', |
| 307 'LinkElement.charset', |
| 308 'LinkElement.rev', |
| 309 'LinkElement.target', |
| 310 'Menu.compact', |
273 'MenuElement.compact', | 311 'MenuElement.compact', |
| 312 'MetaElement.scheme', |
274 'NamedNodeMap.*', | 313 'NamedNodeMap.*', |
275 'Node.compareDocumentPosition', | 314 'Node.compareDocumentPosition', |
276 'Node.get:ATTRIBUTE_NODE', | 315 'Node.get:ATTRIBUTE_NODE', |
277 'Node.get:CDATA_SECTION_NODE', | 316 'Node.get:CDATA_SECTION_NODE', |
278 'Node.get:COMMENT_NODE', | 317 'Node.get:COMMENT_NODE', |
279 'Node.get:DOCUMENT_FRAGMENT_NODE', | 318 'Node.get:DOCUMENT_FRAGMENT_NODE', |
280 'Node.get:DOCUMENT_NODE', | 319 'Node.get:DOCUMENT_NODE', |
281 'Node.get:DOCUMENT_POSITION_CONTAINED_BY', | 320 'Node.get:DOCUMENT_POSITION_CONTAINED_BY', |
282 'Node.get:DOCUMENT_POSITION_CONTAINS', | 321 'Node.get:DOCUMENT_POSITION_CONTAINS', |
283 'Node.get:DOCUMENT_POSITION_DISCONNECTED', | 322 'Node.get:DOCUMENT_POSITION_DISCONNECTED', |
(...skipping 15 matching lines...) Expand all Loading... |
299 'Node.isDefaultNamespace', | 338 'Node.isDefaultNamespace', |
300 'Node.isEqualNode', | 339 'Node.isEqualNode', |
301 'Node.isSameNode', | 340 'Node.isSameNode', |
302 'Node.isSupported', | 341 'Node.isSupported', |
303 'Node.lookupNamespaceURI', | 342 'Node.lookupNamespaceURI', |
304 'Node.lookupPrefix', | 343 'Node.lookupPrefix', |
305 'Node.normalize', | 344 'Node.normalize', |
306 'Node.set:nodeValue', | 345 'Node.set:nodeValue', |
307 'Node.set:prefix', | 346 'Node.set:prefix', |
308 'NodeList.item', | 347 'NodeList.item', |
| 348 'OListElement.compact', |
| 349 'ObjectElement.align', |
| 350 'ObjectElement.archive', |
| 351 'ObjectElement.border', |
| 352 'ObjectElement.codeBase', |
| 353 'ObjectElement.codeType', |
| 354 'ObjectElement.declare', |
| 355 'ObjectElement.hspace', |
| 356 'ObjectElement.standby', |
| 357 'ObjectElement.vspace', |
309 'OptionElement.text', | 358 'OptionElement.text', |
| 359 'ParagraphElement.align', |
| 360 'ParamElement.type', |
| 361 'ParamElement.valueType', |
| 362 'PreElement.width', |
310 'ScriptElement.text', | 363 'ScriptElement.text', |
311 'SelectElement.options', | 364 'SelectElement.options', |
312 'SelectElement.remove', | 365 'SelectElement.remove', |
313 'SelectElement.selectedOptions', | 366 'SelectElement.selectedOptions', |
314 'ShadowRoot.getElementsByTagNameNS', | 367 'ShadowRoot.getElementsByTagNameNS', |
| 368 'TableCaptionElement.align', |
| 369 'TableCellElement.abbr', |
| 370 'TableCellElement.align', |
| 371 'TableCellElement.axis', |
| 372 'TableCellElement.bgColor', |
| 373 'TableCellElement.ch', |
| 374 'TableCellElement.chOff', |
| 375 'TableCellElement.height', |
| 376 'TableCellElement.noWrap', |
| 377 'TableCellElement.scope', |
| 378 'TableCellElement.vAlign', |
| 379 'TableCellElement.width', |
| 380 'TableColElement.align', |
| 381 'TableColElement.ch', |
| 382 'TableColElement.chOff', |
| 383 'TableColElement.vAlign', |
| 384 'TableColElement.width', |
| 385 'TableElement.align', |
| 386 'TableElement.bgColor', |
| 387 'TableElement.cellPadding', |
| 388 'TableElement.cellSpacing', |
| 389 'TableElement.frame', |
| 390 'TableElement.rules', |
| 391 'TableElement.summary', |
| 392 'TableElement.width', |
| 393 'TableRowElement.align', |
| 394 'TableRowElement.bgColor', |
| 395 'TableRowElement.ch', |
| 396 'TableRowElement.chOff', |
| 397 'TableRowElement.vAlign', |
| 398 'TableSectionElement.align', |
| 399 'TableSectionElement.ch', |
| 400 'TableSectionElement.choff', |
| 401 'TableSectionElement.vAlign', |
315 'TitleElement.text', | 402 'TitleElement.text', |
316 'Transaction.READ_ONLY', | 403 'Transaction.READ_ONLY', |
317 'Transaction.READ_WRITE', | 404 'Transaction.READ_WRITE', |
| 405 'UListElement.compact', |
| 406 'UListElement.type', |
318 'WheelEvent.wheelDelta', | 407 'WheelEvent.wheelDelta', |
319 'Window.blur', | 408 'Window.blur', |
320 'Window.clientInformation', | 409 'Window.clientInformation', |
321 'Window.focus', | 410 'Window.focus', |
322 'Window.get:frames', | 411 'Window.get:frames', |
323 'Window.get:length', | 412 'Window.get:length', |
324 'Window.prompt', | 413 'Window.prompt', |
325 'Window.webkitCancelRequestAnimationFrame', | 414 'Window.webkitCancelRequestAnimationFrame', |
326 'Window.webkitIndexedDB', | 415 'Window.webkitIndexedDB', |
327 'WorkerContext.webkitIndexedDB', | 416 'WorkerContext.webkitIndexedDB', |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 501 |
413 # We're looking for a sequence of letters which start with capital letter | 502 # We're looking for a sequence of letters which start with capital letter |
414 # then a series of caps and finishes with either the end of the string or | 503 # then a series of caps and finishes with either the end of the string or |
415 # a capital letter. | 504 # a capital letter. |
416 # The [0-9] check is for names such as 2D or 3D | 505 # The [0-9] check is for names such as 2D or 3D |
417 # The following test cases should match as: | 506 # The following test cases should match as: |
418 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 507 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
419 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 508 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
420 # IFrameElement: (I)()(F)rameElement (no change) | 509 # IFrameElement: (I)()(F)rameElement (no change) |
421 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 510 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
OLD | NEW |