/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

goog.provide('org.apache.flex.effects.PlatformWiper');

goog.require('org.apache.flex.geom.Rectangle');



/**
 * @constructor
 */
org.apache.flex.effects.PlatformWiper = function() {

  /**
   * @private
   * @type {Object}
   */
  this.target_ = null;

};


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.flex.effects.PlatformWiper.prototype.FLEXJS_CLASS_INFO =
    { names: [{ name: 'PlatformWiper',
                qName: 'org.apache.flex.effects.PlatformWiper'}] };


/**
 * @expose
 * Sets the target for the Wipe.
 * @param {Object} target The target for the Wipe effect.
 */
org.apache.flex.effects.PlatformWiper.prototype.set_target =
    function(target) {
  if (target == null)
      delete this.target_.positioner.style.clip;
  this.target_ = target;
};


/**
 * @expose
 * Clips the Object.
 * @param {org.apache.flex.geom.Rectangle} rect The visible area.
 */
org.apache.flex.effects.PlatformWiper.prototype.set_visibleRect =
    function(rect) {
  var styleString = 'rect(';
  styleString += rect.top.toString() + 'px,';
  styleString += rect.width.toString() + 'px,';
  styleString += rect.height.toString() + 'px,';
  styleString += rect.left.toString() + 'px,)';
  this.target_.positioner.style.clip = styleString;
};

@@ -812,16 +812,89 @@
  null;%0A%0A
+%0A  /**%0A   * @private%0A   * @type %7BObject%7D%0A   */%0A  this.overflow_ = null;%0A%0A
 %7D;%0A%0A%0A/**
@@ -1348,16 +1348,50 @@
 == null)
+ %7B%0A    if (this.overflow_ == null)
 %0A      d
@@ -1430,38 +1430,207 @@
 yle.
-clip;%0A  this.target_ = target;
+overflow;%0A    else%0A      this.target_.positioner.style.overflow = this.overflow_;%0A  %7D%0A  this.target_ = target;%0A  if (target != null) %7B%0A    this.overflow_ = this.target_.positioner.style.overflow;%0A  %7D
 %0A%7D;%0A
@@ -1824,16 +1824,21 @@
 rect) %7B%0A
+  /*%0A
   var st
@@ -2044,17 +2044,16 @@
 () + 'px
-,
 )';%0A  th
@@ -2100,11 +2100,141 @@
 String;%0A
+  */%0A  this.target_.positioner.style.height = rect.height.toString() + 'px';%0A  this.target_.positioner.style.overflow = 'hidden';%0A
 %7D;%0A

fix wipe