diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index db7230650cfd..f72cf347800f 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -4213,16 +4213,7 @@ nsXULElement::RemoveFocus(nsIPresContext* aPresContext) NS_IMETHODIMP nsXULElement::GetBindingParent(nsIContent** aContent) { - nsCOMPtr tag; - GetTag(*getter_AddRefs(tag)); - if (tag.get() == nsXULAtoms::scrollbar) { - if (!mParent) { - *aContent = (nsIStyledContent*)this; - } - } - else - *aContent = mBindingParent; - + *aContent = mBindingParent; NS_IF_ADDREF(*aContent); return NS_OK; } diff --git a/content/xul/document/public/nsIControllers.idl b/content/xul/document/public/nsIControllers.idl index 9e46f47af930..0d748dd8b535 100644 --- a/content/xul/document/public/nsIControllers.idl +++ b/content/xul/document/public/nsIControllers.idl @@ -20,12 +20,12 @@ * Contributor(s): */ -#include "nsISupports.idl" +#include "nsISecurityCheckedComponent.idl" #include "nsIController.idl" interface nsIDOMXULCommandDispatcher; [scriptable, uuid(A5ED3A01-7CC7-11d3-BF87-00105A1B0627)] -interface nsIControllers : nsISupports { +interface nsIControllers : nsISecurityCheckedComponent { attribute nsIDOMXULCommandDispatcher commandDispatcher; nsIController getControllerForCommand(in wstring command); diff --git a/content/xul/document/src/nsXULControllers.cpp b/content/xul/document/src/nsXULControllers.cpp index fc0274fe646e..dd7532aa725f 100644 --- a/content/xul/document/src/nsXULControllers.cpp +++ b/content/xul/document/src/nsXULControllers.cpp @@ -66,7 +66,7 @@ NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult) return rv; } -NS_IMPL_ISUPPORTS(nsXULControllers, NS_GET_IID(nsIControllers)); +NS_IMPL_ISUPPORTS2(nsXULControllers, nsIControllers, nsISecurityCheckedComponent); NS_IMETHODIMP @@ -195,3 +195,35 @@ nsXULControllers::GetControllerCount(PRUint32 *_retval) return NS_OK; } + +/* string canCreateWrapper (in nsIIDPtr iid); */ +NS_IMETHODIMP nsXULControllers::CanCreateWrapper(const nsIID * iid, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */ +NS_IMETHODIMP nsXULControllers::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsXULControllers::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsXULControllers::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} diff --git a/content/xul/document/src/nsXULControllers.h b/content/xul/document/src/nsXULControllers.h index 070f847fd0a5..3e57a699f932 100644 --- a/content/xul/document/src/nsXULControllers.h +++ b/content/xul/document/src/nsXULControllers.h @@ -47,6 +47,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICONTROLLERS + NS_DECL_NSISECURITYCHECKEDCOMPONENT protected: nsXULControllers(); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index b0b05597d8a1..5622744d597a 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -7925,13 +7925,144 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext, return rv; } +static nsIFrame* +FindPreviousAnonymousSibling(nsIPresShell* aPresShell, + nsIContent* aContainer, + nsIContent* aChild) +{ + nsIFrame* prevSibling = nsnull; + + nsCOMPtr nodeList; + + nsCOMPtr doc; + aContainer->GetDocument(*getter_AddRefs(doc)); + nsCOMPtr xblDoc(do_QueryInterface(doc)); + nsCOMPtr elt(do_QueryInterface(aContainer)); + xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList)); + if (nodeList) { + PRUint32 ctr,listLength; + nsCOMPtr node; + nodeList->GetLength(&listLength); + if (listLength == 0) + return nsnull; + PRBool found = PR_FALSE; + for (ctr = listLength; ctr > 0; ctr--) { + nodeList->Item(ctr-1, getter_AddRefs(node)); + nsCOMPtr childContent(do_QueryInterface(node)); + if (childContent.get() == aChild) { + found = PR_TRUE; + continue; + } + + if (found) { + aPresShell->GetPrimaryFrameFor(childContent, &prevSibling); + + if (nsnull != prevSibling) { + // The frame may have a next-in-flow. Get the last-in-flow + nsIFrame* nextInFlow; + do { + prevSibling->GetNextInFlow(&nextInFlow); + if (nsnull != nextInFlow) { + prevSibling = nextInFlow; + } + } while (nsnull != nextInFlow); + + // Did we really get the *right* frame? + const nsStyleDisplay* display; + prevSibling->GetStyleData(eStyleStruct_Display, + (const nsStyleStruct*&)display); + const nsStylePosition* position; + prevSibling->GetStyleData(eStyleStruct_Position, + (const nsStyleStruct*&)position); + if (display->IsFloating() || position->IsPositioned()) { + // Nope. Get the place-holder instead + nsIFrame* placeholderFrame; + aPresShell->GetPlaceholderFrameFor(prevSibling, &placeholderFrame); + NS_ASSERTION(nsnull != placeholderFrame, "yikes"); + prevSibling = placeholderFrame; + } + + break; + } + } + } + } + + return prevSibling; +} + +static nsIFrame* +FindNextAnonymousSibling(nsIPresShell* aPresShell, + nsIContent* aContainer, + nsIContent* aChild) +{ + nsIFrame* nextSibling = nsnull; + + nsCOMPtr nodeList; + + nsCOMPtr doc; + aContainer->GetDocument(*getter_AddRefs(doc)); + nsCOMPtr xblDoc(do_QueryInterface(doc)); + nsCOMPtr elt(do_QueryInterface(aContainer)); + xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList)); + if (nodeList) { + PRUint32 ctr,listLength; + nsCOMPtr node; + nodeList->GetLength(&listLength); + PRBool found = PR_FALSE; + for (ctr = 0; ctr < listLength; ctr++) { + nodeList->Item(ctr, getter_AddRefs(node)); + nsCOMPtr childContent(do_QueryInterface(node)); + if (childContent.get() == aChild) { + found = PR_TRUE; + continue; + } + + if (found) { + aPresShell->GetPrimaryFrameFor(childContent, &nextSibling); + + if (nsnull != nextSibling) { + // The frame may have a next-in-flow. Get the first-in-flow + nsIFrame* prevInFlow; + do { + nextSibling->GetPrevInFlow(&prevInFlow); + if (nsnull != prevInFlow) { + nextSibling = prevInFlow; + } + } while (nsnull != prevInFlow); + + // Did we really get the *right* frame? + const nsStyleDisplay* display; + nextSibling->GetStyleData(eStyleStruct_Display, + (const nsStyleStruct*&)display); + const nsStylePosition* position; + nextSibling->GetStyleData(eStyleStruct_Position, + (const nsStyleStruct*&)position); + if (display->IsFloating() || position->IsPositioned()) { + // Nope. Get the place-holder instead + nsIFrame* placeholderFrame; + aPresShell->GetPlaceholderFrameFor(nextSibling, &placeholderFrame); + NS_ASSERTION(nsnull != placeholderFrame, "yikes"); + nextSibling = placeholderFrame; + } + + break; + } + } + } + } + + return nextSibling; +} + static nsIFrame* FindPreviousSibling(nsIPresShell* aPresShell, nsIContent* aContainer, PRInt32 aIndexInContainer) { nsIFrame* prevSibling = nsnull; - + + // Walk the // Note: not all content objects are associated with a frame (e.g., if their // 'display' type is 'hidden') so keep looking until we find a previous frame for (PRInt32 i = aIndexInContainer - 1; i >= 0; i--) { @@ -8475,35 +8606,18 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, } else { // Find the frame that precedes the insertion point. - nsIFrame* prevSibling = FindPreviousSibling(shell, aContainer, aIndexInContainer); - - /* - if (prevSibling) { - nsIFrame* parent; - prevSibling->GetParent(&parent); - nsIFrame* first; - parent->FirstChild(aPresContext, nsnull, &first); - PRBool found = PR_FALSE; - while(first) - { - if (first == prevSibling) { - found = PR_TRUE; - break; - } - - first->GetNextSibling(&first); - } - - NS_ASSERTION(found,"Error sibling not in parent!!!!!"); - } - */ + nsIFrame* prevSibling = (aIndexInContainer == -1) ? + FindPreviousAnonymousSibling(shell, aContainer, aChild) : + FindPreviousSibling(shell, aContainer, aIndexInContainer); nsIFrame* nextSibling = nsnull; PRBool isAppend = PR_FALSE; // If there is no previous sibling, then find the frame that follows if (nsnull == prevSibling) { - nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer); + nextSibling = (aIndexInContainer == -1) ? + FindNextAnonymousSibling(shell, aContainer, aChild) : + FindNextSibling(shell, aContainer, aIndexInContainer); } // Get the geometric parent. Use the prev sibling if we have it; diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index b0b05597d8a1..5622744d597a 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -7925,13 +7925,144 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext, return rv; } +static nsIFrame* +FindPreviousAnonymousSibling(nsIPresShell* aPresShell, + nsIContent* aContainer, + nsIContent* aChild) +{ + nsIFrame* prevSibling = nsnull; + + nsCOMPtr nodeList; + + nsCOMPtr doc; + aContainer->GetDocument(*getter_AddRefs(doc)); + nsCOMPtr xblDoc(do_QueryInterface(doc)); + nsCOMPtr elt(do_QueryInterface(aContainer)); + xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList)); + if (nodeList) { + PRUint32 ctr,listLength; + nsCOMPtr node; + nodeList->GetLength(&listLength); + if (listLength == 0) + return nsnull; + PRBool found = PR_FALSE; + for (ctr = listLength; ctr > 0; ctr--) { + nodeList->Item(ctr-1, getter_AddRefs(node)); + nsCOMPtr childContent(do_QueryInterface(node)); + if (childContent.get() == aChild) { + found = PR_TRUE; + continue; + } + + if (found) { + aPresShell->GetPrimaryFrameFor(childContent, &prevSibling); + + if (nsnull != prevSibling) { + // The frame may have a next-in-flow. Get the last-in-flow + nsIFrame* nextInFlow; + do { + prevSibling->GetNextInFlow(&nextInFlow); + if (nsnull != nextInFlow) { + prevSibling = nextInFlow; + } + } while (nsnull != nextInFlow); + + // Did we really get the *right* frame? + const nsStyleDisplay* display; + prevSibling->GetStyleData(eStyleStruct_Display, + (const nsStyleStruct*&)display); + const nsStylePosition* position; + prevSibling->GetStyleData(eStyleStruct_Position, + (const nsStyleStruct*&)position); + if (display->IsFloating() || position->IsPositioned()) { + // Nope. Get the place-holder instead + nsIFrame* placeholderFrame; + aPresShell->GetPlaceholderFrameFor(prevSibling, &placeholderFrame); + NS_ASSERTION(nsnull != placeholderFrame, "yikes"); + prevSibling = placeholderFrame; + } + + break; + } + } + } + } + + return prevSibling; +} + +static nsIFrame* +FindNextAnonymousSibling(nsIPresShell* aPresShell, + nsIContent* aContainer, + nsIContent* aChild) +{ + nsIFrame* nextSibling = nsnull; + + nsCOMPtr nodeList; + + nsCOMPtr doc; + aContainer->GetDocument(*getter_AddRefs(doc)); + nsCOMPtr xblDoc(do_QueryInterface(doc)); + nsCOMPtr elt(do_QueryInterface(aContainer)); + xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList)); + if (nodeList) { + PRUint32 ctr,listLength; + nsCOMPtr node; + nodeList->GetLength(&listLength); + PRBool found = PR_FALSE; + for (ctr = 0; ctr < listLength; ctr++) { + nodeList->Item(ctr, getter_AddRefs(node)); + nsCOMPtr childContent(do_QueryInterface(node)); + if (childContent.get() == aChild) { + found = PR_TRUE; + continue; + } + + if (found) { + aPresShell->GetPrimaryFrameFor(childContent, &nextSibling); + + if (nsnull != nextSibling) { + // The frame may have a next-in-flow. Get the first-in-flow + nsIFrame* prevInFlow; + do { + nextSibling->GetPrevInFlow(&prevInFlow); + if (nsnull != prevInFlow) { + nextSibling = prevInFlow; + } + } while (nsnull != prevInFlow); + + // Did we really get the *right* frame? + const nsStyleDisplay* display; + nextSibling->GetStyleData(eStyleStruct_Display, + (const nsStyleStruct*&)display); + const nsStylePosition* position; + nextSibling->GetStyleData(eStyleStruct_Position, + (const nsStyleStruct*&)position); + if (display->IsFloating() || position->IsPositioned()) { + // Nope. Get the place-holder instead + nsIFrame* placeholderFrame; + aPresShell->GetPlaceholderFrameFor(nextSibling, &placeholderFrame); + NS_ASSERTION(nsnull != placeholderFrame, "yikes"); + nextSibling = placeholderFrame; + } + + break; + } + } + } + } + + return nextSibling; +} + static nsIFrame* FindPreviousSibling(nsIPresShell* aPresShell, nsIContent* aContainer, PRInt32 aIndexInContainer) { nsIFrame* prevSibling = nsnull; - + + // Walk the // Note: not all content objects are associated with a frame (e.g., if their // 'display' type is 'hidden') so keep looking until we find a previous frame for (PRInt32 i = aIndexInContainer - 1; i >= 0; i--) { @@ -8475,35 +8606,18 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, } else { // Find the frame that precedes the insertion point. - nsIFrame* prevSibling = FindPreviousSibling(shell, aContainer, aIndexInContainer); - - /* - if (prevSibling) { - nsIFrame* parent; - prevSibling->GetParent(&parent); - nsIFrame* first; - parent->FirstChild(aPresContext, nsnull, &first); - PRBool found = PR_FALSE; - while(first) - { - if (first == prevSibling) { - found = PR_TRUE; - break; - } - - first->GetNextSibling(&first); - } - - NS_ASSERTION(found,"Error sibling not in parent!!!!!"); - } - */ + nsIFrame* prevSibling = (aIndexInContainer == -1) ? + FindPreviousAnonymousSibling(shell, aContainer, aChild) : + FindPreviousSibling(shell, aContainer, aIndexInContainer); nsIFrame* nextSibling = nsnull; PRBool isAppend = PR_FALSE; // If there is no previous sibling, then find the frame that follows if (nsnull == prevSibling) { - nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer); + nextSibling = (aIndexInContainer == -1) ? + FindNextAnonymousSibling(shell, aContainer, aChild) : + FindNextSibling(shell, aContainer, aIndexInContainer); } // Get the geometric parent. Use the prev sibling if we have it; diff --git a/layout/xul/base/public/nsPIBoxObject.h b/layout/xul/base/public/nsPIBoxObject.h index e16ed27e624f..d9df26b9e928 100644 --- a/layout/xul/base/public/nsPIBoxObject.h +++ b/layout/xul/base/public/nsPIBoxObject.h @@ -31,13 +31,27 @@ class nsIPresShell; class nsIContent; class nsIDocument; -class nsPIBoxObject : public nsISupports { +#include "nsISecurityCheckedComponent.h" + +class nsPIBoxObject : public nsISecurityCheckedComponent { public: static const nsIID& GetIID() { static nsIID iid = NS_PIBOXOBJECT_IID; return iid; } NS_IMETHOD Init(nsIContent* aContent, nsIPresShell* aShell) = 0; NS_IMETHOD SetDocument(nsIDocument* aDocument) = 0; + + /* string canCreateWrapper (in nsIIDPtr iid); */ + NS_IMETHOD CanCreateWrapper(const nsIID * iid, char **_retval) = 0; + + /* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */ + NS_IMETHOD CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval) = 0; + + /* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */ + NS_IMETHOD CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) = 0; + + /* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */ + NS_IMETHOD CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) = 0; }; #endif diff --git a/layout/xul/base/src/nsBoxObject.cpp b/layout/xul/base/src/nsBoxObject.cpp index fc2ee4d3df9e..a058470d2b88 100644 --- a/layout/xul/base/src/nsBoxObject.cpp +++ b/layout/xul/base/src/nsBoxObject.cpp @@ -41,7 +41,7 @@ // Static member variable initialization // Implement our nsISupports methods -NS_IMPL_ISUPPORTS2(nsBoxObject, nsIBoxObject, nsPIBoxObject) +NS_IMPL_ISUPPORTS3(nsBoxObject, nsIBoxObject, nsPIBoxObject, nsISecurityCheckedComponent) // Constructors/Destructors nsBoxObject::nsBoxObject(void) @@ -263,6 +263,37 @@ nsBoxObject::GetHeight(PRInt32* aResult) return NS_OK; } +/* string canCreateWrapper (in nsIIDPtr iid); */ +NS_IMETHODIMP nsBoxObject::CanCreateWrapper(const nsIID * iid, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */ +NS_IMETHODIMP nsBoxObject::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsBoxObject::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsBoxObject::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} // Creation Routine /////////////////////////////////////////////////////////////////////// nsresult diff --git a/layout/xul/base/src/nsBoxObject.h b/layout/xul/base/src/nsBoxObject.h index 3a6e964e5ed3..2fffc9e82213 100644 --- a/layout/xul/base/src/nsBoxObject.h +++ b/layout/xul/base/src/nsBoxObject.h @@ -34,6 +34,7 @@ class nsBoxObject : public nsIBoxObject, public nsPIBoxObject { NS_DECL_ISUPPORTS NS_DECL_NSIBOXOBJECT + NS_DECL_NSISECURITYCHECKEDCOMPONENT public: nsBoxObject(); diff --git a/layout/xul/base/src/nsScrollBoxFrame.cpp b/layout/xul/base/src/nsScrollBoxFrame.cpp index a0a81016d6be..f3d1f91a8b5e 100644 --- a/layout/xul/base/src/nsScrollBoxFrame.cpp +++ b/layout/xul/base/src/nsScrollBoxFrame.cpp @@ -43,6 +43,7 @@ #include "nsIBox.h" #include "nsBoxLayoutState.h" #include "nsIBoxToBlockAdaptor.h" +#include "nsIScrollbarMediator.h" #include "nsISupportsPrimitives.h" #include "nsIPresState.h" #include "nsButtonBoxFrame.h" @@ -634,6 +635,14 @@ NS_IMETHODIMP nsScrollBoxFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** aState) { + nsCOMPtr mediator; + nsIFrame* first = mFrames.FirstChild(); + mediator = do_QueryInterface(first); + if (mediator) { + // Child manages its own scrolling. Bail. + return NS_OK; + } + nsresult res = NS_OK; PRInt32 x,y; nsIScrollableView* scrollingView; diff --git a/rdf/base/idl/nsIControllers.idl b/rdf/base/idl/nsIControllers.idl index 9e46f47af930..0d748dd8b535 100644 --- a/rdf/base/idl/nsIControllers.idl +++ b/rdf/base/idl/nsIControllers.idl @@ -20,12 +20,12 @@ * Contributor(s): */ -#include "nsISupports.idl" +#include "nsISecurityCheckedComponent.idl" #include "nsIController.idl" interface nsIDOMXULCommandDispatcher; [scriptable, uuid(A5ED3A01-7CC7-11d3-BF87-00105A1B0627)] -interface nsIControllers : nsISupports { +interface nsIControllers : nsISecurityCheckedComponent { attribute nsIDOMXULCommandDispatcher commandDispatcher; nsIController getControllerForCommand(in wstring command); diff --git a/rdf/content/src/nsXULControllers.cpp b/rdf/content/src/nsXULControllers.cpp index fc0274fe646e..dd7532aa725f 100644 --- a/rdf/content/src/nsXULControllers.cpp +++ b/rdf/content/src/nsXULControllers.cpp @@ -66,7 +66,7 @@ NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult) return rv; } -NS_IMPL_ISUPPORTS(nsXULControllers, NS_GET_IID(nsIControllers)); +NS_IMPL_ISUPPORTS2(nsXULControllers, nsIControllers, nsISecurityCheckedComponent); NS_IMETHODIMP @@ -195,3 +195,35 @@ nsXULControllers::GetControllerCount(PRUint32 *_retval) return NS_OK; } + +/* string canCreateWrapper (in nsIIDPtr iid); */ +NS_IMETHODIMP nsXULControllers::CanCreateWrapper(const nsIID * iid, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */ +NS_IMETHODIMP nsXULControllers::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsXULControllers::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} + +/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */ +NS_IMETHODIMP nsXULControllers::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval) +{ + nsCAutoString str("AllAccess"); + *_retval = str.ToNewCString(); + return NS_OK; +} diff --git a/rdf/content/src/nsXULControllers.h b/rdf/content/src/nsXULControllers.h index 070f847fd0a5..3e57a699f932 100644 --- a/rdf/content/src/nsXULControllers.h +++ b/rdf/content/src/nsXULControllers.h @@ -47,6 +47,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICONTROLLERS + NS_DECL_NSISECURITYCHECKEDCOMPONENT protected: nsXULControllers(); diff --git a/rdf/content/src/nsXULElement.cpp b/rdf/content/src/nsXULElement.cpp index db7230650cfd..f72cf347800f 100644 --- a/rdf/content/src/nsXULElement.cpp +++ b/rdf/content/src/nsXULElement.cpp @@ -4213,16 +4213,7 @@ nsXULElement::RemoveFocus(nsIPresContext* aPresContext) NS_IMETHODIMP nsXULElement::GetBindingParent(nsIContent** aContent) { - nsCOMPtr tag; - GetTag(*getter_AddRefs(tag)); - if (tag.get() == nsXULAtoms::scrollbar) { - if (!mParent) { - *aContent = (nsIStyledContent*)this; - } - } - else - *aContent = mBindingParent; - + *aContent = mBindingParent; NS_IF_ADDREF(*aContent); return NS_OK; }