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

DomParser crashes on null pointer exception #60

Open
kabinja opened this issue Oct 1, 2020 · 2 comments · May be fixed by #80
Open

DomParser crashes on null pointer exception #60

kabinja opened this issue Oct 1, 2020 · 2 comments · May be fixed by #80

Comments

@kabinja
Copy link

kabinja commented Oct 1, 2020

Hello,

First of all, I want to say thanks for developing such a great tool, I really enjoy using your tool. However, I encounter an issue, that I didn't find an answer yet. Basically, the rendering of some pages lead to a null pointer exception.

For instance, if you use the BoxBrowser demo, available in the project, and pass it a stackoverflow url, for instance:

https://stackoverflow.com/questions/42728417/qquickview-content-not-resizing-properly

this leads to the following error:

*** Error: null
java.lang.NullPointerException
at org.fit.cssbox.layout.ElementBox.getAbsoluteContentX(ElementBox.java:823)
at org.fit.cssbox.layout.Box.getAbsoluteContentBounds(Box.java:647)
at org.fit.cssbox.layout.BlockBox.updateStaticPosition(BlockBox.java:1487)
at org.fit.cssbox.layout.BlockBox.absolutePositions(BlockBox.java:1396)
at org.fit.cssbox.layout.Viewport.absolutePositionsChildren(Viewport.java:440)
at org.fit.cssbox.layout.Viewport.updateBounds(Viewport.java:374)
at org.fit.cssbox.layout.BrowserCanvas.createLayout(BrowserCanvas.java:181)
at org.fit.cssbox.demo.BoxBrowser.displayURL(BoxBrowser.java:167)
at org.fit.cssbox.demo.BoxBrowser$5.actionPerformed(BoxBrowser.java:712)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Is there a simple reason for this behavior or did I discover a bug?

Thanks a lot

@radkovo
Copy link
Owner

radkovo commented Oct 2, 2020

It seems that the page is using flex layout which is not supported at the moment (and causes the NPE in this case). Flexbox and grid support is now work in progress so hopefully, the bug will be resolved soon.

@kabinja
Copy link
Author

kabinja commented Oct 2, 2020

It seems that the page is using flex layout which is not supported at the moment (and causes the NPE in this case). Flexbox and grid support is now work in progress so hopefully, the bug will be resolved soon.

Thanks a lot for the answer. I was expecting that it was a feature that was not supported.

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 a pull request may close this issue.

2 participants