зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1147412 part 8 - Clean up nsHTMLCSSUtils::IsCSSInvertible; r=ehsan
This commit is contained in:
Родитель
e6d0f69eea
Коммит
80da878691
|
@ -575,12 +575,12 @@ nsHTMLCSSUtils::RemoveCSSInlineStyle(nsIDOMNode *aNode, nsIAtom *aProperty, cons
|
|||
return mHTMLEditor->RemoveContainer(element);
|
||||
}
|
||||
|
||||
// Answers true is the property can be removed by setting a "none" CSS value
|
||||
// Answers true if the property can be removed by setting a "none" CSS value
|
||||
// on a node
|
||||
bool
|
||||
nsHTMLCSSUtils::IsCSSInvertable(nsIAtom *aProperty, const nsAString *aAttribute)
|
||||
nsHTMLCSSUtils::IsCSSInvertible(nsIAtom& aProperty, const nsAString* aAttribute)
|
||||
{
|
||||
return nsGkAtoms::b == aProperty;
|
||||
return nsGkAtoms::b == &aProperty;
|
||||
}
|
||||
|
||||
// Get the default browser background color if we need it for GetCSSBackgroundColorState
|
||||
|
|
|
@ -146,7 +146,7 @@ public:
|
|||
* @param aProperty [IN] an atom containing a CSS property
|
||||
* @param aAttribute [IN] pointer to an attribute name or null if this information is irrelevant
|
||||
*/
|
||||
bool IsCSSInvertable(nsIAtom * aProperty, const nsAString * aAttribute);
|
||||
bool IsCSSInvertible(nsIAtom& aProperty, const nsAString* aAttribute);
|
||||
|
||||
/** Get the default browser background color if we need it for GetCSSBackgroundColorState
|
||||
*
|
||||
|
|
|
@ -1374,7 +1374,7 @@ nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom* aProperty,
|
|||
// HTML style to remove is applied; but we found no element in the
|
||||
// ancestors of startNode carrying specified styles; assume it
|
||||
// comes from a rule and try to insert a span "inverting" the style
|
||||
if (mHTMLCSSUtils->IsCSSInvertable(aProperty, aAttribute)) {
|
||||
if (mHTMLCSSUtils->IsCSSInvertible(*aProperty, aAttribute)) {
|
||||
NS_NAMED_LITERAL_STRING(value, "-moz-editor-invert-value");
|
||||
SetInlinePropertyOnTextNode(*startNode->GetAsText(),
|
||||
range->StartOffset(),
|
||||
|
@ -1414,7 +1414,7 @@ nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom* aProperty,
|
|||
// in the ancestors of startNode carrying specified styles;
|
||||
// assume it comes from a rule and let's try to insert a span
|
||||
// "inverting" the style
|
||||
mHTMLCSSUtils->IsCSSInvertable(aProperty, aAttribute)) {
|
||||
mHTMLCSSUtils->IsCSSInvertible(*aProperty, aAttribute)) {
|
||||
NS_NAMED_LITERAL_STRING(value, "-moz-editor-invert-value");
|
||||
SetInlinePropertyOnNode(node->AsContent(), aProperty,
|
||||
aAttribute, &value);
|
||||
|
|
Загрузка…
Ссылка в новой задаче