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

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

Issue 1123173003: Another try at appendHtml and insertAdjacentHtml should be consistently sanitized (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 'Document.webkitFullscreenElement', 230 'Document.webkitFullscreenElement',
231 'Document.webkitFullscreenEnabled', 231 'Document.webkitFullscreenEnabled',
232 'Document.webkitHidden', 232 'Document.webkitHidden',
233 'Document.webkitIsFullScreen', 233 'Document.webkitIsFullScreen',
234 'Document.webkitVisibilityState', 234 'Document.webkitVisibilityState',
235 235
236 'Element.children', 236 'Element.children',
237 'Element.childElementCount', 237 'Element.childElementCount',
238 'Element.firstElementChild', 238 'Element.firstElementChild',
239 'Element.getElementsByTagName', 239 'Element.getElementsByTagName',
240 'Element.insertAdjacentHTML',
240 'Element.scrollIntoView', 241 'Element.scrollIntoView',
241 'Element.scrollIntoViewIfNeeded', 242 'Element.scrollIntoViewIfNeeded',
242 'Element.removeAttribute', 243 'Element.removeAttribute',
243 'Element.removeAttributeNS', 244 'Element.removeAttributeNS',
244 'Element.hasAttribute', 245 'Element.hasAttribute',
245 'Element.hasAttributeNS', 246 'Element.hasAttributeNS',
246 'Element.innerHTML', 247 'Element.innerHTML',
247 'Element.querySelectorAll', 248 'Element.querySelectorAll',
248 # TODO(vsm): These have been converted from int to double in Chrome 36. 249 # TODO(vsm): These have been converted from int to double in Chrome 36.
249 # Special case them so we run on 34, 35, and 36. 250 # Special case them so we run on 34, 35, and 36.
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 1029
1029 # We're looking for a sequence of letters which start with capital letter 1030 # We're looking for a sequence of letters which start with capital letter
1030 # then a series of caps and finishes with either the end of the string or 1031 # then a series of caps and finishes with either the end of the string or
1031 # a capital letter. 1032 # a capital letter.
1032 # The [0-9] check is for names such as 2D or 3D 1033 # The [0-9] check is for names such as 2D or 3D
1033 # The following test cases should match as: 1034 # The following test cases should match as:
1034 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 1035 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
1035 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 1036 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
1036 # IFrameElement: (I)()(F)rameElement (no change) 1037 # IFrameElement: (I)()(F)rameElement (no change)
1037 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 1038 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698