Changeset 167518 in webkit
- Timestamp:
- Apr 18, 2014 4:30:58 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167506 r167518 1 2014-04-18 Hans Muller <hmuller@adobe.com> 2 3 [CSS Shapes] Add parsing support for gradients 4 https://bugs.webkit.org/show_bug.cgi?id=131444 5 6 Reviewed by Bem Jones-Bey. 7 8 * fast/shapes/parsing/parsing-shape-outside-expected.txt: 9 * fast/shapes/parsing/parsing-test-utils.js: 10 * fast/shapes/shape-outside-floats/shape-outside-linear-gradient-expected.html: Added. 11 * fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html: Added. 12 1 13 2014-04-18 Alexey Proskuryakov <ap@apple.com> 2 14 -
trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt
r167132 r167518 168 168 PASS getCSSText("-webkit-shape-outside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "margin-box polygon(0px 0px, 10px 10px, 10px 0px)" 169 169 PASS getComputedStyleValue("-webkit-shape-outside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(0px 0px, 10px 10px, 10px 0px) margin-box" 170 PASS getCSSText("-webkit-shape-outside", "linear-gradient(to right, red, blue)") is "linear-gradient(to right, red, blue)" 171 PASS getComputedStyleValue("-webkit-shape-outside", "linear-gradient(to right, red, blue)") is "linear-gradient(to right, red, blue)" 172 PASS getCSSText("-webkit-shape-outside", "radial-gradient(at 10px 20px, red 0%, blue 50%, green 95%)") is "radial-gradient(at 10px 20px, red 0%, blue 50%, green 95%)" 173 PASS getComputedStyleValue("-webkit-shape-outside", "radial-gradient(at 10px 20px, red 0%, blue 50%, green 95%)") is "radial-gradient(at 10px 20px, red 0%, blue 50%, green 95%)" 170 174 PASS removeBaseURL(getCSSText("-webkit-shape-outside", "url('image')")) is "url(image)" 171 175 PASS removeBaseURL(getComputedStyleValue("-webkit-shape-outside", "url('image')")) is "url(image)" -
trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js
r167132 r167518 95 95 ["padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "padding-box polygon(0px 0px, 10px 10px, 10px 0px)", "polygon(0px 0px, 10px 10px, 10px 0px) padding-box"], 96 96 ["border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "border-box polygon(0px 0px, 10px 10px, 10px 0px)", "polygon(0px 0px, 10px 10px, 10px 0px) border-box"], 97 ["margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "margin-box polygon(0px 0px, 10px 10px, 10px 0px)", "polygon(0px 0px, 10px 10px, 10px 0px) margin-box"] 97 ["margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "margin-box polygon(0px 0px, 10px 10px, 10px 0px)", "polygon(0px 0px, 10px 10px, 10px 0px) margin-box"], 98 99 "linear-gradient(to right, red, blue)", 100 "radial-gradient(at 10px 20px, red 0%, blue 50%, green 95%)" 98 101 ]; 99 102 -
trunk/Source/WebCore/ChangeLog
r167517 r167518 1 2014-04-18 Hans Muller <hmuller@adobe.com> 2 3 [CSS Shapes] Add parsing support for gradients 4 https://bugs.webkit.org/show_bug.cgi?id=131444 5 6 Reviewed by Bem Jones-Bey. 7 8 Added support for shape-outside gradient values. 9 10 Test: fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html 11 12 * css/DeprecatedStyleBuilder.cpp: 13 (WebCore::ApplyPropertyShape::applyValue): Accept generated images as shape-outside values. 14 * rendering/shapes/ShapeOutsideInfo.cpp: 15 (WebCore::checkShapeImageOrigin): Generated images get a pass, others do not. 16 (WebCore::getShapeImageAndRect): Use StyleImage::image() to get a generated image. 17 (WebCore::ShapeOutsideInfo::isEnabledFor): 18 * rendering/style/ShapeValue.h: 19 (WebCore::ShapeValue::isImageValid): Generated images are always considered valid. 20 1 21 2014-04-18 Brady Eidson <beidson@apple.com> 2 22 -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r167448 r167518 2179 2179 if (primitiveValue->getValueID() == CSSValueAuto) 2180 2180 setValue(styleResolver->style(), 0); 2181 } else if (value->isImageValue() || value->isImage SetValue()) {2181 } else if (value->isImageValue() || value->isImageGeneratorValue() || value->isImageSetValue()) { 2182 2182 RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver->styleImage(property, value)); 2183 2183 setValue(styleResolver->style(), shape.release()); -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r166797 r167518 121 121 } 122 122 123 static inline bool checkShapeImageOrigin(Document& document, CachedImage& cachedImage) 124 { 123 static inline bool checkShapeImageOrigin(Document& document, const StyleImage& styleImage) 124 { 125 if (styleImage.isGeneratedImage()) 126 return true; 127 128 ASSERT(styleImage.cachedImage()); 129 CachedImage& cachedImage = *(styleImage.cachedImage()); 125 130 if (cachedImage.isOriginClean(document.securityOrigin())) 126 131 return true; … … 141 146 styleImage->setContainerSizeForRenderer(&renderBox, imageSize, renderBox.style().effectiveZoom()); 142 147 143 image = styleImage->cachedImage()->imageForRenderer(&renderBox); 148 image = nullptr; 149 if (styleImage->isCachedImage() || styleImage->isCachedImageSet()) 150 image = styleImage->cachedImage()->imageForRenderer(&renderBox); 151 else if (styleImage->isGeneratedImage()) 152 image = styleImage->image(const_cast<RenderBox*>(&renderBox), imageSize).get(); 153 144 154 if (renderBox.isRenderImage()) 145 155 rect = toRenderImage(&renderBox)->replacedContentRect(renderBox.intrinsicSize()); … … 294 304 switch (shapeValue->type()) { 295 305 case ShapeValue::Shape: return shapeValue->shape(); 296 case ShapeValue::Image: return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image() ->cachedImage()));306 case ShapeValue::Image: return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image())); 297 307 case ShapeValue::Box: return true; 298 308 } -
trunk/Source/WebCore/rendering/style/ShapeValue.h
r166786 r167518 68 68 69 69 StyleImage* image() const { return m_image.get(); } 70 bool isImageValid() const { return image() && image()->cachedImage() && image()->cachedImage()->hasImage(); } 70 71 bool isImageValid() const 72 { 73 if (!image()) 74 return false; 75 if (image()->isCachedImage() || image()->isCachedImageSet()) 76 return image()->cachedImage() && image()->cachedImage()->hasImage(); 77 return image()->isGeneratedImage(); 78 } 79 71 80 void setImage(PassRefPtr<StyleImage> image) 72 81 {
Note: See TracChangeset
for help on using the changeset viewer.