From 283ce3676526b74f44b8d6ff16ffb8279ce58dcf Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Tue, 14 Aug 2001 00:07:36 +0000 Subject: [PATCH] Fix for 94944. r=danm, sr=hewitt git-svn-id: svn://10.0.0.236/trunk@100961 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/xbl/public/nsIXBLInsertionPoint.h | 3 + mozilla/content/xbl/src/nsXBLBinding.cpp | 6 +- .../content/xbl/src/nsXBLInsertionPoint.cpp | 18 +++- mozilla/content/xbl/src/nsXBLInsertionPoint.h | 7 +- .../content/xbl/src/nsXBLPrototypeBinding.cpp | 101 +++++++++++++++--- .../content/xbl/src/nsXBLPrototypeBinding.h | 2 +- .../layout/xul/base/src/nsTextBoxFrame.cpp | 7 ++ .../classic/global/mac/classicBindings.xml | 8 +- mozilla/themes/classic/global/win/button.css | 4 + .../classic/global/win/buttonBindings.xml | 16 +-- .../classic/global/win/classicBindings.xml | 8 +- mozilla/themes/modern/global/button.css | 93 ++++++++-------- .../themes/modern/global/globalBindings.xml | 51 ++++----- .../resources/content/bindings/checkbox.xml | 4 +- mozilla/xpfe/global/resources/content/xul.css | 10 ++ 15 files changed, 226 insertions(+), 112 deletions(-) diff --git a/mozilla/content/xbl/public/nsIXBLInsertionPoint.h b/mozilla/content/xbl/public/nsIXBLInsertionPoint.h index 907b9db0b1d..e9cca248708 100644 --- a/mozilla/content/xbl/public/nsIXBLInsertionPoint.h +++ b/mozilla/content/xbl/public/nsIXBLInsertionPoint.h @@ -42,6 +42,9 @@ public: NS_IMETHOD SetDefaultContent(nsIContent* aDefaultContent)=0; NS_IMETHOD GetDefaultContent(nsIContent** aDefaultContent)=0; + NS_IMETHOD SetDefaultContentTemplate(nsIContent* aDefaultContent)=0; + NS_IMETHOD GetDefaultContentTemplate(nsIContent** aDefaultContent)=0; + NS_IMETHOD AddChild(nsIContent* aChildElement)=0; NS_IMETHOD InsertChildAt(PRInt32 aIndex, nsIContent* aChildElement)=0; NS_IMETHOD RemoveChild(nsIContent* aChildElement)=0; diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index beeb88c5422..e338eefa30a 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -600,7 +600,7 @@ PRBool PR_CALLBACK RealizeDefaultContent(nsHashKey* aKey, void* aData, void* aCl if (insCount == 0) { nsCOMPtr defContent; - currPoint->GetDefaultContent(getter_AddRefs(defContent)); + currPoint->GetDefaultContentTemplate(getter_AddRefs(defContent)); if (defContent) { // We need to take this template and use it to realize the // actual default content (through cloning). @@ -743,8 +743,6 @@ nsXBLBinding::GenerateAnonymousContent() clonedContent = do_QueryInterface(clonedNode); SetAnonymousContent(clonedContent); - mPrototypeBinding->SetInitialAttributes(mBoundElement, mContent); - if (hasInsertionPoints) { // Now check and see if we have a single insertion point // or multiple insertion points. @@ -847,6 +845,8 @@ nsXBLBinding::GenerateAnonymousContent() mInsertionPointTable->Enumerate(RealizeDefaultContent, &data); } } + + mPrototypeBinding->SetInitialAttributes(mBoundElement, mContent); } // Always check the content element for potential attributes. diff --git a/mozilla/content/xbl/src/nsXBLInsertionPoint.cpp b/mozilla/content/xbl/src/nsXBLInsertionPoint.cpp index 9808b77fa34..8c60a4b6a3a 100644 --- a/mozilla/content/xbl/src/nsXBLInsertionPoint.cpp +++ b/mozilla/content/xbl/src/nsXBLInsertionPoint.cpp @@ -32,7 +32,7 @@ nsXBLInsertionPoint::nsXBLInsertionPoint(nsIContent* aParentElement, PRUint32 aI NS_INIT_REFCNT(); mParentElement = aParentElement; mIndex = aIndex; - mDefaultContent = aDefaultContent; + mDefaultContentTemplate = aDefaultContent; } nsXBLInsertionPoint::~nsXBLInsertionPoint() @@ -71,6 +71,22 @@ nsXBLInsertionPoint::GetDefaultContent(nsIContent** aDefaultContent) return NS_OK; } +NS_IMETHODIMP +nsXBLInsertionPoint::SetDefaultContentTemplate(nsIContent* aDefaultContent) +{ + mDefaultContentTemplate = aDefaultContent; + return NS_OK; +} + +NS_IMETHODIMP +nsXBLInsertionPoint::GetDefaultContentTemplate(nsIContent** aDefaultContent) +{ + *aDefaultContent = mDefaultContentTemplate; + NS_IF_ADDREF(*aDefaultContent); + return NS_OK; +} + + NS_IMETHODIMP nsXBLInsertionPoint::AddChild(nsIContent* aChildElement) { diff --git a/mozilla/content/xbl/src/nsXBLInsertionPoint.h b/mozilla/content/xbl/src/nsXBLInsertionPoint.h index c0e2e570978..96b5471062c 100644 --- a/mozilla/content/xbl/src/nsXBLInsertionPoint.h +++ b/mozilla/content/xbl/src/nsXBLInsertionPoint.h @@ -43,6 +43,9 @@ public: NS_IMETHOD SetDefaultContent(nsIContent* aDefaultContent); NS_IMETHOD GetDefaultContent(nsIContent** aDefaultContent); + NS_IMETHOD SetDefaultContentTemplate(nsIContent* aDefaultContent); + NS_IMETHOD GetDefaultContentTemplate(nsIContent** aDefaultContent); + NS_IMETHOD AddChild(nsIContent* aChildElement); NS_IMETHOD InsertChildAt(PRInt32 aIndex, nsIContent* aChildElement); NS_IMETHOD RemoveChild(nsIContent* aChildElement); @@ -57,7 +60,9 @@ protected: nsIContent* mParentElement; // This ref is weak. The parent of the element. PRInt32 mIndex; // The index of this insertion point. -1 is a pseudo-point. nsCOMPtr mElements; // An array of elements present at the insertion point. - nsCOMPtr mDefaultContent; // The default content at this insertion point. + nsCOMPtr mDefaultContentTemplate ; // The template default content that will be cloned if + // the insertion point is empty. + nsCOMPtr mDefaultContent; // The cloned default content obtained by cloning mDefaultContentTemplate. }; extern nsresult diff --git a/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp b/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp index b0ca3cf57c0..32bde4fb8d5 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -641,7 +641,7 @@ nsXBLPrototypeBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceI xblAttr->GetElement(getter_AddRefs(element)); nsCOMPtr realElement; - LocateInstance(content, aAnonymousContent, element, getter_AddRefs(realElement)); + LocateInstance(aChangedElement, content, aAnonymousContent, element, getter_AddRefs(realElement)); xblAttr->GetDstAttribute(getter_AddRefs(dstAttr)); @@ -737,7 +737,7 @@ PRBool PR_CALLBACK InstantiateInsertionPoint(nsHashKey* aKey, void* aData, void* binding->GetAnonymousContent(getter_AddRefs(instanceRoot)); nsCOMPtr templRoot; proto->GetImmediateChild(nsXBLPrototypeBinding::kContentAtom, getter_AddRefs(templRoot)); - proto->LocateInstance(templRoot, instanceRoot, content, getter_AddRefs(realContent)); + proto->LocateInstance(nsnull, templRoot, instanceRoot, content, getter_AddRefs(realContent)); if (!realContent) binding->GetBoundElement(getter_AddRefs(realContent)); @@ -806,7 +806,7 @@ nsXBLPrototypeBinding::GetInsertionPoint(nsIContent* aBoundElement, nsIContent* entry->GetDefaultContent(aDefaultContent); // Addref happens here. nsCOMPtr templContent; GetImmediateChild(kContentAtom, getter_AddRefs(templContent)); - LocateInstance(templContent, aCopyRoot, content, getter_AddRefs(realContent)); + LocateInstance(nsnull, templContent, aCopyRoot, content, getter_AddRefs(realContent)); } else { // We got nothin'. Bail. @@ -844,7 +844,7 @@ nsXBLPrototypeBinding::GetSingleInsertionPoint(nsIContent* aBoundElement, entry->GetDefaultContent(aDefaultContent); // Addref happens here. nsCOMPtr templContent; GetImmediateChild(kContentAtom, getter_AddRefs(templContent)); - LocateInstance(templContent, aCopyRoot, content, getter_AddRefs(realContent)); + LocateInstance(nsnull, templContent, aCopyRoot, content, getter_AddRefs(realContent)); } else { // The only insertion point specified was actually a filtered insertion point. @@ -964,29 +964,93 @@ nsXBLPrototypeBinding::ConstructHandlers() } void -nsXBLPrototypeBinding::LocateInstance(nsIContent* aTemplRoot, nsIContent* aCopyRoot, +nsXBLPrototypeBinding::LocateInstance(nsIContent* aBoundElement, nsIContent* aTemplRoot, nsIContent* aCopyRoot, nsIContent* aTemplChild, nsIContent** aCopyResult) { // XXX We will get in trouble if the binding instantiation deviates from the template // in the prototype. - if (aTemplChild == aTemplRoot) { + if (aTemplChild == aTemplRoot || !aTemplChild) { *aCopyResult = nsnull; return; } nsCOMPtr templParent; nsCOMPtr copyParent; - + nsCOMPtr childPoint; aTemplChild->GetParent(*getter_AddRefs(templParent)); - + + if (aBoundElement) { + nsCOMPtr tag; + templParent->GetTag(*getter_AddRefs(tag)); + if (tag == kChildrenAtom) { + childPoint = templParent; + childPoint->GetParent(*getter_AddRefs(templParent)); + } + } + + if (!templParent) + return; + if (templParent.get() == aTemplRoot) copyParent = aCopyRoot; else - LocateInstance(aTemplRoot, aCopyRoot, templParent, getter_AddRefs(copyParent)); + LocateInstance(aBoundElement, aTemplRoot, aCopyRoot, templParent, getter_AddRefs(copyParent)); - PRInt32 index; - templParent->IndexOf(aTemplChild, index); - copyParent->ChildAt(index, *aCopyResult); // Addref happens here. + if (childPoint && aBoundElement) { + // First we have to locate this insertion point and use its index and its + // count to detemine our precise position within the template. + nsCOMPtr doc; + aBoundElement->GetDocument(*getter_AddRefs(doc)); + nsCOMPtr bm; + doc->GetBindingManager(getter_AddRefs(bm)); + nsCOMPtr binding; + bm->GetBinding(aBoundElement, getter_AddRefs(binding)); + + nsCOMPtr currBinding = binding; + while (currBinding) { + nsCOMPtr anonContent; + currBinding->GetAnonymousContent(getter_AddRefs(anonContent)); + if (anonContent) + break; + nsCOMPtr tempBinding = currBinding; + tempBinding->GetBaseBinding(getter_AddRefs(currBinding)); + } + + nsCOMPtr points; + currBinding->GetInsertionPointsFor(copyParent, getter_AddRefs(points)); + nsCOMPtr insertionPoint; + PRUint32 count; + points->Count(&count); + for (PRUint32 i = 0; i < count; i++) { + // Next we have to find the real insertion point for this proto insertion + // point. If it does not contain any default content, then we should + // return null, since the content is not in the clone. + nsCOMPtr currPoint = getter_AddRefs((nsIXBLInsertionPoint*)points->ElementAt(i)); + nsCOMPtr defContent; + currPoint->GetDefaultContentTemplate(getter_AddRefs(defContent)); + if (defContent == childPoint) { + // Now check to see if we even built default content at this + // insertion point. + currPoint->GetDefaultContent(getter_AddRefs(defContent)); + if (defContent) { + // Find out the index of the template element within the elt. + PRInt32 index; + childPoint->IndexOf(aTemplChild, index); + + // Now we just have to find the corresponding elt underneath the cloned + // default content. + defContent->ChildAt(index, *aCopyResult); + } + break; + } + } + } + else if (copyParent) + { + PRInt32 index; + templParent->IndexOf(aTemplChild, index); + copyParent->ChildAt(index, *aCopyResult); // Addref happens here. + } } struct nsXBLAttrChangeData @@ -1039,7 +1103,8 @@ PRBool PR_CALLBACK SetAttrs(nsHashKey* aKey, void* aData, void* aClosure) curr->GetElement(getter_AddRefs(element)); nsCOMPtr realElement; - changeData->mProto->LocateInstance(content, changeData->mContent, element, getter_AddRefs(realElement)); + changeData->mProto->LocateInstance(changeData->mBoundElement, + content, changeData->mContent, element, getter_AddRefs(realElement)); if (realElement) { realElement->SetAttribute(kNameSpaceID_None, dst, value, PR_FALSE); nsCOMPtr tag; @@ -1240,7 +1305,7 @@ nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent* aContent) nsISupportsKey key(atom); mInsertionPointTable->Put(&key, xblIns); - token = nsCRT::strtok( newStr, ", ", &newStr ); + token = nsCRT::strtok( newStr, "| ", &newStr ); } nsMemory::Free(str); @@ -1267,8 +1332,14 @@ nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent* aContent) // in situations where no content ends up being placed at the insertion point. PRInt32 defaultCount; child->ChildCount(defaultCount); - if (defaultCount > 0) + if (defaultCount > 0) { + // Annotate the insertion point with our default content. xblIns->SetDefaultContent(child); + + // Reconnect back to our parent for access later. This makes "inherits" easier + // to work with on default content. + child->SetParent(parent); + } } } } diff --git a/mozilla/content/xbl/src/nsXBLPrototypeBinding.h b/mozilla/content/xbl/src/nsXBLPrototypeBinding.h index 9ea6fb63441..e5cd712dd60 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeBinding.h +++ b/mozilla/content/xbl/src/nsXBLPrototypeBinding.h @@ -138,7 +138,7 @@ public: // Internal member functions public: void GetImmediateChild(nsIAtom* aTag, nsIContent** aResult); - void LocateInstance(nsIContent* aTemplRoot, nsIContent* aCopyRoot, + void LocateInstance(nsIContent* aBoundElt, nsIContent* aTemplRoot, nsIContent* aCopyRoot, nsIContent* aTemplChild, nsIContent** aCopyResult); protected: diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp index c7bb85993d8..d366c4d042f 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp @@ -264,6 +264,13 @@ nsTextBoxFrame::PaintTitle(nsIPresContext* aPresContext, nsRect textRect(aRect); textRect.width = mTitleWidth; + // Align our text within the overall rect by checking our text-align property. + const nsStyleText* textStyle = (const nsStyleText*)mStyleContext->GetStyleData(eStyleStruct_Text); + if (textStyle->mTextAlign == NS_STYLE_TEXT_ALIGN_CENTER) + textRect.x += (aRect.width - textRect.width)/2; + else if (textStyle->mTextAlign == NS_STYLE_TEXT_ALIGN_RIGHT) + textRect.x += (aRect.width - textRect.width); + // don't draw if the title is not dirty if (PR_FALSE == aDirtyRect.Intersects(textRect)) return NS_OK; diff --git a/mozilla/themes/classic/global/mac/classicBindings.xml b/mozilla/themes/classic/global/mac/classicBindings.xml index 57f9d20fffd..8cf38c74c47 100644 --- a/mozilla/themes/classic/global/mac/classicBindings.xml +++ b/mozilla/themes/classic/global/mac/classicBindings.xml @@ -41,9 +41,7 @@ - - - + @@ -57,9 +55,7 @@ - - - + diff --git a/mozilla/themes/classic/global/win/button.css b/mozilla/themes/classic/global/win/button.css index 0945365ba4c..c29767e0ea9 100644 --- a/mozilla/themes/classic/global/win/button.css +++ b/mozilla/themes/classic/global/win/button.css @@ -14,6 +14,10 @@ -moz-user-focus : normal; } + .button-text { + text-align: center; + } + button, button[disabled="true"][default], button[disabled="true"]:hover:active diff --git a/mozilla/themes/classic/global/win/buttonBindings.xml b/mozilla/themes/classic/global/win/buttonBindings.xml index bea5cd2d535..ae209261be1 100644 --- a/mozilla/themes/classic/global/win/buttonBindings.xml +++ b/mozilla/themes/classic/global/win/buttonBindings.xml @@ -6,15 +6,17 @@ - - - - - - + + + + + + + + - + diff --git a/mozilla/themes/classic/global/win/classicBindings.xml b/mozilla/themes/classic/global/win/classicBindings.xml index e9166dcee76..de8cd186793 100644 --- a/mozilla/themes/classic/global/win/classicBindings.xml +++ b/mozilla/themes/classic/global/win/classicBindings.xml @@ -43,9 +43,7 @@ - - - + @@ -60,9 +58,7 @@ - - - + diff --git a/mozilla/themes/modern/global/button.css b/mozilla/themes/modern/global/button.css index 71aaef05feb..8aad2e68cb7 100644 --- a/mozilla/themes/modern/global/button.css +++ b/mozilla/themes/modern/global/button.css @@ -47,9 +47,12 @@ button { padding: 3px 2px 3px 2px; } -.button-text-mid, -.button-icon-mid { +.button-text-mid { + margin-left: 3px; margin-right: 3px; + margin-top: 0px; + margin-bottom: 0px; + text-align: center; } /* .......... focused state .......... */ @@ -122,48 +125,48 @@ button[open="true"] { color: #FFFFFF; } -button:hover:active > .button-box-left > .button-left-top, +button:hover:active > .box-inherit > .button-box-left > .button-left-top, button[open="true"] > .button-box-left > .button-left-top { background-image: url("chrome://global/skin/button/btn-act-lft-top.gif"); } -button:hover:active > .button-box-left > .button-left-mid, -button[open="true"] > .button-box-left > .button-left-mid { +button:hover:active > .box-inherit > .button-box-left > .button-left-mid, +button[open="true"] > .box-inherit > .button-box-left > .button-left-mid { background-image: url("chrome://global/skin/button/btn-act-lft-mid.gif"); } -button:hover:active > .button-box-left > .button-left-btm, -button[open="true"] > .button-box-left > .button-left-btm { +button:hover:active > .box-inherit > .button-box-left > .button-left-btm, +button[open="true"] > .box-inherit > .button-box-left > .button-left-btm { background-image: url("chrome://global/skin/button/btn-act-lft-btm.gif"); } -button:hover:active > .button-stack > .button-box-mid, -button[open="true"] > .button-stack > .button-box-mid { +button:hover:active > .box-inherit > .button-stack > .button-box-mid, +button[open="true"] > .box-inherit > .button-stack > .button-box-mid { background-color: #90A1B3; } -button:hover:active > .button-stack > .button-box-mid > .button-mid-top, -button[open="true"] > .button-stack > .button-box-mid > .button-mid-top { +button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-top, +button[open="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-top { background-image: url("chrome://global/skin/button/btn-act-mid-top.gif"); } -button:hover:active > .button-stack > .button-box-mid > .button-mid-btm, -button[open="true"] > .button-stack > .button-box-mid > .button-mid-btm { +button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm, +button[open="true"] > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm { background-image: url("chrome://global/skin/button/btn-act-mid-btm.gif"); } -button:hover:active > .button-box-right > .button-right-top, -button[open="true"] > .button-box-right > .button-right-top { +button:hover:active > .box-inherit > .button-box-right > .button-right-top, +button[open="true"] > .box-inherit > .button-box-right > .button-right-top { background-image: url("chrome://global/skin/button/btn-act-rit-top.gif"); } -button:hover:active > .button-box-right > .button-right-mid, -button[open="true"] > .button-box-right > .button-right-mid { +button:hover:active > .box-inherit > .button-box-right > .button-right-mid, +button[open="true"] > .box-inherit > .button-box-right > .button-right-mid { background-image: url("chrome://global/skin/button/btn-act-rit-mid.gif"); } -button:hover:active > .button-box-right > .button-right-btm, -button[open="true"] > .button-box-right > .button-right-btm { +button:hover:active > .box-inherit > .button-box-right > .button-right-btm, +button[open="true"] > .box-inherit > .button-box-right > .button-right-btm { background-image: url("chrome://global/skin/button/btn-act-rit-btm.gif"); } @@ -174,47 +177,47 @@ button[disabled="true"]:hover:active { color: #8C99AB; } -button:hover:active > .button-box-left > .button-left-top[disabled="true"], +button:hover:active > .box-inherit > .button-box-left > .button-left-top[disabled="true"], .button-left-top[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-top.gif"); } -button:hover:active > .button-box-left > .button-left-mid[disabled="true"], +button:hover:active > .box-inherit > .button-box-left > .button-left-mid[disabled="true"], .button-left-mid[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-mid.gif"); } -button:hover:active > .button-box-left > .button-left-btm[disabled="true"], +button:hover:active > .box-inherit > .button-box-left > .button-left-btm[disabled="true"], .button-left-btm[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-btm.gif"); } -button:hover:active > .button-stack > .button-box-mid[disabled="true"], +button:hover:active > .box-inherit > .button-stack > .button-box-mid[disabled="true"], .button-box-mid[disabled="true"] { background-color: #B7BFCB; } -button:hover:active > .button-stack > .button-box-mid > .button-mid-top[disabled="true"], +button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-top[disabled="true"], .button-mid-top[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-mid-top.gif"); } -button:hover:active > .button-stack > .button-box-mid > .button-mid-btm[disabled="true"], +button:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm[disabled="true"], .button-mid-btm[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-mid-btm.gif"); } -button:hover:active > .button-box-right > .button-right-top[disabled="true"], +button:hover:active > .box-inherit > .button-box-right > .button-right-top[disabled="true"], .button-right-top[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-top.gif"); } -button:hover:active > .button-box-right > .button-right-mid[disabled="true"], +button:hover:active > .box-inherit > .button-box-right > .button-right-mid[disabled="true"], .button-right-mid[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-mid.gif"); } -button:hover:active > .button-box-right > .button-right-btm[disabled="true"], +button:hover:active > .box-inherit > .button-box-right > .button-right-btm[disabled="true"], .button-right-btm[disabled="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-btm.gif"); } @@ -273,35 +276,35 @@ button[default="true"] { /* .......... default active state .......... */ -:hover:active > .button-box-left > .button-left-top[default="true"] { +:hover:active > .box-inherit > .button-box-left > .button-left-top[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-lft-top.gif"); } -:hover:active > .button-box-left > .button-left-mid[default="true"] { +:hover:active > .box-inherit > .button-box-left > .button-left-mid[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-lft-mid.gif"); } -:hover:active > .button-box-left > .button-left-btm[default="true"] { +:hover:active > .box-inherit > .button-box-left > .button-left-btm[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-lft-btm.gif"); } -:hover:active > .button-stack > .button-box-mid > .button-mid-top[default="true"] { +:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-top[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-mid-top.gif"); } -:hover:active > .button-stack > .button-box-mid > .button-mid-btm[default="true"] { +:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-mid-btm.gif"); } -:hover:active > .button-box-right > .button-right-top[default="true"] { +:hover:active > .box-inherit > .button-box-right > .button-right-top[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-rit-top.gif"); } -:hover:active > .button-box-right > .button-right-mid[default="true"] { +:hover:active > .box-inherit > .button-box-right > .button-right-mid[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-rit-mid.gif"); } -:hover:active > .button-box-right > .button-right-btm[default="true"] { +:hover:active > .box-inherit > .button-box-right > .button-right-btm[default="true"] { background-image: url("chrome://global/skin/button/btn-def-act-rit-btm.gif"); } @@ -312,7 +315,7 @@ button[default="true"][disabled="true"] { margin-bottom: 3px; } -:hover:active > .button-box-left > .button-left-top[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-left > .button-left-top[disabled="true"][default="true"], .button-left-top[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-top.gif"); height: 9px; @@ -322,29 +325,29 @@ button[default="true"][disabled="true"] { width: 6px; } -:hover:active > .button-box-left > .button-left-mid[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-left > .button-left-mid[disabled="true"][default="true"], .button-left-mid[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-mid.gif"); } -:hover:active > .button-box-left > .button-left-btm[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-left > .button-left-btm[disabled="true"][default="true"], .button-left-btm[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-lft-btm.gif"); height: 8px; } -:hover:active > .button-stack > .button-box-mid[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-stack > .button-box-mid[disabled="true"][default="true"], .button-box-mid[disabled="true"][default="true"] { background-color: #B7BFCB; } -:hover:active > .button-stack > .button-box-mid > .button-mid-top[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-top[disabled="true"][default="true"], .button-mid-top[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-mid-top.gif"); height: 9px; } -:hover:active > .button-stack > .button-box-mid > .button-mid-btm[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-stack > .button-box-mid > .button-mid-btm[disabled="true"][default="true"], .button-mid-btm[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-mid-btm.gif"); height: 8px; @@ -354,18 +357,18 @@ button[default="true"][disabled="true"] { width: 6px; } -:hover:active > .button-box-right > .button-right-top[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-right > .button-right-top[disabled="true"][default="true"], .button-right-top[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-top.gif"); height: 9px; } -:hover:active > .button-box-right > .button-right-mid[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-right > .button-right-mid[disabled="true"][default="true"], .button-right-mid[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-mid.gif"); } -:hover:active > .button-box-right > .button-right-btm[disabled="true"][default="true"], +:hover:active > .box-inherit > .button-box-right > .button-right-btm[disabled="true"][default="true"], .button-right-btm[disabled="true"][default="true"] { background-image: url("chrome://global/skin/button/btn-dis-rit-btm.gif"); height: 8px; diff --git a/mozilla/themes/modern/global/globalBindings.xml b/mozilla/themes/modern/global/globalBindings.xml index 94ea6021d3c..89f19a3612d 100644 --- a/mozilla/themes/modern/global/globalBindings.xml +++ b/mozilla/themes/modern/global/globalBindings.xml @@ -26,33 +26,36 @@ - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + + + + + + + - - - - - - - + + + + + + diff --git a/mozilla/xpfe/global/resources/content/bindings/checkbox.xml b/mozilla/xpfe/global/resources/content/bindings/checkbox.xml index cedae6e22ac..9d08558b216 100644 --- a/mozilla/xpfe/global/resources/content/bindings/checkbox.xml +++ b/mozilla/xpfe/global/resources/content/bindings/checkbox.xml @@ -17,9 +17,7 @@ - - - + diff --git a/mozilla/xpfe/global/resources/content/xul.css b/mozilla/xpfe/global/resources/content/xul.css index dcaecf2c4d4..2585d19b4b1 100644 --- a/mozilla/xpfe/global/resources/content/xul.css +++ b/mozilla/xpfe/global/resources/content/xul.css @@ -438,6 +438,16 @@ progressmeter { -moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter"); } +/********** basic rule for anonymous content that needs to pass box properties through + ********** to an insertion point parent that holds the real kids **************/ + + .box-inherit { + -moz-box-orient: inherit; + -moz-box-pack: inherit; + -moz-box-align: inherit; + -moz-box-direction: inherit; +} + /********** label **********/ /* XXXdwh , and are deprecated. */