Diff
Modified: trunk/LayoutTests/ChangeLog (99026 => 99027)
--- trunk/LayoutTests/ChangeLog 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/ChangeLog 2011-11-02 01:52:35 UTC (rev 99027)
@@ -1,3 +1,22 @@
+2011-11-01 Anna Cavender <ann...@chromium.org>
+
+ Makes [Reflect] work for constants.
+ This is needed to avoid platform-specific define conflicts, specifically
+ TextTrack::ERROR conflicts with a windows define.
+ https://bugs.webkit.org/show_bug.cgi?id=70951
+
+ Reviewed by Darin Adler.
+
+ * media/track/track-constants-expected.txt: Added.
+ * media/track/track-constants.html: Added.
+ * media/track/track-load-error-readyState.html: Updated with new const name.
+ * media/track/track-load-from-element-readyState.html: Updated with new const name.
+ * media/track/track-load-from-src-readyState.html: Updated with new const name.
+
+ VIDEO_TRACK is not enabled on these ports, so skipping this test:
+ * platform/mac/Skipped:
+ * platform/win/Skipped:
+
2011-11-01 Dominic Cooney <domin...@chromium.org>
Remove initErrorEvent method
Added: trunk/LayoutTests/media/track/track-constants-expected.txt (0 => 99027)
--- trunk/LayoutTests/media/track/track-constants-expected.txt (rev 0)
+++ trunk/LayoutTests/media/track/track-constants-expected.txt 2011-11-02 01:52:35 UTC (rev 99027)
@@ -0,0 +1,12 @@
+Test TextTrack constants.
+
+EXPECTED (TextTrack.NONE == '0') OK
+EXPECTED (TextTrack.LOADING == '1') OK
+EXPECTED (TextTrack.LOADED == '2') OK
+EXPECTED (TextTrack.ERROR == '3') OK
+
+EXPECTED (TextTrack.DISABLED == '0') OK
+EXPECTED (TextTrack.HIDDEN == '1') OK
+EXPECTED (TextTrack.SHOWING == '2') OK
+END OF TEST
+
Added: trunk/LayoutTests/media/track/track-constants.html (0 => 99027)
--- trunk/LayoutTests/media/track/track-constants.html (rev 0)
+++ trunk/LayoutTests/media/track/track-constants.html 2011-11-02 01:52:35 UTC (rev 99027)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script type="text/_javascript_">
+ function doTest ()
+ {
+ testExpected("TextTrack.NONE", 0);
+ testExpected("TextTrack.LOADING", 1);
+ testExpected("TextTrack.LOADED", 2);
+ testExpected("TextTrack.ERROR", 3);
+ consoleWrite("");
+
+ testExpected("TextTrack.DISABLED", 0);
+ testExpected("TextTrack.HIDDEN", 1);
+ testExpected("TextTrack.SHOWING", 2);
+
+ endTest();
+ }
+ </script>
+</head>
+<body _onload_="doTest()">
+ <p>Test TextTrack constants.</p>
+</body>
+</html>
Modified: trunk/LayoutTests/media/track/track-load-error-readyState.html (99026 => 99027)
--- trunk/LayoutTests/media/track/track-load-error-readyState.html 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/media/track/track-load-error-readyState.html 2011-11-02 01:52:35 UTC (rev 99027)
@@ -11,7 +11,7 @@
{
consoleWrite("EVENT(error)");
track = document.getElementById('testTrackError');
- testExpected("track.track.readyState", TextTrack.Error);
+ testExpected("track.track.readyState", TextTrack.ERROR);
endTest();
}
Modified: trunk/LayoutTests/media/track/track-load-from-element-readyState.html (99026 => 99027)
--- trunk/LayoutTests/media/track/track-load-from-element-readyState.html 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/media/track/track-load-from-element-readyState.html 2011-11-02 01:52:35 UTC (rev 99027)
@@ -11,7 +11,7 @@
{
consoleWrite("EVENT(load)");
track = document.getElementById('testTrackSrc');
- testExpected("track.track.readyState", TextTrack.Loaded);
+ testExpected("track.track.readyState", TextTrack.LOADED);
endTest();
}
Modified: trunk/LayoutTests/media/track/track-load-from-src-readyState.html (99026 => 99027)
--- trunk/LayoutTests/media/track/track-load-from-src-readyState.html 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/media/track/track-load-from-src-readyState.html 2011-11-02 01:52:35 UTC (rev 99027)
@@ -16,12 +16,12 @@
function trackLoaded()
{
consoleWrite("EVENT(load)");
- testExpected("track.track.readyState", TextTrack.Loaded);
+ testExpected("track.track.readyState", TextTrack.LOADED);
endTest();
}
track = document.getElementById('testTrackEmpty');
- testExpected("track.track.readyState", TextTrack.None);
+ testExpected("track.track.readyState", TextTrack.NONE);
track.addEventListener("load", function () { trackLoaded(); }, true);
track.src = ""
Modified: trunk/LayoutTests/platform/mac/Skipped (99026 => 99027)
--- trunk/LayoutTests/platform/mac/Skipped 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/platform/mac/Skipped 2011-11-02 01:52:35 UTC (rev 99027)
@@ -421,6 +421,7 @@
# Tests for <track>. Feature is not yet functional.
# https://bugs.webkit.org/show_bug.cgi?id=43668
+media/track/track-constants.html
media/track/track-load-error-readyState.html
media/track/track-load-from-element-readyState.html
media/track/track-load-from-src-readyState.html
Modified: trunk/LayoutTests/platform/win/Skipped (99026 => 99027)
--- trunk/LayoutTests/platform/win/Skipped 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/LayoutTests/platform/win/Skipped 2011-11-02 01:52:35 UTC (rev 99027)
@@ -1405,6 +1405,7 @@
# Tests for <track>. Feature is not yet functional.
# https://bugs.webkit.org/show_bug.cgi?id=43668
+media/track/track-constants.html
media/track/track-load-error-readyState.html
media/track/track-load-from-element-readyState.html
media/track/track-load-from-src-readyState.html
Modified: trunk/Source/WebCore/ChangeLog (99026 => 99027)
--- trunk/Source/WebCore/ChangeLog 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/ChangeLog 2011-11-02 01:52:35 UTC (rev 99027)
@@ -1,3 +1,35 @@
+2011-11-01 Anna Cavender <ann...@chromium.org>
+
+ Makes [Reflect] work for constants.
+ This is needed to avoid platform-specific define conflicts, specifically
+ TextTrack::ERROR conflicts with a windows define.
+ https://bugs.webkit.org/show_bug.cgi?id=70951
+
+ Reviewed by Darin Adler.
+
+ Test: media/track/track-constants.html
+
+ * bindings/scripts/CodeGenerator.pm:
+ (GenerateCompileTimeCheckForEnumsIfNeeded):
+ Check for [Reflect] and assign name accordingly.
+
+ * bindings/scripts/test/CPP/WebDOMTestObj.h: Update test file.
+ * bindings/scripts/test/JS/JSTestObj.cpp: Update test file.
+ (WebCore::jsTestObjCONST_JAVASCRIPT):
+ * bindings/scripts/test/JS/JSTestObj.h: Update test file.
+ * bindings/scripts/test/ObjC/DOMTestObj.h: Update test file.
+ * bindings/scripts/test/TestObj.idl: Update test file.
+ * bindings/scripts/test/V8/V8TestObj.cpp: Update test file.
+
+ * html/LoadableTextTrack.cpp: Use new DOM const name.
+ (WebCore::LoadableTextTrack::cueLoadingStarted):
+ (WebCore::LoadableTextTrack::cueLoadingCompleted):
+ * html/TextTrack.cpp: Use new DOM const name.
+ (WebCore::TextTrack::TextTrack):
+ (WebCore::TextTrack::setMode):
+ * html/TextTrack.h: Use new DOM const name.
+ * html/TextTrack.idl: Use Reflect for ERROR, but leave other DOM const names.
+
2011-11-01 Levi Weintraub <le...@chromium.org>
Amend missing uses of LayoutUnit in RenderBlock
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2011-11-02 01:52:35 UTC (rev 99027)
@@ -568,7 +568,8 @@
if (ShouldCheckEnums($dataNode) && @{$dataNode->constants}) {
push(@checks, "\n");
foreach my $constant (@{$dataNode->constants}) {
- my $name = $constant->name;
+ my $reflect = $constant->extendedAttributes->{"Reflect"};
+ my $name = $reflect ? $reflect : $constant->name;
my $value = $constant->value;
push(@checks, "COMPILE_ASSERT($value == ${interfaceName}::$name, ${interfaceName}Enum${name}IsWrongUseDontCheckEnums);\n");
}
Modified: trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h 2011-11-02 01:52:35 UTC (rev 99027)
@@ -58,7 +58,8 @@
WEBDOM_CONST_VALUE_11 = 0xffffffff,
WEBDOM_CONST_VALUE_12 = 0x01,
WEBDOM_CONST_VALUE_13 = 0X20,
- WEBDOM_CONST_VALUE_14 = 0x1abc
+ WEBDOM_CONST_VALUE_14 = 0x1abc,
+ WEBDOM_CONST_JAVASCRIPT = 15
};
int readOnlyIntAttr() const;
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2011-11-02 01:52:35 UTC (rev 99027)
@@ -158,6 +158,7 @@
{ "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
+ { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
};
@@ -175,6 +176,7 @@
COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDontCheckEnums);
const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
@@ -225,6 +227,7 @@
{ "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
+ { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
{ "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
@@ -1929,6 +1932,12 @@
return jsNumber(static_cast<int>(0x1abc));
}
+JSValue jsTestObjCONST_JAVASCRIPT(ExecState* exec, JSValue, const Identifier&)
+{
+ UNUSED_PARAM(exec);
+ return jsNumber(static_cast<int>(15));
+}
+
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* impl)
{
return wrap<JSTestObj>(exec, globalObject, impl);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h 2011-11-02 01:52:35 UTC (rev 99027)
@@ -255,6 +255,7 @@
JSC::JSValue jsTestObjCONST_VALUE_12(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjCONST_VALUE_13(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjCONST_VALUE_14(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_JAVASCRIPT(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h 2011-11-02 01:52:35 UTC (rev 99027)
@@ -49,7 +49,8 @@
DOM_CONST_VALUE_11 = 0xffffffff,
DOM_CONST_VALUE_12 = 0x01,
DOM_CONST_VALUE_13 = 0X20,
- DOM_CONST_VALUE_14 = 0x1abc
+ DOM_CONST_VALUE_14 = 0x1abc,
+ DOM_CONST_JAVASCRIPT = 15
};
@interface DOMTestObj : DOMObject
Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2011-11-02 01:52:35 UTC (rev 99027)
@@ -190,5 +190,6 @@
const unsigned short CONST_VALUE_12 = 0x01;
const unsigned short CONST_VALUE_13 = 0X20;
const unsigned short CONST_VALUE_14 = 0x1abc;
+ const [Reflect=CONST_IMPL] unsigned short CONST_JAVASCRIPT = 15;
};
}
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (99026 => 99027)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2011-11-02 01:52:35 UTC (rev 99027)
@@ -1387,6 +1387,7 @@
{"CONST_VALUE_12", static_cast<signed int>(0x01)},
{"CONST_VALUE_13", static_cast<signed int>(0X20)},
{"CONST_VALUE_14", static_cast<signed int>(0x1abc)},
+ {"CONST_JAVASCRIPT", static_cast<signed int>(15)},
};
@@ -1401,6 +1402,7 @@
COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDontCheckEnums);
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
Modified: trunk/Source/WebCore/html/LoadableTextTrack.cpp (99026 => 99027)
--- trunk/Source/WebCore/html/LoadableTextTrack.cpp 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/html/LoadableTextTrack.cpp 2011-11-02 01:52:35 UTC (rev 99027)
@@ -60,14 +60,14 @@
{
ASSERT_UNUSED(loader, m_loader == loader);
- setReadyState(TextTrack::Loading);
+ setReadyState(TextTrack::LOADING);
}
void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadingFailed)
{
ASSERT_UNUSED(loader, m_loader == loader);
- loadingFailed ? setReadyState(TextTrack::Error) : setReadyState(TextTrack::Loaded);
+ loadingFailed ? setReadyState(TextTrack::HTML_ERROR) : setReadyState(TextTrack::LOADED);
if (m_loadingClient)
m_loadingClient->textTrackLoadingCompleted(this, loadingFailed);
Modified: trunk/Source/WebCore/html/TextTrack.cpp (99026 => 99027)
--- trunk/Source/WebCore/html/TextTrack.cpp 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/html/TextTrack.cpp 2011-11-02 01:52:35 UTC (rev 99027)
@@ -42,8 +42,8 @@
: m_kind(kind)
, m_label(label)
, m_language(language)
- , m_readyState(TextTrack::None)
- , m_mode(TextTrack::Showing)
+ , m_readyState(TextTrack::NONE)
+ , m_mode(TextTrack::SHOWING)
, m_client(client)
{
}
@@ -91,7 +91,7 @@
{
// 4.8.10.12.5 On setting the mode, if the new value is not either 0, 1, or 2,
// the user agent must throw an INVALID_ACCESS_ERR exception.
- if (mode == TextTrack::Disabled || mode == TextTrack::Hidden || mode == TextTrack::Showing) {
+ if (mode == TextTrack::DISABLED || mode == TextTrack::HIDDEN || mode == TextTrack::SHOWING) {
m_mode = static_cast<Mode>(mode);
if (m_client)
m_client->textTrackModeChanged(this);
Modified: trunk/Source/WebCore/html/TextTrack.h (99026 => 99027)
--- trunk/Source/WebCore/html/TextTrack.h 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/html/TextTrack.h 2011-11-02 01:52:35 UTC (rev 99027)
@@ -63,10 +63,10 @@
String label() const;
String language() const;
- enum ReadyState { None = 0, Loading = 1, Loaded = 2, Error = 3 };
+ enum ReadyState { NONE = 0, LOADING = 1, LOADED = 2, HTML_ERROR = 3 };
ReadyState readyState() const;
- enum Mode { Disabled = 0, Hidden = 1, Showing = 2 };
+ enum Mode { DISABLED = 0, HIDDEN = 1, SHOWING = 2 };
Mode mode() const;
void setMode(unsigned short, ExceptionCode&);
Modified: trunk/Source/WebCore/html/TextTrack.idl (99026 => 99027)
--- trunk/Source/WebCore/html/TextTrack.idl 2011-11-02 01:51:12 UTC (rev 99026)
+++ trunk/Source/WebCore/html/TextTrack.idl 2011-11-02 01:52:35 UTC (rev 99027)
@@ -33,15 +33,16 @@
readonly attribute DOMString label;
readonly attribute DOMString language;
- const [Reflect=NONE] unsigned short None = 0;
- const [Reflect=LOADING] unsigned short Loading = 1;
- const [Reflect=LOADED] unsigned short Loaded = 2;
- const [Reflect=ERROR] unsigned short Error = 3;
+ const unsigned short NONE = 0;
+ const unsigned short LOADING = 1;
+ const unsigned short LOADED = 2;
+ // Reflect is used for TextTrack::ERROR because it conflicts with a windows define.
+ const [Reflect=HTML_ERROR] unsigned short ERROR = 3;
readonly attribute unsigned short readyState;
- const [Reflect=DISABLED] unsigned short Disabled = 0;
- const [Reflect=HIDDEN] unsigned short Hidden = 1;
- const [Reflect=SHOWING] unsigned short Showing = 2;
+ const unsigned short DISABLED = 0;
+ const unsigned short HIDDEN = 1;
+ const unsigned short SHOWING = 2;
attribute unsigned short mode
setter raises (DOMException);