Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
scripts.systemhtml Namespace Reference

Classes

class  Dart2JSBackend
 
class  DartLibraries
 
class  DartLibrary
 
class  DartLibraryEmitter
 
class  ElementConstructorInfo
 
class  HtmlDartInterfaceGenerator
 

Functions

 CanUseStaticExtensions (interface, should)
 
 ElementConstructorInfos (typename, element_constructors, factory_provider_name='_Elements')
 
 SvgSupportStr (tagName)
 
 ElemSupportStr (tagName)
 
 _IsPromiseOperationGenerateCall (interface_operation)
 
 _GetPromiseOperationType (interface_operation)
 
 _GetPromiseAttributeType (interface_operation)
 

Variables

 _logger = logging.getLogger('systemhtml')
 
list HTML_LIBRARY_NAMES
 
 _safe_to_ignore_shadowing_members
 
 _js_custom_members
 
 _js_custom_constructors
 
 _static_classes = set(['Url'])
 
 _callback_list_generics_mapping
 
 _html_element_constructors
 
 _svg_element_constructors
 
dict _element_constructors
 
dict _factory_ctr_strings
 
list _js_support_checks_basic_element_with_constructors
 
list _js_support_checks_additional_element
 
 js_support_checks
 
 _js_unreliable_element_factories
 
 promise_attributes
 
 promise_operations
 
 promise_generateCall
 
dict compat_conflicts
 

Detailed Description

This module provides shared functionality for the system to generate
Dart:html APIs from the IDL database.

Function Documentation

◆ _GetPromiseAttributeType()

scripts.systemhtml._GetPromiseAttributeType (   interface_operation)
protected

Definition at line 1251 of file systemhtml.py.

1251def _GetPromiseAttributeType(interface_operation):
1252 if interface_operation in promise_attributes:
1253 return promise_attributes[interface_operation]
1254 return None
1255
1256# Compatibility is used to help determine attribute nullability i.e. if the
1257# attribute is not compatible across all browsers, the getter/setter is marked
1258# as nullable. There are cases where the attribute belongs to a class that
1259# implements an interface whose methods are not in the IDL, however.
1260# Since attribute getters need to match their overridden method declaration,
1261# there are conflicts when the overriding method is not compatible, the
1262# overriding method is, and they're not already nullable. This dict marks the
1263# attributes where there is a conflict that cannot be resolved with code
1264# generation or within src/template files.

◆ _GetPromiseOperationType()

scripts.systemhtml._GetPromiseOperationType (   interface_operation)
protected

Definition at line 1245 of file systemhtml.py.

1245def _GetPromiseOperationType(interface_operation):
1246 if interface_operation in promise_operations:
1247 return promise_operations[interface_operation]
1248 return None
1249
1250

◆ _IsPromiseOperationGenerateCall()

scripts.systemhtml._IsPromiseOperationGenerateCall (   interface_operation)
protected

Definition at line 1241 of file systemhtml.py.

1241def _IsPromiseOperationGenerateCall(interface_operation):
1242 return interface_operation in promise_generateCall
1243
1244

◆ CanUseStaticExtensions()

scripts.systemhtml.CanUseStaticExtensions (   interface,
  should 
)

Definition at line 21 of file systemhtml.py.

21def CanUseStaticExtensions(interface, should):
22 if not should:
23 return False
24 static_extension_interfaces = [] # Classes to be migrated
25 return interface in static_extension_interfaces
26
27

◆ ElementConstructorInfos()

scripts.systemhtml.ElementConstructorInfos (   typename,
  element_constructors,
  factory_provider_name = '_Elements' 
)
Returns list of ElementConstructorInfos about the convenience constructors
for an Element or SvgElement.

Definition at line 442 of file systemhtml.py.

444 factory_provider_name='_Elements'):
445 """Returns list of ElementConstructorInfos about the convenience constructors
446 for an Element or SvgElement."""
447 # TODO(sra): Handle multiple and named constructors.
448 if typename not in element_constructors:
449 return []
450 infos = element_constructors[typename]
451 if isinstance(infos, str):
452 infos = ElementConstructorInfo(
453 tag=infos, factory_provider_name=factory_provider_name)
454 if not isinstance(infos, list):
455 infos = [infos]
456 return infos
457
458
459# ------------------------------------------------------------------------------

◆ ElemSupportStr()

scripts.systemhtml.ElemSupportStr (   tagName)

Definition at line 464 of file systemhtml.py.

464def ElemSupportStr(tagName):
465 return "Element.isTagSupported('%s')" % tagName
466
467

◆ SvgSupportStr()

scripts.systemhtml.SvgSupportStr (   tagName)

Definition at line 460 of file systemhtml.py.

460def SvgSupportStr(tagName):
461 return 'Svg%s' % ElemSupportStr(tagName)
462
463

Variable Documentation

◆ _callback_list_generics_mapping

scripts.systemhtml._callback_list_generics_mapping
protected
Initial value:
1= monitored.Set(
2 'systemhtml._callback_list_generics_mapping', [
3 'List<Entry>',
4 'List<IntersectionObserverEntry>',
5 'List<MutationRecord>',
6 'List<_Report>',
7 'List<ResizeObserverEntry>',
8 ])

Definition at line 147 of file systemhtml.py.

◆ _element_constructors

