mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 756383 - make nsHTMLAnchorElement::IsHTMLFocusable faster, r=bz
This commit is contained in:
parent
767b20f01f
commit
705d243c9c
@ -104,6 +104,18 @@ public:
|
||||
protected:
|
||||
virtual ~Link();
|
||||
|
||||
/**
|
||||
* Return true if the link has associated URI.
|
||||
*/
|
||||
bool HasURI() const
|
||||
{
|
||||
if (mCachedURI)
|
||||
return true;
|
||||
|
||||
nsCOMPtr<nsIURI> uri(GetURI());
|
||||
return !!uri;
|
||||
}
|
||||
|
||||
bool HasCachedURI() const { return !!mCachedURI; }
|
||||
|
||||
private:
|
||||
|
@ -287,8 +287,7 @@ nsHTMLAnchorElement::IsHTMLFocusable(bool aWithMouse,
|
||||
|
||||
if (!HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex)) {
|
||||
// check whether we're actually a link
|
||||
nsCOMPtr<nsIURI> absURI;
|
||||
if (!IsLink(getter_AddRefs(absURI))) {
|
||||
if (!Link::HasURI()) {
|
||||
// Not tabbable or focusable without href (bug 17605), unless
|
||||
// forced to be via presence of nonnegative tabindex attribute
|
||||
if (aTabIndex) {
|
||||
|
Loading…
Reference in New Issue
Block a user