)]}'
{
  "commit": "56ee502d9e86abafd0c233cd37497543b37ef2d0",
  "tree": "fc32731139dedf6bc4581944ed3ea87d3fbdf4ef",
  "parents": [
    "5222a7c0c03dd4c60a8ebd2ac05d964583f9f6d7"
  ],
  "author": {
    "name": "Jozsef Fejes",
    "email": "joco@google.com",
    "time": "Wed Sep 21 11:55:24 2016 +0100"
  },
  "committer": {
    "name": "Daniel Kurka",
    "email": "dankurka@google.com",
    "time": "Sat Oct 29 17:42:51 2016 +0000"
  },
  "message": "Fix loading bug in waitForBodyLoaded.js.\n\nPage loading normally happens in two phases: first DOMContentLoaded is fired, and readyState goes to interactive, second the normal document/window.load is fired and readyState goes to complete.\n\nisBodyLoaded.js verifies loading state by checking if readyState is complete. However, waitForBodyLoaded.js listens for DOMContentLoaded. So when that event is fired, the ready state is not there yet, thus this event handler is useless.\n\n(GWT has a fallback mechanism, a 50ms interval timer. That works, but it causes an unnecessary latency. Also, I\u0027m working on a project where raw JS scripts are loaded next to GWT and they assume GWT is loaded when window.load is fired. But because of this bug, this doesn\u0027t work, causing hacky workarounds.)\n\nRepro here: https://jsfiddle.net/wxawpadr/1/ . This is mostly a copy of GWT\u0027s scripts and logs what\u0027s happening to the console. This shows that the callback is triggered by the timer, not the event.\n\nThe fix is really simple: if isBodyLoaded.js wants a complete readyState, then we listen for the readystatechange event. Also there\u0027s a minor code cleanup relating to that, because we don\u0027t want to fire when readyState goes to interactive.\n\nChange-Id: I7c9f1c89bd12916549581ffe8bbc522c09f56b50\nReview-Link: https://gwt-review.googlesource.com/#/c/16960/\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4d4c33f868b50aac110224a742d07e95d2472459",
      "old_mode": 33188,
      "old_path": "dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js",
      "new_id": "91cf0dcd08d7e804690618750d678cd689191db1",
      "new_mode": 33188,
      "new_path": "dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js"
    }
  ]
}
