Diff
Modified: trunk/LayoutTests/ChangeLog (177615 => 177616)
--- trunk/LayoutTests/ChangeLog 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/LayoutTests/ChangeLog 2014-12-20 03:41:47 UTC (rev 177616)
@@ -1,3 +1,16 @@
+2014-12-19 Chris Dumez <[email protected]>
+
+ Fix initial / inherit support for '-webkit-perspective-origin' CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=139843
+
+ Reviewed by Simon Fraser.
+
+ Add layout test to cover 'initial' / 'inherit' support for
+ '-webkit-perspective-origin' CSS property.
+
+ * fast/css/perspective-origin-initial-inherit-expected.txt: Added.
+ * fast/css/perspective-origin-initial-inherit.html: Added.
+
2014-12-19 Alexey Proskuryakov <[email protected]>
REGRESSION (177368): Some tests started to immediately time out
Added: trunk/LayoutTests/fast/css/perspective-origin-initial-inherit-expected.txt (0 => 177616)
--- trunk/LayoutTests/fast/css/perspective-origin-initial-inherit-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css/perspective-origin-initial-inherit-expected.txt 2014-12-20 03:41:47 UTC (rev 177616)
@@ -0,0 +1,33 @@
+Tests that setting -webkit-perspective-origin property is corrected parsed / computed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(parentDiv)['-webkit-perspective'] is "150px"
+PASS getComputedStyle(parentDiv)['-webkit-perspective-origin'] is "10px 10px"
+PASS getComputedStyle(parentDiv)['-webkit-perspective-origin-x'] is ""
+PASS getComputedStyle(parentDiv)['-webkit-perspective-origin-y'] is ""
+PASS getComputedStyle(testDiv)['-webkit-perspective'] is "100px"
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin'] is "5px 5px"
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin-x'] is ""
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin-y'] is ""
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective'] is "200px"
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin'] is "15px 15px"
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin-x'] is ""
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin-y'] is ""
+testDiv.style['-webkit-perspective-origin'] = 'inherit'
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin'] is "10px 10px"
+testDiv.style['-webkit-perspective-origin'] = 'initial'
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin'] is "100px 100px"
+testDiv.style['-webkit-perspective-origin'] = '20px 20px'
+PASS getComputedStyle(testDiv)['-webkit-perspective-origin'] is "20px 20px"
+noShortHandDiv.style['-webkit-perspective-origin'] = 'inherit'
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin'] is "10px 10px"
+noShortHandDiv.style['-webkit-perspective-origin'] = 'initial'
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin'] is "150px 150px"
+noShortHandDiv.style['-webkit-perspective-origin'] = '20px 20px'
+PASS getComputedStyle(noShortHandDiv)['-webkit-perspective-origin'] is "20px 20px"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/css/perspective-origin-initial-inherit.html (0 => 177616)
--- trunk/LayoutTests/fast/css/perspective-origin-initial-inherit.html (rev 0)
+++ trunk/LayoutTests/fast/css/perspective-origin-initial-inherit.html 2014-12-20 03:41:47 UTC (rev 177616)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<div id="parentDiv" style="-webkit-perspective: 150px; -webkit-perspective-origin: 10px 10px; width: 400px; height: 400px">
+ <div id="testDiv" style="-webkit-perspective: 100px; -webkit-perspective-origin: 5px 5px; width: 200px; height: 200px"></div>
+ <div id="noShortHandDiv" style="-webkit-perspective: 200px; -webkit-perspective-origin: 15px 15px; width: 300px; height: 300px"></div>
+</div>
+<script>
+description("Tests that setting -webkit-perspective-origin property is corrected parsed / computed.");
+
+var parentDiv = document.getElementById("parentDiv");
+var testDiv = document.getElementById("testDiv");
+var noShortHandDiv = document.getElementById("noShortHandDiv");
+
+shouldBeEqualToString("getComputedStyle(parentDiv)['-webkit-perspective']", "150px");
+shouldBeEqualToString("getComputedStyle(parentDiv)['-webkit-perspective-origin']", "10px 10px");
+// Not implemented.
+shouldBeEmptyString("getComputedStyle(parentDiv)['-webkit-perspective-origin-x']");
+shouldBeEmptyString("getComputedStyle(parentDiv)['-webkit-perspective-origin-y']");
+
+shouldBeEqualToString("getComputedStyle(testDiv)['-webkit-perspective']", "100px");
+shouldBeEqualToString("getComputedStyle(testDiv)['-webkit-perspective-origin']", "5px 5px");
+// Not implemented.
+shouldBeEmptyString("getComputedStyle(testDiv)['-webkit-perspective-origin-x']");
+shouldBeEmptyString("getComputedStyle(testDiv)['-webkit-perspective-origin-y']");
+
+shouldBeEqualToString("getComputedStyle(noShortHandDiv)['-webkit-perspective']", "200px");
+shouldBeEqualToString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin']", "15px 15px");
+// Not implemented.
+shouldBeEmptyString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin-x']");
+shouldBeEmptyString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin-y']");
+
+evalAndLog("testDiv.style['-webkit-perspective-origin'] = 'inherit'");
+shouldBeEqualToString("getComputedStyle(testDiv)['-webkit-perspective-origin']", "10px 10px");
+
+evalAndLog("testDiv.style['-webkit-perspective-origin'] = 'initial'");
+// Initial is '50% 50%' -> '100px 100px', because width / height are 100px.
+shouldBeEqualToString("getComputedStyle(testDiv)['-webkit-perspective-origin']", "100px 100px");
+
+evalAndLog("testDiv.style['-webkit-perspective-origin'] = '20px 20px'");
+shouldBeEqualToString("getComputedStyle(testDiv)['-webkit-perspective-origin']", "20px 20px");
+
+evalAndLog("noShortHandDiv.style['-webkit-perspective-origin'] = 'inherit'");
+shouldBeEqualToString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin']", "10px 10px");
+
+evalAndLog("noShortHandDiv.style['-webkit-perspective-origin'] = 'initial'");
+// Initial is '50% 50%' -> '150px 150px', because width / height are 300px.
+shouldBeEqualToString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin']", "150px 150px");
+
+evalAndLog("noShortHandDiv.style['-webkit-perspective-origin'] = '20px 20px'");
+shouldBeEqualToString("getComputedStyle(noShortHandDiv)['-webkit-perspective-origin']", "20px 20px");
+
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (177615 => 177616)
--- trunk/Source/WebCore/ChangeLog 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/ChangeLog 2014-12-20 03:41:47 UTC (rev 177616)
@@ -1,3 +1,36 @@
+2014-12-19 Chris Dumez <[email protected]>
+
+ Fix initial / inherit support for '-webkit-perspective-origin' CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=139843
+
+ Reviewed by Simon Fraser.
+
+ Fix initial / inherit support for '-webkit-perspective-origin' CSS
+ property. These previously had no effect.
+
+ This patch updates the code to be consistent with
+ '-webkit-transform-origin' and gets rid of the code in
+ DeprecatedStyleBuilder as it isn't used.
+
+ Test: fast/css/perspective-origin-initial-inherit.html
+
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+ (WebCore::ApplyPropertyPerspectiveOrigin::applyInheritValue): Deleted.
+ (WebCore::ApplyPropertyPerspectiveOrigin::applyInitialValue): Deleted.
+ (WebCore::ApplyPropertyPerspectiveOrigin::applyValue): Deleted.
+ (WebCore::ApplyPropertyPerspectiveOrigin::createHandler): Deleted.
+ * css/StyleProperties.cpp:
+ (WebCore::StyleProperties::getPropertyValue):
+ (WebCore::StyleProperties::asText):
+ * css/StylePropertyShorthand.cpp:
+ (WebCore::webkitPerspectiveOriginShorthand):
+ (WebCore::shorthandForProperty):
+ (WebCore::matchingShorthandsForLonghand):
+ * css/StylePropertyShorthand.h:
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+
2014-12-19 Commit Queue <[email protected]>
Unreviewed, rolling out r177599.
Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (177615 => 177616)
--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp 2014-12-20 03:41:47 UTC (rev 177616)
@@ -41,48 +41,6 @@
using namespace HTMLNames;
-class ApplyPropertyPerspectiveOrigin {
-public:
- template <CSSPropertyID id>
- static inline void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
- {
- // FIXME: This doesn't seem to do anything as CSSPropertyWebkitPerspectiveOriginX
- // and CSSPropertyWebkitPerspectiveOriginY don't have a property handler.
- const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
- const PropertyHandler& handler = table.propertyHandler(id);
- if (handler.isValid())
- handler.applyInheritValue(propertyID, styleResolver);
- }
-
- static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
- {
- applyInheritValue<CSSPropertyWebkitPerspectiveOriginX>(propertyID, styleResolver);
- applyInheritValue<CSSPropertyWebkitPerspectiveOriginY>(propertyID, styleResolver);
- }
-
- template <CSSPropertyID id>
- static inline void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
- {
- // FIXME: This doesn't seem to do anything as CSSPropertyWebkitPerspectiveOriginX
- // and CSSPropertyWebkitPerspectiveOriginY don't have a property handler.
- const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
- const PropertyHandler& handler = table.propertyHandler(id);
- if (handler.isValid())
- handler.applyInitialValue(propertyID, styleResolver);
- }
-
- static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
- {
- applyInitialValue<CSSPropertyWebkitPerspectiveOriginX>(propertyID, styleResolver);
- applyInitialValue<CSSPropertyWebkitPerspectiveOriginY>(propertyID, styleResolver);
- }
-
- static void applyValue(CSSPropertyID, StyleResolver*, CSSValue*)
- { }
-
- static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
enum AutoValueType {Number = 0, ComputeLength};
template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
class ApplyPropertyAuto {
@@ -670,7 +628,6 @@
setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
- setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyPerspectiveOrigin::createHandler());
setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (177615 => 177616)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2014-12-20 03:41:47 UTC (rev 177616)
@@ -199,6 +199,8 @@
return getShorthandValue(webkitTextEmphasisShorthand());
case CSSPropertyWebkitTextStroke:
return getShorthandValue(webkitTextStrokeShorthand());
+ case CSSPropertyWebkitPerspectiveOrigin:
+ return getShorthandValue(webkitPerspectiveOriginShorthand());
case CSSPropertyWebkitTransformOrigin:
return getShorthandValue(webkitTransformOriginShorthand());
case CSSPropertyWebkitTransition:
@@ -926,6 +928,10 @@
case CSSPropertyWebkitMaskOrigin:
shorthandPropertyID = CSSPropertyWebkitMask;
break;
+ case CSSPropertyWebkitPerspectiveOriginX:
+ case CSSPropertyWebkitPerspectiveOriginY:
+ shorthandPropertyID = CSSPropertyWebkitPerspectiveOrigin;
+ break;
case CSSPropertyWebkitTransformOriginX:
case CSSPropertyWebkitTransformOriginY:
case CSSPropertyWebkitTransformOriginZ:
Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (177615 => 177616)
--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp 2014-12-20 03:41:47 UTC (rev 177616)
@@ -509,6 +509,15 @@
return StylePropertyShorthand(CSSPropertyWebkitTransition, transitionProperties, WTF_ARRAY_LENGTH(transitionProperties));
}
+StylePropertyShorthand webkitPerspectiveOriginShorthand()
+{
+ static const CSSPropertyID perspectiveOriginProperties[] = {
+ CSSPropertyWebkitPerspectiveOriginX,
+ CSSPropertyWebkitPerspectiveOriginY
+ };
+ return StylePropertyShorthand(CSSPropertyWebkitPerspectiveOrigin, perspectiveOriginProperties, WTF_ARRAY_LENGTH(perspectiveOriginProperties));
+}
+
StylePropertyShorthand webkitTransformOriginShorthand()
{
static const CSSPropertyID transformOriginProperties[] = {
@@ -627,6 +636,8 @@
return webkitMaskPositionShorthand();
case CSSPropertyWebkitMaskRepeat:
return webkitMaskRepeatShorthand();
+ case CSSPropertyWebkitPerspectiveOrigin:
+ return webkitPerspectiveOriginShorthand();
case CSSPropertyWebkitTextEmphasis:
return webkitTextEmphasisShorthand();
case CSSPropertyWebkitTextStroke:
@@ -850,6 +861,9 @@
case CSSPropertyWebkitMaskRepeatX:
case CSSPropertyWebkitMaskRepeatY:
return makeVector(webkitMaskRepeatShorthand());
+ case CSSPropertyWebkitPerspectiveOriginX:
+ case CSSPropertyWebkitPerspectiveOriginY:
+ return makeVector(webkitPerspectiveOriginShorthand());
case CSSPropertyWebkitTextEmphasisStyle:
case CSSPropertyWebkitTextEmphasisColor:
return makeVector(webkitTextEmphasisShorthand());
Modified: trunk/Source/WebCore/css/StylePropertyShorthand.h (177615 => 177616)
--- trunk/Source/WebCore/css/StylePropertyShorthand.h 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.h 2014-12-20 03:41:47 UTC (rev 177616)
@@ -110,6 +110,7 @@
StylePropertyShorthand webkitMaskShorthand();
StylePropertyShorthand webkitMaskPositionShorthand();
StylePropertyShorthand webkitMaskRepeatShorthand();
+StylePropertyShorthand webkitPerspectiveOriginShorthand();
StylePropertyShorthand webkitTextEmphasisShorthand();
StylePropertyShorthand webkitTextStrokeShorthand();
StylePropertyShorthand webkitTransitionShorthand();
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (177615 => 177616)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2014-12-20 02:39:28 UTC (rev 177615)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2014-12-20 03:41:47 UTC (rev 177616)
@@ -2426,6 +2426,7 @@
case CSSPropertyWebkitMask:
case CSSPropertyWebkitMaskPosition:
case CSSPropertyWebkitMaskRepeat:
+ case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitTextEmphasis:
case CSSPropertyWebkitTextStroke:
case CSSPropertyWebkitTransition:
@@ -3040,7 +3041,6 @@
case CSSPropertyWebkitMaskSourceType:
case CSSPropertyWebkitNbspMode:
case CSSPropertyWebkitPerspective:
- case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY:
case CSSPropertyWebkitPrintColorAdjust: