Bug 842186 - Replace use of jsval with JS::Value in cpp and h files under the content/html directory. r=jwalden

--HG--
extra : rebase_source : 258b3dfa6fea0aa6e888fd625ef24c864dd1a12f
This commit is contained in:
Jose Cortes 2013-03-22 22:00:43 -07:00
parent bd70d54caf
commit 32cfbd9ae1
6 changed files with 18 additions and 18 deletions

View File

@ -497,14 +497,14 @@ HTMLBodyElement::IsEventAttributeName(nsIAtom *aName)
// EventHandlerNonNull*, so allow passing in the type to use here.
#define FORWARDED_EVENT_HELPER(name_, forwardto_, type_, getter_type_) \
NS_IMETHODIMP \
HTMLBodyElement::GetOn##name_(JSContext *cx, jsval *vp) \
HTMLBodyElement::GetOn##name_(JSContext *cx, JS::Value *vp) \
{ \
getter_type_ h = forwardto_::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP \
HTMLBodyElement::SetOn##name_(JSContext *cx, const jsval &v) \
HTMLBodyElement::SetOn##name_(JSContext *cx, const JS::Value &v) \
{ \
JSObject *obj = GetWrapper(); \
if (!obj) { \

View File

@ -65,8 +65,8 @@ public:
// forward to window that don't come from nsIDOMHTMLBodyElement.
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by the shim */
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
NS_IMETHOD GetOn##name_(JSContext *cx, jsval *vp); \
NS_IMETHOD SetOn##name_(JSContext *cx, const jsval &v);
NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp); \
NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
#define WINDOW_EVENT_HELPER(name_, type_) \
type_* GetOn##name_(); \
void SetOn##name_(type_* handler, ErrorResult& error);

View File

@ -766,7 +766,7 @@ HTMLCanvasElement::GetContext(const nsAString& aContextId,
JS::AutoIdArray props(cx, JS_Enumerate(cx, &opts));
for (size_t i = 0; !!props && i < props.length(); ++i) {
jsid propid = props[i];
jsval propname, propval;
JS::Value propname, propval;
if (!JS_IdToValue(cx, propid, &propname) ||
!JS_GetPropertyById(cx, &opts, propid, &propval)) {
return NS_ERROR_FAILURE;

View File

@ -362,14 +362,14 @@ HTMLFrameSetElement::IsEventAttributeName(nsIAtom *aName)
// EventHandlerNonNull*, so allow passing in the type to use here.
#define FORWARDED_EVENT_HELPER(name_, forwardto_, type_, getter_type_) \
NS_IMETHODIMP \
HTMLFrameSetElement::GetOn##name_(JSContext *cx, jsval *vp) \
HTMLFrameSetElement::GetOn##name_(JSContext *cx, JS::Value *vp) \
{ \
getter_type_ h = forwardto_::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP \
HTMLFrameSetElement::SetOn##name_(JSContext *cx, const jsval &v) \
HTMLFrameSetElement::SetOn##name_(JSContext *cx, const JS::Value &v) \
{ \
JSObject *obj = GetWrapper(); \
if (!obj) { \

View File

@ -95,8 +95,8 @@ public:
// forward to window that don't come from nsIDOMHTMLFrameSetElement.
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by the superclass */
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
NS_IMETHOD GetOn##name_(JSContext *cx, jsval *vp); \
NS_IMETHOD SetOn##name_(JSContext *cx, const jsval &v);
NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp); \
NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
#define WINDOW_EVENT_HELPER(name_, type_) \
type_* GetOn##name_(); \
void SetOn##name_(type_* handler, ErrorResult& error);

View File

@ -1147,8 +1147,8 @@ nsHTMLInputElement::ConvertStringToNumber(nsAString& aValue,
return false;
}
jsval rval;
jsval fullYear[3];
JS::Value rval;
JS::Value fullYear[3];
fullYear[0].setInt32(year);
fullYear[1].setInt32(month - 1);
fullYear[2].setInt32(day);
@ -1157,7 +1157,7 @@ nsHTMLInputElement::ConvertStringToNumber(nsAString& aValue,
return false;
}
jsval timestamp;
JS::Value timestamp;
if (!JS::Call(ctx, date, "getTime", 0, nullptr, &timestamp)) {
JS_ClearPendingException(ctx);
return false;
@ -1312,7 +1312,7 @@ nsHTMLInputElement::ConvertNumberToString(double aValue,
return false;
}
jsval year, month, day;
JS::Value year, month, day;
if (!JS::Call(ctx, date, "getUTCFullYear", 0, nullptr, &year) ||
!JS::Call(ctx, date, "getUTCMonth", 0, nullptr, &month) ||
!JS::Call(ctx, date, "getUTCDate", 0, nullptr, &day)) {
@ -1369,7 +1369,7 @@ nsHTMLInputElement::ConvertNumberToString(double aValue,
}
NS_IMETHODIMP
nsHTMLInputElement::GetValueAsDate(JSContext* aCtx, jsval* aDate)
nsHTMLInputElement::GetValueAsDate(JSContext* aCtx, JS::Value* aDate)
{
if (mType != NS_FORM_INPUT_DATE && mType != NS_FORM_INPUT_TIME) {
aDate->setNull();
@ -1394,8 +1394,8 @@ nsHTMLInputElement::GetValueAsDate(JSContext* aCtx, jsval* aDate)
return NS_OK;
}
jsval rval;
jsval fullYear[3];
JS::Value rval;
JS::Value fullYear[3];
fullYear[0].setInt32(year);
fullYear[1].setInt32(month - 1);
fullYear[2].setInt32(day);
@ -1435,7 +1435,7 @@ nsHTMLInputElement::GetValueAsDate(JSContext* aCtx, jsval* aDate)
}
NS_IMETHODIMP
nsHTMLInputElement::SetValueAsDate(JSContext* aCtx, const jsval& aDate)
nsHTMLInputElement::SetValueAsDate(JSContext* aCtx, const JS::Value& aDate)
{
if (mType != NS_FORM_INPUT_DATE && mType != NS_FORM_INPUT_TIME) {
return NS_ERROR_DOM_INVALID_STATE_ERR;
@ -1453,7 +1453,7 @@ nsHTMLInputElement::SetValueAsDate(JSContext* aCtx, const jsval& aDate)
}
JSObject& date = aDate.toObject();
jsval timestamp;
JS::Value timestamp;
if (!JS::Call(aCtx, &date, "getTime", 0, nullptr, &timestamp) ||
!timestamp.isNumber() || MOZ_DOUBLE_IS_NaN(timestamp.toNumber())) {
JS_ClearPendingException(aCtx);