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
More properties for the browsers compatibility #409
Comments
Just because most of your post seems to be related to adding I would just like to highlight that we can continue to discuss adding the properties to Document and or Element/Node as they are specified. |
We will have to check in which specifications those things are defined. |
It's possible just to add one optional parameter to the constructor — current |
Trying to better understand your use case: But you are always using the constructor without any arguments. Since the browser native DOMParser doesn't support constructor arguments, would you just always pass the argument? In xmldom the a tag element doesn't have any special behavior, so joining the value from the href attribute with whatever the document.location is, would mean we have to add special attribute behavior. For now I would still suggest to handle the joining on the level of your code that handles ponyfilling: if the href attribute value starts with Or start looking into the code to add a PR for that feature. |
It just ignores them. So, I think it's safely to extend the constructor. The code will be compatible with the browsers. new DOMParser({location: "https://example.com"});
For example, from the my code above: Well, here is how I can manually resolve it with const resolveLocation = "https://example.com";
new URL(doc.querySelector("a").getAttribute("href"), resolveLocation).href |
I would like to have access to more properties like it is in the browsers to write a browser compatible code.
For example,
innerHTML
,dataset
,body
,head
,href
,src
,classList
:The full code:
#92 (comment)
The text was updated successfully, but these errors were encountered: