Make applet and embed elements focusable. Bug 257488, r=aaronl, sr=jst

This commit is contained in:
bzbarsky%mit.edu 2005-01-22 04:48:00 +00:00
parent bf9a5d31f9
commit 6eaa641179
2 changed files with 18 additions and 3 deletions

View File

@ -77,6 +77,11 @@ public:
virtual void DoneAddingChildren();
virtual PRBool IsDoneAddingChildren();
// nsIContent
// Have to override tabindex for <embed> to act right
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult);
@ -143,7 +148,8 @@ NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Name, name)
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Object, object)
NS_IMPL_INT_ATTR(nsHTMLAppletElement, Vspace, vspace)
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Width, width)
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLAppletElement, TabIndex, tabindex, 0)
PRBool
nsHTMLAppletElement::ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,

View File

@ -112,6 +112,11 @@ public:
// nsIDOMHTMLBaseFontElement
NS_DECL_NSIDOMHTMLBASEFONTELEMENT
// nsIContent
// Have to override tabindex for <embed> to act right
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult);
@ -206,6 +211,10 @@ NS_IMPL_STRING_ATTR(nsHTMLSharedElement, Color, color)
NS_IMPL_STRING_ATTR(nsHTMLSharedElement, Face, face)
NS_IMPL_INT_ATTR(nsHTMLSharedElement, Size, size)
// TabIndex for embed
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSharedElement, TabIndex, tabindex,
mNodeInfo->Equals(nsHTMLAtoms::embed) ? 0 : -1)
NS_IMETHODIMP
nsHTMLSharedElement::GetType(nsAString& aType)
{
@ -242,8 +251,6 @@ nsHTMLSharedElement::GetForm(nsIDOMHTMLFormElement** aForm)
NS_IMPL_URI_ATTR(nsHTMLSharedElement, Href, href)
NS_IMPL_STRING_ATTR(nsHTMLSharedElement, Target, target)
// spacer element code
PRBool
nsHTMLSharedElement::ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,
@ -319,6 +326,8 @@ nsHTMLSharedElement::AttributeToString(nsIAtom* aAttribute,
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
// spacer element code
static void
SpacerMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)