зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6567ae2b15be (bug 845205) for possibly introducing more assertions, causing the browser-chrome tests to go over their log limit. CLOSED TREE
This commit is contained in:
Родитель
2d5a0df8de
Коммит
be6e80b946
|
@ -55,28 +55,24 @@ Declaration::ValueAppended(nsCSSProperty aProperty)
|
|||
mOrder.AppendElement(aProperty);
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
Declaration::RemoveProperty(nsCSSProperty aProperty)
|
||||
{
|
||||
nsCSSExpandedDataBlock data;
|
||||
ExpandTo(&data);
|
||||
NS_ABORT_IF_FALSE(!mData && !mImportantData, "Expand didn't null things out");
|
||||
|
||||
bool removed = false;
|
||||
|
||||
if (nsCSSProps::IsShorthand(aProperty)) {
|
||||
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProperty) {
|
||||
removed = data.ClearLonghandProperty(*p) || removed;
|
||||
data.ClearLonghandProperty(*p);
|
||||
mOrder.RemoveElement(*p);
|
||||
}
|
||||
} else {
|
||||
removed = data.ClearLonghandProperty(aProperty);
|
||||
data.ClearLonghandProperty(aProperty);
|
||||
mOrder.RemoveElement(aProperty);
|
||||
}
|
||||
|
||||
CompressFrom(&data);
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
*/
|
||||
void ValueAppended(nsCSSProperty aProperty);
|
||||
|
||||
bool RemoveProperty(nsCSSProperty aProperty);
|
||||
void RemoveProperty(nsCSSProperty aProperty);
|
||||
|
||||
bool HasProperty(nsCSSProperty aProperty) const;
|
||||
|
||||
|
|
|
@ -445,30 +445,26 @@ nsCSSExpandedDataBlock::Clear()
|
|||
AssertInitialState();
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
nsCSSExpandedDataBlock::ClearProperty(nsCSSProperty aPropID)
|
||||
{
|
||||
bool cleared = false;
|
||||
|
||||
if (nsCSSProps::IsShorthand(aPropID)) {
|
||||
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID) {
|
||||
cleared = ClearLonghandProperty(*p) || cleared;
|
||||
ClearLonghandProperty(*p);
|
||||
}
|
||||
} else {
|
||||
cleared = ClearLonghandProperty(aPropID);
|
||||
ClearLonghandProperty(aPropID);
|
||||
}
|
||||
|
||||
return cleared;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
nsCSSExpandedDataBlock::ClearLonghandProperty(nsCSSProperty aPropID)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aPropID), "out of range");
|
||||
|
||||
ClearPropertyBit(aPropID);
|
||||
ClearImportantBit(aPropID);
|
||||
PropertyAt(aPropID)->Reset();
|
||||
return ClearPropertyBit(aPropID);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -224,12 +224,12 @@ public:
|
|||
* Clear the data for the given property (including the set and
|
||||
* important bits). Can be used with shorthand properties.
|
||||
*/
|
||||
bool ClearProperty(nsCSSProperty aPropID);
|
||||
void ClearProperty(nsCSSProperty aPropID);
|
||||
|
||||
/**
|
||||
* Same as ClearProperty, but faster and cannot be used with shorthands.
|
||||
*/
|
||||
bool ClearLonghandProperty(nsCSSProperty aPropID);
|
||||
void ClearLonghandProperty(nsCSSProperty aPropID);
|
||||
|
||||
/**
|
||||
* Transfer the state for |aPropID| (which may be a shorthand)
|
||||
|
@ -306,8 +306,8 @@ private:
|
|||
mPropertiesSet.AddProperty(aProperty);
|
||||
}
|
||||
|
||||
bool ClearPropertyBit(nsCSSProperty aProperty) {
|
||||
return mPropertiesSet.RemoveProperty(aProperty);
|
||||
void ClearPropertyBit(nsCSSProperty aProperty) {
|
||||
mPropertiesSet.RemoveProperty(aProperty);
|
||||
}
|
||||
|
||||
bool HasPropertyBit(nsCSSProperty aProperty) {
|
||||
|
@ -318,8 +318,8 @@ private:
|
|||
mPropertiesImportant.AddProperty(aProperty);
|
||||
}
|
||||
|
||||
bool ClearImportantBit(nsCSSProperty aProperty) {
|
||||
return mPropertiesImportant.RemoveProperty(aProperty);
|
||||
void ClearImportantBit(nsCSSProperty aProperty) {
|
||||
mPropertiesImportant.RemoveProperty(aProperty);
|
||||
}
|
||||
|
||||
bool HasImportantBit(nsCSSProperty aProperty) {
|
||||
|
|
|
@ -38,13 +38,11 @@ public:
|
|||
property_set_type(1) << (p % kBitsInChunk);
|
||||
}
|
||||
|
||||
bool RemoveProperty(nsCSSProperty aProperty) {
|
||||
void RemoveProperty(nsCSSProperty aProperty) {
|
||||
AssertInSetRange(aProperty);
|
||||
size_t p = aProperty;
|
||||
property_set_type prev = mProperties[p / kBitsInChunk];
|
||||
mProperties[p / kBitsInChunk] &=
|
||||
~(property_set_type(1) << (p % kBitsInChunk));
|
||||
return prev != mProperties[p / kBitsInChunk];
|
||||
}
|
||||
|
||||
bool HasProperty(nsCSSProperty aProperty) const {
|
||||
|
|
|
@ -273,7 +273,7 @@ nsresult
|
|||
nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
|
||||
{
|
||||
css::Declaration* decl = GetCSSDeclaration(false);
|
||||
if (!decl || decl->Count() == 0) {
|
||||
if (!decl) {
|
||||
return NS_OK; // no decl, so nothing to remove
|
||||
}
|
||||
|
||||
|
@ -284,13 +284,7 @@ nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
|
|||
// rule (see stack in bug 209575).
|
||||
mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
|
||||
|
||||
css::Declaration* mutableDecl = decl->EnsureMutable();
|
||||
if (!mutableDecl->RemoveProperty(aPropID)) {
|
||||
if (mutableDecl != decl) {
|
||||
delete mutableDecl;
|
||||
}
|
||||
return NS_OK; // nothing removed
|
||||
}
|
||||
|
||||
return SetCSSDeclaration(mutableDecl);
|
||||
decl = decl->EnsureMutable();
|
||||
decl->RemoveProperty(aPropID);
|
||||
return SetCSSDeclaration(decl);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче