Bug 1335191 - Remove support for the attributes "activetitlebarcolor" and "inactivetitlebarcolor" for XUL window elements. r?emilio
The last piece of code that was using these attributes was removed in
https://hg.mozilla.org/mozilla-central/rev/35b7fa5ebd58
MozReview-Commit-ID: FyF7kzlpqMz
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1106,34 +1106,21 @@ nsXULElement::AfterSetAttr(int32_t aName
aValue->Equals(NS_LITERAL_STRING("true"), eCaseMatters));
} else if (aName == nsGkAtoms::chromemargin) {
SetChromeMargins(aValue);
} else if (aName == nsGkAtoms::windowtype &&
document && document->GetRootElement() == this) {
MaybeUpdatePrivateLifetime();
}
}
- // title, (in)activetitlebarcolor and drawintitlebar are settable on
+ // title and drawintitlebar are settable on
// any root node (windows, dialogs, etc)
if (document && document->GetRootElement() == this) {
if (aName == nsGkAtoms::title) {
document->NotifyPossibleTitleChange(false);
- } else if ((aName == nsGkAtoms::activetitlebarcolor ||
- aName == nsGkAtoms::inactivetitlebarcolor)) {
- nscolor color = NS_RGBA(0, 0, 0, 0);
- if (aValue->Type() == nsAttrValue::eColor) {
- aValue->GetColorValue(color);
- } else {
- nsAutoString tmp;
- nsAttrValue attrValue;
- aValue->ToString(tmp);
- attrValue.ParseColor(tmp);
- attrValue.GetColorValue(color);
- }
- SetTitlebarColor(color, aName == nsGkAtoms::activetitlebarcolor);
} else if (aName == nsGkAtoms::drawintitlebar) {
SetDrawsInTitlebar(
aValue->Equals(NS_LITERAL_STRING("true"), eCaseMatters));
} else if (aName == nsGkAtoms::drawtitle) {
SetDrawsTitle(
aValue->Equals(NS_LITERAL_STRING("true"), eCaseMatters));
} else if (aName == nsGkAtoms::localedir) {
// if the localedir changed on the root element, reset the document direction
@@ -1163,21 +1150,17 @@ nsXULElement::AfterSetAttr(int32_t aName
HideWindowChrome(false);
} else if (aName == nsGkAtoms::chromemargin) {
ResetChromeMargins();
}
}
nsIDocument* doc = GetUncomposedDoc();
if (doc && doc->GetRootElement() == this) {
- if ((aName == nsGkAtoms::activetitlebarcolor ||
- aName == nsGkAtoms::inactivetitlebarcolor)) {
- // Use 0, 0, 0, 0 as the "none" color.
- SetTitlebarColor(NS_RGBA(0, 0, 0, 0), aName == nsGkAtoms::activetitlebarcolor);
- } else if (aName == nsGkAtoms::localedir) {
+ if (aName == nsGkAtoms::localedir) {
// if the localedir changed on the root element, reset the document direction
XULDocument* xuldoc = doc->AsXULDocument();
if (xuldoc) {
xuldoc->ResetDocumentDirection();
}
} else if ((aName == nsGkAtoms::lwtheme ||
aName == nsGkAtoms::lwthemetextcolor)) {
// if the lwtheme changed, make sure to restyle appropriately
@@ -1810,25 +1793,16 @@ nsXULElement::GetWindowWidget()
nsCOMPtr<nsIWidget> mainWidget;
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
return mainWidget;
}
}
return nullptr;
}
-void
-nsXULElement::SetTitlebarColor(nscolor aColor, bool aActive)
-{
- nsIWidget* mainWidget = GetWindowWidget();
- if (mainWidget) {
- mainWidget->SetWindowTitlebarColor(aColor, aActive);
- }
-}
-
class SetDrawInTitleBarEvent : public Runnable
{
public:
SetDrawInTitleBarEvent(nsIWidget* aWidget, bool aState)
: mozilla::Runnable("SetDrawInTitleBarEvent")
, mWidget(aWidget)
, mState(aState)
{}
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -732,17 +732,16 @@ protected:
void MaybeAddPopupListener(nsAtom* aLocalName);
nsIWidget* GetWindowWidget();
// attribute setters for widget
nsresult HideWindowChrome(bool aShouldHide);
void SetChromeMargins(const nsAttrValue* aValue);
void ResetChromeMargins();
- void SetTitlebarColor(nscolor aColor, bool aActive);
void SetDrawsInTitlebar(bool aState);
void SetDrawsTitle(bool aState);
void UpdateBrightTitlebarForeground(nsIDocument* aDocument);
void RemoveBroadcaster(const nsAString & broadcasterId);
protected:
--- a/xpcom/ds/nsGkAtomList.h
+++ b/xpcom/ds/nsGkAtomList.h
@@ -56,17 +56,16 @@ GK_ATOM(abort, "abort")
GK_ATOM(above, "above")
GK_ATOM(acceltext, "acceltext")
GK_ATOM(accept, "accept")
GK_ATOM(acceptcharset, "accept-charset")
GK_ATOM(accesskey, "accesskey")
GK_ATOM(acronym, "acronym")
GK_ATOM(action, "action")
GK_ATOM(active, "active")
-GK_ATOM(activetitlebarcolor, "activetitlebarcolor")
GK_ATOM(activateontab, "activateontab")
GK_ATOM(actuate, "actuate")
GK_ATOM(address, "address")
GK_ATOM(after, "after")
GK_ATOM(after_end, "after_end")
GK_ATOM(after_start, "after_start")
GK_ATOM(align, "align")
GK_ATOM(alink, "alink")
@@ -555,17 +554,16 @@ GK_ATOM(ignorekeys, "ignorekeys")
GK_ATOM(ignoreuserfocus, "ignoreuserfocus")
GK_ATOM(ilayer, "ilayer")
GK_ATOM(image, "image")
GK_ATOM(imageClickedPoint, "image-clicked-point")
GK_ATOM(img, "img")
GK_ATOM(implementation, "implementation")
GK_ATOM(implements, "implements")
GK_ATOM(import, "import")
-GK_ATOM(inactivetitlebarcolor, "inactivetitlebarcolor")
GK_ATOM(include, "include")
GK_ATOM(includes, "includes")
GK_ATOM(increment, "increment")
GK_ATOM(indent, "indent")
GK_ATOM(indeterminate, "indeterminate")
GK_ATOM(index, "index")
GK_ATOM(infer, "infer")
GK_ATOM(infinity, "infinity")