summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp b/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
index e46ba382d..b397bce60 100644
--- a/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -256,8 +256,8 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, int& leftPosition, int& righ
int boxShadowLeft = 0;
int boxShadowRight = 0;
for (ShadowData* boxShadow = renderer()->style(m_firstLine)->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
- boxShadowLeft = min(boxShadow->x - boxShadow->blur, boxShadowLeft);
- boxShadowRight = max(boxShadow->x + boxShadow->blur, boxShadowRight);
+ boxShadowLeft = min(boxShadow->x - boxShadow->blur - boxShadow->spread, boxShadowLeft);
+ boxShadowRight = max(boxShadow->x + boxShadow->blur + boxShadow->spread, boxShadowRight);
}
leftPosition = min(xPos + boxShadowLeft, leftPosition);
@@ -529,8 +529,8 @@ void InlineFlowBox::placeBoxesVertically(int yPos, int maxHeight, int maxAscent,
}
for (ShadowData* boxShadow = curr->renderer()->style(m_firstLine)->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
- overflowTop = min(overflowTop, boxShadow->y - boxShadow->blur);
- overflowBottom = max(overflowBottom, boxShadow->y + boxShadow->blur);
+ overflowTop = min(overflowTop, boxShadow->y - boxShadow->blur - boxShadow->spread);
+ overflowBottom = max(overflowBottom, boxShadow->y + boxShadow->blur + boxShadow->spread);
}
for (ShadowData* textShadow = curr->renderer()->style(m_firstLine)->textShadow(); textShadow; textShadow = textShadow->next) {
@@ -601,8 +601,8 @@ void InlineFlowBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
int shadowLeft = 0;
int shadowRight = 0;
for (ShadowData* boxShadow = renderer()->style(m_firstLine)->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
- shadowLeft = min(boxShadow->x - boxShadow->blur, shadowLeft);
- shadowRight = max(boxShadow->x + boxShadow->blur, shadowRight);
+ shadowLeft = min(boxShadow->x - boxShadow->blur - boxShadow->spread, shadowLeft);
+ shadowRight = max(boxShadow->x + boxShadow->blur + boxShadow->spread, shadowRight);
}
for (ShadowData* textShadow = renderer()->style(m_firstLine)->textShadow(); textShadow; textShadow = textShadow->next) {
shadowLeft = min(textShadow->x - textShadow->blur, shadowLeft);
@@ -696,14 +696,14 @@ void InlineFlowBox::paintFillLayer(const RenderObject::PaintInfo& paintInfo, con
}
}
-void InlineFlowBox::paintBoxShadow(GraphicsContext* context, RenderStyle* s, int tx, int ty, int w, int h)
+void InlineFlowBox::paintBoxShadow(GraphicsContext* context, RenderStyle* s, ShadowStyle shadowStyle, int tx, int ty, int w, int h)
{
if ((!prevLineBox() && !nextLineBox()) || !parent())
- boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s);
+ boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle);
else {
// FIXME: We can do better here in the multi-line case. We want to push a clip so that the shadow doesn't
// protrude incorrectly at the edges, and we want to possibly include shadows cast from the previous/following lines
- boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, includeLeftEdge(), includeRightEdge());
+ boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle, includeLeftEdge(), includeRightEdge());
}
}
@@ -727,11 +727,14 @@ void InlineFlowBox::paintBoxDecorations(RenderObject::PaintInfo& paintInfo, int
if ((!parent() && m_firstLine && styleToUse != renderer()->style()) || (parent() && renderer()->hasBoxDecorations())) {
// Shadow comes first and is behind the background and border.
if (styleToUse->boxShadow())
- paintBoxShadow(context, styleToUse, tx, ty, w, h);
+ paintBoxShadow(context, styleToUse, Normal, tx, ty, w, h);
Color c = styleToUse->backgroundColor();
paintFillLayers(paintInfo, c, styleToUse->backgroundLayers(), tx, ty, w, h);
+ if (styleToUse->boxShadow())
+ paintBoxShadow(context, styleToUse, Inset, tx, ty, w, h);
+
// :first-line cannot be used to put borders on a line. Always paint borders with our
// non-first-line style.
if (parent() && renderer()->style()->hasBorder()) {