Skip to content

Implement of interface DOMImplementation #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions w3/python/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
"""

from w3.python.core.fundamental_interface import DOMException
from w3.python.core.fundamental_interface import DOMImplementation
30 changes: 30 additions & 0 deletions w3/python/core/fundamental_interface/DOMImplementation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from __future__ import absolute_import

from w3.python.core.type import DOMString


class DOMImplementation:
"""Interface DOMImplementation

The `DOMImplementation` interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.

The DOM Level 1 does not specify a way of creating a document instance, and hence document creation is an operation specific to an implementation. Future Levels of the DOM specification are expected to provide methods for creating documents directly.
"""

# TODO
def has_feature(self,
feature: DOMString,
version: DOMString) -> bool:
"""<NOT IMPLEMENTED>
Test if the DOM implementation implements a specific feature.

Args:
feature: The package name of the feature to test. In Level 1, the legal values are "HTML" and "XML" (case-insensitive).
version: This is the version number of the package name to test. In Level 1, this is the string "1.0". If the version is not specified, supporting any version of the feature will cause the method to return true.

Returns:
`True` if the feature is implemented in the specified version, `False` otherwise.

This method raises no exceptions.
"""
raise NotImplementedError
1 change: 1 addition & 0 deletions w3/python/core/fundamental_interface/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
from __future__ import absolute_import

from w3.python.core.fundamental_interface.DOMException import DOMException
from w3.python.core.fundamental_interface.DOMImplementation import DOMImplementation
1 change: 1 addition & 0 deletions w3/python/dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

# Bring in subpackages.
from w3.python.core import DOMException
from w3.python.core import DOMImplementation