Changeset 44906 in webkit for trunk


Ignore:
Timestamp:
Jun 20, 2009 7:05:30 PM (15 years ago)
Author:
weinig@apple.com
Message:

WebCore:

2009-06-20 Sam Weinig <sam@webkit.org>

Reviewed by Adam Barth.

Fix for https://bugs.webkit.org/show_bug.cgi?id=26554
Shadowing of top and parent

  • page/DOMWindow.idl:

LayoutTests:

2009-06-20 Sam Weinig <sam@webkit.org>

Reviewed by Adam Barth.

Test for https://bugs.webkit.org/show_bug.cgi?id=26554

Test writing to parent and top.

  • http/tests/security/cross-frame-access-put-expected.txt:
  • http/tests/security/cross-frame-access-put.html:
  • http/tests/security/resources/cross-frame-iframe-for-put-test.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r44902 r44906  
     12009-06-20  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Test for https://bugs.webkit.org/show_bug.cgi?id=26554
     6
     7        Test writing to parent and top.
     8
     9        * http/tests/security/cross-frame-access-put-expected.txt:
     10        * http/tests/security/cross-frame-access-put.html:
     11        * http/tests/security/resources/cross-frame-iframe-for-put-test.html:
     12
    1132009-06-20  Mark Rowe  <mrowe@apple.com>
    214
  • trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt

    r37895 r44906  
    11CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html from frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html. Domains, protocols and ports must match.
     2
     3CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html. Domains, protocols and ports must match.
     4
     5CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html. Domains, protocols and ports must match.
    26
    37CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html. Domains, protocols and ports must match.
     
    527531ALERT: PASS: window.toolbar should be '[object BarInfo]' and is.
    528532ALERT: PASS: window.window should be '[object DOMWindow]' and is.
     533ALERT: PASS: window.parent should be parentOld and is.
     534ALERT: PASS: window.top should be topOld and is.
    529535ALERT: PASS: window.addEventListener should be 'function addEventListener() {    [native code]}' and is.
    530536ALERT: PASS: window.alert should be 'function alert() {    [native code]}' and is.
  • trunk/LayoutTests/http/tests/security/cross-frame-access-put.html

    r34142 r44906  
    193193    setForbiddenProperty(targetWindow, "toolbar");
    194194    setForbiddenProperty(targetWindow, "window");
    195 
    196     // FIXME: find a way to test these attributes
    197     // setForbiddenProperty(targetWindow, "parent");
    198     // setForbiddenProperty(targetWindow, "top");
     195    setForbiddenProperty(targetWindow, "parent");
     196    setForbiddenProperty(targetWindow, "top");
    199197
    200198    // Functions
  • trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html

    r24743 r44906  
    210210        var toolbarOld = window.toolbar;
    211211        var windowOld = window.window;
    212 
    213         // FIXME: find a way to test these attributes
    214         // var parentOld = window.parent;
    215         // var topOld = window.top;
     212        var parentOld = window.parent;
     213        var topOld = window.top;
    216214
    217215        // Functions
     
    418416            shouldBe("window.window", "windowOld");
    419417
    420             // FIXME: find a way to test these attributes
    421             // shouldBe("window.parent", "parentOld");
    422             // shouldBe("window.top", "topOld");
     418            // Using shouldBe for parent and top causes extraneous warnings due to cross-orgin toString'ing.
     419            if (window.parent === parentOld) {
     420                alert("PASS: window.parent should be parentOld and is.");
     421            } else {
     422                alert("*** FAIL: window.parent should be parentOld but instead is " + window.parent + ". ***");
     423            }
     424
     425            if (window.top === topOld) {
     426                alert("PASS: window.top should be topOld and is.");
     427            } else {
     428                alert("*** FAIL: window.top should be topOld but instead is " + window.top + ". ***");
     429            }
    423430
    424431            // Functions
  • trunk/WebCore/ChangeLog

    r44902 r44906  
     12009-06-20  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=26554
     6        Shadowing of top and parent
     7
     8        * page/DOMWindow.idl:
     9
    1102009-06-20  Mark Rowe  <mrowe@apple.com>
    211
  • trunk/WebCore/page/DOMWindow.idl

    r44867 r44906  
    134134
    135135        attribute [Replaceable, DoNotCheckDomainSecurityOnGet, V8CustomSetter] DOMWindow opener;
    136         attribute [Replaceable, DoNotCheckDomainSecurity] DOMWindow parent;
    137         attribute [Replaceable, DoNotCheckDomainSecurity, V8DisallowShadowing, V8ReadOnly] DOMWindow top;
     136        attribute [Replaceable, DoNotCheckDomainSecurityOnGet] DOMWindow parent;
     137        attribute [Replaceable, DoNotCheckDomainSecurityOnGet, V8DisallowShadowing, V8ReadOnly] DOMWindow top;
    138138
    139139        // DOM Level 2 AbstractView Interface
Note: See TracChangeset for help on using the changeset viewer.