Reviewed by John.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 May 2005 22:25:04 +0000 (22:25 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 May 2005 22:25:04 +0000 (22:25 +0000)
- 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

12 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/html/html_imageimpl.cpp
WebCore/khtml/html/html_inlineimpl.cpp
WebCore/khtml/rendering/render_flexbox.cpp
WebCore/khtml/rendering/render_layer.cpp
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/xml/dom_nodeimpl.cpp
WebCore/khtml/xml/dom_nodeimpl.h
WebCore/kwq/KWQAccObject.mm
WebCore/kwq/KWQKHTMLPart.mm

index b23dd7dd970ce7c4eb9565232d6c2cb52ec5a99d..1471a70b6657ebfd060978839390a6a324261a3e 100644 (file)
@@ -1,3 +1,43 @@
+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.
index b813cba4ee6fb0fab65d6a4d9d09ad539a97d015..f5f3b4a5af45d6c310cf32da0217ad67ad4bf200 100644 (file)
@@ -551,7 +551,7 @@ static void cleanpath(QString &path)
 
 static void checkPseudoState( DOM::ElementImpl *e, bool checkVisited = true )
 {
-    if (!e->hasAnchor()) {
+    if (!e->isLink()) {
         pseudoState = PseudoNone;
         return;
     }
@@ -626,7 +626,7 @@ bool CSSStyleSelector::canShareStyleWithElement(NodeImpl* n)
         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()) &&
@@ -643,18 +643,18 @@ bool CSSStyleSelector::canShareStyleWithElement(NodeImpl* n)
                 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;
                 }
             }
@@ -816,7 +816,7 @@ RenderStyle* CSSStyleSelector::styleForElement(ElementImpl* e, RenderStyle* defa
     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.
@@ -1303,7 +1303,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             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()) {
@@ -1334,7 +1334,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             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())
index 23a23589cb2a50dc02d9ff8f631adc132459ff1b..aa64d0da8b645006e7ed77ca8f175fcaf3796b2b 100644 (file)
@@ -1250,7 +1250,7 @@ static bool isSpecialElement(NodeImpl *n)
     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)
index a9ba7830eaa7049b232ec47cfab3bd1c44b57554..de8ed088f6662b4f05dd646a9f8dda89295d0268 100644 (file)
@@ -220,7 +220,7 @@ void HTMLImageElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
             // the map is on the same html page....
             usemap = url;
         }
-        m_hasAnchor = !attr->isNull();
+        m_isLink = !attr->isNull();
     case ATTR_ISMAP:
         ismap = true;
         break;
index d3a21caeb3cfb999bb2dcc133fcd2154a3bb0cf3..aa61eb663302e67e0d411d41fbec414aaaebd4d2 100644 (file)
@@ -61,7 +61,7 @@ bool HTMLAnchorElementImpl::isFocusable() const
 
     // 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
@@ -115,7 +115,7 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt)
     // 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 );
@@ -219,7 +219,7 @@ void HTMLAnchorElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
     switch(attr->id())
     {
     case ATTR_HREF:
-        m_hasAnchor = !attr->isNull();
+        m_isLink = !attr->isNull();
         break;
     case ATTR_TARGET:
         m_hasTarget = !attr->isNull();
index 138f79dfafef2b419664d0394abd2eb53f5c2893..74d7f211017ff154df603ac8c6ae30d2e0e2ea24 100644 (file)
@@ -747,7 +747,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
                 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;
index f3b7b8f972a28f103f9f16b4e0b7929832f89766..1c26eff75e37005711e670fee83fb652df5db5bf 100644 (file)
@@ -987,7 +987,7 @@ RenderLayer::hitTest(RenderObject::NodeInfo& info, int x, int y)
     // 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();
     }
index a28608f9f40c298bde60d8c70a576c4109ff182e..b4b8d9f11cf0d77bd1629f8ebb25a853927a6ea2 100644 (file)
@@ -1324,7 +1324,7 @@ QString RenderObject::information() const
     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() << ")"
index 45fe8cbf7a5d24756c742e6c06c0ecd669a4f562..6be4100a5b2f6df185c28ff4eb85a58c1b035ee2 100644 (file)
@@ -82,7 +82,7 @@ NodeImpl::NodeImpl(DocumentPtr *doc)
       m_changed( false ),
       m_hasChangedChild( false ),
       m_inDocument( false ),
-      m_hasAnchor( false ),
+      m_isLink( false ),
       m_specified( false ),
       m_focused( false ),
       m_active( false ),
index 37b0372476197e654f257d36e8bedce798a3c537..f99ceba25fd552ba16f57acfe6ebc9167d35377d 100644 (file)
@@ -253,7 +253,7 @@ public:
     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; }
@@ -500,7 +500,7 @@ protected:
     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;
index 34065fe37a6d22a25d6316daa6535c3c435e8fc4..5f0d13b4a830f27ff924da1dd46d74e3cd79f39a 100644 (file)
@@ -179,7 +179,7 @@ extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
     // 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);
     }
   
@@ -317,7 +317,7 @@ extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
                 // 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];
@@ -367,7 +367,7 @@ extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
 
     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";
@@ -554,7 +554,7 @@ extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
     
     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];
@@ -633,7 +633,7 @@ static QRect boundingBoxRect(RenderObject* obj)
     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())
@@ -728,7 +728,7 @@ static QRect boundingBoxRect(RenderObject* obj)
     
     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;
 }
@@ -911,7 +911,7 @@ static QRect boundingBoxRect(RenderObject* obj)
     }
     
     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();
index 55f10a6979c71a206294ddbd379ac8f63cf26563..482c79b7d781fe61c213b178b5e9b5a06b4d3930 100644 (file)
@@ -2277,7 +2277,7 @@ void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
             } 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());