diff options
Diffstat (limited to 'WebCore/html/HTMLAnchorElement.cpp')
-rw-r--r-- | WebCore/html/HTMLAnchorElement.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp index 4122168..c6b2a95 100644 --- a/WebCore/html/HTMLAnchorElement.cpp +++ b/WebCore/html/HTMLAnchorElement.cpp @@ -38,7 +38,8 @@ #include "KeyboardEvent.h" #include "MouseEvent.h" #include "MutationEvent.h" -#include "RenderFlow.h" +#include "Page.h" +#include "RenderBox.h" #include "RenderImage.h" #include "ResourceRequest.h" #include "SelectionController.h" @@ -107,18 +108,14 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const if (!document()->frame()->eventHandler()->tabsToLinks(event)) return false; - if (!renderer() || !renderer()->isBox()) + if (!renderer() || !renderer()->isBoxModelObject()) return false; // Before calling absoluteRects, check for the common case where the renderer - // or one of the continuations is non-empty, since this is a faster check and - // almost always returns true. - RenderBox* box = toRenderBox(renderer()); + // is non-empty, since this is a faster check and almost always returns true. + RenderBoxModelObject* box = toRenderBoxModelObject(renderer()); if (!box->borderBoundingBox().isEmpty()) return true; - for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation()) - if (!r->borderBoundingBox().isEmpty()) - return true; Vector<IntRect> rects; FloatPoint absPos = renderer()->localToAbsolute(); @@ -203,7 +200,7 @@ void HTMLAnchorElement::defaultEventHandler(Event* evt) if (evt->target()->toNode()->hasTagName(imgTag)) { HTMLImageElement* img = static_cast<HTMLImageElement*>(evt->target()->toNode()); if (img && img->isServerMap()) { - RenderImage* r = static_cast<RenderImage*>(img->renderer()); + RenderImage* r = toRenderImage(img->renderer()); if (r && e) { // FIXME: broken with transforms FloatPoint absPos = r->localToAbsolute(); @@ -434,7 +431,8 @@ void HTMLAnchorElement::setType(const AtomicString& value) String HTMLAnchorElement::hash() const { - return "#" + href().ref(); + String ref = href().ref(); + return ref.isEmpty() ? "" : "#" + ref; } String HTMLAnchorElement::host() const @@ -467,7 +465,8 @@ String HTMLAnchorElement::protocol() const String HTMLAnchorElement::search() const { - return href().query(); + String query = href().query(); + return query.isEmpty() ? "" : "?" + query; } String HTMLAnchorElement::text() const |