зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141455 - Do not treat an element with tabindex as an interactive content in label. r=smaug
This commit is contained in:
Родитель
e71864bf6c
Коммит
de4b4e39c8
|
@ -1832,7 +1832,7 @@ Element::IsLabelable() const
|
|||
}
|
||||
|
||||
bool
|
||||
Element::IsInteractiveHTMLContent() const
|
||||
Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ public:
|
|||
/**
|
||||
* Returns if the element is interactive content as per HTML specification.
|
||||
*/
|
||||
virtual bool IsInteractiveHTMLContent() const;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const;
|
||||
|
||||
/**
|
||||
* Is the attribute named stored in the mapped attributes?
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
virtual bool Draggable() const MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ HTMLAudioElement::~HTMLAudioElement()
|
|||
}
|
||||
|
||||
bool
|
||||
HTMLAudioElement::IsInteractiveHTMLContent() const
|
||||
HTMLAudioElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return HasAttr(kNameSpaceID_None, nsGkAtoms::controls);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
explicit HTMLAudioElement(already_AddRefed<NodeInfo>& aNodeInfo);
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMHTMLMediaElement
|
||||
using HTMLMediaElement::GetPaused;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLButtonElement, button)
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ NS_IMPL_STRING_ATTR(HTMLImageElement, UseMap, usemap)
|
|||
NS_IMPL_INT_ATTR(HTMLImageElement, Vspace, vspace)
|
||||
|
||||
bool
|
||||
HTMLImageElement::IsInteractiveHTMLContent() const
|
||||
HTMLImageElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return HasAttr(kNameSpaceID_None, nsGkAtoms::usemap);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
virtual bool Draggable() const MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMHTMLImageElement
|
||||
NS_DECL_NSIDOMHTMLIMAGEELEMENT
|
||||
|
|
|
@ -3222,7 +3222,7 @@ HTMLInputElement::Focus(ErrorResult& aError)
|
|||
}
|
||||
|
||||
bool
|
||||
HTMLInputElement::IsInteractiveHTMLContent() const
|
||||
HTMLInputElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return mType != NS_FORM_INPUT_HIDDEN;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMHTMLInputElement
|
||||
NS_DECL_NSIDOMHTMLINPUTELEMENT
|
||||
|
|
|
@ -88,7 +88,7 @@ InInteractiveHTMLContent(nsIContent* aContent, nsIContent* aStop)
|
|||
nsIContent* content = aContent;
|
||||
while (content && content != aStop) {
|
||||
if (content->IsElement() &&
|
||||
content->AsElement()->IsInteractiveHTMLContent()) {
|
||||
content->AsElement()->IsInteractiveHTMLContent(true)) {
|
||||
return true;
|
||||
}
|
||||
content = content->GetParent();
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ HTMLObjectElement::~HTMLObjectElement()
|
|||
}
|
||||
|
||||
bool
|
||||
HTMLObjectElement::IsInteractiveHTMLContent() const
|
||||
HTMLObjectElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return HasAttr(kNameSpaceID_None, nsGkAtoms::usemap);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
#endif
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_DECL_NSIDOMHTMLOBJECTELEMENT
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ nsresult HTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel)
|
|||
}
|
||||
|
||||
bool
|
||||
HTMLVideoElement::IsInteractiveHTMLContent() const
|
||||
HTMLVideoElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return HasAttr(kNameSpaceID_None, nsGkAtoms::controls);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel) MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
// WebIDL
|
||||
|
||||
|
|
|
@ -1794,11 +1794,11 @@ nsGenericHTMLElement::IsLabelable() const
|
|||
}
|
||||
|
||||
bool
|
||||
nsGenericHTMLElement::IsInteractiveHTMLContent() const
|
||||
nsGenericHTMLElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
{
|
||||
return IsAnyOfHTMLElements(nsGkAtoms::details, nsGkAtoms::embed,
|
||||
nsGkAtoms::keygen) ||
|
||||
HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex);
|
||||
(!aIgnoreTabindex && HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex));
|
||||
}
|
||||
|
||||
already_AddRefed<UndoManager>
|
||||
|
|
|
@ -923,7 +923,7 @@ public:
|
|||
}
|
||||
|
||||
virtual bool IsLabelable() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const MOZ_OVERRIDE;
|
||||
|
||||
static bool TouchEventsEnabled(JSContext* /* unused */, JSObject* /* unused */);
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=229925
|
|||
<select id="yes12"><option>select</option></select>
|
||||
<textarea id="yes13" cols="1" rows="1"></textarea>
|
||||
<video id="yes14" controls></video>
|
||||
<span id="yes15" tabindex="1">tabindex</span>
|
||||
|
||||
<audio id="no1"></audio>
|
||||
<img id="no2" src="data:image/png,">
|
||||
<input id="no3" type="hidden">
|
||||
<object id="no4">object</object>
|
||||
<video id="no5"></video>
|
||||
<span id="no6" tabindex="1">tabindex</span>
|
||||
</label>
|
||||
</form>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -62,7 +62,6 @@ var yes_nodes = [
|
|||
document.getElementById("yes12"),
|
||||
document.getElementById("yes13"),
|
||||
document.getElementById("yes14"),
|
||||
document.getElementById("yes15"),
|
||||
];
|
||||
|
||||
var no_nodes = [
|
||||
|
@ -72,6 +71,7 @@ var no_nodes = [
|
|||
document.getElementById("no3"),
|
||||
document.getElementById("no4"),
|
||||
document.getElementById("no5"),
|
||||
document.getElementById("no6"),
|
||||
];
|
||||
|
||||
var target_clicked = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче