Changeset 24490 in webkit


Ignore:
Timestamp:
Jul 20, 2007, 3:35:50 PM (18 years ago)
Author:
mjs
Message:

LayoutTests:

Reviewed by Oliver.

  • test case for <rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element


(Test mostly by Alice.)

  • fast/events/no-blur-on-page-leave-expected.txt: Added.
  • fast/events/no-blur-on-page-leave.html: Added.
  • fast/events/resources/no-blur-result.html: Added.

WebCore:

Reviewed by Oliver.

<rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element


The proximate cause was the recent change to keep focus on the
WebHTMLView when switching views. But the reason this happend was
that didCommitLoadForFrame got called at a time when the new view
was in place, but the old document was still there. This was a
longstanding problem with the delegate, and fixing it cleans it
up.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::begin): Don't send dispatchWindowObjectAvailable if caller asked not to (this is to allow order of delegates to be the same). (WebCore::FrameLoader::transitionToCommitted): Don't emit didCommitLoadForFrame here. (WebCore::FrameLoader::receivedFirstData): Instead do it here, after calling begin(), so the new document is set up.
  • loader/FrameLoader.h: Add new optional parameter to begin().
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r24487 r24490  
     12007-07-20  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        - test case for <rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element
     6       
     7        (Test mostly by Alice.)
     8
     9        * fast/events/no-blur-on-page-leave-expected.txt: Added.
     10        * fast/events/no-blur-on-page-leave.html: Added.
     11        * fast/events/resources/no-blur-result.html: Added.
     12
    1132007-07-20  Sam Weinig  <sam@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r24486 r24490  
     12007-07-20  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        <rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element
     6
     7
     8       
     9        The proximate cause was the recent change to keep focus on the
     10        WebHTMLView when switching views. But the reason this happend was
     11        that didCommitLoadForFrame got called at a time when the new view
     12        was in place, but the old document was still there. This was a
     13        longstanding problem with the delegate, and fixing it cleans it
     14        up.
     15
     16        * loader/FrameLoader.cpp:
     17        (WebCore::FrameLoader::begin): Don't send dispatchWindowObjectAvailable if
     18        caller asked not to (this is to allow order of delegates to be the same).
     19        (WebCore::FrameLoader::transitionToCommitted): Don't emit didCommitLoadForFrame here.
     20        (WebCore::FrameLoader::receivedFirstData): Instead do it here, after calling begin(),
     21        so the new document is set up.
     22        * loader/FrameLoader.h: Add new optional parameter to begin().
     23
    1242007-07-20  Sam Weinig  <sam@webkit.org>
    225
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r24485 r24490  
    1173511735                        isa = PBXProject;
    1173611736                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
     11737                        compatibilityVersion = "Xcode 2.4";
    1173711738                        hasScannedForEncodings = 1;
    1173811739                        knownRegions = (
     
    1174811749                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
    1174911750                        projectDirPath = "";
     11751                        projectRoot = "";
    1175011752                        targets = (
    1175111753                                93F198A508245E59001E9ABC /* WebCore */,
  • trunk/WebCore/loader/FrameLoader.cpp

    r24434 r24490  
    818818void FrameLoader::receivedFirstData()
    819819{
    820     begin(m_workingURL);
     820    begin(m_workingURL, false);
     821
     822    dispatchDidCommitLoad();
     823    dispatchWindowObjectAvailable();
     824   
     825    String ptitle = m_documentLoader->title();
     826    // If we have a title let the WebView know about it.
     827    if (!ptitle.isNull())
     828        m_client->dispatchDidReceiveTitle(ptitle);
    821829
    822830    m_frame->document()->docLoader()->setCachePolicy(m_cachePolicy);
     
    853861}
    854862
    855 void FrameLoader::begin(const KURL& url)
     863void FrameLoader::begin(const KURL& url, bool dispatch)
    856864{
    857865    clear();
    858     dispatchWindowObjectAvailable();
     866    if (dispatch)
     867        dispatchWindowObjectAvailable();
    859868
    860869    m_needsClear = true;
     
    24312440    // Handle adding the URL to the back/forward list.
    24322441    DocumentLoader* dl = m_documentLoader.get();
    2433     String ptitle = dl->title();
    24342442
    24352443    switch (m_loadType) {
     
    24862494
    24872495    m_committedFirstRealDocumentLoad = true;
    2488 
    2489     dispatchDidCommitLoad();
    2490    
    2491     // If we have a title let the WebView know about it.
    2492     if (!ptitle.isNull())
    2493         m_client->dispatchDidReceiveTitle(ptitle);
    24942496}
    24952497
  • trunk/WebCore/loader/FrameLoader.h

    r24367 r24490  
    310310
    311311        void begin();
    312         void begin(const KURL&);
     312        void begin(const KURL&, bool dispatchWindowObjectAvailable = true);
     313
    313314        void write(const char* str, int len = -1, bool flush = false);
    314315        void write(const String&);
Note: See TracChangeset for help on using the changeset viewer.