зеркало из 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);
|
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
|
// on a node
|
||||||
bool
|
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
|
// 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 aProperty [IN] an atom containing a CSS property
|
||||||
* @param aAttribute [IN] pointer to an attribute name or null if this information is irrelevant
|
* @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
|
/** 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
|
// HTML style to remove is applied; but we found no element in the
|
||||||
// ancestors of startNode carrying specified styles; assume it
|
// ancestors of startNode carrying specified styles; assume it
|
||||||
// comes from a rule and try to insert a span "inverting" the style
|
// 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");
|
NS_NAMED_LITERAL_STRING(value, "-moz-editor-invert-value");
|
||||||
SetInlinePropertyOnTextNode(*startNode->GetAsText(),
|
SetInlinePropertyOnTextNode(*startNode->GetAsText(),
|
||||||
range->StartOffset(),
|
range->StartOffset(),
|
||||||
|
@ -1414,7 +1414,7 @@ nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom* aProperty,
|
||||||
// in the ancestors of startNode carrying specified styles;
|
// in the ancestors of startNode carrying specified styles;
|
||||||
// assume it comes from a rule and let's try to insert a span
|
// assume it comes from a rule and let's try to insert a span
|
||||||
// "inverting" the style
|
// "inverting" the style
|
||||||
mHTMLCSSUtils->IsCSSInvertable(aProperty, aAttribute)) {
|
mHTMLCSSUtils->IsCSSInvertible(*aProperty, aAttribute)) {
|
||||||
NS_NAMED_LITERAL_STRING(value, "-moz-editor-invert-value");
|
NS_NAMED_LITERAL_STRING(value, "-moz-editor-invert-value");
|
||||||
SetInlinePropertyOnNode(node->AsContent(), aProperty,
|
SetInlinePropertyOnNode(node->AsContent(), aProperty,
|
||||||
aAttribute, &value);
|
aAttribute, &value);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче