Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: Source/core/rendering/shapes/ShapeOutsideInfo.cpp

Issue 244693003: [CSS Shapes] Add parsing support for gradients (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Increase threshold Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/shapes/ShapeOutsideInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index 6b4138b66064792b7e32429ee8adf85d9171312b..303ce29518fdbbd4d060c8f094bbb85b901e61e9 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -80,8 +80,13 @@ void ShapeOutsideInfo::setReferenceBoxLogicalSize(LayoutSize newReferenceBoxLogi
m_referenceBoxLogicalSize = newReferenceBoxLogicalSize;
}
-static bool checkShapeImageOrigin(Document& document, ImageResource& imageResource)
+static bool checkShapeImageOrigin(Document& document, const StyleImage& styleImage)
{
+ if (styleImage.isGeneratedImage())
+ return true;
+
+ ASSERT(styleImage.cachedImage());
+ ImageResource& imageResource = *(styleImage.cachedImage());
if (imageResource.isAccessAllowed(document.securityOrigin()))
return true;
@@ -100,7 +105,12 @@ static void getShapeImageAndRect(const ShapeValue& shapeValue, const RenderBox&
const IntSize& imageSize = renderBox.calculateImageIntrinsicDimensions(styleImage, roundedIntSize(referenceBoxSize), RenderImage::ScaleByEffectiveZoom);
styleImage->setContainerSizeForRenderer(&renderBox, imageSize, renderBox.style()->effectiveZoom());
- image = styleImage->cachedImage()->imageForRenderer(&renderBox);
+ image = 0;
+ if (styleImage->isImageResource() || styleImage->isImageResourceSet())
+ image = styleImage->cachedImage()->imageForRenderer(&renderBox);
+ else if (styleImage->isGeneratedImage())
+ image = styleImage->image(const_cast<RenderBox*>(&renderBox), imageSize).get();
+
if (renderBox.isRenderImage())
rect = toRenderImage(&renderBox)->replacedContentRect();
else
@@ -263,7 +273,7 @@ bool ShapeOutsideInfo::isEnabledFor(const RenderBox& box)
case ShapeValue::Shape:
return shapeValue->shape();
case ShapeValue::Image:
- return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()->cachedImage()));
+ return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()));
case ShapeValue::Box:
return true;
}
« no previous file with comments | « Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ('k') | Source/core/rendering/style/ShapeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698