dict scripts.systemhtml._element_constructors
protected
Initial value:
1= {
2 'html': _html_element_constructors,
3 'indexed_db': {},
4 'svg': _svg_element_constructors,
5 'typed_data': {},
6 'web_audio': {},
7 'web_gl': {},
8 'web_sql': {},
9}

Definition at line 400 of file systemhtml.py.

◆ _factory_ctr_strings

dict scripts.systemhtml._factory_ctr_strings
protected
Initial value:
1= {
2 'html': {
3 'provider_name': 'document',
4 'constructor_name': 'createElement'
5 },
6 'indexed_db': {
7 'provider_name': 'document',
8 'constructor_name': 'createElement'
9 },
10 'svg': {
11 'provider_name': '_SvgElementFactoryProvider',
12 'constructor_name': 'createSvgElement_tag',
13 },
14 'typed_data': {
15 'provider_name': 'document',
16 'constructor_name': 'createElement'
17 },
18 'web_audio': {
19 'provider_name': 'document',
20 'constructor_name': 'createElement'
21 },
22 'web_gl': {
23 'provider_name': 'document',
24 'constructor_name': 'createElement'
25 },
26 'web_sql': {
27 'provider_name': 'document',
28 'constructor_name': 'createElement'
29 },
30}

Definition at line 410 of file systemhtml.py.

◆ _html_element_constructors

scripts.systemhtml._html_element_constructors
protected

Definition at line 201 of file systemhtml.py.

◆ _js_custom_constructors

scripts.systemhtml._js_custom_constructors
protected
Initial value:
1= monitored.Set(
2 'systemhtml._js_custom_constructors', [
3 'AudioContext',
4 'Blob',
5 'Comment',
6 'MutationObserver',
7 'PaymentRequest',
8 'RTCIceCandidate',
9 'RTCPeerConnection',
10 'RTCSessionDescription',
11 'SpeechRecognition',
12 ],
13 dart2jsOnly=True)

Definition at line 128 of file systemhtml.py.

◆ _js_custom_members

scripts.systemhtml._js_custom_members
protected

Definition at line 38 of file systemhtml.py.

◆ _js_support_checks_additional_element

list scripts.systemhtml._js_support_checks_additional_element
protected

Definition at line 481 of file systemhtml.py.

◆ _js_support_checks_basic_element_with_constructors

list scripts.systemhtml._js_support_checks_basic_element_with_constructors
protected
Initial value:
1= [
2 'HTMLContentElement',
3 'HTMLDataListElement',
4 'HTMLDetailsElement',
5 'HTMLEmbedElement',
6 'HTMLMeterElement',
7 'HTMLObjectElement',
8 'HTMLOutputElement',
9 'HTMLProgressElement',
10 'HTMLTemplateElement',
11 'HTMLTrackElement',
12]

Definition at line 468 of file systemhtml.py.

◆ _js_unreliable_element_factories

scripts.systemhtml._js_unreliable_element_factories
protected
Initial value:
1= set(
2 _js_support_checks_basic_element_with_constructors +
3 _js_support_checks_additional_element + [
4 'HTMLEmbedElement',
5 'HTMLObjectElement',
6 'HTMLShadowElement',
7 'HTMLTemplateElement',
8 ])

Definition at line 584 of file systemhtml.py.

◆ _logger

scripts.systemhtml._logger = logging.getLogger('systemhtml')
protected

Definition at line 18 of file systemhtml.py.

◆ _safe_to_ignore_shadowing_members

scripts.systemhtml._safe_to_ignore_shadowing_members
protected
Initial value:
1= monitored.Set(
2 'systemhtml._safe_to_ignore_shadowing_members', [
3 'SVGElement.tabIndex',
4 'SVGStyleElement.title',
5 ])

Definition at line 32 of file systemhtml.py.

◆ _static_classes

scripts.systemhtml._static_classes = set(['Url'])
protected

Definition at line 144 of file systemhtml.py.

◆ _svg_element_constructors

scripts.systemhtml._svg_element_constructors
protected

Definition at line 331 of file systemhtml.py.

◆ compat_conflicts

dict scripts.systemhtml.compat_conflicts
Initial value:
1= {
2 # These interfaces implement Rectangle, which is a Dart interface. In order
3 # to match the interface of Rectangle, they must be marked as non-nullable.
4 'DOMRectReadOnly': ['bottom', 'height', 'left', 'right', 'top', 'width'],
5 'DOMRect': ['height', 'width'],
6}

Definition at line 1265 of file systemhtml.py.

◆ HTML_LIBRARY_NAMES

list scripts.systemhtml.HTML_LIBRARY_NAMES
Initial value:
1= [
2 'html', 'indexed_db', 'svg', 'web_audio', 'web_gl', 'web_sql'
3]

Definition at line 28 of file systemhtml.py.

◆ js_support_checks

scripts.systemhtml.js_support_checks

Definition at line 517 of file systemhtml.py.

◆ promise_attributes

scripts.systemhtml.promise_attributes

Definition at line 922 of file systemhtml.py.

◆ promise_generateCall

scripts.systemhtml.promise_generateCall
Initial value:
1= monitored.Set('systemhtml.promise_generateCall', [
2 "Navigator.requestKeyboardLock",
3])

Definition at line 1236 of file systemhtml.py.

◆ promise_operations

scripts.systemhtml.promise_operations

Definition at line 956 of file systemhtml.py.