Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #2236.

Turns out this wasn't a Fx.CSS.parser issue but more of a
Element.getStyle needed to clean the value from rect(a, b, c, d) to our
preferred value of rect(a b c d).

This solves IE8 issue of returning rect(a,b,c,d) and non-webkit
returning rect(a, b, c, d). Element.setStyle still accepts rect(a b c d)
or rect(a, b, c, d).

PASSED: IE6-9; FFx 3-5, 8, 10; Chrome latest; Safari 5; Opera 11
  • Loading branch information...
commit baff862805c0b3c4668689563f5d262d9671916f 1 parent 0664977
@ibolmo authored
Showing with 33 additions and 0 deletions.
  1. +1 −0  Source/Element/Element.Style.js
  2. +32 −0 Specs/1.4client/Fx/Fx.Tween.js
View
1  Source/Element/Element.Style.js
@@ -89,6 +89,7 @@ Element.implement({
if (property == 'opacity') return getOpacity(this);
property = (property == 'float' ? floatName : property).camelCase();
var result = this.style[property];
+ if (property == 'clip') result = result.replace(/,\s*/g, ' ');
if (!result || property == 'zIndex'){
result = [];
for (var style in Element.ShortStyles){
View
32 Specs/1.4client/Fx/Fx.Tween.js
@@ -59,4 +59,36 @@ describe('Fx.Tween', function(){
});
+ describe('Element.tween("clip")', function(){
+
+ it('should animate the clip', function(){
+ var element = new Element('div', {
+ text: Array(5).join('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '),
+ styles: {
+ width: 200,
+ height: 100,
+ position: 'absolute',
+ clip: 'rect(0px, 0px, 200px, 0px)'
+ }
+ });
+ var spy = spyOn(element, 'setStyle').andCallThrough();
+
+ element.tween('clip', 'rect(0px, 100px, 200px, 0px)');
+
+ this.clock.tick(10000);
+
+ expect(spy).toHaveBeenCalledWith('clip', ['rect(0px,', 100, 200, 0]);
+
+ spy.reset();
+
+ element.tween('clip', 'rect(0px 50px 200px 0px)');
+
+ this.clock.tick(10000);
+
+ expect(spy).toHaveBeenCalledWith('clip', ['rect(0px', 50, 200, 0]);
+
+ })
+
+ });
+
});
Please sign in to comment.
Something went wrong with that request. Please try again.