Diff
Modified: trunk/Source/WebCore/ChangeLog (108602 => 108603)
--- trunk/Source/WebCore/ChangeLog 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/ChangeLog 2012-02-23 04:24:02 UTC (rev 108603)
@@ -1,3 +1,38 @@
+2012-02-22 Kentaro Hara <[email protected]>
+
+ [Supplemental] should support constants
+ https://bugs.webkit.org/show_bug.cgi?id=79303
+
+ Reviewed by Adam Barth.
+
+ Given that we have
+
+ interface [Supplemental=Y] X { constant int A = 123; }
+
+ then the code generator should generate
+
+ X::A
+
+ to refer to the constant. However, the current code generator generates Y::A instead.
+ This patch fixes it.
+
+ Test: bindings/scripts/test/TestSupplemental.idl
+
+ * bindings/scripts/CodeGenerator.pm: Modified as described above.
+ (GenerateCompileTimeCheckForEnumsIfNeeded):
+
+ * bindings/scripts/test/JS/JSTestInterface.cpp: Updated run-bindings-tests results.
+ (WebCore):
+ * bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
+ (WebCore):
+
+ * page/DOMWindow.h: Moved DOMWindow::FileSystemType to DOMWindowFileSystem::FileSystemType.
+ (DOMWindow):
+ * fileapi/DOMWindowFileSystem.h: Ditto.
+ (DOMWindowFileSystem):
+ * fileapi/DOMWindowFileSystem.cpp: Ditto.
+ (WebCore):
+
2012-02-22 MORITA Hajime <[email protected]>
Adding a ShadowRoot to image-backed element causes a crash
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (108602 => 108603)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-02-23 04:24:02 UTC (rev 108603)
@@ -627,7 +627,11 @@
push(@checks, "#if ${conditionalString}\n");
}
- push(@checks, "COMPILE_ASSERT($value == ${interfaceName}::$name, ${interfaceName}Enum${name}IsWrongUseDoNotCheckConstants);\n");
+ if ($constant->extendedAttributes->{"ImplementedBy"}) {
+ push(@checks, "COMPILE_ASSERT($value == " . $constant->extendedAttributes->{"ImplementedBy"} . "::$name, ${interfaceName}Enum${name}IsWrongUseDoNotCheckConstants);\n");
+ } else {
+ push(@checks, "COMPILE_ASSERT($value == ${interfaceName}::$name, ${interfaceName}Enum${name}IsWrongUseDoNotCheckConstants);\n");
+ }
if ($conditional) {
push(@checks, "#endif\n");
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (108602 => 108603)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-02-23 04:24:02 UTC (rev 108603)
@@ -1369,6 +1369,10 @@
push(@hashValue2, "0");
push(@hashSpecials, "DontDelete | ReadOnly");
+ my $implementedBy = $constant->extendedAttributes->{"ImplementedBy"};
+ if ($implementedBy) {
+ $implIncludes{"${implementedBy}.h"} = 1;
+ }
my $conditional = $constant->extendedAttributes->{"Conditional"};
if ($conditional) {
$conditionals{$name} = $conditional;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (108602 => 108603)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-02-23 04:24:02 UTC (rev 108603)
@@ -2428,6 +2428,10 @@
my $value = $constant->value;
my $attrExt = $constant->extendedAttributes;
my $conditional = $attrExt->{"Conditional"};
+ my $implementedBy = $attrExt->{"ImplementedBy"};
+ if ($implementedBy) {
+ AddToImplIncludes("${implementedBy}.h");
+ }
if ($attrExt->{"V8EnabledAtRuntime"}) {
push(@constantsEnabledAtRuntime, $constant);
} else {
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (108602 => 108603)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2012-02-23 04:24:02 UTC (rev 108603)
@@ -86,10 +86,10 @@
static const HashTable JSTestInterfaceConstructorTable = { 4, 3, JSTestInterfaceConstructorTableValues, 0 };
#if ENABLE(Condition11) || ENABLE(Condition12)
-COMPILE_ASSERT(1 == TestInterface::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants);
+COMPILE_ASSERT(1 == TestSupplemental::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants);
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-COMPILE_ASSERT(2 == TestInterface::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
+COMPILE_ASSERT(2 == TestSupplemental::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
#endif
const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &Base::s_info, &JSTestInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) };
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (108602 => 108603)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-02-23 04:24:02 UTC (rev 108603)
@@ -186,10 +186,10 @@
#if ENABLE(Condition11) || ENABLE(Condition12)
-COMPILE_ASSERT(1 == TestInterface::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants);
+COMPILE_ASSERT(1 == TestSupplemental::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants);
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-COMPILE_ASSERT(2 == TestInterface::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
+COMPILE_ASSERT(2 == TestSupplemental::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
#endif
v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/fileapi/DOMWindowFileSystem.cpp (108602 => 108603)
--- trunk/Source/WebCore/fileapi/DOMWindowFileSystem.cpp 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/fileapi/DOMWindowFileSystem.cpp 2012-02-23 04:24:02 UTC (rev 108603)
@@ -99,8 +99,8 @@
LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, filePath));
}
-COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
-COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
+COMPILE_ASSERT(static_cast<int>(DOMWindowFileSystem::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
+COMPILE_ASSERT(static_cast<int>(DOMWindowFileSystem::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
} // namespace WebCore
Modified: trunk/Source/WebCore/fileapi/DOMWindowFileSystem.h (108602 => 108603)
--- trunk/Source/WebCore/fileapi/DOMWindowFileSystem.h 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/fileapi/DOMWindowFileSystem.h 2012-02-23 04:24:02 UTC (rev 108603)
@@ -44,6 +44,13 @@
static void webkitRequestFileSystem(DOMWindow*, int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
static void webkitResolveLocalFileSystemURL(DOMWindow*, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+ // They are placed here and in all capital letters so they can be checked against the constants in the
+ // IDL at compile time.
+ enum FileSystemType {
+ TEMPORARY,
+ PERSISTENT,
+ };
+
private:
DOMWindowFileSystem();
~DOMWindowFileSystem();
Modified: trunk/Source/WebCore/page/DOMWindow.h (108602 => 108603)
--- trunk/Source/WebCore/page/DOMWindow.h 2012-02-23 04:01:43 UTC (rev 108602)
+++ trunk/Source/WebCore/page/DOMWindow.h 2012-02-23 04:24:02 UTC (rev 108603)
@@ -352,16 +352,6 @@
Storage* sessionStorage(ExceptionCode&) const;
Storage* localStorage(ExceptionCode&) const;
-#if ENABLE(FILE_SYSTEM)
- // They are placed here and in all capital letters so they can be checked against the constants in the
- // IDL at compile time.
- // FIXME: Move these constants to DOMWindowFileSystem.
- enum FileSystemType {
- TEMPORARY,
- PERSISTENT,
- };
-#endif
-
#if ENABLE(NOTIFICATIONS)
NotificationCenter* webkitNotifications() const;
// Renders webkitNotifications object safely inoperable, disconnects