Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
scripts.mdnreader.MDNReader Class Reference
Inheritance diagram for scripts.mdnreader.MDNReader:

Public Member Functions

def __init__ (self)
 
def is_compatible (self, attribute)
 
def set_compatible (self, attribute, compatible)
 

Detailed Description

Definition at line 255 of file mdnreader.py.

Constructor & Destructor Documentation

◆ __init__()

def scripts.mdnreader.MDNReader.__init__ (   self)

Definition at line 259 of file mdnreader.py.

259 def __init__(self):
260 self._compat_overrides = {}
261

Member Function Documentation

◆ is_compatible()

def scripts.mdnreader.MDNReader.is_compatible (   self,
  attribute 
)

Definition at line 295 of file mdnreader.py.

295 def is_compatible(self, attribute):
296 # Since capitalization isn't consistent across MDN and WebCore, we
297 # compare lowercase equivalents for interface and attribute names.
298 interface = attribute.doc_js_interface_name.lower()
299 if interface in self._BROWSER_COMPAT_DATA and attribute.id and len(
300 attribute.id) > 0:
301 interface_dict = self._BROWSER_COMPAT_DATA[interface]
302 id_name = attribute.id.lower()
303 secure_context_key = 'isSecureContext'
304 if interface in self._compat_overrides and id_name in self._compat_overrides[
305 interface]:
306 return self._compat_overrides[interface][id_name]
307 elif secure_context_key in interface_dict:
308 # If the interface requires a secure context, all attributes are
309 # implicitly incompatible.
310 return False
311 elif id_name in interface_dict:
312 id_data = interface_dict[id_name]
313 return self._get_attr_compatibility(id_data[_COMPAT_KEY])
314 else:
315 # Might be an attribute that is defined in a parent interface.
316 # We defer until attribute emitting to determine if this is the
317 # case. Otherwise, return None.
318 pass
319 return None
320
static bool is_compatible(const GrSurfaceCharacterization &gsc, const GrBackendTexture &backendTex)

◆ set_compatible()

def scripts.mdnreader.MDNReader.set_compatible (   self,
  attribute,
  compatible 
)

Definition at line 321 of file mdnreader.py.

321 def set_compatible(self, attribute, compatible):
322 # Override value in the MDN browser compatibility data.
323 if not compatible in [True, False, None]:
324 raise ValueError('Cannot set a non-boolean object for compatible')
325 interface = attribute.doc_js_interface_name.lower()
326 if not interface in self._compat_overrides:
327 self._compat_overrides[interface] = {}
328 if attribute.id and len(attribute.id) > 0:
329 id_name = attribute.id.lower()
330 self._compat_overrides[interface][id_name] = compatible

The documentation for this class was generated from the following file: