/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
bool HTMLAnchorElement::Draggable() const { // links can be dragged as long as there is an href and the // draggable attribute isn't false if (!HasAttr(nsGkAtoms::href)) { // no href, so just use the same behavior as other elements return nsGenericHTMLElement::Draggable();
}
void HTMLAnchorElement::UnbindFromTree(UnbindContext& aContext) { // Cancel any DNS prefetches // Note: Must come before ResetLinkState. If called after, it will recreate // mCachedURI based on data that is invalid - due to a call to Link::GetURI() // via GetURIForDNSPrefetch().
CancelDNSPrefetch(*this);
nsGenericHTMLElement::UnbindFromTree(aContext);
// Without removing the link state we risk a dangling pointer in the // mStyledLinks hashtable
Link::UnbindFromTree();
}
// cannot focus links if there is no link handler if (!OwnerDoc()->LinkHandlingEnabled()) {
*aTabIndex = -1;
*aIsFocusable = false; returnfalse;
}
// Links that are in an editable region should never be focusable, even if // they are in a contenteditable="false" region. if (nsContentUtils::IsNodeInEditableRegion(this)) {
*aTabIndex = -1;
*aIsFocusable = false; returntrue;
}
if (GetTabIndexAttrValue().isNothing()) { // check whether we're actually a link if (!IsLink()) { // Not tabbable or focusable without href (bug 17605), unless // forced to be via presence of nonnegative tabindex attribute
*aTabIndex = -1;
*aIsFocusable = false; returnfalse;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.