Add initial support for [Unforgeable] IDL extended attribute
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 17:46:24 +0000 (17:46 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 17:46:24 +0000 (17:46 +0000)
commit623f1eb441ab11c2a51f209be946de3769f6e766
tree3fd3159d719a2b06d92c122766e5f228f6e4c5eb
parent3ef95bd0627c70268800b8d56a6623d9fb0c216b
Add initial support for [Unforgeable] IDL extended attribute
https://bugs.webkit.org/show_bug.cgi?id=149147

Reviewed by Darin Adler.

Source/WebCore:

Add initial support for [Unforgeable] IDL extended attribute:
https://heycam.github.io/webidl/#Unforgeable

In particular, attributes marked as unforgeable are now:
- on the instance rather than the prototype
- non-configurable. WebKit does not match the Web IDL specification
  and most properties are currently non-configurable already. However,
  I added an extra check for [Unforgeable] so that unforgeable
  attributes stay unconfigurable if we later decide to match the spec
  and mark properties as configurable.

Operation marked as unforgeable are now non-configurable. However, this
patch does not move them from the prototype to the instance yet. This
needs to be addressed in a follow-up patch as this is a larger change.

This patch also drops support for the undocumented
[OperationsNotDeletable] IDL extended attribute. It is no longer needed
now that we support [Unforgeable] and still support [NotDeletable] for
operations.

Test: fast/dom/unforgeable-attributes.html

* Modules/plugins/QuickTimePluginReplacement.idl:
Drop [OperationsNotDeletable] on the interface and mark the only
operation on this interface as [NotDeletable]. There is no behavior
change but this allows us to drop support for a non-standard and
undocumented IDL extended attribute.

* bindings/scripts/CodeGeneratorJS.pm:
(AttributeShouldBeOnInstance):
(GenerateAttributesHashTable):
(GenerateImplementation):
Add initial support for [Unforgeable] IDL extended attribute.

* bindings/scripts/IDLAttributes.txt:
Add [Unforgeable]. Drop [OperationsNotDeletable].

* crypto/CryptoKeyPair.idl:
Drop [OperationsNotDeletable] on the interface as this interface has
no operations.

* dom/Document.idl:
* page/DOMWindow.idl:
* page/Location.idl:
Mark attributes / interfaces as [Unforgeable] as per the latest HTML
specification:
https://html.spec.whatwg.org/multipage/dom.html#document
https://html.spec.whatwg.org/multipage/browsers.html#window
https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface

LayoutTests:

New test that verifies that well-known [Unforgeable] attributes
are on the instance rather than the prototype and that they are
non-configurable.

* fast/dom/unforgeable-attributes-expected.txt: Added.
* fast/dom/unforgeable-attributes.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/unforgeable-attributes-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/unforgeable-attributes.html [new file with mode: 0644]
LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/crypto/CryptoKeyPair.idl
Source/WebCore/dom/Document.idl
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/Location.idl