Title: [199349] releases/WebKitGTK/webkit-2.12
Revision
199349
Author
[email protected]
Date
2016-04-12 06:52:56 -0700 (Tue, 12 Apr 2016)

Log Message

Merge r197874 - Move attributes to the instance for most interfaces that have "Error" in their name
https://bugs.webkit.org/show_bug.cgi?id=155231

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Our bindings generator was keeping attributes on the instances for
interfaces having "Error" or "Exception" in their name. The reason is
that interfaces that have "Error" in their prototype would not behave
correctly otherwise because "Error" incorrectly has its attributes on
the instance at the moment. However, in our bindings generator, the
condition to decide if an interface's prototype should be "Error" is
if $interface->isException. Therefore, we should use the same condition
to decide if we should keep attributes on the instance until "Error"
is updated to have its attributes on the prototype. Doing this for any
interface having "Error" or "Exception" in their name is overkill.

No new tests, already covered by existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstance):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/ChangeLog (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/ChangeLog	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/ChangeLog	2016-04-12 13:52:56 UTC (rev 199349)
@@ -1,3 +1,14 @@
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Move attributes to the instance for most interfaces that have "Error" in their name
+        https://bugs.webkit.org/show_bug.cgi?id=155231
+
+        Reviewed by Darin Adler.
+
+        Rebaseline now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
 2016-02-21  Chris Dumez  <[email protected]>
 
         iframe/frame/object.contentDocument should be on the prototype

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-04-12 13:52:56 UTC (rev 199349)
@@ -2184,14 +2184,14 @@
 PASS MediaError interface: constant MEDIA_ERR_DECODE on interface prototype object 
 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface object 
 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object 
-FAIL MediaError interface: attribute code assert_true: The prototype object must have a property "code" expected true got false
+PASS MediaError interface: attribute code 
 PASS MediaError must be primary interface of errorVideo.error 
 PASS Stringification of errorVideo.error 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_ABORTED" with the proper type (0) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_NETWORK" with the proper type (1) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_DECODE" with the proper type (2) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type (3) 
-FAIL MediaError interface: errorVideo.error must inherit property "code" with the proper type (4) assert_inherits: property "code" found on object expected in prototype chain
+PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type (4) 
 PASS AudioTrackList interface: existence and properties of interface object 
 PASS AudioTrackList interface object length 
 PASS AudioTrackList interface object name 
@@ -4260,10 +4260,10 @@
 PASS ErrorEvent interface object name 
 PASS ErrorEvent interface: existence and properties of interface prototype object 
 PASS ErrorEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL ErrorEvent interface: attribute message assert_true: The prototype object must have a property "message" expected true got false
-FAIL ErrorEvent interface: attribute filename assert_true: The prototype object must have a property "filename" expected true got false
-FAIL ErrorEvent interface: attribute lineno assert_true: The prototype object must have a property "lineno" expected true got false
-FAIL ErrorEvent interface: attribute colno assert_true: The prototype object must have a property "colno" expected true got false
+PASS ErrorEvent interface: attribute message 
+PASS ErrorEvent interface: attribute filename 
+PASS ErrorEvent interface: attribute lineno 
+PASS ErrorEvent interface: attribute colno 
 FAIL ErrorEvent interface: attribute error assert_true: The prototype object must have a property "error" expected true got false
 PASS Navigator interface: existence and properties of interface object 
 PASS Navigator interface object length 

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-04-12 13:52:56 UTC (rev 199349)
@@ -2184,14 +2184,14 @@
 PASS MediaError interface: constant MEDIA_ERR_DECODE on interface prototype object 
 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface object 
 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object 
-FAIL MediaError interface: attribute code assert_true: The prototype object must have a property "code" expected true got false
+PASS MediaError interface: attribute code 
 PASS MediaError must be primary interface of errorVideo.error 
 PASS Stringification of errorVideo.error 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_ABORTED" with the proper type (0) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_NETWORK" with the proper type (1) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_DECODE" with the proper type (2) 
 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type (3) 
-FAIL MediaError interface: errorVideo.error must inherit property "code" with the proper type (4) assert_inherits: property "code" found on object expected in prototype chain
+PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type (4) 
 PASS AudioTrackList interface: existence and properties of interface object 
 PASS AudioTrackList interface object length 
 PASS AudioTrackList interface object name 
@@ -4264,10 +4264,10 @@
 PASS ErrorEvent interface object name 
 PASS ErrorEvent interface: existence and properties of interface prototype object 
 PASS ErrorEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL ErrorEvent interface: attribute message assert_true: The prototype object must have a property "message" expected true got false
-FAIL ErrorEvent interface: attribute filename assert_true: The prototype object must have a property "filename" expected true got false
-FAIL ErrorEvent interface: attribute lineno assert_true: The prototype object must have a property "lineno" expected true got false
-FAIL ErrorEvent interface: attribute colno assert_true: The prototype object must have a property "colno" expected true got false
+PASS ErrorEvent interface: attribute message 
+PASS ErrorEvent interface: attribute filename 
+PASS ErrorEvent interface: attribute lineno 
+PASS ErrorEvent interface: attribute colno 
 FAIL ErrorEvent interface: attribute error assert_true: The prototype object must have a property "error" expected true got false
 PASS Navigator interface: existence and properties of interface object 
 PASS Navigator interface object length 

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-12 13:52:56 UTC (rev 199349)
@@ -1,3 +1,34 @@
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Unreviewed, rebaseline bindings tests after r197874.
+
+        * bindings/scripts/test/JS/JSattribute.cpp:
+        (WebCore::JSattribute::getOwnPropertySlot):
+        * bindings/scripts/test/JS/JSattribute.h:
+
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Move attributes to the instance for most interfaces that have "Error" in their name
+        https://bugs.webkit.org/show_bug.cgi?id=155231
+
+        Reviewed by Darin Adler.
+
+        Our bindings generator was keeping attributes on the instances for
+        interfaces having "Error" or "Exception" in their name. The reason is
+        that interfaces that have "Error" in their prototype would not behave
+        correctly otherwise because "Error" incorrectly has its attributes on
+        the instance at the moment. However, in our bindings generator, the
+        condition to decide if an interface's prototype should be "Error" is
+        if $interface->isException. Therefore, we should use the same condition
+        to decide if we should keep attributes on the instance until "Error"
+        is updated to have its attributes on the prototype. Doing this for any
+        interface having "Error" or "Exception" in their name is overkill.
+
+        No new tests, already covered by existing test.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (InterfaceRequiresAttributesOnInstance):
+
 2016-03-09  Tim Horton  <[email protected]>
 
         Removing and re-adding a script message handler with the same name results in an unusable message handler

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-04-12 13:52:56 UTC (rev 199349)
@@ -670,9 +670,8 @@
     # Some of them are unavoidable due to DOM weirdness, in which case we should
     # add an IDL attribute for them
 
-    # FIXME: These two should be fixed by removing the custom override of message, etc
-    return 1 if $interfaceName =~ "Exception";
-    return 1 if $interfaceName =~ "Error";
+    # FIXME: We should be able to drop this once <rdar://problem/24466097> is fixed.
+    return 1 if $interface->isException;
 
     return 1 if IsDOMGlobalObject($interface);
 

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp	2016-04-12 13:52:56 UTC (rev 199349)
@@ -65,6 +65,20 @@
 
 typedef JSDOMConstructorNotConstructable<JSattribute> JSattributeConstructor;
 
+/* Hash table */
+
+static const struct CompactHashIndex JSattributeTableIndex[2] = {
+    { 0, -1 },
+    { -1, -1 },
+};
+
+
+static const HashTableValue JSattributeTableValues[] =
+{
+    { "readonly", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsattributeReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+};
+
+static const HashTable JSattributeTable = { 1, 1, true, JSattributeTableValues, JSattributeTableIndex };
 template<> JSValue JSattributeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
 {
     UNUSED_PARAM(vm);
@@ -85,7 +99,6 @@
 static const HashTableValue JSattributePrototypeTableValues[] =
 {
     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsattributeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSattributeConstructor) } },
-    { "readonly", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsattributeReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
 };
 
 const ClassInfo JSattributePrototype::s_info = { "attributePrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSattributePrototype) };
@@ -96,7 +109,7 @@
     reifyStaticProperties(vm, JSattributePrototypeTableValues, *this);
 }
 
-const ClassInfo JSattribute::s_info = { "attribute", &Base::s_info, 0, CREATE_METHOD_TABLE(JSattribute) };
+const ClassInfo JSattribute::s_info = { "attribute", &Base::s_info, &JSattributeTable, CREATE_METHOD_TABLE(JSattribute) };
 
 JSattribute::JSattribute(Structure* structure, JSDOMGlobalObject& globalObject, Ref<attribute>&& impl)
     : JSDOMWrapper<attribute>(structure, globalObject, WTFMove(impl))
@@ -119,6 +132,15 @@
     thisObject->JSattribute::~JSattribute();
 }
 
+bool JSattribute::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+    auto* thisObject = jsCast<JSattribute*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    if (getStaticValueSlot<JSattribute, Base>(state, JSattributeTable, thisObject, propertyName, slot))
+        return true;
+    return false;
+}
+
 EncodedJSValue jsattributeReadonly(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.h (199348 => 199349)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.h	2016-04-12 13:33:31 UTC (rev 199348)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/test/JS/JSattribute.h	2016-04-12 13:52:56 UTC (rev 199349)
@@ -38,11 +38,12 @@
         return ptr;
     }
 
-    static const bool hasStaticPropertyTable = false;
+    static const bool hasStaticPropertyTable = true;
 
     static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static attribute* toWrapped(JSC::JSValue);
+    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
 
     DECLARE_INFO;
@@ -53,6 +54,8 @@
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
     JSattribute(JSC::Structure*, JSDOMGlobalObject&, Ref<attribute>&&);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to