- rename hasAnchor method to isLink
* khtml/css/cssstyleselector.cpp:
(khtml::checkPseudoState):
(khtml::CSSStyleSelector::canShareStyleWithElement):
(khtml::CSSStyleSelector::styleForElement):
(khtml::CSSStyleSelector::checkOneSelector):
* khtml/editing/htmlediting.cpp:
(khtml::isSpecialElement):
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::parseHTMLAttribute):
* khtml/html/html_inlineimpl.cpp:
(DOM::HTMLAnchorElementImpl::isFocusable):
(DOM::HTMLAnchorElementImpl::defaultEventHandler):
(DOM::HTMLAnchorElementImpl::parseHTMLAttribute):
* khtml/rendering/render_flexbox.cpp:
(khtml::RenderFlexibleBox::layoutVerticalBox):
* khtml/rendering/render_layer.cpp:
(RenderLayer::hitTest):
* khtml/rendering/render_object.cpp:
(RenderObject::information):
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::NodeImpl):
* khtml/xml/dom_nodeimpl.h:
(DOM::NodeImpl::isLink):
* kwq/KWQAccObject.mm:
(-[KWQAccObject anchorElement]):
(-[KWQAccObject addChildrenToArray:]):
(-[KWQAccObject role]):
(-[KWQAccObject title]):
(-[KWQAccObject accessibilityIsIgnored]):
(-[KWQAccObject accessibilityAttributeNames]):
(-[KWQAccObject accessibilityAttributeValue:]):
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMouseMoveEvent):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9155
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-05-10 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by John.
+
+ - rename hasAnchor method to isLink
+
+ * khtml/css/cssstyleselector.cpp:
+ (khtml::checkPseudoState):
+ (khtml::CSSStyleSelector::canShareStyleWithElement):
+ (khtml::CSSStyleSelector::styleForElement):
+ (khtml::CSSStyleSelector::checkOneSelector):
+ * khtml/editing/htmlediting.cpp:
+ (khtml::isSpecialElement):
+ * khtml/html/html_imageimpl.cpp:
+ (HTMLImageElementImpl::parseHTMLAttribute):
+ * khtml/html/html_inlineimpl.cpp:
+ (DOM::HTMLAnchorElementImpl::isFocusable):
+ (DOM::HTMLAnchorElementImpl::defaultEventHandler):
+ (DOM::HTMLAnchorElementImpl::parseHTMLAttribute):
+ * khtml/rendering/render_flexbox.cpp:
+ (khtml::RenderFlexibleBox::layoutVerticalBox):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::hitTest):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::information):
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeImpl::NodeImpl):
+ * khtml/xml/dom_nodeimpl.h:
+ (DOM::NodeImpl::isLink):
+ * kwq/KWQAccObject.mm:
+ (-[KWQAccObject anchorElement]):
+ (-[KWQAccObject addChildrenToArray:]):
+ (-[KWQAccObject role]):
+ (-[KWQAccObject title]):
+ (-[KWQAccObject accessibilityIsIgnored]):
+ (-[KWQAccObject accessibilityAttributeNames]):
+ (-[KWQAccObject accessibilityAttributeValue:]):
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::khtmlMouseMoveEvent):
+
2005-05-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
static void checkPseudoState( DOM::ElementImpl *e, bool checkVisited = true )
{
- if (!e->hasAnchor()) {
+ if (!e->isLink()) {
pseudoState = PseudoNone;
return;
}
if (s->renderer() && (s->id() == element->id()) && !s->hasID() &&
(s->hasClass() == element->hasClass()) && !s->inlineStyleDecl() &&
(s->hasMappedAttributes() == htmlElement->hasMappedAttributes()) &&
- (s->hasAnchor() == element->hasAnchor()) &&
+ (s->isLink() == element->isLink()) &&
!s->renderer()->style()->affectedByAttributeSelectors() &&
(s->renderer()->mouseInside() == mouseInside) &&
(s->active() == element->active()) &&
if (s->hasMappedAttributes())
mappedAttrsMatch = s->htmlAttributes()->mapsEquivalent(htmlElement->htmlAttributes());
if (mappedAttrsMatch) {
- bool anchorsMatch = true;
- if (s->hasAnchor()) {
+ bool linksMatch = true;
+ if (s->isLink()) {
// We need to check to see if the visited state matches.
QColor linkColor = element->getDocument()->linkColor();
QColor visitedColor = element->getDocument()->visitedLinkColor();
if (pseudoState == PseudoUnknown)
checkPseudoState(element, s->renderer()->style()->pseudoState() != PseudoAnyLink ||
linkColor != visitedColor);
- anchorsMatch = (pseudoState == s->renderer()->style()->pseudoState());
+ linksMatch = (pseudoState == s->renderer()->style()->pseudoState());
}
- if (anchorsMatch)
+ if (linksMatch)
return true;
}
}
adjustRenderStyle(style, e);
// If we are a link, cache the determined pseudo-state.
- if (e->hasAnchor())
+ if (e->isLink())
style->setPseudoState(pseudoState);
// Now return the style.
case CSSSelector::PseudoHover: {
// If we're in quirks mode, then hover should never match anchors with no
// href. This is important for sites like wsj.com.
- if (strictParsing || e->id() != ID_A || e->hasAnchor()) {
+ if (strictParsing || e->id() != ID_A || e->isLink()) {
if (element == e && style)
style->setAffectedByHoverRules(true);
if (e->renderer()) {
case CSSSelector::PseudoActive:
// If we're in quirks mode, then :active should never match anchors with no
// href.
- if (strictParsing || e->id() != ID_A || e->hasAnchor()) {
+ if (strictParsing || e->id() != ID_A || e->isLink()) {
if (element == e && style)
style->setAffectedByActiveRules(true);
else if (e->renderer())
if (!n->isHTMLElement())
return false;
- if (n->id() == ID_A && n->hasAnchor())
+ if (n->id() == ID_A && n->isLink())
return true;
if (n->id() == ID_UL || n->id() == ID_OL || n->id() == ID_DL)
// the map is on the same html page....
usemap = url;
}
- m_hasAnchor = !attr->isNull();
+ m_isLink = !attr->isNull();
case ATTR_ISMAP:
ismap = true;
break;
// FIXME: Even if we are not visible, we might have a child that is visible.
// Dave wants to fix that some day with a "has visible content" flag or the like.
- if (!(m_hasAnchor && m_render && m_render->style()->visibility() == VISIBLE))
+ if (!(m_isLink && m_render && m_render->style()->visibility() == VISIBLE))
return false;
// Before calling absoluteRects, check for the common case where the renderer
// Don't make this KEYUP_EVENT again, it makes khtml follow links it shouldn't,
// when pressing Enter in the combo.
if ( ( evt->id() == EventImpl::KHTML_CLICK_EVENT ||
- ( evt->id() == EventImpl::KEYDOWN_EVENT && m_focused)) && m_hasAnchor) {
+ ( evt->id() == EventImpl::KEYDOWN_EVENT && m_focused)) && m_isLink) {
MouseEventImpl *e = 0;
if ( evt->id() == EventImpl::KHTML_CLICK_EVENT )
e = static_cast<MouseEventImpl*>( evt );
switch(attr->id())
{
case ATTR_HREF:
- m_hasAnchor = !attr->isNull();
+ m_isLink = !attr->isNull();
break;
case ATTR_TARGET:
m_hasTarget = !attr->isNull();
InlineBox* anchorBox = lastLine->lastChild();
if (!anchorBox) continue;
if (!anchorBox->object()->element()) continue;
- if (!anchorBox->object()->element()->hasAnchor()) continue;
+ if (!anchorBox->object()->element()->isLink()) continue;
RootInlineBox* lastVisibleLine = blockChild->lineAtIndex(numVisibleLines-1);
if (!lastVisibleLine) continue;
// it already set URLElement and only use the innermost.
DOM::NodeImpl* node = info.innerNode();
while (node) {
- if (node->hasAnchor() && !info.URLElement())
+ if (node->isLink() && !info.URLElement())
info.setURLElement(node);
node = node->parentNode();
}
if (mouseInside()) ts << "mi ";
if (style() && style()->zIndex()) ts << "zI: " << style()->zIndex();
if (element() && element()->active()) ts << "act ";
- if (element() && element()->hasAnchor()) ts << "anchor ";
+ if (element() && element()->isLink()) ts << "anchor ";
if (element() && element()->focused()) ts << "focus ";
if (element()) ts << " <" << getTagName(element()->id()).string() << ">";
ts << " (" << xPos() << "," << yPos() << "," << width() << "," << height() << ")"
m_changed( false ),
m_hasChangedChild( false ),
m_inDocument( false ),
- m_hasAnchor( false ),
+ m_isLink( false ),
m_specified( false ),
m_focused( false ),
m_active( false ),
bool attached() const { return m_attached; }
bool changed() const { return m_changed; }
bool hasChangedChild() const { return m_hasChangedChild; }
- bool hasAnchor() const { return m_hasAnchor; }
+ bool isLink() const { return m_isLink; }
bool inDocument() const { return m_inDocument; }
bool styleElement() const { return m_styleElement; }
bool implicitNode() const { return m_implicit; }
bool m_hasChangedChild : 1;
bool m_inDocument : 1;
- bool m_hasAnchor : 1;
+ bool m_isLink : 1;
bool m_specified : 1; // used in AttrImpl. Accessor functions there
bool m_focused : 1;
bool m_active : 1;
// NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElementImpl
NodeImpl* elt = currRenderer->element();
for ( ; elt; elt = elt->parentNode()) {
- if (elt->hasAnchor() && elt->renderer() && !elt->renderer()->isImage())
+ if (elt->isLink() && elt->renderer() && !elt->renderer()->isImage())
return static_cast<HTMLAnchorElementImpl*>(elt);
}
// add an <area> element for this child if it has a link
// NOTE: can't cache these because they all have the same renderer, which is the cache key, right?
// plus there may be little reason to since they are being added to the handy array
- if (current->hasAnchor()) {
+ if (current->isLink()) {
KWQAccObject* obj = [[[KWQAccObject alloc] initWithRenderer: m_renderer] autorelease];
obj->m_areaElement = static_cast<HTMLAreaElementImpl*>(current);
[array addObject: obj];
if (m_areaElement)
return @"AXLink";
- if (m_renderer->element() && m_renderer->element()->hasAnchor()) {
+ if (m_renderer->element() && m_renderer->element()->isLink()) {
if (m_renderer->isImage())
return @"AXImageMap";
return @"AXLink";
if (m_renderer->element()->isHTMLElement() && Node(m_renderer->element()).elementId() == ID_BUTTON)
return [self textUnderElement];
- if (m_renderer->element()->hasAnchor())
+ if (m_renderer->element()->isLink())
return [self textUnderElement];
if ([self isAttachment])
return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityTitleAttribute];
if ([self isAttachment])
return [[self attachmentView] accessibilityIsIgnored];
- if (m_areaElement || (m_renderer->element() && m_renderer->element()->hasAnchor()))
+ if (m_areaElement || (m_renderer->element() && m_renderer->element()->isLink()))
return NO;
if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
if (m_renderer && m_renderer->isCanvas())
return webAreaAttrs;
- if (m_areaElement || (m_renderer && !m_renderer->isImage() && m_renderer->element() && m_renderer->element()->hasAnchor()))
+ if (m_areaElement || (m_renderer && !m_renderer->isImage() && m_renderer->element() && m_renderer->element()->isLink()))
return anchorAttrs;
return attributes;
}
}
if ([attributeName isEqualToString: @"AXURL"] &&
- (m_areaElement || (!m_renderer->isImage() && m_renderer->element() && m_renderer->element()->hasAnchor()))) {
+ (m_areaElement || (!m_renderer->isImage() && m_renderer->element() && m_renderer->element()->isLink()))) {
HTMLAnchorElementImpl* anchor = [self anchorElement];
if (anchor) {
QString s = anchor->getAttribute(ATTR_HREF).string();
} else {
// remember some facts about this source, while we have a NodeInfo handy
NodeImpl *node = nodeInfo.URLElement();
- _dragSrcIsLink = node ? node->hasAnchor() : false;
+ _dragSrcIsLink = node ? node->isLink() : false;
node = nodeInfo.innerNonSharedNode();
_dragSrcIsImage = (node && node->renderer() && node->renderer()->isImage());