diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp index 098932a..adf6deb 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp @@ -774,7 +774,7 @@ void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, int x1, break; case BSRight: drawLineForBoxSide(graphicsContext, x1, y1 + max((adjbw1 * 2 + 1) / 3, 0), - x1 + third, y2 - max(( adjbw2 * 2 + 1) / 3, 0), + x1 + third, y2 - max((adjbw2 * 2 + 1) / 3, 0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird); drawLineForBoxSide(graphicsContext, x2 - third, y1 + max((-adjbw1 * 2 + 1) / 3, 0), x2, y2 - max((-adjbw2 * 2 + 1) / 3, 0), @@ -1738,8 +1738,8 @@ IntSize RenderObject::offsetFromContainer(RenderObject* o) const IntRect RenderObject::localCaretRect(InlineBox*, int, int* extraWidthToEndOfLine) { - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = 0; + if (extraWidthToEndOfLine) + *extraWidthToEndOfLine = 0; return IntRect(); } @@ -1980,6 +1980,27 @@ void RenderObject::layout() setNeedsLayout(false); } +PassRefPtr<RenderStyle> RenderObject::uncachedFirstLineStyle(RenderStyle* style) const +{ + if (!document()->usesFirstLineRules()) + return 0; + + ASSERT(!isText()); + + RefPtr<RenderStyle> result; + + if (isBlockFlow()) { + if (RenderBlock* firstLineBlock = this->firstLineBlock()) + result = firstLineBlock->getUncachedPseudoStyle(FIRST_LINE, style, firstLineBlock == this ? style : 0); + } else if (!isAnonymous() && isRenderInline()) { + RenderStyle* parentStyle = parent()->firstLineStyle(); + if (parentStyle != parent()->style()) + result = getUncachedPseudoStyle(FIRST_LINE_INHERITED, parentStyle, style); + } + + return result.release(); +} + RenderStyle* RenderObject::firstLineStyleSlowCase() const { ASSERT(document()->usesFirstLineRules()); @@ -2016,13 +2037,15 @@ RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* pa return 0; } -PassRefPtr<RenderStyle> RenderObject::getUncachedPseudoStyle(PseudoId pseudo, RenderStyle* parentStyle) const +PassRefPtr<RenderStyle> RenderObject::getUncachedPseudoStyle(PseudoId pseudo, RenderStyle* parentStyle, RenderStyle* ownStyle) const { - if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo)) + if (pseudo < FIRST_INTERNAL_PSEUDOID && !ownStyle && !style()->hasPseudoStyle(pseudo)) return 0; - if (!parentStyle) + if (!parentStyle) { + ASSERT(!ownStyle); parentStyle = style(); + } Node* n = node(); while (n && !n->isElementNode()) |