Diff
Modified: trunk/LayoutTests/ChangeLog (167935 => 167936)
--- trunk/LayoutTests/ChangeLog 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/LayoutTests/ChangeLog 2014-04-29 16:17:09 UTC (rev 167936)
@@ -1,5 +1,15 @@
2014-04-29 Zoltan Horvath <zol...@webkit.org>
+ [CSS Shapes] complex calc args for inset round vanish
+ https://bugs.webkit.org/show_bug.cgi?id=132293
+
+ Reviewed by Bem Jones-Bey.
+
+ * fast/shapes/parsing/parsing-shape-outside-expected.txt:
+ * fast/shapes/parsing/parsing-test-utils.js:
+
+2014-04-29 Zoltan Horvath <zol...@webkit.org>
+
[CSS Shapes] complex calc values for shape-margin return null for computed style
https://bugs.webkit.org/show_bug.cgi?id=132313
Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt (167935 => 167936)
--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt 2014-04-29 16:17:09 UTC (rev 167936)
@@ -67,6 +67,8 @@
PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 0px / 10px)") is "inset(10px round 0px / 10px)"
PASS getCSSText("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 10in) 0px 0px)"
PASS getComputedStyleValue("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 960px) 0px 0px)"
+PASS getCSSText("-webkit-shape-outside", "inset(10px 10px 10px 10px round calc(25%*3 - 10in))") is "inset(10px round calc(75% - 10in))"
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 10px 10px 10px round calc(25%*3 - 10in))") is "inset(10px round calc(75% - 960px))"
PASS getCSSText("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)"
PASS getComputedStyleValue("-webkit-shape-outside", "circle()") is "circle(closest-side at 50% 50%)"
PASS getCSSText("-webkit-shape-outside", "circle(farthest-side)") is "circle(farthest-side at 50% 50%)"
Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js (167935 => 167936)
--- trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js 2014-04-29 16:17:09 UTC (rev 167936)
@@ -39,6 +39,7 @@
"inset(10px round 0px / 10px)",
["inset(calc(25%*3 - 10in) 0 0 0)", "inset(calc(75% - 10in) 0px 0px)", "inset(calc(75% - 960px) 0px 0px)"],
+ ["inset(10px 10px 10px 10px round calc(25%*3 - 10in))", "inset(10px round calc(75% - 10in))", "inset(10px round calc(75% - 960px))"],
["circle()", "circle(at 50% 50%)", "circle(closest-side at 50% 50%)"],
["circle(farthest-side)", "circle(farthest-side at 50% 50%)", "circle(farthest-side at 50% 50%)"],
Modified: trunk/Source/WebCore/ChangeLog (167935 => 167936)
--- trunk/Source/WebCore/ChangeLog 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/Source/WebCore/ChangeLog 2014-04-29 16:17:09 UTC (rev 167936)
@@ -1,5 +1,29 @@
2014-04-29 Zoltan Horvath <zol...@webkit.org>
+ [CSS Shapes] complex calc args for inset round vanish
+ https://bugs.webkit.org/show_bug.cgi?id=132293
+
+ Reviewed by Bem Jones-Bey.
+
+ In order to use calc in the rounded parameters for inset shapes, we need
+ to pass RenderStyle for the value creation as we did for the width arguments.
+ Without taking RenderStyle into account, we hit an assert not reache
+ in CSSPrimitiveValue::init in the debug builds.
+
+ I've added new parsing test.
+
+ * css/BasicShapeFunctions.cpp:
+ (WebCore::valueForBasicShape):
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::init):
+ * css/CSSPrimitiveValue.h:
+ (WebCore::CSSPrimitiveValue::create):
+ * css/CSSValuePool.h:
+ (WebCore::CSSValuePool::createValue):
+
+2014-04-29 Zoltan Horvath <zol...@webkit.org>
+
[CSS Shapes] complex calc values for shape-margin return null for computed style
https://bugs.webkit.org/show_bug.cgi?id=132313
Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (167935 => 167936)
--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp 2014-04-29 16:17:09 UTC (rev 167936)
@@ -112,10 +112,10 @@
insetValue->setBottom(pool.createValue(inset->bottom(), style));
insetValue->setLeft(pool.createValue(inset->left(), style));
- insetValue->setTopLeftRadius(pool.createValue(inset->topLeftRadius()));
- insetValue->setTopRightRadius(pool.createValue(inset->topRightRadius()));
- insetValue->setBottomRightRadius(pool.createValue(inset->bottomRightRadius()));
- insetValue->setBottomLeftRadius(pool.createValue(inset->bottomLeftRadius()));
+ insetValue->setTopLeftRadius(pool.createValue(inset->topLeftRadius(), style));
+ insetValue->setTopRightRadius(pool.createValue(inset->topRightRadius(), style));
+ insetValue->setBottomRightRadius(pool.createValue(inset->bottomRightRadius(), style));
+ insetValue->setBottomLeftRadius(pool.createValue(inset->bottomLeftRadius(), style));
basicShapeValue = insetValue.release();
break;
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (167935 => 167936)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2014-04-29 16:17:09 UTC (rev 167936)
@@ -317,10 +317,10 @@
ASSERT_NOT_REACHED();
}
-CSSPrimitiveValue::CSSPrimitiveValue(const LengthSize& lengthSize)
+CSSPrimitiveValue::CSSPrimitiveValue(const LengthSize& lengthSize, const RenderStyle* style)
: CSSValue(PrimitiveClass)
{
- init(lengthSize);
+ init(lengthSize, style);
}
void CSSPrimitiveValue::init(const Length& length)
@@ -388,11 +388,11 @@
ASSERT_NOT_REACHED();
}
-void CSSPrimitiveValue::init(const LengthSize& lengthSize)
+void CSSPrimitiveValue::init(const LengthSize& lengthSize, const RenderStyle* style)
{
m_primitiveUnitType = CSS_PAIR;
m_hasCachedCSSText = false;
- m_value.pair = Pair::create(create(lengthSize.width()), create(lengthSize.height())).leakRef();
+ m_value.pair = Pair::create(create(lengthSize.width(), style), create(lengthSize.height(), style)).leakRef();
}
void CSSPrimitiveValue::init(PassRefPtr<Counter> c)
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (167935 => 167936)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.h 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h 2014-04-29 16:17:09 UTC (rev 167936)
@@ -214,7 +214,7 @@
static PassRef<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
static PassRef<CSSPrimitiveValue> create(const String& value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
static PassRef<CSSPrimitiveValue> create(const Length& value, const RenderStyle* style) { return adoptRef(*new CSSPrimitiveValue(value, style)); }
- static PassRef<CSSPrimitiveValue> create(const LengthSize& value) { return adoptRef(*new CSSPrimitiveValue(value)); }
+ static PassRef<CSSPrimitiveValue> create(const LengthSize& value, const RenderStyle* style) { return adoptRef(*new CSSPrimitiveValue(value, style)); }
template<typename T> static PassRef<CSSPrimitiveValue> create(T value)
{
@@ -346,7 +346,7 @@
CSSPrimitiveValue(unsigned color); // RGB value
CSSPrimitiveValue(const Length&);
CSSPrimitiveValue(const Length&, const RenderStyle*);
- CSSPrimitiveValue(const LengthSize&);
+ CSSPrimitiveValue(const LengthSize&, const RenderStyle*);
CSSPrimitiveValue(const String&, UnitTypes);
CSSPrimitiveValue(double, UnitTypes);
@@ -368,7 +368,7 @@
template<typename T> operator T*(); // compile-time guard
void init(const Length&);
- void init(const LengthSize&);
+ void init(const LengthSize&, const RenderStyle*);
void init(PassRefPtr<Counter>);
void init(PassRefPtr<Rect>);
void init(PassRefPtr<Pair>);
Modified: trunk/Source/WebCore/css/CSSValuePool.h (167935 => 167936)
--- trunk/Source/WebCore/css/CSSValuePool.h 2014-04-29 16:16:11 UTC (rev 167935)
+++ trunk/Source/WebCore/css/CSSValuePool.h 2014-04-29 16:17:09 UTC (rev 167936)
@@ -54,7 +54,7 @@
PassRef<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitTypes);
PassRef<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
PassRef<CSSPrimitiveValue> createValue(const Length& value, const RenderStyle* style) { return CSSPrimitiveValue::create(value, style); }
- PassRef<CSSPrimitiveValue> createValue(const LengthSize& value) { return CSSPrimitiveValue::create(value); }
+ PassRef<CSSPrimitiveValue> createValue(const LengthSize& value, const RenderStyle* style) { return CSSPrimitiveValue::create(value, style); }
template<typename T> static PassRef<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); }
void drain();