diff options
Diffstat (limited to 'WebCore/rendering/RenderObject.cpp')
-rw-r--r-- | WebCore/rendering/RenderObject.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp index eb75ce2..9d2895f 100644 --- a/WebCore/rendering/RenderObject.cpp +++ b/WebCore/rendering/RenderObject.cpp @@ -1154,6 +1154,16 @@ void RenderObject::drawArcForBoxSide(GraphicsContext* graphicsContext, int x, in } } #endif + +void RenderObject::paintFocusRing(GraphicsContext* context, int tx, int ty, RenderStyle* style) +{ + Vector<IntRect> focusRingRects; + addFocusRingRects(focusRingRects, tx, ty); + if (style->outlineStyleIsAuto()) + context->drawFocusRing(focusRingRects, style->outlineWidth(), style->outlineOffset(), style->visitedDependentColor(CSSPropertyOutlineColor)); + else + addPDFURLRect(context, unionRect(focusRingRects)); +} void RenderObject::addPDFURLRect(GraphicsContext* context, const IntRect& rect) { @@ -1184,12 +1194,7 @@ void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) { if (!theme()->supportsFocusRing(styleToUse)) { // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. - Vector<IntRect> focusRingRects; - addFocusRingRects(focusRingRects, tx, ty); - if (styleToUse->outlineStyleIsAuto()) - graphicsContext->drawFocusRing(focusRingRects, ow, offset, oc); - else - addPDFURLRect(graphicsContext, unionRect(focusRingRects)); + paintFocusRing(graphicsContext, tx, ty, styleToUse); } } @@ -2227,7 +2232,7 @@ void RenderObject::updateDragState(bool dragOn) { bool valueChanged = (dragOn != m_isDragging); m_isDragging = dragOn; - if (valueChanged && style()->affectedByDragRules()) + if (valueChanged && style()->affectedByDragRules() && node()) node()->setNeedsStyleRecalc(); for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) curr->updateDragState(dragOn); @@ -2275,17 +2280,6 @@ bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int /*x*/, return false; } -int RenderObject::lineHeight(bool firstLine, bool /*isRootLineBox*/) const -{ - return style(firstLine)->computedLineHeight(); -} - -int RenderObject::baselinePosition(bool firstLine, bool isRootLineBox) const -{ - const Font& f = style(firstLine)->font(); - return f.ascent() + (lineHeight(firstLine, isRootLineBox) - f.height()) / 2; -} - void RenderObject::scheduleRelayout() { if (isRenderView()) { |