mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 907547: Update nsCSSValue::BufferFromString documentation to indicate that it's infallible, and remove callers' unneeded null-checks. r=bz
This commit is contained in:
parent
e176529eae
commit
706bb34072
@ -56,11 +56,6 @@ nsCSSValue::nsCSSValue(const nsString& aValue, nsCSSUnit aUnit)
|
||||
NS_ABORT_IF_FALSE(UnitHasStringValue(), "not a string value");
|
||||
if (UnitHasStringValue()) {
|
||||
mValue.mString = BufferFromString(aValue).get();
|
||||
if (MOZ_UNLIKELY(!mValue.mString)) {
|
||||
// XXXbz not much we can do here; just make sure that our promise of a
|
||||
// non-null mValue.mString holds for string units.
|
||||
mUnit = eCSSUnit_Null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mUnit = eCSSUnit_Null;
|
||||
@ -345,11 +340,6 @@ void nsCSSValue::SetStringValue(const nsString& aValue,
|
||||
NS_ABORT_IF_FALSE(UnitHasStringValue(), "not a string unit");
|
||||
if (UnitHasStringValue()) {
|
||||
mValue.mString = BufferFromString(aValue).get();
|
||||
if (MOZ_UNLIKELY(!mValue.mString)) {
|
||||
// XXXbz not much we can do here; just make sure that our promise of a
|
||||
// non-null mValue.mString holds for string units.
|
||||
mUnit = eCSSUnit_Null;
|
||||
}
|
||||
} else
|
||||
mUnit = eCSSUnit_Null;
|
||||
}
|
||||
|
@ -514,8 +514,8 @@ public:
|
||||
// Checks if this is a function value with the specified function id.
|
||||
bool EqualsFunction(nsCSSKeyword aFunctionId) const;
|
||||
|
||||
// Returns an already addrefed buffer. Can return null on allocation
|
||||
// failure.
|
||||
// Returns an already addrefed buffer. Guaranteed to return non-null.
|
||||
// (Will abort on allocation failure.)
|
||||
static already_AddRefed<nsStringBuffer>
|
||||
BufferFromString(const nsString& aValue);
|
||||
|
||||
|
@ -3402,11 +3402,6 @@ nsStyleAnimation::Value::SetUnparsedStringValue(const nsString& aString)
|
||||
FreeValue();
|
||||
mUnit = eUnit_UnparsedString;
|
||||
mValue.mString = nsCSSValue::BufferFromString(aString).get();
|
||||
if (MOZ_UNLIKELY(!mValue.mString)) {
|
||||
// not much we can do here; just make sure that our promise of a
|
||||
// non-null mValue.mString holds for string units.
|
||||
mUnit = eUnit_Null;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user