diff options
Diffstat (limited to 'WebCore/rendering/RenderObject.cpp')
-rw-r--r-- | WebCore/rendering/RenderObject.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp index 78da758..9ee97b4 100644 --- a/WebCore/rendering/RenderObject.cpp +++ b/WebCore/rendering/RenderObject.cpp @@ -41,7 +41,8 @@ #include "RenderArena.h" #include "RenderCounter.h" #include "RenderFlexibleBox.h" -#include "RenderImageGeneratedContent.h" +#include "RenderImage.h" +#include "RenderImageResourceStyleImage.h" #include "RenderInline.h" #include "RenderLayer.h" #include "RenderListItem.h" @@ -110,10 +111,12 @@ RenderObject* RenderObject::createObject(Node* node, RenderStyle* style) // Otherwise acts as if we didn't support this feature. const ContentData* contentData = style->contentData(); if (contentData && !contentData->next() && contentData->isImage() && doc != node) { - RenderImageGeneratedContent* image = new (arena) RenderImageGeneratedContent(node); + RenderImage* image = new (arena) RenderImage(node); image->setStyle(style); if (StyleImage* styleImage = contentData->image()) - image->setStyleImage(styleImage); + image->setImageResource(RenderImageResourceStyleImage::create(styleImage)); + else + image->setImageResource(RenderImageResource::create()); return image; } @@ -1425,7 +1428,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight); int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0; - int borderWidth = max(-outlineStyle->outlineOffset(), max(borderRight, max(style()->borderTopRightRadius().width(), style()->borderBottomRightRadius().width()))) + max(ow, shadowRight); + int boxWidth = isBox() ? toRenderBox(this)->width() : 0; + int borderWidth = max(-outlineStyle->outlineOffset(), max(borderRight, max(style()->borderTopRightRadius().width().calcValue(boxWidth), style()->borderBottomRightRadius().width().calcValue(boxWidth)))) + max(ow, shadowRight); IntRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth, newOutlineBox.y(), width + borderWidth, @@ -1443,7 +1447,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom); int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0; - int borderHeight = max(-outlineStyle->outlineOffset(), max(borderBottom, max(style()->borderBottomLeftRadius().height(), style()->borderBottomRightRadius().height()))) + max(ow, shadowBottom); + int boxHeight = isBox() ? toRenderBox(this)->height() : 0; + int borderHeight = max(-outlineStyle->outlineOffset(), max(borderBottom, max(style()->borderBottomLeftRadius().height().calcValue(boxHeight), style()->borderBottomRightRadius().height().calcValue(boxHeight)))) + max(ow, shadowBottom); IntRect bottomRect(newOutlineBox.x(), min(newOutlineBox.bottom(), oldOutlineBox.bottom()) - borderHeight, max(newOutlineBox.width(), oldOutlineBox.width()), @@ -2556,27 +2561,11 @@ void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const { int outlineSize = outlineStyleForRepaint()->outlineSize(); if (const ShadowData* boxShadow = style()->boxShadow()) { - int shadowLeft = 0; - int shadowRight = 0; - int shadowTop = 0; - int shadowBottom = 0; - - do { - if (boxShadow->style() == Normal) { - shadowLeft = min(boxShadow->x() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowLeft); - shadowRight = max(boxShadow->x() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowRight); - shadowTop = min(boxShadow->y() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowTop); - shadowBottom = max(boxShadow->y() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowBottom); - } - - boxShadow = boxShadow->next(); - } while (boxShadow); + boxShadow->adjustRectForShadow(rect, outlineSize); + return; + } - rect.move(shadowLeft, shadowTop); - rect.setWidth(rect.width() - shadowLeft + shadowRight); - rect.setHeight(rect.height() - shadowTop + shadowBottom); - } else - rect.inflate(outlineSize); + rect.inflate(outlineSize); } AnimationController* RenderObject::animation() const @@ -2708,6 +2697,12 @@ RenderSVGResourceContainer* RenderObject::toRenderSVGResourceContainer() return 0; } +void RenderObject::setNeedsBoundariesUpdate() +{ + if (RenderObject* renderer = parent()) + renderer->setNeedsBoundariesUpdate(); +} + FloatRect RenderObject::objectBoundingBox() const { ASSERT_NOT_REACHED(); |