Diff
Modified: trunk/Source/WebCore/ChangeLog (197352 => 197353)
--- trunk/Source/WebCore/ChangeLog 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/ChangeLog 2016-02-29 17:28:13 UTC (rev 197353)
@@ -1,3 +1,141 @@
+2016-02-29 Chris Dumez <cdu...@apple.com>
+
+ [Web IDL] Add support for [TreatNullAs=EmptyString] and use it
+ https://bugs.webkit.org/show_bug.cgi?id=154654
+
+ Reviewed by Darin Adler.
+
+ Add support for [TreatNullAs=EmptyString] standard Web IDL extended
+ attribute:
+ - http://heycam.github.io/webidl/#TreatNullAs
+
+ This replaces the WebKit-specific [TreatNullAs=NullString] IDL
+ extended attribute. Instead of passing a null String() to the
+ implementation, emptyString() is passed.
+
+ This patch does not cause any web-exposed behavior change. For
+ case where switching from NullString to EmptyString would change
+ the behavior (or require changes to the implementation), the old
+ IDL attribute was kept. However, it was renamed to
+ [TreatNullAs=LegacyNullString] to discourage its use in new code.
+ Eventually, this legacy IDL attribute should go away entirely.
+
+ [TreatNullAs=EmptyString] should only be used when it is present
+ in the corresponding specification. Note that there are a lot of
+ places where we use [TreatNullAs=EmptyString] in our IDL where it
+ does not match the specification. I have added FIXME comments for
+ those so we can clean them up later.
+
+ No new tests, no web-exposed behavior change.
+
+ * Modules/mediastream/RTCPeerConnection.idl:
+ No behavior change because this is not implemented.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::valueToStringTreatingNullAsEmptyString):
+ * bindings/js/JSDOMBinding.h:
+ Add new function to convert a JSValue into a String while treating
+ null as the empty string.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (JSValueToNative):
+ * bindings/scripts/IDLAttributes.txt:
+ - Add support for [TreatNullAs=EmptyString].
+ - Rename NullString to LegacyNullString to discourage its use.
+
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/TestObj.idl:
+ Add bindings tests coverage for [TreatNullAs=EmptyString].
+
+ * css/CSSStyleDeclaration.idl:
+ * dom/CharacterData.idl:
+ * dom/DOMImplementation.idl:
+ * dom/Document.idl:
+ * dom/Element.idl:
+ * dom/ShadowRoot.idl:
+ * html/HTMLOutputElement.idl:
+ * html/HTMLScriptElement.idl:
+ * html/URLUtils.idl:
+ * svg/SVGAngle.idl:
+ * svg/SVGLength.idl:
+ Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString].
+ There is not behavior change because the implementation does
+ not distinguish the null string from the empty string.
+
+ * html/HTMLBaseElement.idl:
+ * html/HTMLButtonElement.idl:
+ * html/HTMLFormElement.idl:
+ * html/HTMLMediaElement.idl:
+ * html/HTMLSelectElement.idl:
+ * svg/SVGElement.idl:
+ * svg/SVGScriptElement.idl:
+ Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString],
+ no behavior change.
+
+ * html/HTMLDocument.idl:
+ - dir and *Color: Rename [TreatNullAs=NullString] to
+ [TreatNullAs=LegacyNullString].
+ - designMode: Drop [TreatNullAs=NullString] as per the specification:
+ - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
+ null now gets converted to "null" instead of the null String but this
+ does not change behavior because the implementation only recognizes
+ "on" / "off" / others. So we still end up using inherit mode when
+ set to null.
+
+ * html/HTMLElement.idl:
+ - Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString] for
+ innerText / outerText. Does not change behavior because the
+ implementation does not distinguishes.
+ - Drop [TreatNullAs=NullString] from contentEditable to match the spec:
+ - https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
+ This does not change behavior because the implementation will the a SyntaxError
+ wether a null String or the string "null" is passed.
+
+ * html/HTMLFrameElement.idl:
+ Drop [TreatNullAs=NullString] from location attribute. This does not
+ change behavior because the attribute is using a custom setter.
+
+ * html/HTMLInputElement.idl:
+ - formEnctype / formMethod / autocapitalize: Rename [TreatNullAs=NullString] to
+ [TreatNullAs=LegacyNullString].
+ - value: Rename [TreatNullAs=NullString] to Rename [TreatNullAs=EmptyString], which
+ does not change behavior because the implementation does not distinguish. Also
+ drop the extended attribute for non-JS bindings as it has no impact.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setMediaGroup):
+ Drop redundant group.isNull() check as group.isEmpty() already checks for null.
+
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::setText):
+ Drop useless .impl() call as we have a String and the method requires a String
+ as input.
+
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::setValueCommon):
+ Use emptyString() instead of "" as it is slightly more efficient.
+
+ * html/HTMLTextAreaElement.idl:
+ - value: Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString]. No
+ behavior change because the implementation does not distinguish.
+ - autocapitalize: Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString].
+
+ * html/canvas/CanvasRenderingContext2D.idl:
+ - globalCompositeOperation / repetitionType: Use [TreatNullAs=EmptyString] instead of
+ [TreatNullAs=NullString]. No behavior change because the implementation does not
+ distinguish.
+ - lineCap / lineJoin: Drop the [TreatNullAs=NullString] to match the spec:
+ - https://html.spec.whatwg.org/multipage/scripting.html#canvaspathdrawingstyles
+ There is no behavior change because those are string enumerations and the value
+ is not recognized either way (String() or String("null")).
+ - shadowColor: Drop the [TreatNullAs=NullString] to match the spec:
+ - https://html.spec.whatwg.org/multipage/scripting.html#canvasshadowstyles
+ No behavior change because this is not a valid color either way.
+
2016-02-29 Youenn Fablet <youenn.fab...@crf.canon.fr>
Refactor FetchBody constructors
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (197352 => 197353)
--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -100,7 +100,7 @@
// RTCStatsCallback successCallback,
// RTCPeerConnectionErrorCallback errorCallback);
- [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString] DOMString label, optional Dictionary options);
+ [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional Dictionary options);
void close();
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (197352 => 197353)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -107,6 +107,13 @@
return value.toString(exec)->value(exec);
}
+String valueToStringTreatingNullAsEmptyString(ExecState* exec, JSValue value)
+{
+ if (value.isNull())
+ return emptyString();
+ return value.toString(exec)->value(exec);
+}
+
String valueToStringWithUndefinedOrNullCheck(ExecState* exec, JSValue value)
{
if (value.isUndefinedOrNull())
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (197352 => 197353)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2016-02-29 17:28:13 UTC (rev 197353)
@@ -316,7 +316,10 @@
AtomicString propertyNameToAtomicString(JSC::PropertyName);
+// FIXME: This is only used by legacy code and should go away. Use valueToStringTreatingNullAsEmptyString() instead.
String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
+
+String valueToStringTreatingNullAsEmptyString(JSC::ExecState*, JSC::JSValue);
String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
template<typename T> JSC::JSValue toNullableJSNumber(Optional<T>); // null if the optional is null
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-29 17:28:13 UTC (rev 197353)
@@ -4141,8 +4141,9 @@
return "valueToDate(state, $value)" if $type eq "Date";
if ($type eq "DOMString") {
- if ($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") {
- return "valueToStringWithNullCheck(state, $value)"
+ if ($signature->extendedAttributes->{"TreatNullAs"}) {
+ return "valueToStringTreatingNullAsEmptyString(state, $value)" if $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString";
+ return "valueToStringWithNullCheck(state, $value)" if $signature->extendedAttributes->{"TreatNullAs"} eq "LegacyNullString";
}
return "valueToStringWithUndefinedOrNullCheck(state, $value)" if $signature->isNullable;
return "$value.toString(state)->toAtomicString(state)" if $signature->extendedAttributes->{"AtomicString"};
Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-02-29 17:28:13 UTC (rev 197353)
@@ -119,7 +119,7 @@
SkipVTableValidation
StrictTypeChecking
SuppressToJSObject
-TreatNullAs=NullString
+TreatNullAs=EmptyString|LegacyNullString
TreatReturnedNaNDateAs=Null|NaN
TypedArray=*
URL
Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -92,6 +92,7 @@
PROP_TEST_OBJ_ATTR,
PROP_LENIENT_TEST_OBJ_ATTR,
PROP_UNFORGEABLE_ATTR,
+ PROP_STRING_ATTR_TREATING_NULL_AS_EMPTY_STRING,
PROP_XML_OBJ_ATTR,
PROP_CREATE,
PROP_REFLECTED_STRING_ATTR,
@@ -183,6 +184,9 @@
case PROP_STRING_ATTR:
webkit_dom_test_obj_set_string_attr(self, g_value_get_string(value));
break;
+ case PROP_STRING_ATTR_TREATING_NULL_AS_EMPTY_STRING:
+ webkit_dom_test_obj_set_string_attr_treating_null_as_empty_string(self, g_value_get_string(value));
+ break;
case PROP_CREATE:
webkit_dom_test_obj_set_create(self, g_value_get_boolean(value));
break;
@@ -311,6 +315,9 @@
case PROP_UNFORGEABLE_ATTR:
g_value_take_string(value, webkit_dom_test_obj_get_unforgeable_attr(self));
break;
+ case PROP_STRING_ATTR_TREATING_NULL_AS_EMPTY_STRING:
+ g_value_take_string(value, webkit_dom_test_obj_get_string_attr_treating_null_as_empty_string(self));
+ break;
case PROP_XML_OBJ_ATTR:
g_value_set_object(value, webkit_dom_test_obj_get_xml_obj_attr(self));
break;
@@ -629,6 +636,16 @@
g_object_class_install_property(
gobjectClass,
+ PROP_STRING_ATTR_TREATING_NULL_AS_EMPTY_STRING,
+ g_param_spec_string(
+ "string-attr-treating-null-as-empty-string",
+ "TestObj:string-attr-treating-null-as-empty-string",
+ "read-write gchar* TestObj:string-attr-treating-null-as-empty-string",
+ "",
+ WEBKIT_PARAM_READWRITE));
+
+ g_object_class_install_property(
+ gobjectClass,
PROP_XML_OBJ_ATTR,
g_param_spec_object(
"xml-obj-attr",
@@ -1252,6 +1269,16 @@
return result;
}
+void webkit_dom_test_obj_method_with_arg_treating_null_as_empty_string(WebKitDOMTestObj* self, const gchar* arg)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ g_return_if_fail(arg);
+ WebCore::TestObj* item = WebKit::core(self);
+ WTF::String convertedArg = WTF::String::fromUTF8(arg);
+ item->methodWithArgTreatingNullAsEmptyString(convertedArg);
+}
+
gchar* webkit_dom_test_obj_nullable_string_method(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
@@ -1911,6 +1938,25 @@
return result;
}
+gchar* webkit_dom_test_obj_get_string_attr_treating_null_as_empty_string(WebKitDOMTestObj* self)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
+ WebCore::TestObj* item = WebKit::core(self);
+ gchar* result = convertToUTF8String(item->stringAttrTreatingNullAsEmptyString());
+ return result;
+}
+
+void webkit_dom_test_obj_set_string_attr_treating_null_as_empty_string(WebKitDOMTestObj* self, const gchar* value)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ g_return_if_fail(value);
+ WebCore::TestObj* item = WebKit::core(self);
+ WTF::String convertedValue = WTF::String::fromUTF8(value);
+ item->setStringAttrTreatingNullAsEmptyString(convertedValue);
+}
+
WebKitDOMTestObj* webkit_dom_test_obj_get_xml_obj_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h 2016-02-29 17:28:13 UTC (rev 197353)
@@ -247,6 +247,16 @@
webkit_dom_test_obj_unforgeable_method(WebKitDOMTestObj* self);
/**
+ * webkit_dom_test_obj_method_with_arg_treating_null_as_empty_string:
+ * @self: A #WebKitDOMTestObj
+ * @arg: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_method_with_arg_treating_null_as_empty_string(WebKitDOMTestObj* self, const gchar* arg);
+
+/**
* webkit_dom_test_obj_nullable_string_method:
* @self: A #WebKitDOMTestObj
*
@@ -937,6 +947,27 @@
webkit_dom_test_obj_get_unforgeable_attr(WebKitDOMTestObj* self);
/**
+ * webkit_dom_test_obj_get_string_attr_treating_null_as_empty_string:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_string_attr_treating_null_as_empty_string(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_string_attr_treating_null_as_empty_string:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr_treating_null_as_empty_string(WebKitDOMTestObj* self, const gchar* value);
+
+/**
* webkit_dom_test_obj_get_xml_obj_attr:
* @self: A #WebKitDOMTestObj
*
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -100,6 +100,7 @@
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjInstanceFunctionUnforgeableMethod(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionNullableStringMethod(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionNullableStringStaticMethod(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionNullableStringSpecialMethod(JSC::ExecState*);
@@ -224,6 +225,8 @@
JSC::EncodedJSValue jsTestObjLenientTestObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
void setJSTestObjLenientTestObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
JSC::EncodedJSValue jsTestObjUnforgeableAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+JSC::EncodedJSValue jsTestObjStringAttrTreatingNullAsEmptyString(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+void setJSTestObjStringAttrTreatingNullAsEmptyString(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
JSC::EncodedJSValue jsTestObjXMLObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
void setJSTestObjXMLObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
JSC::EncodedJSValue jsTestObjCreate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -527,6 +530,7 @@
{ "stringAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttr) } },
{ "testObjAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestObjAttr) } },
{ "lenientTestObjAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLenientTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjLenientTestObjAttr) } },
+ { "stringAttrTreatingNullAsEmptyString", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrTreatingNullAsEmptyString), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrTreatingNullAsEmptyString) } },
{ "XMLObjAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjXMLObjAttr) } },
{ "create", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCreate) } },
{ "readOnlySymbolAttr", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlySymbolAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
@@ -616,6 +620,7 @@
{ "longMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethodWithArgs), (intptr_t) (3) } },
{ "objMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t) (0) } },
{ "objMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t) (3) } },
+ { "methodWithArgTreatingNullAsEmptyString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString), (intptr_t) (1) } },
{ "nullableStringMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionNullableStringMethod), (intptr_t) (0) } },
{ "nullableStringSpecialMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionNullableStringSpecialMethod), (intptr_t) (1) } },
{ "methodWithSequenceArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) } },
@@ -1067,6 +1072,21 @@
}
+EncodedJSValue jsTestObjStringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(thisValue);
+ JSValue decodedThisValue = JSValue::decode(thisValue);
+ auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
+ if (UNLIKELY(!castedThis)) {
+ return throwGetterTypeError(*state, "TestObj", "stringAttrTreatingNullAsEmptyString");
+ }
+ auto& impl = castedThis->wrapped();
+ JSValue result = jsStringWithCache(state, impl.stringAttrTreatingNullAsEmptyString());
+ return JSValue::encode(result);
+}
+
+
EncodedJSValue jsTestObjXMLObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
UNUSED_PARAM(state);
@@ -2245,6 +2265,23 @@
}
+void setJSTestObjStringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(thisValue);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ throwSetterTypeError(*state, "TestObj", "stringAttrTreatingNullAsEmptyString");
+ return;
+ }
+ auto& impl = castedThis->wrapped();
+ String nativeValue = valueToStringTreatingNullAsEmptyString(state, value);
+ if (UNLIKELY(state->hadException()))
+ return;
+ impl.setStringAttrTreatingNullAsEmptyString(nativeValue);
+}
+
+
void setJSTestObjXMLObjAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
@@ -3302,6 +3339,23 @@
return JSValue::encode(result);
}
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObj", "methodWithArgTreatingNullAsEmptyString");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ String arg = valueToStringTreatingNullAsEmptyString(state, state->argument(0));
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.methodWithArgTreatingNullAsEmptyString(arg);
+ return JSValue::encode(jsUndefined());
+}
+
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionNullableStringMethod(ExecState* state)
{
JSValue thisValue = state->thisValue();
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h 2016-02-29 17:28:13 UTC (rev 197353)
@@ -75,6 +75,7 @@
@property (strong) DOMTestObj *testObjAttr;
@property (strong) DOMTestObj *lenientTestObjAttr;
@property (readonly, copy) NSString *unforgeableAttr;
+@property (copy) NSString *stringAttrTreatingNullAsEmptyString;
@property (strong) DOMTestObj *XMLObjAttr;
@property BOOL create;
@property (copy) NSString *reflectedStringAttr;
@@ -143,6 +144,7 @@
- (DOMTestObj *)objMethod;
- (DOMTestObj *)objMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
- (int)unforgeableMethod;
+- (void)methodWithArgTreatingNullAsEmptyString:(NSString *)arg;
- (NSString *)nullableStringMethod;
- (NSString *)nullableStringStaticMethod;
- (NSString *)nullableStringSpecialMethod:(unsigned)index;
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm 2016-02-29 17:28:13 UTC (rev 197353)
@@ -245,6 +245,18 @@
return IMPL->unforgeableAttr();
}
+- (NSString *)stringAttrTreatingNullAsEmptyString
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->stringAttrTreatingNullAsEmptyString();
+}
+
+- (void)setStringAttrTreatingNullAsEmptyString:(NSString *)newStringAttrTreatingNullAsEmptyString
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setStringAttrTreatingNullAsEmptyString(newStringAttrTreatingNullAsEmptyString);
+}
+
- (DOMTestObj *)XMLObjAttr
{
WebCore::JSMainThreadNullState state;
@@ -981,6 +993,12 @@
return IMPL->unforgeableMethod();
}
+- (void)methodWithArgTreatingNullAsEmptyString:(NSString *)arg
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->methodWithArgTreatingNullAsEmptyString(arg);
+}
+
- (NSString *)nullableStringMethod
{
WebCore::JSMainThreadNullState state;
Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (197352 => 197353)
--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -59,6 +59,7 @@
attribute TestObj testObjAttr;
[LenientThis] attribute TestObj lenientTestObjAttr;
[Unforgeable] readonly attribute DOMString unforgeableAttr;
+ [TreatNullAs=EmptyString] attribute DOMString stringAttrTreatingNullAsEmptyString;
// WK_ucfirst, WK_lcfirst exceptional cases.
attribute TestObj XMLObjAttr;
@@ -96,6 +97,7 @@
TestObj objMethod();
TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
[Unforgeable] long unforgeableMethod();
+ void methodWithArgTreatingNullAsEmptyString([TreatNullAs=EmptyString] DOMString arg);
// Nullable String return values.
DOMString? nullableStringMethod();
Modified: trunk/Source/WebCore/css/CSSStyleDeclaration.idl (197352 => 197353)
--- trunk/Source/WebCore/css/CSSStyleDeclaration.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/css/CSSStyleDeclaration.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -34,8 +34,10 @@
[Custom] CSSValue getPropertyCSSValue([Default=Undefined] optional DOMString propertyName);
[RaisesException] DOMString removeProperty([Default=Undefined] optional DOMString propertyName);
DOMString? getPropertyPriority([Default=Undefined] optional DOMString propertyName);
+
+ // FIXME: 'priority' should use [TreatNullAs=EmptyString].
[ObjCLegacyUnnamedParameters, RaisesException] void setProperty([Default=Undefined] optional DOMString propertyName,
- [TreatNullAs=NullString, Default=Undefined] optional DOMString value,
+ [TreatNullAs=EmptyString, Default=Undefined] optional DOMString value,
[Default=Undefined] optional DOMString priority);
readonly attribute unsigned long length;
Modified: trunk/Source/WebCore/dom/CharacterData.idl (197352 => 197353)
--- trunk/Source/WebCore/dom/CharacterData.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/dom/CharacterData.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -19,7 +19,7 @@
interface CharacterData : Node {
- [TreatNullAs=NullString] attribute DOMString data;
+ [TreatNullAs=EmptyString] attribute DOMString data;
readonly attribute unsigned long length;
Modified: trunk/Source/WebCore/dom/DOMImplementation.idl (197352 => 197353)
--- trunk/Source/WebCore/dom/DOMImplementation.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/dom/DOMImplementation.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -26,7 +26,7 @@
// DOM Level 1
[ObjCLegacyUnnamedParameters] boolean hasFeature([Default=Undefined] optional DOMString feature,
- [TreatNullAs=NullString, Default=Undefined] optional DOMString version);
+ [TreatNullAs=EmptyString, Default=Undefined] optional DOMString version);
// DOM Level 2
@@ -38,7 +38,7 @@
optional DocumentType doctype);
#else
[RaisesException, NewObject] XMLDocument createDocument([Default=Undefined] optional DOMString? namespaceURI,
- [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
+ [TreatNullAs=EmptyString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
#endif
// DOMImplementationCSS interface from DOM Level 2 CSS
Modified: trunk/Source/WebCore/dom/Document.idl (197352 => 197353)
--- trunk/Source/WebCore/dom/Document.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/dom/Document.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -54,10 +54,14 @@
[ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
optional boolean deep);
+
+ // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString].
[ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([Default=Undefined] optional DOMString? namespaceURI,
- [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
+ [TreatNullAs=EmptyString, Default=Undefined] optional DOMString qualifiedName);
+
+ // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString].
[ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
- [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
+ [TreatNullAs=EmptyString, Default=Undefined] optional DOMString qualifiedName);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
[ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
@@ -158,16 +162,20 @@
// Moved down from HTMLDocument
- [TreatNullAs=NullString] attribute DOMString title;
+ // FIXME: Should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString] attribute DOMString title;
+
readonly attribute DOMString referrer;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString domain;
+ // FIXME: Should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString domain;
#else
readonly attribute DOMString domain;
#endif
[ImplementedAs=urlForBindings] readonly attribute DOMString URL;
- [TreatNullAs=NullString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;
+ // FIXME: Should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;
[SetterRaisesException, ImplementedAs=bodyOrFrameset, StrictTypeChecking] attribute HTMLElement body;
Modified: trunk/Source/WebCore/dom/Element.idl (197352 => 197353)
--- trunk/Source/WebCore/dom/Element.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/dom/Element.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -117,8 +117,8 @@
#else
HTMLCollection getElementsByClassName([Default=Undefined] optional DOMString name);
#endif
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString innerHTML;
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString outerHTML;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString innerHTML;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString outerHTML;
[Reflect=class] attribute DOMString className;
Modified: trunk/Source/WebCore/dom/ShadowRoot.idl (197352 => 197353)
--- trunk/Source/WebCore/dom/ShadowRoot.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/dom/ShadowRoot.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -30,6 +30,5 @@
readonly attribute Element activeElement;
readonly attribute Element host;
- [TreatNullAs=NullString, SetterRaisesException]
- attribute DOMString innerHTML;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString innerHTML;
};
Modified: trunk/Source/WebCore/html/HTMLBaseElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLBaseElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLBaseElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -18,6 +18,8 @@
*/
interface HTMLBaseElement : HTMLElement {
- [TreatNullAs=NullString] attribute DOMString href;
+ // FIXME: This should not have [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString href;
+
[Reflect] attribute DOMString target;
};
Modified: trunk/Source/WebCore/html/HTMLButtonElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLButtonElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLButtonElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -23,12 +23,15 @@
[Reflect] attribute boolean disabled;
readonly attribute HTMLFormElement form;
attribute DOMString formAction;
- [TreatNullAs=NullString] attribute DOMString formEnctype;
- [TreatNullAs=NullString] attribute DOMString formMethod;
+
+ // FIXME: These should not have [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString formEnctype;
+ [TreatNullAs=LegacyNullString] attribute DOMString formMethod;
+ [TreatNullAs=LegacyNullString] attribute DOMString type;
+
[Reflect] attribute boolean formNoValidate;
[Reflect] attribute DOMString formTarget;
[Reflect] attribute DOMString name;
- [TreatNullAs=NullString] attribute DOMString type;
[Reflect] attribute DOMString value;
readonly attribute boolean willValidate;
Modified: trunk/Source/WebCore/html/HTMLDocument.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLDocument.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLDocument.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -50,15 +50,18 @@
readonly attribute long height;
#endif
- [TreatNullAs=NullString] attribute DOMString dir;
- [TreatNullAs=NullString] attribute DOMString designMode;
+ // FIXME: This should not have [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString dir;
+
+ attribute DOMString designMode;
readonly attribute DOMString compatMode;
- // Deprecated attributes
- [TreatNullAs=NullString] attribute DOMString bgColor;
- [TreatNullAs=NullString] attribute DOMString fgColor;
- [TreatNullAs=NullString] attribute DOMString alinkColor;
- [TreatNullAs=NullString] attribute DOMString linkColor;
- [TreatNullAs=NullString] attribute DOMString vlinkColor;
+ // Deprecated attributes.
+ // FIXME: These should not have [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString bgColor;
+ [TreatNullAs=LegacyNullString] attribute DOMString fgColor;
+ [TreatNullAs=LegacyNullString] attribute DOMString alinkColor;
+ [TreatNullAs=LegacyNullString] attribute DOMString linkColor;
+ [TreatNullAs=LegacyNullString] attribute DOMString vlinkColor;
};
Modified: trunk/Source/WebCore/html/HTMLElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -45,8 +45,8 @@
[Reflect] attribute DOMString accessKey;
// Extensions
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString innerText;
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString outerText;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString innerText;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString outerText;
[RaisesException] Element insertAdjacentElement([Default=Undefined] optional DOMString where,
[Default=Undefined] optional Element element);
@@ -59,7 +59,7 @@
readonly attribute HTMLCollection children;
#endif
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString contentEditable;
+ [SetterRaisesException] attribute DOMString contentEditable;
readonly attribute boolean isContentEditable;
attribute boolean spellcheck;
Modified: trunk/Source/WebCore/html/HTMLFormElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLFormElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLFormElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -25,9 +25,12 @@
[Reflect=accept_charset] attribute DOMString acceptCharset;
[Reflect, URL] attribute DOMString action;
attribute DOMString autocomplete;
- [TreatNullAs=NullString] attribute DOMString enctype;
- [TreatNullAs=NullString] attribute DOMString encoding;
- [TreatNullAs=NullString] attribute DOMString method;
+
+ // FIXME: These should not have [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString enctype;
+ [TreatNullAs=LegacyNullString] attribute DOMString encoding;
+ [TreatNullAs=LegacyNullString] attribute DOMString method;
+
[Reflect] attribute DOMString name;
[Reflect] attribute boolean noValidate;
[Reflect] attribute DOMString target;
@@ -42,8 +45,10 @@
getter Element (unsigned long index);
[Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
- [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=NullString] attribute DOMString autocapitalize;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=LegacyNullString] attribute DOMString autocapitalize;
+
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[ImplementedAs=submitFromJavaScript] void submit();
#else
Modified: trunk/Source/WebCore/html/HTMLFrameElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLFrameElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLFrameElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -22,8 +22,11 @@
[Reflect] attribute DOMString frameBorder;
[Reflect] attribute DOMString longDesc;
+
+ // FIXME: These should use [TreatNullAs=EmptyString].
[Reflect] attribute DOMString marginHeight;
[Reflect] attribute DOMString marginWidth;
+
[Reflect] attribute DOMString name;
[Reflect] attribute boolean noResize;
[Reflect] attribute DOMString scrolling;
@@ -39,7 +42,7 @@
[CheckSecurityForNode, RaisesException] SVGDocument getSVGDocument();
#endif
- [TreatNullAs=NullString, CustomSetter] attribute DOMString location;
+ [CustomSetter] attribute DOMString location;
readonly attribute long width;
readonly attribute long height;
Modified: trunk/Source/WebCore/html/HTMLInputElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLInputElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLInputElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -31,8 +31,11 @@
readonly attribute HTMLFormElement form;
attribute FileList files;
attribute DOMString formAction;
- [TreatNullAs=NullString] attribute DOMString formEnctype;
- [TreatNullAs=NullString] attribute DOMString formMethod;
+
+ // FIXME: These should not use [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString formEnctype;
+ [TreatNullAs=LegacyNullString] attribute DOMString formMethod;
+
[Reflect] attribute boolean formNoValidate;
[Reflect] attribute DOMString formTarget;
attribute unsigned long height;
@@ -58,9 +61,9 @@
attribute DOMString defaultValue;
// See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString value;
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString value;
#else
- [TreatNullAs=NullString] attribute DOMString value;
+ attribute DOMString value;
#endif
[SetterRaisesException] attribute Date valueAsDate;
[SetterRaisesException] attribute unrestricted double valueAsNumber;
@@ -120,8 +123,10 @@
#endif
[Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
- [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=NullString] attribute DOMString autocapitalize;
+ // FIXME: This should not use TreatNullAs=LegacyNullString.
+ [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=LegacyNullString] attribute DOMString autocapitalize;
+
// See http://www.w3.org/TR/html-media-capture/
[Conditional=MEDIA_CAPTURE, Reflect] attribute boolean capture;
};
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -5792,7 +5792,7 @@
setController(0);
// 3. If m's mediagroup attribute is being removed, then abort these steps.
- if (group.isNull() || group.isEmpty())
+ if (group.isEmpty())
return;
// 4. If there is another media element whose Document is the same as m's Document (even if one or both
Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLMediaElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -108,7 +108,9 @@
[Conditional=VIDEO_TRACK] readonly attribute VideoTrackList videoTracks;
#endif
- [Reflect, TreatNullAs=NullString] attribute DOMString mediaGroup;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [Reflect, TreatNullAs=LegacyNullString] attribute DOMString mediaGroup;
+
[CustomSetter] attribute MediaController controller;
#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
Modified: trunk/Source/WebCore/html/HTMLOutputElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLOutputElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLOutputElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -29,8 +29,8 @@
[Reflect] attribute DOMString name;
readonly attribute DOMString type;
- [TreatNullAs=NullString] attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
+ [TreatNullAs=EmptyString] attribute DOMString defaultValue;
+ [TreatNullAs=EmptyString] attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLScriptElement.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -79,7 +79,7 @@
ScriptElement::finishedInsertingSubtree();
}
-void HTMLScriptElement::setText(const String &value)
+void HTMLScriptElement::setText(const String& value)
{
Ref<HTMLScriptElement> protectFromMutationEvents(*this);
@@ -91,7 +91,7 @@
if (hasChildNodes())
removeChildren();
- appendChild(document().createTextNode(value.impl()), IGNORE_EXCEPTION);
+ appendChild(document().createTextNode(value), IGNORE_EXCEPTION);
}
void HTMLScriptElement::setAsync(bool async)
Modified: trunk/Source/WebCore/html/HTMLScriptElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLScriptElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLScriptElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -18,7 +18,9 @@
*/
interface HTMLScriptElement : HTMLElement {
- [TreatNullAs=NullString] attribute DOMString text;
+ // FIXME: This should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString] attribute DOMString text;
+
[Reflect=for] attribute DOMString htmlFor;
[Reflect] attribute DOMString event;
[Reflect] attribute DOMString charset;
Modified: trunk/Source/WebCore/html/HTMLSelectElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLSelectElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLSelectElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -64,8 +64,10 @@
#endif
readonly attribute HTMLCollection selectedOptions;
attribute long selectedIndex;
- [TreatNullAs=NullString] attribute DOMString value;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString value;
+
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp 2016-02-29 17:28:13 UTC (rev 197353)
@@ -368,7 +368,7 @@
m_wasModifiedByUser = false;
// Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
// We normalize line endings coming from _javascript_ here.
- String normalizedValue = newValue.isNull() ? "" : newValue;
+ String normalizedValue = newValue.isNull() ? emptyString() : newValue;
normalizedValue.replace("\r\n", "\n");
normalizedValue.replace('\r', '\n');
Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.idl (197352 => 197353)
--- trunk/Source/WebCore/html/HTMLTextAreaElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -40,7 +40,7 @@
readonly attribute DOMString type;
attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
+ [TreatNullAs=EmptyString] attribute DOMString value;
readonly attribute unsigned long textLength;
readonly attribute boolean willValidate;
@@ -71,8 +71,10 @@
#endif
[Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
- [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=NullString] attribute DOMString autocapitalize;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=LegacyNullString] attribute DOMString autocapitalize;
+
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
[Reflect] attribute DOMString accessKey;
#endif
Modified: trunk/Source/WebCore/html/URLUtils.idl (197352 => 197353)
--- trunk/Source/WebCore/html/URLUtils.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/URLUtils.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -32,14 +32,16 @@
readonly attribute DOMString origin;
- [TreatNullAs=NullString] attribute DOMString protocol;
- [TreatNullAs=NullString] attribute DOMString username;
- [TreatNullAs=NullString] attribute DOMString password;
- [TreatNullAs=NullString] attribute DOMString host;
- [TreatNullAs=NullString] attribute DOMString hostname;
- [TreatNullAs=NullString] attribute DOMString port;
- [TreatNullAs=NullString] attribute DOMString pathname;
- [TreatNullAs=NullString] attribute DOMString search;
- // attribute URLSearchParams? searchParams;
- [TreatNullAs=NullString] attribute DOMString hash;
+ // FIXME: These should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString] attribute DOMString protocol;
+ [TreatNullAs=EmptyString] attribute DOMString username;
+ [TreatNullAs=EmptyString] attribute DOMString password;
+ [TreatNullAs=EmptyString] attribute DOMString host;
+ [TreatNullAs=EmptyString] attribute DOMString hostname;
+ [TreatNullAs=EmptyString] attribute DOMString port;
+ [TreatNullAs=EmptyString] attribute DOMString pathname;
+ [TreatNullAs=EmptyString] attribute DOMString hash;
+
+ // FIXME: This should not have [TreatNullAs=NullString].
+ [TreatNullAs=LegacyNullString] attribute DOMString search;
};
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (197352 => 197353)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -42,20 +42,22 @@
unrestricted float dx, unrestricted float dy);
attribute unrestricted float globalAlpha;
- [TreatNullAs=NullString] attribute DOMString globalCompositeOperation;
+ // FIXME: This should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString] attribute DOMString globalCompositeOperation;
+
[RaisesException] CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
[RaisesException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
attribute unrestricted float lineWidth;
- [TreatNullAs=NullString] attribute DOMString lineCap;
- [TreatNullAs=NullString] attribute DOMString lineJoin;
+ attribute DOMString lineCap;
+ attribute DOMString lineJoin;
attribute unrestricted float miterLimit;
attribute unrestricted float shadowOffsetX;
attribute unrestricted float shadowOffsetY;
attribute unrestricted float shadowBlur;
- [TreatNullAs=NullString] attribute DOMString shadowColor;
+ attribute DOMString shadowColor;
void setLineDash(sequence<unrestricted float> dash);
sequence<unrestricted float> getLineDash();
@@ -170,8 +172,8 @@
[RaisesException] void webkitPutImageDataHD(ImageData? imagedata, float dx, float dy);
[RaisesException] void webkitPutImageDataHD(ImageData? imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
- [RaisesException] CanvasPattern createPattern(HTMLCanvasElement? canvas, [TreatNullAs=NullString] DOMString repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLImageElement? image, [TreatNullAs=NullString] DOMString repetitionType);
+ [RaisesException] CanvasPattern createPattern(HTMLCanvasElement? canvas, [TreatNullAs=EmptyString] DOMString repetitionType);
+ [RaisesException] CanvasPattern createPattern(HTMLImageElement? image, [TreatNullAs=EmptyString] DOMString repetitionType);
[RaisesException] ImageData createImageData(ImageData? imagedata);
[RaisesException] ImageData createImageData(float sw, float sh);
Modified: trunk/Source/WebCore/svg/SVGAngle.idl (197352 => 197353)
--- trunk/Source/WebCore/svg/SVGAngle.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/svg/SVGAngle.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -32,7 +32,8 @@
[StrictTypeChecking] attribute unrestricted float value;
[StrictTypeChecking] attribute unrestricted float valueInSpecifiedUnits;
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString valueAsString;
+ // FIXME: This should not have [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString valueAsString;
[StrictTypeChecking, RaisesException] void newValueSpecifiedUnits(unsigned short unitType, unrestricted float valueInSpecifiedUnits);
Modified: trunk/Source/WebCore/svg/SVGElement.idl (197352 => 197353)
--- trunk/Source/WebCore/svg/SVGElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/svg/SVGElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -24,7 +24,8 @@
JSGenerateToNativeObject,
] interface SVGElement : Element {
// FIXME: the xmlbase attribute is no longer part of SVG2 and Chrome already dropped it.
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlbase;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString, SetterRaisesException] attribute DOMString xmlbase;
readonly attribute SVGSVGElement ownerSVGElement;
readonly attribute SVGElement viewportElement;
Modified: trunk/Source/WebCore/svg/SVGLength.idl (197352 => 197353)
--- trunk/Source/WebCore/svg/SVGLength.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/svg/SVGLength.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -38,8 +38,10 @@
[GetterRaisesException, SetterRaisesException, Custom, StrictTypeChecking] attribute unrestricted float value;
[StrictTypeChecking] attribute unrestricted float valueInSpecifiedUnits;
- [TreatNullAs=NullString, StrictTypeChecking, SetterRaisesException] attribute DOMString valueAsString;
+ // FIXME: This should not use [TreatNullAs=EmptyString].
+ [TreatNullAs=EmptyString, StrictTypeChecking, SetterRaisesException] attribute DOMString valueAsString;
+
[StrictTypeChecking, RaisesException] void newValueSpecifiedUnits(unsigned short unitType,
unrestricted float valueInSpecifiedUnits);
Modified: trunk/Source/WebCore/svg/SVGScriptElement.idl (197352 => 197353)
--- trunk/Source/WebCore/svg/SVGScriptElement.idl 2016-02-29 15:03:41 UTC (rev 197352)
+++ trunk/Source/WebCore/svg/SVGScriptElement.idl 2016-02-29 17:28:13 UTC (rev 197353)
@@ -24,7 +24,8 @@
*/
interface SVGScriptElement : SVGElement {
- [TreatNullAs=NullString, Reflect] attribute DOMString type;
+ // FIXME: This should not use [TreatNullAs=LegacyNullString].
+ [TreatNullAs=LegacyNullString, Reflect] attribute DOMString type;
};
SVGScriptElement implements SVGExternalResourcesRequired;