diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/rendering/RenderInline.cpp | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/rendering/RenderInline.cpp')
-rw-r--r-- | WebCore/rendering/RenderInline.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp index 2f9a247..9571751 100644 --- a/WebCore/rendering/RenderInline.cpp +++ b/WebCore/rendering/RenderInline.cpp @@ -23,6 +23,7 @@ #include "config.h" #include "RenderInline.h" +#include "Chrome.h" #include "FloatQuad.h" #include "GraphicsContext.h" #include "HitTestResult.h" @@ -931,13 +932,15 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*) repaint(); } -void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty) +void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty) { for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { RootInlineBox* root = curr->root(); int top = max(root->lineTop(), curr->y()); int bottom = min(root->lineBottom(), curr->y() + curr->height()); - graphicsContext->addFocusRingRect(IntRect(tx + curr->x(), ty + top, curr->width(), bottom - top)); + IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top); + if (!rect.isEmpty()) + rects.append(rect); } for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { @@ -948,17 +951,17 @@ void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, i pos = curr->localToAbsolute(); else if (curr->isBox()) pos.move(toRenderBox(curr)->x(), toRenderBox(curr)->y()); - curr->addFocusRingRects(graphicsContext, pos.x(), pos.y()); + curr->addFocusRingRects(rects, pos.x(), pos.y()); } } if (continuation()) { if (continuation()->isInline()) - continuation()->addFocusRingRects(graphicsContext, + continuation()->addFocusRingRects(rects, tx - containingBlock()->x() + continuation()->containingBlock()->x(), ty - containingBlock()->y() + continuation()->containingBlock()->y()); else - continuation()->addFocusRingRects(graphicsContext, + continuation()->addFocusRingRects(rects, tx - containingBlock()->x() + toRenderBox(continuation())->x(), ty - containingBlock()->y() + toRenderBox(continuation())->y()); } @@ -975,13 +978,12 @@ void RenderInline::paintOutline(GraphicsContext* graphicsContext, int tx, int ty if (!oc.isValid()) oc = style()->color(); - graphicsContext->initFocusRing(ow, style()->outlineOffset()); - addFocusRingRects(graphicsContext, tx, ty); + Vector<IntRect> focusRingRects; + addFocusRingRects(focusRingRects, tx, ty); if (style()->outlineStyleIsAuto()) - graphicsContext->drawFocusRing(oc); + graphicsContext->drawFocusRing(focusRingRects, ow, style()->outlineOffset(), oc); else - addPDFURLRect(graphicsContext, graphicsContext->focusRingBoundingRect()); - graphicsContext->clearFocusRing(); + addPDFURLRect(graphicsContext, unionRect(focusRingRects)); } if (style()->outlineStyleIsAuto() || style()->outlineStyle() == BNONE) |