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

[Android] WebView: The element type "meta" must be terminated by the matching end-tag "</meta>" #1210

Closed
jperedadnr opened this issue Mar 8, 2023 · 0 comments · Fixed by #1211
Labels
bug Something isn't working

Comments

@jperedadnr
Copy link
Contributor

Running HelloFX on Android with a WebView and loading the following valid HTML content:

<html><head><meta charset="UTF-8"><title>Title</title></head><body>test</body></html>

produces an exception that prevents passing the org.w3c.dom.Document object to the WebEngine::documentProperty

[Tue Mar 07 13:23:43 CET 2023][INFO] [SUB] D/GraalCompiled(20108): [Fatal Error] :1:63: The element type "meta" must be terminated by the matching end-tag "</meta>".
[Tue Mar 07 13:23:43 CET 2023][INFO] [SUB] D/GraalCompiled(20108): Error parsing html: The element type "meta" must be terminated by the matching end-tag "</meta>".
[Tue Mar 07 13:23:43 CET 2023][INFO] [SUB] V/GraalActivity(20108): LOAD onReceivedHttpError: request: GET
[Tue Mar 07 13:23:43 CET 2023][INFO] [SUB] V/GraalActivity(20108): LOAD onReceivedHttpError: errorResponse: 
[Tue Mar 07 13:23:43 CET 2023][INFO] [SUB] E/GraalGluon(20108): nativeFailedURL called. Invoke method on webView

JavaFX WebEngine parses HTML (HTML-5 with valid void tags) into XHTML (without valid void tags) with:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(pageContent)));

and fails with such exception:

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 57; The element type "meta" must be terminated by the matching end-tag "</meta>".
        at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:262)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:342)
        at com.gluonhq.web.HelloWeb.start(HelloWeb.java:29)

Expected Behavior

Current Behavior

Steps to Reproduce

Your Environment

@jperedadnr jperedadnr added the bug Something isn't working label Mar 8, 2023
@jperedadnr jperedadnr mentioned this issue Mar 8, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant