diff options
author | ager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 12:46:05 +0000 |
---|---|---|
committer | ager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 12:46:05 +0000 |
commit | 3e965a912eb059d826656622c12b0cb2ab42aa88 (patch) | |
tree | 5046bb3d294b626e5ea41862ef46bcdcaa041e84 /webkit/port | |
parent | 8eb9e9f3027704f7337c13c522e4b8c0941e086e (diff) | |
download | chromium_src-3e965a912eb059d826656622c12b0cb2ab42aa88.zip chromium_src-3e965a912eb059d826656622c12b0cb2ab42aa88.tar.gz chromium_src-3e965a912eb059d826656622c12b0cb2ab42aa88.tar.bz2 |
Disallow shadowing of top since shadowing top can break frame-busting
code.
Also, make sure that top, window, location, and location.href are not
deletable.
I had to fix a couple of layout tests that rely on top being shadowable.
Review URL: http://codereview.chromium.org/9506
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/bindings/scripts/CodeGeneratorV8.pm | 16 | ||||
-rw-r--r-- | webkit/port/page/DOMWindow.idl | 6 | ||||
-rw-r--r-- | webkit/port/page/Location.idl | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/webkit/port/bindings/scripts/CodeGeneratorV8.pm b/webkit/port/bindings/scripts/CodeGeneratorV8.pm index f20e486..b8fbe70 100644 --- a/webkit/port/bindings/scripts/CodeGeneratorV8.pm +++ b/webkit/port/bindings/scripts/CodeGeneratorV8.pm @@ -874,10 +874,13 @@ sub GenerateBatchedAttributeData my $setter; my $propAttr = "v8::None"; - # Check enumerability. - if ($attribute->signature->extendedAttributes->{"DontEnum"}) { + # Check attributes. + if ($attrExt->{"DontEnum"}) { $propAttr .= "|v8::DontEnum"; } + if ($attrExt->{"DontDelete"}) { + $propAttr .= "|v8::DontDelete"; + } my $on_proto = "0 /* on instance */"; my $data = "V8ClassIndex::INVALID_CLASS_INDEX /* no data */"; @@ -1159,10 +1162,7 @@ END my $attrExt = $function->signature->extendedAttributes; my $name = $function->signature->name; - my $property_attributes = "v8::None"; - if (!$attrExt->{"DontDelete"}) { - $property_attributes .= "|v8::DontDelete"; - } + my $property_attributes = "v8::DontDelete"; if ($attrExt->{"DontEnum"}) { $property_attributes .= "|v8::DontEnum"; } @@ -1193,7 +1193,6 @@ END # # The solution is very hacky and fragile, it really needs to be replaced # by a better solution. - $property_attributes .= "|v8::ReadOnly"; push(@implContent, <<END); @@ -1214,7 +1213,6 @@ END $signature = "v8::Local<v8::Signature>()"; } - if (RequiresCustomSignature($function)) { $signature = "${name}_signature"; push(@implContent, "\n // Custom Signature '$name'\n", CreateCustomSignature($function)); @@ -1222,6 +1220,8 @@ END # Normal function call is a template my $templateFunction = GenerateNewFunctionTemplate($function, $dataNode, $signature); + + push(@implContent, <<END); // $commentInfo diff --git a/webkit/port/page/DOMWindow.idl b/webkit/port/page/DOMWindow.idl index a667251..2b4c483 100644 --- a/webkit/port/page/DOMWindow.idl +++ b/webkit/port/page/DOMWindow.idl @@ -52,7 +52,7 @@ module window { attribute [Replaceable] BarInfo toolbar; attribute [Replaceable] Navigator navigator; attribute [Replaceable, v8referenceattr=navigator] Navigator clientInformation; - attribute [DoNotCheckDomainSecurity, CustomSetter, v8DisallowShadowing] Location location; + attribute [DoNotCheckDomainSecurity, CustomSetter, DontDelete, v8DisallowShadowing] Location location; DOMSelection getSelection(); @@ -116,7 +116,7 @@ module window { // Self referential attributes attribute [Replaceable, DoNotCheckDomainSecurityOnGet] DOMWindow self; - readonly attribute [DoNotCheckDomainSecurity, v8DisallowShadowing] DOMWindow window; + readonly attribute [DoNotCheckDomainSecurity, DontDelete, v8DisallowShadowing] DOMWindow window; attribute [Replaceable, DoNotCheckDomainSecurityOnGet] DOMWindow frames; #if defined(V8_BINDING) @@ -125,7 +125,7 @@ module window { attribute [Replaceable, DoNotCheckDomainSecurityOnGet] DOMWindow opener; #endif attribute [Replaceable, DoNotCheckDomainSecurity] DOMWindow parent; - attribute [Replaceable, DoNotCheckDomainSecurity] DOMWindow top; + readonly attribute [DoNotCheckDomainSecurity, DontDelete, v8DisallowShadowing] DOMWindow top; // DOM Level 2 AbstractView Interface readonly attribute Document document; diff --git a/webkit/port/page/Location.idl b/webkit/port/page/Location.idl index e33a694..5432208 100644 --- a/webkit/port/page/Location.idl +++ b/webkit/port/page/Location.idl @@ -7,7 +7,7 @@ module core { attribute DOMString hash; attribute DOMString host; attribute DOMString hostname; - attribute [DoNotCheckDomainSecurityOnSet, v8DisallowShadowing] DOMString href; + attribute [DoNotCheckDomainSecurityOnSet, DontDelete, v8DisallowShadowing] DOMString href; attribute DOMString pathname; attribute DOMString port; attribute DOMString protocol; |