<object> should be in form.elements. Bug 127847, r=jkeiser, sr=jst.
git-svn-id: svn://10.0.0.236/trunk@126485 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -107,7 +107,6 @@
|
||||
#include "nsICaret.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
||||
#include "nsIFrameTraversal.h"
|
||||
#include "nsLayoutCID.h"
|
||||
@@ -1113,7 +1112,8 @@ nsEventStateManager :: FireContextClick ( )
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
lastContent->GetTag ( *getter_AddRefs(tag) );
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> inputElm ( do_QueryInterface(lastContent) );
|
||||
nsCOMPtr<nsIFormControl> formControl ( do_QueryInterface(lastContent) );
|
||||
PRBool isFormControl =
|
||||
lastContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL);
|
||||
if ( inputElm ) {
|
||||
// of all input elements, only ones dealing with text are allowed to have context menus
|
||||
if ( tag == nsHTMLAtoms::input ) {
|
||||
@@ -1124,11 +1124,12 @@ nsEventStateManager :: FireContextClick ( )
|
||||
allowedToDispatch = PR_FALSE;
|
||||
}
|
||||
}
|
||||
else if ( formControl ) // catches combo-boxes
|
||||
else if ( isFormControl && tag != nsHTMLAtoms::textarea )
|
||||
// catches combo-boxes, <object>
|
||||
allowedToDispatch = PR_FALSE;
|
||||
else if ( tag == nsXULAtoms::scrollbar || tag == nsXULAtoms::scrollbarbutton || tag == nsXULAtoms::button )
|
||||
allowedToDispatch = PR_FALSE;
|
||||
else if ( tag == nsHTMLAtoms::applet || tag == nsHTMLAtoms::object || tag == nsHTMLAtoms::embed )
|
||||
else if ( tag == nsHTMLAtoms::applet || tag == nsHTMLAtoms::embed )
|
||||
allowedToDispatch = PR_FALSE;
|
||||
else if ( tag == nsXULAtoms::toolbarbutton ) {
|
||||
// a <toolbarbutton> that has the container attribute set will already have its
|
||||
@@ -4373,9 +4374,11 @@ nsresult nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent
|
||||
nsAutoString nodeValue;
|
||||
domNode->GetNodeValue(nodeValue);
|
||||
|
||||
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(startContent));
|
||||
PRBool isFormControl =
|
||||
startContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL);
|
||||
|
||||
if (nodeValue.Length() == *aStartOffset && !formControl && startContent != rootContent) {
|
||||
if (nodeValue.Length() == *aStartOffset && !isFormControl &&
|
||||
startContent != rootContent) {
|
||||
// Yes, indeed we were at the end of the last node
|
||||
nsCOMPtr<nsIBidirectionalEnumerator> frameTraversal;
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ class nsIFormSubmission;
|
||||
#define NS_FORM_LEGEND 18
|
||||
#define NS_FORM_SELECT 19
|
||||
#define NS_FORM_TEXTAREA 20
|
||||
#define NS_FORM_OBJECT 21
|
||||
|
||||
#define NS_FORM_NOTOK 0xFFFFFFF7
|
||||
#define NS_FORM_NOTSET 0xFFFFFFF7
|
||||
|
||||
@@ -45,8 +45,9 @@
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
||||
class nsHTMLObjectElement : public nsGenericHTMLContainerElement,
|
||||
class nsHTMLObjectElement : public nsGenericHTMLContainerFormElement,
|
||||
public nsIDOMHTMLObjectElement
|
||||
{
|
||||
public:
|
||||
@@ -68,6 +69,16 @@ public:
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_DECL_NSIDOMHTMLOBJECTELEMENT
|
||||
|
||||
// Overriden nsIFormControl methods
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm,
|
||||
PRBool aRemoveFromForm = PR_TRUE);
|
||||
NS_IMETHOD GetType(PRInt32* aType);
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD SubmitNamesValues(nsIFormSubmission* aFormSubmission,
|
||||
nsIContent* aSubmitElement);
|
||||
NS_IMETHOD SaveState();
|
||||
NS_IMETHOD RestoreState(nsIPresState* aState);
|
||||
|
||||
NS_IMETHOD StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsHTMLValue& aResult);
|
||||
@@ -115,6 +126,8 @@ nsHTMLObjectElement::nsHTMLObjectElement()
|
||||
|
||||
nsHTMLObjectElement::~nsHTMLObjectElement()
|
||||
{
|
||||
// Null out form's pointer to us - no ref counting here!
|
||||
SetForm(nsnull);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +136,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, nsGenericElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLObjectElement
|
||||
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLObjectElement,
|
||||
nsGenericHTMLContainerElement)
|
||||
nsGenericHTMLContainerFormElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLObjectElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLObjectElement)
|
||||
NS_HTML_CONTENT_INTERFACE_MAP_END
|
||||
@@ -159,10 +172,48 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return nsGenericHTMLContainerFormElement::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SetForm(nsIDOMHTMLFormElement* aForm,
|
||||
PRBool aRemoveFromForm)
|
||||
{
|
||||
return nsGenericHTMLContainerFormElement::SetForm(aForm, aRemoveFromForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetType(PRInt32* aType)
|
||||
{
|
||||
NS_PRECONDITION(aType, "aType must not be null!");
|
||||
*aType = NS_FORM_OBJECT;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::Reset()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SubmitNamesValues(nsIFormSubmission* aFormSubmission,
|
||||
nsIContent* aSubmitElement)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SaveState()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::RestoreState(nsIPresState* aState)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Code, code)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Align, align)
|
||||
|
||||
@@ -45,8 +45,9 @@
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
||||
class nsHTMLObjectElement : public nsGenericHTMLContainerElement,
|
||||
class nsHTMLObjectElement : public nsGenericHTMLContainerFormElement,
|
||||
public nsIDOMHTMLObjectElement
|
||||
{
|
||||
public:
|
||||
@@ -68,6 +69,16 @@ public:
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_DECL_NSIDOMHTMLOBJECTELEMENT
|
||||
|
||||
// Overriden nsIFormControl methods
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm,
|
||||
PRBool aRemoveFromForm = PR_TRUE);
|
||||
NS_IMETHOD GetType(PRInt32* aType);
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD SubmitNamesValues(nsIFormSubmission* aFormSubmission,
|
||||
nsIContent* aSubmitElement);
|
||||
NS_IMETHOD SaveState();
|
||||
NS_IMETHOD RestoreState(nsIPresState* aState);
|
||||
|
||||
NS_IMETHOD StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsHTMLValue& aResult);
|
||||
@@ -115,6 +126,8 @@ nsHTMLObjectElement::nsHTMLObjectElement()
|
||||
|
||||
nsHTMLObjectElement::~nsHTMLObjectElement()
|
||||
{
|
||||
// Null out form's pointer to us - no ref counting here!
|
||||
SetForm(nsnull);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +136,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, nsGenericElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLObjectElement
|
||||
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLObjectElement,
|
||||
nsGenericHTMLContainerElement)
|
||||
nsGenericHTMLContainerFormElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLObjectElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLObjectElement)
|
||||
NS_HTML_CONTENT_INTERFACE_MAP_END
|
||||
@@ -159,10 +172,48 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return nsGenericHTMLContainerFormElement::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SetForm(nsIDOMHTMLFormElement* aForm,
|
||||
PRBool aRemoveFromForm)
|
||||
{
|
||||
return nsGenericHTMLContainerFormElement::SetForm(aForm, aRemoveFromForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetType(PRInt32* aType)
|
||||
{
|
||||
NS_PRECONDITION(aType, "aType must not be null!");
|
||||
*aType = NS_FORM_OBJECT;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::Reset()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SubmitNamesValues(nsIFormSubmission* aFormSubmission,
|
||||
nsIContent* aSubmitElement)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SaveState()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::RestoreState(nsIPresState* aState)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Code, code)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Align, align)
|
||||
|
||||
@@ -1114,6 +1114,9 @@ MakeContentObject(nsHTMLTag aNodeType,
|
||||
break;
|
||||
case eHTMLTag_object:
|
||||
rv = NS_NewHTMLObjectElement(aResult, aNodeInfo);
|
||||
if (!aInsideNoXXXTag) {
|
||||
SetForm(*aResult, aForm);
|
||||
}
|
||||
break;
|
||||
case eHTMLTag_ol:
|
||||
rv = NS_NewHTMLOListElement(aResult, aNodeInfo);
|
||||
|
||||
Reference in New Issue
Block a user