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

HtmlMesh doesn't handle html comment #23657

Merged
merged 4 commits into from
Mar 4, 2022
Merged

Conversation

remmel
Copy link
Contributor

@remmel remmel commented Mar 4, 2022

Description
HTMLMesh didn't handled when html contains comment <!-- this is a comment! -->. Fix that. (Should I had first created an issue?)
Also use Node constants instead of magic number.
Add an example in webxr_vr_sandbox

That error was output when the html had a comment :

HTMLMesh.js:258 Uncaught TypeError: Cannot read properties of undefined (reading 'display')
    at drawElement (HTMLMesh.js:258)
    at drawElement (HTMLMesh.js:307)
    at html2canvas (HTMLMesh.js:337)
    at new HTMLTexture (HTMLMesh.js:54)
    at new HTMLMesh (HTMLMesh.js:14)
    at init (webxr_vr_sandbox.html:224)
    at webxr_vr_sandbox.html:62

Try it here (I'll probably update the example on my gh-page next days, as I would like to add more feature which faile : shadowRoot, event / changes not reflected, etc...)

remmel added 2 commits March 4, 2022 15:39
HTMLMesh was not working when the html has a comment (see err below). And use Node constants https://developer.mozilla.org/fr/docs/Web/API/Node/nodeType. Add basic example of html with list in webxr_vr_sandbox

```
HTMLMesh.js:258 Uncaught TypeError: Cannot read properties of undefined (reading 'display')
    at drawElement (HTMLMesh.js:258)
    at drawElement (HTMLMesh.js:307)
    at html2canvas (HTMLMesh.js:337)
    at new HTMLTexture (HTMLMesh.js:54)
    at new HTMLMesh (HTMLMesh.js:14)
    at init (webxr_vr_sandbox.html:224)
    at webxr_vr_sandbox.html:62
```
@mrdoob
Copy link
Owner

mrdoob commented Mar 4, 2022

HTMLMesh didn't handled when html contains comment <!-- this is a comment! -->. Fix that. (Should I had first created an issue?)

No need!

@mrdoob mrdoob added this to the r139 milestone Mar 4, 2022
@mrdoob mrdoob merged commit bac57da into mrdoob:dev Mar 4, 2022
@mrdoob
Copy link
Owner

mrdoob commented Mar 4, 2022

Thanks!

donmccurdy pushed a commit to donmccurdy/three.js that referenced this pull request Mar 10, 2022
* HTMLMesh fix html comment, constants and basic html example
HTMLMesh was not working when the html has a comment (see err below). And use Node constants https://developer.mozilla.org/fr/docs/Web/API/Node/nodeType. Add basic example of html with list in webxr_vr_sandbox

```
HTMLMesh.js:258 Uncaught TypeError: Cannot read properties of undefined (reading 'display')
    at drawElement (HTMLMesh.js:258)
    at drawElement (HTMLMesh.js:307)
    at html2canvas (HTMLMesh.js:337)
    at new HTMLTexture (HTMLMesh.js:54)
    at new HTMLMesh (HTMLMesh.js:14)
    at init (webxr_vr_sandbox.html:224)
    at webxr_vr_sandbox.html:62
```

* Update webxr_vr_sandbox.html

* Update webxr_vr_sandbox.html

Co-authored-by: mrdoob <[email protected]>
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* HTMLMesh fix html comment, constants and basic html example
HTMLMesh was not working when the html has a comment (see err below). And use Node constants https://developer.mozilla.org/fr/docs/Web/API/Node/nodeType. Add basic example of html with list in webxr_vr_sandbox

```
HTMLMesh.js:258 Uncaught TypeError: Cannot read properties of undefined (reading 'display')
    at drawElement (HTMLMesh.js:258)
    at drawElement (HTMLMesh.js:307)
    at html2canvas (HTMLMesh.js:337)
    at new HTMLTexture (HTMLMesh.js:54)
    at new HTMLMesh (HTMLMesh.js:14)
    at init (webxr_vr_sandbox.html:224)
    at webxr_vr_sandbox.html:62
```

* Update webxr_vr_sandbox.html

* Update webxr_vr_sandbox.html

Co-authored-by: mrdoob <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants