The risk here (and the reason I asked for a Blink Intent to Ship during review) is that it makes the history API even more unpredictable in sandboxed iframes. That might be ok, but it's a compatibility impact, so I think it's worth getting approval for.
More specifically, an iframe doesn't have control over whether another frame in the page adds a session history item, so it doesn't know whether calling history.back() will work or not. Consider these two scenarios:
One:
1) Top-level document A loads sandboxed iframe B.
2) A does a pushState to #a2.
3) B does a pushState to #b2.
4) B does a history.back() and gets back to its original state.
Two:
1) Top-level document A loads sandboxed iframe B.
2) B does a pushState to #b2.
3) A does a pushState to #a2.
4) B does a history.back().
Scenario Two isn't great either before or after Dave's proposed change. Today, A goes back to its original state but B stays on #b2, and B would have to do another history.back() to get back to its original state. After the proposed change, B's history.back() does nothing, and it's stuck and can never get back to its original state unless A cooperates.
This is all a consequence of the legacy back/forward behavior that operates on joint session history items rather than being frame-specific, which isn't something we can change at this point.
Are we ok with making history.back() do nothing in cases like this, rather than affecting other frames? If so, I'm happy to proceed with reviewing Dave's CL.
Thanks!
Charlie