WebKit2: Pages with dynamically inserted iframes can add extraneous back/forward items.
First noticed at http://www.cnn.com/ with dynamically appended iframes related to facebook.
Turns out this is because the "decidePolicyForNavigationAction" policy delegate is asynchronous, and WebCore can't handle that too well. The answer to that policy delegate is what sets up the provisional DocumentLoader in the FrameLoader, and if it's not synchronous, the FrameLoader can't tell the DocumentLoader "this is a quick redirect - you shouldn't add a back/forward history item"
Making the delegate call synchronous is the cleanest way to fix this for now.
LayoutTest will be included in the upcoming patch.
In radar as <rdar://problem/8636239>
Created attachment 81263 [details]
Patch + layout test (v1)