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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.py

Issue 2043503002: Add [CEReactions] IDL attributes for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yukishiino review Created 4 years, 6 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
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 # [Unscopeable] attributes and methods 226 # [Unscopeable] attributes and methods
227 unscopeables = [] 227 unscopeables = []
228 for attribute in interface.attributes: 228 for attribute in interface.attributes:
229 if 'Unscopeable' in attribute.extended_attributes: 229 if 'Unscopeable' in attribute.extended_attributes:
230 unscopeables.append((attribute.name, v8_utilities.runtime_enabled_fu nction_name(attribute))) 230 unscopeables.append((attribute.name, v8_utilities.runtime_enabled_fu nction_name(attribute)))
231 for method in interface.operations: 231 for method in interface.operations:
232 if 'Unscopeable' in method.extended_attributes: 232 if 'Unscopeable' in method.extended_attributes:
233 unscopeables.append((method.name, v8_utilities.runtime_enabled_funct ion_name(method))) 233 unscopeables.append((method.name, v8_utilities.runtime_enabled_funct ion_name(method)))
234 234
235 # [CEReactions]
236 setter_or_deleters = (
237 interface.indexed_property_setter,
238 interface.indexed_property_deleter,
239 interface.named_property_setter,
240 interface.named_property_deleter,
241 )
242 has_ce_reactions = any(setter_or_deleter and 'CEReactions' in setter_or_dele ter.extended_attributes
243 for setter_or_deleter in setter_or_deleters)
244 if has_ce_reactions:
245 includes.add('core/dom/custom/CEReactionsScope.h')
246
235 context.update({ 247 context.update({
236 'constructors': constructors, 248 'constructors': constructors,
237 'has_custom_constructor': bool(custom_constructors), 249 'has_custom_constructor': bool(custom_constructors),
238 'interface_length': 250 'interface_length':
239 interface_length(interface, constructors + custom_constructors), 251 interface_length(interface, constructors + custom_constructors),
240 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor] 252 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor]
241 'named_constructor': named_constructor, 253 'named_constructor': named_constructor,
242 'unscopeables': sorted(unscopeables), 254 'unscopeables': sorted(unscopeables),
243 }) 255 })
244 256
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 1340
1329 def property_setter(setter, interface): 1341 def property_setter(setter, interface):
1330 if not setter: 1342 if not setter:
1331 return None 1343 return None
1332 1344
1333 extended_attributes = setter.extended_attributes 1345 extended_attributes = setter.extended_attributes
1334 idl_type = setter.arguments[1].idl_type 1346 idl_type = setter.arguments[1].idl_type
1335 idl_type.add_includes_for_type(extended_attributes) 1347 idl_type.add_includes_for_type(extended_attributes)
1336 is_call_with_script_state = v8_utilities.has_extended_attribute_value(setter , 'CallWith', 'ScriptState') 1348 is_call_with_script_state = v8_utilities.has_extended_attribute_value(setter , 'CallWith', 'ScriptState')
1337 is_raises_exception = 'RaisesException' in extended_attributes 1349 is_raises_exception = 'RaisesException' in extended_attributes
1350 is_ce_reactions = 'CEReactions' in extended_attributes
1338 1351
1339 # [LegacyInterfaceTypeChecking] 1352 # [LegacyInterfaceTypeChecking]
1340 has_type_checking_interface = ( 1353 has_type_checking_interface = (
1341 not is_legacy_interface_type_checking(interface, setter) and 1354 not is_legacy_interface_type_checking(interface, setter) and
1342 idl_type.is_wrapper_type) 1355 idl_type.is_wrapper_type)
1343 1356
1344 return { 1357 return {
1345 'has_exception_state': (is_raises_exception or 1358 'has_exception_state': (is_raises_exception or
1346 idl_type.v8_conversion_needs_exception_state), 1359 idl_type.v8_conversion_needs_exception_state),
1347 'has_type_checking_interface': has_type_checking_interface, 1360 'has_type_checking_interface': has_type_checking_interface,
1348 'idl_type': idl_type.base_type, 1361 'idl_type': idl_type.base_type,
1349 'is_call_with_script_state': is_call_with_script_state, 1362 'is_call_with_script_state': is_call_with_script_state,
1363 'is_ce_reactions': is_ce_reactions,
1350 'is_custom': 'Custom' in extended_attributes, 1364 'is_custom': 'Custom' in extended_attributes,
1351 'is_nullable': idl_type.is_nullable, 1365 'is_nullable': idl_type.is_nullable,
1352 'is_raises_exception': is_raises_exception, 1366 'is_raises_exception': is_raises_exception,
1353 'name': cpp_name(setter), 1367 'name': cpp_name(setter),
1354 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( 1368 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
1355 extended_attributes, 'v8Value', 'propertyValue'), 1369 extended_attributes, 'v8Value', 'propertyValue'),
1356 } 1370 }
1357 1371
1358 1372
1359 def property_deleter(deleter): 1373 def property_deleter(deleter):
1360 if not deleter: 1374 if not deleter:
1361 return None 1375 return None
1362 1376
1363 extended_attributes = deleter.extended_attributes 1377 extended_attributes = deleter.extended_attributes
1364 idl_type = deleter.idl_type 1378 idl_type = deleter.idl_type
1365 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1379 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1380 is_ce_reactions = 'CEReactions' in extended_attributes
1366 return { 1381 return {
1367 'is_call_with_script_state': is_call_with_script_state, 1382 'is_call_with_script_state': is_call_with_script_state,
1383 'is_ce_reactions': is_ce_reactions,
1368 'is_custom': 'Custom' in extended_attributes, 1384 'is_custom': 'Custom' in extended_attributes,
1369 'is_raises_exception': 'RaisesException' in extended_attributes, 1385 'is_raises_exception': 'RaisesException' in extended_attributes,
1370 'name': cpp_name(deleter), 1386 'name': cpp_name(deleter),
1371 } 1387 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_attributes.py ('k') | third_party/WebKit/Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698