Changeset 29428 in webkit


Ignore:
Timestamp:
Jan 11, 2008, 11:19:27 PM (17 years ago)
Author:
ggaren@apple.com
Message:

JavaScriptCore:

Reviewed by Oliver Hunt.


Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
variable access (16644)


This bug was caused by var declarations shadowing built-in properties of
the global object.


To match Firefox, we've decided that var declarations will never shadow
built-in properties of the global object or its prototypes. We used to
behave more like IE, which allows shadowing, but walking that line got
us into trouble with websites that sent us down the Firefox codepath.

  • kjs/JSVariableObject.h: (KJS::JSVariableObject::symbolTableGet): New code to support calling hasProperty before the variable object is fully initialized (so you can call it during initialization).
  • kjs/nodes.cpp:. (KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty check when looking for duplicates, not getDirect, since it only checks the property map, and not hasOwnProperty, since it doesn't check prototypes. (KJS::EvalNode::processDeclarations): ditto
  • kjs/property_slot.h: (KJS::PropertySlot::ungettableGetter): Best function name evar.

WebCore:

Reviewed by Oliver Hunt.


Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
variable access (16644)


Removed the ReadOnly bit from some properties, to match Firefox. Also
removed status-related setters, to allow using their names as variable
names.


  • bindings/scripts/CodeGeneratorJS.pm: Added support for properties that are one-way across domain boundaries, to match Firefox.
  • bindings/js/kjs_window.cpp: Changed ReadOnly declarations to match FF.
  • bindings/scripts/CodeGeneratorJS.pm: Don't use JSObject:: because we don't know that JSObject is our base class.
  • page/DOMWindow.idl: Replaced lots of readonly declarations with [Replaceable] declarations.
  • page/DOMWindow.h: Removed interfaces for setting status text via the DOM. (They were getting in the way of, e.g., "var status" declarations.) By default, IE 7 and FF disable these interfaces in order to defend against phishing attacks that try to spoof domain names in the statusbar.
  • page/DOMWindow.cpp:

LayoutTests:

Reviewed by Oliver Hunt.


Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
variable access (16644)


Added a test. Updated other tests to match new behavior.


  • fast/js/var-declarations-shadowing-expected.txt: Added.
  • fast/js/var-declarations-shadowing.html: Added.
  • fast/dom/HTMLScriptElement/script-load-events.html: Changed this test a bit because the original design made it hard to understand why it was failing.
  • fast/dom/HTMLScriptElement/script-load-events-expected.txt:


  • fast/dom/Window/get-set-properties.html: Changed this test to expect our new behavior, which matches Firefox.
  • fast/dom/Window/get-set-properties-expected.txt:
  • fast/dom/Window/window-property-shadowing.html: Removed some cases that differed from Firefox.
  • fast/dom/Window/window-property-shadowing-expected.txt:
  • http/tests/security/cross-frame-access-put-expected.txt: This test emits more "Unsafe JavaScript attempt" messages now because property sets that used to be prohibited (somewhat accidentally) by the ReadOnly attribute are now prohibited by security checks.
Location:
trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r29425 r29428  
     12008-01-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4       
     5        Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
     6        variable access (16644)
     7       
     8        This bug was caused by var declarations shadowing built-in properties of
     9        the global object.
     10       
     11        To match Firefox, we've decided that var declarations will never shadow
     12        built-in properties of the global object or its prototypes. We used to
     13        behave more like IE, which allows shadowing, but walking that line got
     14        us into trouble with websites that sent us down the Firefox codepath.
     15
     16        * kjs/JSVariableObject.h:
     17        (KJS::JSVariableObject::symbolTableGet): New code to support calling
     18        hasProperty before the variable object is fully initialized (so you
     19        can call it during initialization).
     20
     21        * kjs/nodes.cpp:.
     22        (KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty
     23        check when looking for duplicates, not getDirect, since it only checks
     24        the property map, and not hasOwnProperty, since it doesn't check
     25        prototypes.
     26        (KJS::EvalNode::processDeclarations): ditto
     27
     28        * kjs/property_slot.h:
     29        (KJS::PropertySlot::ungettableGetter): Best function name evar.
     30
    1312008-01-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
    232
  • trunk/JavaScriptCore/kjs/JSVariableObject.h

    r29425 r29428  
    9292        size_t index = symbolTable().get(propertyName.ustring().rep());
    9393        if (index != missingSymbolMarker()) {
     94#ifndef NDEBUG
     95            // During initialization, the variable object needs to advertise that it has certain
     96            // properties, even if they're not ready for access yet. This check verifies that
     97            // no one tries to access such a property.
     98           
     99            // In a release build, we optimize this check away and just return an invalid pointer.
     100            // There's no harm in an invalid pointer, since no one dereferences it.
     101            if (index >= d->localStorage.size()) {
     102                slot.setUngettable(this);
     103                return true;
     104            }
     105#endif
    94106            slot.setValueSlot(this, &d->localStorage[index].value);
    95107            return true;
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r29425 r29428  
    43274327    for (size_t i = 0; i < size; ++i) {
    43284328        const Identifier& ident = m_varStack[i].first;
    4329         if (variableObject->getDirect(ident)) {
     4329        if (variableObject->hasProperty(exec, ident)) {
    43304330            m_varIndexes[i] = missingSymbolMarker(); // Signal not to initialize this declaration.
    43314331            continue;
     
    44754475        Identifier& ident = m_varStack[i].first;
    44764476        bool isConstant = m_varStack[i].second & DeclarationStacks::IsConstant;
    4477         if (variableObject->hasOwnProperty(exec, ident))
     4477        if (variableObject->hasProperty(exec, ident))
    44784478            continue;
    44794479        int attributes = minAttributes;
  • trunk/JavaScriptCore/kjs/property_slot.cpp

    r29067 r29428  
    3333}
    3434
     35JSValue* PropertySlot::ungettableGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&)
     36{
     37    ASSERT_NOT_REACHED();
     38    return jsUndefined();
     39}
     40
    3541JSValue *PropertySlot::functionGetter(ExecState* exec, JSObject* originalObject, const Identifier&, const PropertySlot& slot)
    3642{
  • trunk/JavaScriptCore/kjs/property_slot.h

    r27633 r29428  
    110110    }
    111111
     112    void setUngettable(JSObject* slotBase) // Used to signal that you have a property, but trying to get it at this time is an error.
     113    {
     114        m_slotBase = slotBase;
     115        m_getValue = ungettableGetter;
     116    }
     117
    112118    JSObject* slotBase() const { return m_slotBase; }
    113119
     
    117123private:
    118124    static JSValue* undefinedGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     125    static JSValue* ungettableGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
    119126    static JSValue* functionGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
    120127   
  • trunk/LayoutTests/ChangeLog

    r29427 r29428  
     12008-01-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4       
     5        Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
     6        variable access (16644)
     7       
     8        Added a test. Updated other tests to match new behavior.
     9       
     10        * fast/js/var-declarations-shadowing-expected.txt: Added.
     11        * fast/js/var-declarations-shadowing.html: Added.
     12
     13        * fast/dom/HTMLScriptElement/script-load-events.html: Changed this test
     14        a bit because the original design made it hard to understand why it was failing.
     15        * fast/dom/HTMLScriptElement/script-load-events-expected.txt:
     16       
     17        * fast/dom/Window/get-set-properties.html: Changed this test to expect
     18        our new behavior, which matches Firefox.
     19        * fast/dom/Window/get-set-properties-expected.txt:
     20
     21        * fast/dom/Window/window-property-shadowing.html: Removed some cases
     22        that differed from Firefox.
     23        * fast/dom/Window/window-property-shadowing-expected.txt:
     24
     25        * http/tests/security/cross-frame-access-put-expected.txt: This test emits
     26        more "Unsafe JavaScript attempt" messages now because property sets that
     27        used to be prohibited (somewhat accidentally) by the ReadOnly attribute
     28        are now prohibited by security checks.
     29
    1302008-01-11  Anyang Ren  <anyang.ren@gmail.com>
    231
  • trunk/LayoutTests/fast/dom/HTMLScriptElement/script-load-events-expected.txt

    r21687 r29428  
    11This tests for regressions against http://bugzilla.opendarwin.org/show_bug.cgi?id=5812 Generate load events for <script> elements.
    2 Test result: PASS
     2PASS
  • trunk/LayoutTests/fast/dom/HTMLScriptElement/script-load-events.html

    r21591 r29428  
    77function loaded(i)
    88{
    9     status[i-1] = "L";
     9    status[i] = "L";
    1010}
    1111
    1212function erred(i)
    1313{
    14     status[i-1] = "E";
     14    status[i] = "E";
    1515}
    1616
    1717function endTest()
    1818{
     19    var failures = "";
     20    if (status[0] != "E")
     21        failures += "0 ";
     22    if (status[1] != "E")
     23        failures += "1 ";
     24
     25    if (status[2] != "L")
     26        failures += "2 ";
     27    if (status[3] != "L")
     28        failures += "3 ";
     29    if (status[4] != "L")
     30        failures += "4 ";
     31    if (status[5] != "L")
     32        failures += "5 ";
     33
    1934    var results = document.getElementById("results");
    20    
    21     if (status[0]=="E" &&
    22         status[1]=="E" &&
    23         status[2]=="L" &&
    24         status[3]=="L" &&
    25         status[4]=="L" &&
    26         status[5]=="L")
    27         results.innerText = "PASS";
     35    if (failures)
     36        results.innerHTML = "FAIL: The following tests failed: " + failures;
    2837    else
    29         results.innerText = "FAIL: " + status;
    30 }
     38        results.innerHTML = "PASS";
    3139
    32 function loaded6()
    33 {
    34     loaded(6);
    35     endTest();
     40    if (window.layoutTestController)
     41        layoutTestController.notifyDone();
    3642}
    3743
    3844function test()
    3945{
    40     if (window.layoutTestController)
     46    if (window.layoutTestController) {
    4147        layoutTestController.dumpAsText();
    42         var e = document.createElement( "script" ) ;
    43         e.type  = "text/javascript" ;
    44         document.getElementsByTagName("head")[0].appendChild( e ) ;
    45        
    46         e.onload = loaded6;
    47         endTest(); // called here in case the load even doesn't fire
    48         e.src = 'resources/script-load.js' ;
     48        layoutTestController.waitUntilDone();
     49    }
     50
     51    var e = document.createElement("script");
     52    e.type = "text/javascript";
     53    e.src = 'resources/script-load.js';
     54    e.onload = function() {
     55        loaded(5);
     56        endTest();
     57    };
     58    document.getElementsByTagName("head")[0].appendChild( e );
    4959}
    5060</script>
    5161</head>
    5262<body onload="test()">
     63<script type="text/javascript" onload="loaded(0)" onerror="erred(0)" src="resources/certainlydoesnotexist.js"></script>
    5364<script type="text/javascript" onload="loaded(1)" onerror="erred(1)" src="resources/certainlydoesnotexist.js"></script>
    54 <script type="text/javascript" onload="loaded(2)" onerror="erred(2)" src="resources/certainlydoesnotexist.js"></script>
     65<script type="text/javascript" onload="loaded(2)" onerror="erred(2)" src="resources/script-load.js"></script>
    5566<script type="text/javascript" onload="loaded(3)" onerror="erred(3)" src="resources/script-load.js"></script>
    56 <script type="text/javascript" onload="loaded(4)" onerror="erred(4)" src="resources/script-load.js"></script>
    5767<script type="text/javascript">
    58     document.write('<script type="text/javascript" onload="loaded(5)" onerror="erred(5)" src="resources/script-load.js"></script'+'>');
     68    document.write('<script type="text/javascript" onload="loaded(4)" onerror="erred(4)" src="resources/script-load.js"></script'+'>');
    5969</script>
    6070This tests for regressions against <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5812">http://bugzilla.opendarwin.org/show_bug.cgi?id=5812</a>
    6171Generate load events for &lt;script&gt; elements</i>.
    6272<hr>
    63 <p>Test result: <span id="results"></span></p>
     73<p id="results">FAIL: Test never finished.</p>
    6474</body>
    6575</html>
  • trunk/LayoutTests/fast/dom/Window/get-set-properties-expected.txt

    r24182 r29428  
    1 Tests getting and setting window properties and functions.
     1This page tests getting and setting window properties and functions.
    22
    33
    44----- tests for getting/setting read-write properties -----
    55
    6 PASS: canGet('addEventListener') should be 'true' and is.
    7 PASS: canSet('addEventListener') should be 'true' and is.
    8 PASS: canGet('alert') should be 'true' and is.
    9 PASS: canSet('alert') should be 'true' and is.
    10 PASS: canGet('atob') should be 'true' and is.
    11 PASS: canSet('atob') should be 'true' and is.
    126PASS: canGet('Attr') should be 'true' and is.
    137PASS: canSet('Attr') should be 'true' and is.
    14 PASS: canGet('btoa') should be 'true' and is.
    15 PASS: canSet('btoa') should be 'true' and is.
    16 PASS: canGet('captureEvents') should be 'true' and is.
    17 PASS: canSet('captureEvents') should be 'true' and is.
    188PASS: canGet('CDATASection') should be 'true' and is.
    199PASS: canSet('CDATASection') should be 'true' and is.
    20 PASS: canGet('CharacterData') should be 'true' and is.
    21 PASS: canSet('CharacterData') should be 'true' and is.
    22 PASS: canGet('clearInterval') should be 'true' and is.
    23 PASS: canSet('clearInterval') should be 'true' and is.
    24 PASS: canGet('clearTimeout') should be 'true' and is.
    25 PASS: canSet('clearTimeout') should be 'true' and is.
    26 PASS: canGet('Comment') should be 'true' and is.
    27 PASS: canSet('Comment') should be 'true' and is.
    28 PASS: canGet('console') should be 'true' and is.
    29 PASS: canSet('console') should be 'true' and is.
    3010PASS: canGet('CSSPrimitiveValue') should be 'true' and is.
    3111PASS: canSet('CSSPrimitiveValue') should be 'true' and is.
     
    3616PASS: canGet('CSSValue') should be 'true' and is.
    3717PASS: canSet('CSSValue') should be 'true' and is.
     18PASS: canGet('CharacterData') should be 'true' and is.
     19PASS: canSet('CharacterData') should be 'true' and is.
     20PASS: canGet('Comment') should be 'true' and is.
     21PASS: canSet('Comment') should be 'true' and is.
     22PASS: canGet('DOMException') should be 'true' and is.
     23PASS: canSet('DOMException') should be 'true' and is.
     24PASS: canGet('DOMImplementation') should be 'true' and is.
     25PASS: canSet('DOMImplementation') should be 'true' and is.
     26PASS: canGet('DOMParser') should be 'true' and is.
     27PASS: canSet('DOMParser') should be 'true' and is.
    3828PASS: canGet('Document') should be 'true' and is.
    3929PASS: canSet('Document') should be 'true' and is.
     
    4232PASS: canGet('DocumentType') should be 'true' and is.
    4333PASS: canSet('DocumentType') should be 'true' and is.
    44 PASS: canGet('DOMException') should be 'true' and is.
    45 PASS: canSet('DOMException') should be 'true' and is.
    46 PASS: canGet('DOMImplementation') should be 'true' and is.
    47 PASS: canSet('DOMImplementation') should be 'true' and is.
    48 PASS: canGet('DOMParser') should be 'true' and is.
    49 PASS: canSet('DOMParser') should be 'true' and is.
    5034PASS: canGet('Element') should be 'true' and is.
    5135PASS: canSet('Element') should be 'true' and is.
     
    5842PASS: canGet('Event') should be 'true' and is.
    5943PASS: canSet('Event') should be 'true' and is.
    60 PASS: canGet('event') should be 'true' and is.
    61 PASS: canSet('event') should be 'true' and is.
    6244PASS: canGet('HTMLAnchorElement') should be 'true' and is.
    6345PASS: canSet('HTMLAnchorElement') should be 'true' and is.
     
    6648PASS: canGet('HTMLAreaElement') should be 'true' and is.
    6749PASS: canSet('HTMLAreaElement') should be 'true' and is.
     50PASS: canGet('HTMLBRElement') should be 'true' and is.
     51PASS: canSet('HTMLBRElement') should be 'true' and is.
    6852PASS: canGet('HTMLBaseElement') should be 'true' and is.
    6953PASS: canSet('HTMLBaseElement') should be 'true' and is.
     
    7256PASS: canGet('HTMLBodyElement') should be 'true' and is.
    7357PASS: canSet('HTMLBodyElement') should be 'true' and is.
    74 PASS: canGet('HTMLBRElement') should be 'true' and is.
    75 PASS: canSet('HTMLBRElement') should be 'true' and is.
    7658PASS: canGet('HTMLButtonElement') should be 'true' and is.
    7759PASS: canSet('HTMLButtonElement') should be 'true' and is.
    7860PASS: canGet('HTMLCanvasElement') should be 'true' and is.
    7961PASS: canSet('HTMLCanvasElement') should be 'true' and is.
     62PASS: canGet('HTMLDListElement') should be 'true' and is.
     63PASS: canSet('HTMLDListElement') should be 'true' and is.
    8064PASS: canGet('HTMLDirectoryElement') should be 'true' and is.
    8165PASS: canSet('HTMLDirectoryElement') should be 'true' and is.
    8266PASS: canGet('HTMLDivElement') should be 'true' and is.
    8367PASS: canSet('HTMLDivElement') should be 'true' and is.
    84 PASS: canGet('HTMLDListElement') should be 'true' and is.
    85 PASS: canSet('HTMLDListElement') should be 'true' and is.
    8668PASS: canGet('HTMLDocument') should be 'true' and is.
    8769PASS: canSet('HTMLDocument') should be 'true' and is.
     
    9880PASS: canGet('HTMLFrameSetElement') should be 'true' and is.
    9981PASS: canSet('HTMLFrameSetElement') should be 'true' and is.
     82PASS: canGet('HTMLHRElement') should be 'true' and is.
     83PASS: canSet('HTMLHRElement') should be 'true' and is.
    10084PASS: canGet('HTMLHeadElement') should be 'true' and is.
    10185PASS: canSet('HTMLHeadElement') should be 'true' and is.
    10286PASS: canGet('HTMLHeadingElement') should be 'true' and is.
    10387PASS: canSet('HTMLHeadingElement') should be 'true' and is.
    104 PASS: canGet('HTMLHRElement') should be 'true' and is.
    105 PASS: canSet('HTMLHRElement') should be 'true' and is.
    10688PASS: canGet('HTMLHtmlElement') should be 'true' and is.
    10789PASS: canSet('HTMLHtmlElement') should be 'true' and is.
     
    11496PASS: canGet('HTMLIsIndexElement') should be 'true' and is.
    11597PASS: canSet('HTMLIsIndexElement') should be 'true' and is.
     98PASS: canGet('HTMLLIElement') should be 'true' and is.
     99PASS: canSet('HTMLLIElement') should be 'true' and is.
    116100PASS: canGet('HTMLLabelElement') should be 'true' and is.
    117101PASS: canSet('HTMLLabelElement') should be 'true' and is.
    118102PASS: canGet('HTMLLegendElement') should be 'true' and is.
    119103PASS: canSet('HTMLLegendElement') should be 'true' and is.
    120 PASS: canGet('HTMLLIElement') should be 'true' and is.
    121 PASS: canSet('HTMLLIElement') should be 'true' and is.
    122104PASS: canGet('HTMLLinkElement') should be 'true' and is.
    123105PASS: canSet('HTMLLinkElement') should be 'true' and is.
     
    212194PASS: canGet('XSLTProcessor') should be 'true' and is.
    213195PASS: canSet('XSLTProcessor') should be 'true' and is.
     196PASS: canGet('addEventListener') should be 'true' and is.
     197PASS: canSet('addEventListener') should be 'true' and is.
     198PASS: canGet('alert') should be 'true' and is.
     199PASS: canSet('alert') should be 'true' and is.
     200PASS: canGet('atob') should be 'true' and is.
     201PASS: canSet('atob') should be 'true' and is.
     202PASS: canGet('btoa') should be 'true' and is.
     203PASS: canSet('btoa') should be 'true' and is.
     204PASS: canGet('captureEvents') should be 'true' and is.
     205PASS: canSet('captureEvents') should be 'true' and is.
     206PASS: canGet('clearInterval') should be 'true' and is.
     207PASS: canSet('clearInterval') should be 'true' and is.
     208PASS: canGet('clearTimeout') should be 'true' and is.
     209PASS: canSet('clearTimeout') should be 'true' and is.
     210PASS: canGet('clientInformation') should be 'true' and is.
     211PASS: canSet('clientInformation') should be 'true' and is.
     212PASS: canGet('console') should be 'true' and is.
     213PASS: canSet('console') should be 'true' and is.
     214PASS: canGet('defaultStatus') should be 'true' and is.
     215PASS: canSet('defaultStatus') should be 'true' and is.
     216PASS: canGet('defaultstatus') should be 'true' and is.
     217PASS: canSet('defaultstatus') should be 'true' and is.
     218PASS: canGet('devicePixelRatio') should be 'true' and is.
     219PASS: canSet('devicePixelRatio') should be 'true' and is.
     220PASS: canGet('event') should be 'true' and is.
     221PASS: canSet('event') should be 'true' and is.
     222PASS: canGet('frames') should be 'true' and is.
     223PASS: canSet('frames') should be 'true' and is.
     224PASS: canGet('innerHeight') should be 'true' and is.
     225PASS: canSet('innerHeight') should be 'true' and is.
     226PASS: canGet('innerWidth') should be 'true' and is.
     227PASS: canSet('innerWidth') should be 'true' and is.
     228PASS: canGet('length') should be 'true' and is.
     229PASS: canSet('length') should be 'true' and is.
     230PASS: canGet('locationbar') should be 'true' and is.
     231PASS: canSet('locationbar') should be 'true' and is.
     232PASS: canGet('menubar') should be 'true' and is.
     233PASS: canSet('menubar') should be 'true' and is.
     234PASS: canGet('navigator') should be 'true' and is.
     235PASS: canSet('navigator') should be 'true' and is.
     236PASS: canGet('offscreenBuffering') should be 'true' and is.
     237PASS: canSet('offscreenBuffering') should be 'true' and is.
     238PASS: canGet('opener') should be 'true' and is.
     239PASS: canSet('opener') should be 'true' and is.
     240PASS: canGet('outerHeight') should be 'true' and is.
     241PASS: canSet('outerHeight') should be 'true' and is.
     242PASS: canGet('outerWidth') should be 'true' and is.
     243PASS: canSet('outerWidth') should be 'true' and is.
     244PASS: canGet('parent') should be 'true' and is.
     245PASS: canSet('parent') should be 'true' and is.
     246PASS: canGet('personalbar') should be 'true' and is.
     247PASS: canSet('personalbar') should be 'true' and is.
     248PASS: canGet('screenLeft') should be 'true' and is.
     249PASS: canSet('screenLeft') should be 'true' and is.
     250PASS: canGet('screenTop') should be 'true' and is.
     251PASS: canSet('screenTop') should be 'true' and is.
     252PASS: canGet('screenX') should be 'true' and is.
     253PASS: canSet('screenX') should be 'true' and is.
     254PASS: canGet('screenY') should be 'true' and is.
     255PASS: canSet('screenY') should be 'true' and is.
     256PASS: canGet('scrollX') should be 'true' and is.
     257PASS: canSet('scrollX') should be 'true' and is.
     258PASS: canGet('scrollY') should be 'true' and is.
     259PASS: canSet('scrollY') should be 'true' and is.
     260PASS: canGet('scrollbars') should be 'true' and is.
     261PASS: canSet('scrollbars') should be 'true' and is.
     262PASS: canGet('self') should be 'true' and is.
     263PASS: canSet('self') should be 'true' and is.
     264PASS: canGet('status') should be 'true' and is.
     265PASS: canSet('status') should be 'true' and is.
     266PASS: canGet('statusbar') should be 'true' and is.
     267PASS: canSet('statusbar') should be 'true' and is.
     268PASS: canGet('toolbar') should be 'true' and is.
     269PASS: canSet('toolbar') should be 'true' and is.
     270PASS: canGet('top') should be 'true' and is.
     271PASS: canSet('top') should be 'true' and is.
    214272
    215273----- tests for getting/setting readonly properties -----
    216274
    217 PASS: canGet('clientInformation') should be 'true' and is.
    218 PASS: canSet('clientInformation') should be 'false' and is.
    219275PASS: canGet('closed') should be 'true' and is.
    220276PASS: canSet('closed') should be 'false' and is.
    221 PASS: canGet('defaultStatus') should be 'true' and is.
    222 PASS: canSet('defaultStatus') should be 'false' and is.
    223 PASS: canGet('defaultstatus') should be 'true' and is.
    224 PASS: canSet('defaultstatus') should be 'false' and is.
    225 PASS: canGet('devicePixelRatio') should be 'true' and is.
    226 PASS: canSet('devicePixelRatio') should be 'false' and is.
    227277PASS: canGet('document') should be 'true' and is.
    228278PASS: canSet('document') should be 'false' and is.
    229 PASS: canGet('frames') should be 'true' and is.
    230 PASS: canSet('frames') should be 'false' and is.
    231279PASS: canGet('history') should be 'true' and is.
    232280PASS: canSet('history') should be 'false' and is.
    233 PASS: canGet('innerHeight') should be 'true' and is.
    234 PASS: canSet('innerHeight') should be 'false' and is.
    235 PASS: canGet('innerWidth') should be 'true' and is.
    236 PASS: canSet('innerWidth') should be 'false' and is.
    237 PASS: canGet('length') should be 'true' and is.
    238 PASS: canSet('length') should be 'false' and is.
    239 PASS: canGet('locationbar') should be 'true' and is.
    240 PASS: canSet('locationbar') should be 'false' and is.
    241 PASS: canGet('menubar') should be 'true' and is.
    242 PASS: canSet('menubar') should be 'false' and is.
    243281PASS: canGet('name') should be 'true' and is.
    244282PASS: canSet('name') should be 'false' and is.
    245 PASS: canGet('navigator') should be 'true' and is.
    246 PASS: canSet('navigator') should be 'false' and is.
    247 PASS: canGet('offscreenBuffering') should be 'true' and is.
    248 PASS: canSet('offscreenBuffering') should be 'false' and is.
    249 PASS: canGet('opener') should be 'true' and is.
    250 PASS: canSet('opener') should be 'false' and is.
    251 PASS: canGet('outerHeight') should be 'true' and is.
    252 PASS: canSet('outerHeight') should be 'false' and is.
    253 PASS: canGet('outerWidth') should be 'true' and is.
    254 PASS: canSet('outerWidth') should be 'false' and is.
    255283PASS: canGet('pageXOffset') should be 'true' and is.
    256284PASS: canSet('pageXOffset') should be 'false' and is.
    257285PASS: canGet('pageYOffset') should be 'true' and is.
    258286PASS: canSet('pageYOffset') should be 'false' and is.
    259 PASS: canGet('parent') should be 'true' and is.
    260 PASS: canSet('parent') should be 'false' and is.
    261 PASS: canGet('personalbar') should be 'true' and is.
    262 PASS: canSet('personalbar') should be 'false' and is.
    263287PASS: canGet('screen') should be 'true' and is.
    264288PASS: canSet('screen') should be 'false' and is.
    265 PASS: canGet('screenLeft') should be 'true' and is.
    266 PASS: canSet('screenLeft') should be 'false' and is.
    267 PASS: canGet('screenTop') should be 'true' and is.
    268 PASS: canSet('screenTop') should be 'false' and is.
    269 PASS: canGet('screenX') should be 'true' and is.
    270 PASS: canSet('screenX') should be 'false' and is.
    271 PASS: canGet('screenY') should be 'true' and is.
    272 PASS: canSet('screenY') should be 'false' and is.
    273 PASS: canGet('scrollbars') should be 'true' and is.
    274 PASS: canSet('scrollbars') should be 'false' and is.
    275 PASS: canGet('scrollX') should be 'true' and is.
    276 PASS: canSet('scrollX') should be 'false' and is.
    277 PASS: canGet('scrollY') should be 'true' and is.
    278 PASS: canSet('scrollY') should be 'false' and is.
    279 PASS: canGet('self') should be 'true' and is.
    280 PASS: canSet('self') should be 'false' and is.
    281 PASS: canGet('status') should be 'true' and is.
    282 PASS: canSet('status') should be 'false' and is.
    283 PASS: canGet('statusbar') should be 'true' and is.
    284 PASS: canSet('statusbar') should be 'false' and is.
    285 PASS: canGet('toolbar') should be 'true' and is.
    286 PASS: canSet('toolbar') should be 'false' and is.
    287 PASS: canGet('top') should be 'true' and is.
    288 PASS: canSet('top') should be 'false' and is.
    289289PASS: canGet('window') should be 'true' and is.
    290290PASS: canSet('window') should be 'false' and is.
    291291
    292 ----- tests for getting/setting function -----
     292----- tests for getting/setting functions -----
    293293
    294294PASS: canGet('blur') should be 'true' and is.
  • trunk/LayoutTests/fast/dom/Window/get-set-properties.html

    r24182 r29428  
    1 <p>Tests getting and setting window properties and functions.</p>
     1<p>This page tests getting and setting window properties and functions.</p>
    22<pre id="console"></pre>
    33
     
    5858
    5959var windowReadWriteProperties = [
    60     "addEventListener",
    61     "alert",
    62     "atob",
    6360    "Attr",
    64     "btoa",
    65     "captureEvents",
    6661    "CDATASection",
    67     "CharacterData",
    68     "clearInterval",
    69     "clearTimeout",
    70     "Comment",
    71     "console",
    7262    "CSSPrimitiveValue",
    7363    "CSSRule",
    7464    "CSSStyleDeclaration",
    7565    "CSSValue",
     66    "CharacterData",
     67    "Comment",
     68    "DOMException",
     69    "DOMImplementation",
     70    "DOMParser",
    7671    "Document",
    7772    "DocumentFragment",
    7873    "DocumentType",
    79     "DOMException",
    80     "DOMImplementation",
    81     "DOMParser",
    8274    "Element",
    8375    "Entity",
     
    8577    "EvalError",
    8678    "Event",
    87     "event",
    8879    "HTMLAnchorElement",
    8980    "HTMLAppletElement",
    9081    "HTMLAreaElement",
     82    "HTMLBRElement",
    9183    "HTMLBaseElement",
    9284    "HTMLBaseFontElement",
    9385    "HTMLBodyElement",
    94     "HTMLBRElement",
    9586    "HTMLButtonElement",
    9687    "HTMLCanvasElement",
     88    "HTMLDListElement",
    9789    "HTMLDirectoryElement",
    9890    "HTMLDivElement",
    99     "HTMLDListElement",
    10091    "HTMLDocument",
    10192    "HTMLElement",
     
    10596    "HTMLFrameElement",
    10697    "HTMLFrameSetElement",
     98    "HTMLHRElement",
    10799    "HTMLHeadElement",
    108100    "HTMLHeadingElement",
    109     "HTMLHRElement",
    110101    "HTMLHtmlElement",
    111102    "HTMLIFrameElement",
     
    113104    "HTMLInputElement",
    114105    "HTMLIsIndexElement",
     106    "HTMLLIElement",
    115107    "HTMLLabelElement",
    116108    "HTMLLegendElement",
    117     "HTMLLIElement",
    118109    "HTMLLinkElement",
    119110    "HTMLMapElement",
     
    162153    "XPathResult",
    163154    "XSLTProcessor",
    164 ];
    165 
    166 var windowReadOnlyProperties = [
     155    "addEventListener",
     156    "alert",
     157    "atob",
     158    "btoa",
     159    "captureEvents",
     160    "clearInterval",
     161    "clearTimeout",
    167162    "clientInformation",
    168     "closed",
     163    "console",
    169164    "defaultStatus",
    170165    "defaultstatus",
    171166    "devicePixelRatio",
    172     "document",
     167    "event",
    173168    "frames",
    174     "history",
    175169    "innerHeight",
    176170    "innerWidth",
     
    178172    "locationbar",
    179173    "menubar",
    180     "name",
    181174    "navigator",
    182175    "offscreenBuffering",
     
    184177    "outerHeight",
    185178    "outerWidth",
    186     "pageXOffset",
    187     "pageYOffset",
    188179    "parent",
    189180    "personalbar",
    190     "screen",
    191181    "screenLeft",
    192182    "screenTop",
    193183    "screenX",
    194184    "screenY",
    195     "scrollbars",
    196185    "scrollX",
    197186    "scrollY",
     187    "scrollbars",
    198188    "self",
    199189    "status",
    200190    "statusbar",
    201191    "toolbar",
    202     "top",
     192    "top"
     193];
     194
     195var windowReadOnlyProperties = [
     196    "closed",
     197    "document",
     198    "history",
     199    "name",
     200    "pageXOffset",
     201    "pageYOffset",
     202    "screen",
    203203    "window"
    204204];
     
    277277    }
    278278
    279     log("\n----- tests for getting/setting function -----\n");
     279    log("\n----- tests for getting/setting functions -----\n");
    280280
    281281    for (var i = 0; i < windowFunctions.length; i++) { //>
  • trunk/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt

    r23987 r29428  
    1 PASS: screen successfully shadowed
    2 PASS: history successfully shadowed
    31PASS: locationbar successfully shadowed
    42PASS: menubar successfully shadowed
     
    75PASS: toolbar successfully shadowed
    86PASS: devicePixelRatio successfully shadowed
    9 PASS: closed successfully shadowed
    10 PASS: crypto successfully shadowed
    117PASS: defaultStatus successfully shadowed
    128PASS: defaultstatus successfully shadowed
     
    1915PASS: name successfully shadowed
    2016PASS: navigator successfully shadowed
    21 PASS: location successfully shadowed
    2217PASS: clientInformation successfully shadowed
    2318PASS: offscreenBuffering successfully shadowed
     
    2520PASS: outerHeight successfully shadowed
    2621PASS: outerWidth successfully shadowed
    27 PASS: pageXOffset successfully shadowed
    28 PASS: pageYOffset successfully shadowed
    2922PASS: parent successfully shadowed
    3023PASS: screenX successfully shadowed
     
    3629PASS: self successfully shadowed
    3730PASS: top successfully shadowed
    38 PASS: onabort successfully shadowed
    39 PASS: onblur successfully shadowed
    40 PASS: onchange successfully shadowed
    41 PASS: onclick successfully shadowed
    42 PASS: ondblclick successfully shadowed
    43 PASS: onerror successfully shadowed
    44 PASS: onfocus successfully shadowed
    45 PASS: onkeydown successfully shadowed
    46 PASS: onkeypress successfully shadowed
    47 PASS: onkeyup successfully shadowed
    48 PASS: onload successfully shadowed
    49 PASS: onmousedown successfully shadowed
    50 PASS: onmousemove successfully shadowed
    51 PASS: onmouseout successfully shadowed
    52 PASS: onmouseover successfully shadowed
    53 PASS: onmouseup successfully shadowed
    54 PASS: onmousewheel successfully shadowed
    55 PASS: onreset successfully shadowed
    56 PASS: onresize successfully shadowed
    57 PASS: onscroll successfully shadowed
    58 PASS: onsearch successfully shadowed
    59 PASS: onselect successfully shadowed
    60 PASS: onsubmit successfully shadowed
    61 PASS: onunload successfully shadowed
    62 PASS: onbeforeunload successfully shadowed
    63 PASS: frameElement successfully shadowed
    64 PASS: window successfully shadowed
    6531PASS: getSelection successfully shadowed
    6632PASS: getComputedStyle successfully shadowed
  • trunk/LayoutTests/fast/dom/Window/window-property-shadowing.html

    r28884 r29428  
    1616
    1717        // Window Attributes
    18         var screen = 1;
    19         log(screen == 1 ? "PASS: screen successfully shadowed" : "FAIL: screen was not shadowed");
    20         var history = 1;
    21         log(history == 1 ? "PASS: history successfully shadowed" : "FAIL: history was not shadowed");
    2218        var locationbar = 1;
    2319        log(locationbar == 1 ? "PASS: locationbar successfully shadowed" : "FAIL: locationbar was not shadowed");
     
    3228        var devicePixelRatio = 1;
    3329        log(devicePixelRatio == 1 ? "PASS: devicePixelRatio successfully shadowed" : "FAIL: devicePixelRatio was not shadowed");
    34         var closed = 1;
    35         log(closed == 1 ? "PASS: closed successfully shadowed" : "FAIL: closed was not shadowed");
    36         var crypto = 1;
    37         log(crypto == 1 ? "PASS: crypto successfully shadowed" : "FAIL: crypto was not shadowed");
    3830        var defaultStatus = 1;
    3931        log(defaultStatus == 1 ? "PASS: defaultStatus successfully shadowed" : "FAIL: defaultStatus was not shadowed");
     
    5648        var navigator = 1;
    5749        log(navigator == 1 ? "PASS: navigator successfully shadowed" : "FAIL: navigator was not shadowed");
    58         var location = 1;
    59         log(location == 1 ? "PASS: location successfully shadowed" : "FAIL: location was not shadowed");
    6050        var clientInformation = 1;
    6151        log(clientInformation == 1 ? "PASS: clientInformation successfully shadowed" : "FAIL: clientInformation was not shadowed");
     
    6858        var outerWidth = 1;
    6959        log(outerWidth == 1 ? "PASS: outerWidth successfully shadowed" : "FAIL: outerWidth was not shadowed");
    70         var pageXOffset = 1;
    71         log(pageXOffset == 1 ? "PASS: pageXOffset successfully shadowed" : "FAIL: pageXOffset was not shadowed");
    72         var pageYOffset = 1;
    73         log(pageYOffset == 1 ? "PASS: pageYOffset successfully shadowed" : "FAIL: pageYOffset was not shadowed");
    7460        var parent = 1;
    7561        log(parent == 1 ? "PASS: parent successfully shadowed" : "FAIL: parent was not shadowed");
     
    9076        var top = 1;
    9177        log(top == 1 ? "PASS: top successfully shadowed" : "FAIL: top was not shadowed");
    92         var onabort = 1;
    93         log(onabort == 1 ? "PASS: onabort successfully shadowed" : "FAIL: onabort was not shadowed");
    94         var onblur = 1;
    95         log(onblur == 1 ? "PASS: onblur successfully shadowed" : "FAIL: onblur was not shadowed");
    96         var onchange = 1;
    97         log(onchange == 1 ? "PASS: onchange successfully shadowed" : "FAIL: onchange was not shadowed");
    98         var onclick = 1;
    99         log(onclick == 1 ? "PASS: onclick successfully shadowed" : "FAIL: onclick was not shadowed");
    100         var ondblclick = 1;
    101         log(ondblclick == 1 ? "PASS: ondblclick successfully shadowed" : "FAIL: ondblclick was not shadowed");
    102         var onerror = 1;
    103         log(onerror == 1 ? "PASS: onerror successfully shadowed" : "FAIL: onerror was not shadowed");
    104         var onfocus = 1;
    105         log(onfocus == 1 ? "PASS: onfocus successfully shadowed" : "FAIL: onfocus was not shadowed");
    106         var onkeydown = 1;
    107         log(onkeydown == 1 ? "PASS: onkeydown successfully shadowed" : "FAIL: onkeydown was not shadowed");
    108         var onkeypress = 1;
    109         log(onkeypress == 1 ? "PASS: onkeypress successfully shadowed" : "FAIL: onkeypress was not shadowed");
    110         var onkeyup = 1;
    111         log(onkeyup == 1 ? "PASS: onkeyup successfully shadowed" : "FAIL: onkeyup was not shadowed");
    112         var onload = 1;
    113         log(onload == 1 ? "PASS: onload successfully shadowed" : "FAIL: onload was not shadowed");
    114         var onmousedown = 1;
    115         log(onmousedown == 1 ? "PASS: onmousedown successfully shadowed" : "FAIL: onmousedown was not shadowed");
    116         var onmousemove = 1;
    117         log(onmousemove == 1 ? "PASS: onmousemove successfully shadowed" : "FAIL: onmousemove was not shadowed");
    118         var onmouseout = 1;
    119         log(onmouseout == 1 ? "PASS: onmouseout successfully shadowed" : "FAIL: onmouseout was not shadowed");
    120         var onmouseover = 1;
    121         log(onmouseover == 1 ? "PASS: onmouseover successfully shadowed" : "FAIL: onmouseover was not shadowed");
    122         var onmouseup = 1;
    123         log(onmouseup == 1 ? "PASS: onmouseup successfully shadowed" : "FAIL: onmouseup was not shadowed");
    124         var onmousewheel = 1;
    125         log(onmousewheel == 1 ? "PASS: onmousewheel successfully shadowed" : "FAIL: onmousewheel was not shadowed");
    126         var onreset = 1;
    127         log(onreset == 1 ? "PASS: onreset successfully shadowed" : "FAIL: onreset was not shadowed");
    128         var onresize = 1;
    129         log(onresize == 1 ? "PASS: onresize successfully shadowed" : "FAIL: onresize was not shadowed");
    130         var onscroll = 1;
    131         log(onscroll == 1 ? "PASS: onscroll successfully shadowed" : "FAIL: onscroll was not shadowed");
    132         var onsearch = 1;
    133         log(onsearch == 1 ? "PASS: onsearch successfully shadowed" : "FAIL: onsearch was not shadowed");
    134         var onselect = 1;
    135         log(onselect == 1 ? "PASS: onselect successfully shadowed" : "FAIL: onselect was not shadowed");
    136         var onsubmit = 1;
    137         log(onsubmit == 1 ? "PASS: onsubmit successfully shadowed" : "FAIL: onsubmit was not shadowed");
    138         var onunload = 1;
    139         log(onunload == 1 ? "PASS: onunload successfully shadowed" : "FAIL: onunload was not shadowed");
    140         var onbeforeunload = 1;
    141         log(onbeforeunload == 1 ? "PASS: onbeforeunload successfully shadowed" : "FAIL: onbeforeunload was not shadowed");
    142         var frameElement = 1;
    143         log(frameElement == 1 ? "PASS: frameElement successfully shadowed" : "FAIL: frameElement was not shadowed");
    144         var window = 1;
    145         log(window == 1 ? "PASS: window successfully shadowed" : "FAIL: window was not shadowed");
    14678
    14779        // Window functions
  • trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt

    r27161 r29428  
    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.
     6
     7CONSOLE 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.
     8
     9CONSOLE 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.
     10
     11CONSOLE 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.
     12
     13CONSOLE 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.
     14
     15CONSOLE 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.
     16
     17CONSOLE 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.
     18
     19CONSOLE 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.
     20
     21CONSOLE 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.
     22
     23CONSOLE 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.
     24
     25CONSOLE 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
     27CONSOLE 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.
     28
     29CONSOLE 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.
     30
     31CONSOLE 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.
     32
     33CONSOLE 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.
     34
     35CONSOLE 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.
     36
     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.
     38
     39CONSOLE 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.
     40
     41CONSOLE 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.
     42
     43CONSOLE 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.
     44
     45CONSOLE 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.
    246
    347CONSOLE 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.
  • trunk/WebCore/ChangeLog

    r29427 r29428  
     12008-01-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4       
     5        Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
     6        variable access (16644)
     7       
     8        Removed the ReadOnly bit from some properties, to match Firefox. Also
     9        removed status-related setters, to allow using their names as variable
     10        names.
     11       
     12        * bindings/scripts/CodeGeneratorJS.pm: Added support for properties that
     13        are one-way across domain boundaries, to match Firefox.
     14
     15        * bindings/js/kjs_window.cpp: Changed ReadOnly declarations to match FF.
     16
     17        * bindings/scripts/CodeGeneratorJS.pm: Don't use JSObject:: because
     18        we don't know that JSObject is our base class.
     19
     20        * page/DOMWindow.idl: Replaced lots of readonly declarations with
     21        [Replaceable] declarations.
     22
     23        * page/DOMWindow.h: Removed interfaces for setting status text via the
     24        DOM. (They were getting in the way of, e.g., "var status"
     25        declarations.) By default, IE 7 and FF disable these interfaces in order
     26        to defend against phishing attacks that try to spoof domain names in the
     27        statusbar.
     28        * page/DOMWindow.cpp:
     29
    1302008-01-11  Anyang Ren  <anyang.ren@gmail.com>
    231
  • trunk/WebCore/bindings/js/kjs_window.cpp

    r29388 r29428  
    165165  event                 Window::Event_              DontDelete
    166166  location              Window::Location_           DontDelete
    167   navigator             Window::Navigator_          DontDelete|ReadOnly
    168   clientInformation     Window::ClientInformation   DontDelete|ReadOnly
     167  navigator             Window::Navigator_          DontDelete
     168  clientInformation     Window::ClientInformation   DontDelete
    169169# -- Event Listeners --
    170170  onabort               Window::Onabort             DontDelete
     
    489489      // FIXME: this will make the "navigator" object accessible from windows that fail
    490490      // the security check the first time, but not subsequent times, seems weird.
    491       const_cast<Window *>(this)->putDirect("navigator", n, DontDelete|ReadOnly);
    492       const_cast<Window *>(this)->putDirect("clientInformation", n, DontDelete|ReadOnly);
     491      const_cast<Window *>(this)->putDirect("navigator", n, DontDelete);
     492      const_cast<Window *>(this)->putDirect("clientInformation", n, DontDelete);
    493493      return n;
    494494    }
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r29325 r29428  
    901901                . "AttrNum: {\n");
    902902
    903             if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
     903            if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} &&
     904                !$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurity"} &&
     905                !$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurityOnRead"}) {
    904906                push(@implContent, "        if (!allowsAccessFrom(exec))\n");
    905907                push(@implContent, "            return jsUndefined();\n");
     
    10151017                        $implIncludes{"JS" . $constructorType . ".h"} = 1;
    10161018                        push(@implContent, "        // Shadowing a built-in constructor\n");
    1017                         push(@implContent, "        JSObject::put(exec, \"$name\", value);\n");
     1019                        push(@implContent, "        putDirect(\"$name\", value);\n");
    10181020                    } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
    1019                         push(@implContent, "        JSObject::put(exec, \"$name\", value);\n");
     1021                        push(@implContent, "        putDirect(\"$name\", value);\n");
    10201022                    } else {
    10211023                        if ($podType) {
  • trunk/WebCore/page/DOMWindow.cpp

    r29051 r29428  
    507507}
    508508
    509 void DOMWindow::setStatus(const String& string)
    510 {
    511     if (!m_frame)
    512         return;
    513 
    514     m_frame->setJSStatusBarText(string);
    515 }
    516 
    517509String DOMWindow::defaultStatus() const
    518510{
     
    521513
    522514    return m_frame->jsDefaultStatusBarText();
    523 }
    524 
    525 void DOMWindow::setDefaultStatus(const String& string)
    526 {
    527     if (!m_frame)
    528         return;
    529 
    530     m_frame->setJSDefaultStatusBarText(string);
    531515}
    532516
  • trunk/WebCore/page/DOMWindow.h

    r29051 r29428  
    110110
    111111        String status() const;
    112         void setStatus(const String&);
    113112        String defaultStatus() const;
    114113        void setDefaultStatus(const String&);
  • trunk/WebCore/page/DOMWindow.idl

    r29073 r29428  
    3030        readonly attribute Screen screen;
    3131        readonly attribute [DoNotCheckDomainSecurity] History history;
    32         readonly attribute BarInfo locationbar;
    33         readonly attribute BarInfo menubar;
    34         readonly attribute BarInfo personalbar;
    35         readonly attribute BarInfo scrollbars;
    36         readonly attribute BarInfo statusbar;
    37         readonly attribute BarInfo toolbar;
     32        attribute [Replaceable] BarInfo locationbar;
     33        attribute [Replaceable] BarInfo menubar;
     34        attribute [Replaceable] BarInfo personalbar;
     35        attribute [Replaceable] BarInfo scrollbars;
     36        attribute [Replaceable] BarInfo statusbar;
     37        attribute [Replaceable] BarInfo toolbar;
    3838
    3939        DOMSelection getSelection();
     
    6161                     in boolean showDialog);
    6262
    63         readonly attribute boolean offscreenBuffering;
    64 
    65         readonly attribute long outerHeight;
    66         readonly attribute long outerWidth;
    67         readonly attribute long innerHeight;
    68         readonly attribute long innerWidth;
    69         readonly attribute long screenX;
    70         readonly attribute long screenY;
    71         readonly attribute long screenLeft;
    72         readonly attribute long screenTop;
    73         readonly attribute long scrollX;
    74         readonly attribute long scrollY;
     63        attribute [Replaceable] boolean offscreenBuffering;
     64
     65        attribute [Replaceable] long outerHeight;
     66        attribute [Replaceable] long outerWidth;
     67        attribute [Replaceable] long innerHeight;
     68        attribute [Replaceable] long innerWidth;
     69        attribute [Replaceable] long screenX;
     70        attribute [Replaceable] long screenY;
     71        attribute [Replaceable] long screenLeft;
     72        attribute [Replaceable] long screenTop;
     73        attribute [Replaceable] long scrollX;
     74        attribute [Replaceable] long scrollY;
    7575        readonly attribute long pageXOffset;
    7676        readonly attribute long pageYOffset;
     
    8686        readonly attribute [DoNotCheckDomainSecurity] boolean closed;
    8787
    88         readonly attribute [DoNotCheckDomainSecurity] unsigned long length;
    89 
    90                  attribute DOMString name;
    91 
    92                  attribute DOMString status;
    93                  attribute DOMString defaultStatus;
     88        attribute [Replaceable, DoNotCheckDomainSecurityOnRead] unsigned long length;
     89
     90        attribute DOMString name;
     91
     92        attribute [Replaceable] DOMString status;
     93        attribute [Replaceable] DOMString defaultStatus;
    9494#if defined(LANGUAGE_JAVASCRIPT)
    95                  // This attribute is an alias of defaultStatus and is necessary for legacy uses.
    96                  attribute DOMString defaultstatus;
     95        // This attribute is an alias of defaultStatus and is necessary for legacy uses.
     96        attribute [Replaceable] DOMString defaultstatus;
    9797#endif
    9898
    9999        // Self referential attributes
    100         readonly attribute [DoNotCheckDomainSecurity] DOMWindow self;
     100        attribute [Replaceable, DoNotCheckDomainSecurityOnRead] DOMWindow self;
    101101        readonly attribute [DoNotCheckDomainSecurity] DOMWindow window;
    102         readonly attribute [DoNotCheckDomainSecurity] DOMWindow frames;
    103 
    104         readonly attribute [DoNotCheckDomainSecurity] DOMWindow opener;
    105         readonly attribute [DoNotCheckDomainSecurity] DOMWindow parent;
    106         readonly attribute [DoNotCheckDomainSecurity] DOMWindow top;
     102        attribute [Replaceable, DoNotCheckDomainSecurityOnRead] DOMWindow frames;
     103
     104        attribute [Replaceable, DoNotCheckDomainSecurityOnRead] DOMWindow opener;
     105        attribute [Replaceable, DoNotCheckDomainSecurity] DOMWindow parent;
     106        attribute [Replaceable, DoNotCheckDomainSecurity] DOMWindow top;
    107107
    108108        // DOM Level 2 AbstractView Interface
     
    117117                                       in DOMString pseudoElement,
    118118                                       in [Optional] boolean authorOnly);
    119         readonly attribute double devicePixelRatio;
     119        attribute [Replaceable] double devicePixelRatio;
    120120
    121121#if defined(ENABLE_DATABASE)
Note: See TracChangeset for help on using the changeset viewer.