Landing XBL scrollbars.

This commit is contained in:
hyatt%netscape.com 2000-01-15 05:31:45 +00:00
parent 0bf84e3705
commit 797cd22ff4
11 changed files with 84 additions and 3 deletions

View File

@ -12,6 +12,7 @@
#include "nsNetUtil.h"
#include "plstr.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIBindableContent.h"
#include "nsIDocument.h"
#include "nsIXMLContentSink.h"
@ -270,7 +271,10 @@ nsXBLService::GetContentList(nsIContent* aContent, nsISupportsArray** aResult)
content->ChildAt(i, *getter_AddRefs(anonymousChild));
if (!(*aResult))
NS_NewISupportsArray(aResult); // This call addrefs the array.
(*aResult)->AppendElement(anonymousChild);
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(anonymousChild);
if (element) // Don't let the extra text frames get generated.
(*aResult)->AppendElement(anonymousChild);
}
}

View File

@ -32,6 +32,8 @@
#include "nsINameSpaceManager.h"
#include "nsIURL.h"
#include "nsIXBLBinding.h"
//static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
static NS_DEFINE_IID(kIXMLContentIID, NS_IXMLCONTENT_IID);
@ -88,6 +90,12 @@ nsXMLElement::QueryInterface(REFNSIID aIID,
NS_ADDREF_THIS();
return NS_OK;
}
else if (aIID.Equals(nsIBindableContent::GetIID())) {
nsIBindableContent* tmp = this;
*aInstancePtr = (void*) tmp;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
@ -213,3 +221,17 @@ nsXMLElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
}
NS_IMETHODIMP
nsXMLElement::SetBinding(nsIXBLBinding* aBinding)
{
mBinding = aBinding; // nsCOMPtr handles addrefing.
return NS_OK;
}
NS_IMETHODIMP
nsXMLElement::GetBinding(nsIXBLBinding** aResult)
{
*aResult = mBinding;
NS_IF_ADDREF(*aResult);
return NS_OK;
}

View File

@ -23,12 +23,14 @@
#ifndef nsXMLElement_h___
#define nsXMLElement_h___
#include "nsCOMPtr.h"
#include "nsIDOMElement.h"
#include "nsIScriptObjectOwner.h"
#include "nsIDOMEventReceiver.h"
#include "nsIXMLContent.h"
#include "nsIJSScriptObject.h"
#include "nsGenericXMLElement.h"
#include "nsIBindableContent.h"
class nsIDocument;
class nsIAtom;
@ -39,6 +41,7 @@ class nsXMLElement : public nsIDOMElement,
public nsIScriptObjectOwner,
public nsIDOMEventReceiver,
public nsIXMLContent,
public nsIBindableContent,
public nsIJSScriptObject
{
public:
@ -196,6 +199,10 @@ public:
return mInner.SetNameSpaceID(aNameSpaceId);
}
// nsIBindableContent
NS_IMETHOD SetBinding(nsIXBLBinding* aBinding);
NS_IMETHOD GetBinding(nsIXBLBinding** aResult);
// nsIDOMEventReceiver
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
@ -229,6 +236,7 @@ protected:
nsGenericXMLElement mInner;
PRBool mIsLink;
PRUint32 mContentID;
nsCOMPtr<nsIXBLBinding> mBinding;
};
#endif // nsXMLElement_h___

View File

@ -12,6 +12,7 @@
#include "nsNetUtil.h"
#include "plstr.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIBindableContent.h"
#include "nsIDocument.h"
#include "nsIXMLContentSink.h"
@ -270,7 +271,10 @@ nsXBLService::GetContentList(nsIContent* aContent, nsISupportsArray** aResult)
content->ChildAt(i, *getter_AddRefs(anonymousChild));
if (!(*aResult))
NS_NewISupportsArray(aResult); // This call addrefs the array.
(*aResult)->AppendElement(anonymousChild);
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(anonymousChild);
if (element) // Don't let the extra text frames get generated.
(*aResult)->AppendElement(anonymousChild);
}
}

View File

