Changeset 91044 in webkit


Ignore:
Timestamp:
Jul 14, 2011, 7:16:09 PM (14 years ago)
Author:
abarth@webkit.org
Message:

The beforeload event allows tracking URI changes in a frame
https://bugs.webkit.org/show_bug.cgi?id=64482

Reviewed by Nate Chapin.

Source/WebCore:

Tests: http/tests/security/beforeload-iframe-client-redirect.html

http/tests/security/beforeload-iframe-server-redirect.html

Only dispatch the beforeload event for a frame if we haven't yet
committed our first real load. The URL that we send to our parent will
be the same URL the parent seens in the src attribute.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadWithDocumentLoader):

LayoutTests:

Test whether the beforeload event is fired for various kinds of redirects.

  • http/tests/security/beforeload-iframe-client-redirect-expected.txt: Added.
  • http/tests/security/beforeload-iframe-client-redirect.html: Added.
  • http/tests/security/beforeload-iframe-server-redirect-expected.txt: Added.
  • http/tests/security/beforeload-iframe-server-redirect.html: Added.
  • http/tests/security/resources/post-done.html: Added.
  • http/tests/security/resources/client-redir.html: Added.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91037 r91044  
     12011-07-14  Adam Barth  <abarth@webkit.org>
     2
     3        The beforeload event allows tracking URI changes in a frame
     4        https://bugs.webkit.org/show_bug.cgi?id=64482
     5
     6        Reviewed by Nate Chapin.
     7
     8        Test whether the beforeload event is fired for various kinds of redirects.
     9
     10        * http/tests/security/beforeload-iframe-client-redirect-expected.txt: Added.
     11        * http/tests/security/beforeload-iframe-client-redirect.html: Added.
     12        * http/tests/security/beforeload-iframe-server-redirect-expected.txt: Added.
     13        * http/tests/security/beforeload-iframe-server-redirect.html: Added.
     14        * http/tests/security/resources/post-done.html: Added.
     15        * http/tests/security/resources/client-redir.html: Added.
     16
    1172011-07-14  Vincent Scheib  <scheib@chromium.org>
    218
  • trunk/Source/WebCore/ChangeLog

    r91043 r91044  
     12011-07-14  Adam Barth  <abarth@webkit.org>
     2
     3        The beforeload event allows tracking URI changes in a frame
     4        https://bugs.webkit.org/show_bug.cgi?id=64482
     5
     6        Reviewed by Nate Chapin.
     7
     8        Tests: http/tests/security/beforeload-iframe-client-redirect.html
     9               http/tests/security/beforeload-iframe-server-redirect.html
     10
     11        Only dispatch the beforeload event for a frame if we haven't yet
     12        committed our first real load.  The URL that we send to our parent will
     13        be the same URL the parent seens in the src attribute.
     14
     15        * loader/FrameLoader.cpp:
     16        (WebCore::FrameLoader::loadWithDocumentLoader):
     17
    1182011-07-14  Dan Bernstein  <mitz@apple.com>
    219
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r91006 r91044  
    13541354
    13551355        if (Element* ownerElement = m_frame->ownerElement()) {
    1356             if (!ownerElement->dispatchBeforeLoadEvent(loader->request().url().string())) {
     1356            // We skip dispatching the beforeload event if we've already
     1357            // committed a real document load because the event would leak
     1358            // subsequent activity by the frame which the parent frame isn't
     1359            // supposed to learn. For example, if the child frame navigated to
     1360            // a new URL, the parent frame shouldn't learn the URL.
     1361            if (!m_stateMachine.committedFirstRealDocumentLoad()
     1362                && !ownerElement->dispatchBeforeLoadEvent(loader->request().url().string())) {
    13571363                continueLoadAfterNavigationPolicy(loader->request(), formState, false);
    13581364                return;
Note: See TracChangeset for help on using the changeset viewer.