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
fix: Only use HTML rules if mimeType matches #338
Commits on Feb 28, 2022
-
feat: Add
DOMImplementation.createHTMLDocument
- always set `Document.type` and `Document.contentType` - `Document.createElement` properly HTML casing and (X)HTML namespacing https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument https://dom.spec.whatwg.org/#dom-document-createelement
-
refactor: Create HTML document from
DOMHandler
when `mimeType` is `text/html`. The `mimeType` can now optionally be passed to the `DOMHandler` constructor. Documented `DOMHandler` constructor and all properties. - For XML documents the XHTML and SVG mime types are preserved as expected. - `Document.documentURI` is no longer initialized with the undocumented `Locator.systemId` value. - Deprecate `DOMParserOptions.domBuilder` since state would be preserved between calls to `DOMParser.parseFromString` which can have unexpected side effects, especially since we are now using the `DOMHandler` to manage the mimeType and defaultNamespace.
-
feat: Use minimal
Object.assign
ponyfillto be able to copy from options provided to `DOMParser`
-
refactor: Copy DOMParserOptions
locator
andxmlns
to instanceInstead of accessing `this.options` in `DOMParser.parseToString`, the default values are now applied in the constructor. Since the locator passed to `options` is no longer being modified, the type of the option was changed to boolean. There is no change in behavior in this commit, since truthy and falsy values are accepted as well.
-
refactor: Copy DOMParserOptions
normalizeLineEndings
to instanceInstead of accessing `this.options` in `DOMParser.parseToString`, the default values are now applied in the constructor.
-
refactor: Copy DOMParserOptions
errorHandler
to instanceInstead of accessing `this.options` in `DOMParser.parseToString`, use `this.errorHandler`.
-
fix: Replace
DOMParserOptions
domBuilder
bydomHandler
which points to a class instead of an instance and is only meant for internal testing. BREAKING CHANGE: If you used to configure `DOMParserOptions.domBuilder`. You might be able to configure the `domHandler` instead, but should be avoided. This is only there for testing purposes.
-
refactor: Drop
DOMParser.options
propertyAll options are now taken care of by the constructor and are available as individual properties. Most are marked as `readonly`, some are `private`. BREAKING CHANGE: If you used `DOMParser.options` after creating an instance. You can still read the individual properties from the instance, but there is no longer a way to mutate them, so you need to really pass the required options when constructing them.
-
feat: Correctly handle all case modifications
in HTML docs or namespaces
-
-
-
-
-
-
-
Commits on Mar 6, 2022
-
fix(sax): Handle raw text elements in HTML
and drop warning for boolean attributes in HTML
-
-
-
-
fix(dom): Serialize according to document type
BREAKING CHANGE: The following methods no longer allow a (non spec compliant) boolean argument to toggle "HTML rules": - `XMLSerializer.serializeToString` - `Node.toString` - `Document.toString`
-