-
Notifications
You must be signed in to change notification settings - Fork 31
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
Bug in assert_node_equals hides test failures #202
Comments
I had solved this problem at some point with a more complex version of
Hmm. Maybe that's the simpler way. But I believe
My "reading" of the group is that there's a strong preference to build things on top of existing DOM algorithms. I suspect some sort of append-and-join-text-nodes wouldn't be well received. Maybe one could spec it to always |
I'm not sure we if we require neighboring text nodes to be merged. I agree with @otherdaniel, that it doesn't sound so great about using innerHTML to compare a serialization. Looking at our HTML experts, e.g., @annevk and @zcorpan to see if they have had this issue before. |
There's not many APIs that manipulate the node tree directly in this way. I suggest you look at what the various methods on ranges do. They might normalize, not sure. |
Would it be viable to just call |
Mh, would it make sense to |
We apparently have three |
Can you take a stab at fixing the (tentative) tests and closing this one out, @evilpie? |
We should switch to html5lib's treebuilder tests |
I have updated the tests, I can try to figure out how to this via WPT directly or we sync them via Mozilla. @otherdaniel does this look good to you: https://phabricator.services.mozilla.com/D200627 |
@evilpie this does not allow us to test the exact structure, which does not seem ideal. We'd then have to test separately that normalization does not happen. I think Simon's idea was more promising. |
There's likely value in solving this with a function that is upstreamed to wpt in order to make use of this here and in Trusted Types. |
While updating the tests for the new WebIDL syntax I realized that
assert_node_equals
doesn't correctly work for<template>
, becauseisNodeEqual
doesn't look at theDocumentFragement
in content at all.After running the setHTML tests with a
<div>
instead, I've noticed some test failures with tests like this:This is caused by "flattening" turning the first into three text nodes like
[test][p][tt]
instead of one long text node[testptt]
. I am not sure if there is way to keep the current way we write tests combined withisNodeEqual
. A simplea.innerHTML == b.innerHTML
wouldn't have this issue.Aside: Should the Sanitizer algorithm maybe concatenate those nodes?
/cc @otherdaniel
The text was updated successfully, but these errors were encountered: