Skip to content
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

Use wrapper divs in trusted-types-createHTMLDocument.html #50000

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

fred-wang
Copy link
Contributor

Currently it uses doc.body but when doc == document, this is causing errors in testharness.js:

TypeError: can't access property "addEventListener", output_document.getElementById(...) is null

Currently it uses `doc.body` but when `doc == document`, this is causing
errors in `testharness.js`:

`TypeError: can't access property "addEventListener", output_document.getElementById(...) is null`
Copy link
Member

@lukewarlow lukewarlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the issue but this seems harmless so lgtm.

@fred-wang
Copy link
Contributor Author

fred-wang commented Jan 9, 2025

I don't really understand the issue but this seems harmless so lgtm.

Basically testharness.js adds some internal div with specific ids for its own reports (like tests running, pending, detailed results etc). The test does document.body.innerHTML = "..." which erases the whole doc content, and that does not interact well with testharness.js code...

@fred-wang fred-wang merged commit 409679c into master Jan 9, 2025
17 checks passed
@fred-wang fred-wang deleted the trusted-types-createHTMLDocument.html branch January 9, 2025 17:59
sadym-chromium pushed a commit that referenced this pull request Jan 14, 2025
Currently it uses `doc.body` but when `doc == document`, this is causing
errors in `testharness.js`:

`TypeError: can't access property "addEventListener", output_document.getElementById(...) is null`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants