[openjfx11] Review request for 8204856: WebEngine document becomes null after PAGE_REPLACED event

Arunprasad Rajkumar arunprasad.rajkumar at oracle.com
Wed Jun 27 11:21:18 UTC 2018


Please review the following fix: 

patch: http://cr.openjdk.java.net/~arajkumar/8204856/webrev/ <http://cr.openjdk.java.net/~arajkumar/8204856/webrev/> 
bug: https://bugs.openjdk.java.net/browse/JDK-8204856 <https://bugs.openjdk.java.net/browse/JDK-8204856>

Root cause: 
When ever location changes due WebHistory API calls, we propagate it to WebEngine to update the `location` property. However the private method{WebEngine.updateLocation} which we used to update `location` also invalidates the `document` property of WebEngine, which is undesirable.

Directly update the `location` property when WebEngine gets PAGE_REPLACED event. Don’t use {WebEngine.updateLocation}.

Unit tests are added to cover both history.pushState and history.replaceState., Use the following command to run the newly added unit test,

gradle :web:cleanTest :web:test --tests test.javafx.scene.web.HistoryStateTest

(Note: No _need_ to compile the web module in order to test this fix, all changes are done only in Java binding files)


More information about the openjfx-dev mailing list