[Webkit-unassigned] [Bug 41372] popstate event is not fired until document opts in by calling pushstate.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 26 14:37:08 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41372





--- Comment #16 from Brady Eidson <beidson at apple.com>  2010-08-26 14:37:08 PST ---
(From update of attachment 65584)
> diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
> index 90939d33bae3c100b19f133cceab418558464ffc..7048c484f63a1eed460487301801656bbcdf430d 100644
> --- a/WebCore/dom/Document.cpp
> +++ b/WebCore/dom/Document.cpp
> @@ -2003,6 +2003,10 @@ void Document::implicitClose()
>      enqueuePageshowEvent(PageshowEventNotPersisted);
>      if (m_pendingStateObject)
>          enqueuePopstateEvent(m_pendingStateObject.release());
> +    else {
> +        RefPtr<SerializedScriptValue> nullStateObject = SerializedScriptValue::create();
> +        enqueuePopstateEvent(nullStateObject.get());
> +    }

and

> diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
> index 24888f27e9ea190672e203ef85630d59a935e208..37ccbdcbe5f91ae02ac44ef71a8a35e71efb2530 100644
> --- a/WebCore/loader/FrameLoader.cpp
> +++ b/WebCore/loader/FrameLoader.cpp
> @@ -1169,10 +1169,13 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta
>  
>      m_client->dispatchDidNavigateWithinPage();
>  
> -    if (stateObject) {
> +    if (stateObject)
>          m_frame->document()->statePopped(stateObject);
> -        m_client->dispatchDidPopStateWithinPage();
> +    else {
> +        RefPtr<SerializedScriptValue> nullStateObject = SerializedScriptValue::create();
> +        m_frame->document()->statePopped(nullStateObject.get());
>      }
> +    m_client->dispatchDidPopStateWithinPage();

Since we'll be using the null SerializedScriptValue a lot more often now (every history navigation), we may as well make it a static shared object.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list