@ -76,6 +76,11 @@ nsGenericXMLElement::CopyInnerTo(nsIContent* aSrcContent,
if (NS_OK == result) {
aDst->mNameSpacePrefix = mNameSpacePrefix;
NS_IF_ADDREF(mNameSpacePrefix);
aDst->mNameSpace = mNameSpace;
NS_IF_ADDREF(mNameSpace);
aDst->mNameSpaceID = mNameSpaceID;
}
return NS_OK;
}

View File

@ -32,6 +32,8 @@
#include "nsINameSpaceManager.h"
#include "nsIURL.h"
#include "nsIXBLBinding.h"
//static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
static NS_DEFINE_IID(kIXMLContentIID, NS_IXMLCONTENT_IID);
@ -88,6 +90,12 @@ nsXMLElement::QueryInterface(REFNSIID aIID,
NS_ADDREF_THIS();
return NS_OK;
}
else if (aIID.Equals(nsIBindableContent::GetIID())) {
nsIBindableContent* tmp = this;
*aInstancePtr = (void*) tmp;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
@ -213,3 +221,17 @@ nsXMLElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
}
NS_IMETHODIMP
nsXMLElement::SetBinding(nsIXBLBinding* aBinding)
{
mBinding = aBinding; // nsCOMPtr handles addrefing.
return NS_OK;
}
NS_IMETHODIMP
nsXMLElement::GetBinding(nsIXBLBinding** aResult)
{
*aResult = mBinding;
NS_IF_ADDREF(*aResult);
return NS_OK;
}

View File

@ -23,12 +23,14 @@
#ifndef nsXMLElement_h___
#define nsXMLElement_h___
#include "nsCOMPtr.h"
#include "nsIDOMElement.h"
#include "nsIScriptObjectOwner.h"
#include "nsIDOMEventReceiver.h"
#include "nsIXMLContent.h"
#include "nsIJSScriptObject.h"
#include "nsGenericXMLElement.h"
#include "nsIBindableContent.h"
class nsIDocument;
class nsIAtom;
@ -39,6 +41,7 @@ class nsXMLElement : public nsIDOMElement,
public nsIScriptObjectOwner,
public nsIDOMEventReceiver,
public nsIXMLContent,
public nsIBindableContent,
public nsIJSScriptObject
{
public:
@ -196,6 +199,10 @@ public:
return mInner.SetNameSpaceID(aNameSpaceId);
}
// nsIBindableContent
NS_IMETHOD SetBinding(nsIXBLBinding* aBinding);
NS_IMETHOD GetBinding(nsIXBLBinding** aResult);
// nsIDOMEventReceiver
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
@ -229,6 +236,7 @@ protected:
nsGenericXMLElement mInner;
PRBool mIsLink;
PRUint32 mContentID;
nsCOMPtr<nsIXBLBinding> mBinding;
};
#endif // nsXMLElement_h___

View File

@ -1 +1,2 @@
xul.css
xulBindings.xml

View File

@ -107,7 +107,9 @@ EXPORT_RESOURCE_CONTENT = \
$(srcdir)/wizardOverlay.css \
$(NULL)
EXPORT_CHROME = $(srcdir)/xul.css
EXPORT_CHROME = $(srcdir)/xul.css \
$(srcdir)/xulBindings.xml \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -29,6 +29,7 @@ DISTXUL=$(DIST)\bin\chrome
install::
$(MAKE_INSTALL) tasksOverlay.css $(DISTBROWSER)
$(MAKE_INSTALL) xul.css $(DISTXUL)
$(MAKE_INSTALL) xulBindings.xml $(DISTXUL)
$(MAKE_INSTALL) global.css $(DISTBROWSER)
$(MAKE_INSTALL) lessCols.gif $(DISTBROWSER)
$(MAKE_INSTALL) lessCols_mo.gif $(DISTBROWSER)

View File

@ -233,6 +233,10 @@ tabcontrol {
/********* XP Scrollbar *********/
scrollbar {
behavior: url("resource:/chrome/xulBindings.xml#scrollbar");
}
thumb {
display: block;
user-focus: ignore;