The beforeload event allows tracking URI changes in a frame
authorAdam Barth <abarth@webkit.org>
Fri, 15 Jul 2011 02:16:09 +0000 (02:16 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Mon, 18 Jul 2011 21:30:22 +0000 (18:30 -0300)
commitbce34be0051479037e4fa69357cfaea68b3d2602
treeffd602ed8db5fdf8d18f5a2f9c94bf9f13fc0110
parent4cbf7a06f84f7fc8d6f0a030ae52c3473526fd95
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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/beforeload-iframe-client-redirect-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/beforeload-iframe-client-redirect.html [new file with mode: 0644]
LayoutTests/http/tests/security/beforeload-iframe-server-redirect-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/beforeload-iframe-server-redirect.html [new file with mode: 0644]
LayoutTests/http/tests/security/resources/client-redir.html [new file with mode: 0644]
LayoutTests/http/tests/security/resources/post-done.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp