Don't fire popstate events for cross-document loads
Don't fire popstate events for cross-document loads

The previous code was oversending popstate events, and in some cases
sending them in the wrong order. This uses a heurstic to try to
determine whether to send the popstate manually.

This code definitely has edge cases that won't be handled correctly,
but it should be an incremental improvement. The longer-term solution
will be to completely overhaul the document and URL tracking in
WebController so that this logic can operate on exact information
rather than heuristics.

BUG=566157, 554693
TEST=Go back to a page that was reached via form submission, then
called replaceState, in WKWebView mode. It should work correctly.

Review URL: https://codereview.chromium.org/1499073004

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#364538}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk