Skip to main content

Bug Tracker

Side navigation

#11533 closed bug (plugin)

Opened March 29, 2012 10:14PM UTC

Closed March 29, 2012 10:55PM UTC

Last modified March 30, 2012 01:59PM UTC

Normalize css.clip

Reported by: SineSwiper Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

The $.css('clip') command is not normalized across browsers. The "getClip" code found here should be implemented within jQuery to make sure it works in IE and others.

Furthermore, the clipTop/Bottom/Left/Right properties should also be normalized in the other direction, so that they can easily by used in animate operations.

Attachments (0)
Change History (4)

Changed March 29, 2012 10:20PM UTC by SineSwiper comment:1

Here is an optimized code block

      return (!elem.style.clip && elem.currentStyle) ?
         // IE refuses to return 'clip'
         // but has no problem with 'clipTop' and the likes
         // This unpleasantness reconstructs what a "good" browser would return
         'rect('
         + elem.currentStyle.clipTop    + ', '
         + elem.currentStyle.clipRight  + ', '
         + elem.currentStyle.clipBottom + ', '
         + elem.currentStyle.clipLeft   + ')'
      : elem.style.clip;

Changed March 29, 2012 10:55PM UTC by dmethvin comment:2

resolution: → plugin
status: newclosed

I think the pattern to be followed here is the color plugin. We don't need to add this to core, it's not a common need.

Changed March 30, 2012 01:59PM UTC by SineSwiper comment:3

What does the color plugin have to do with the clip property?

Changed March 30, 2012 01:59PM UTC by dmethvin comment:4

Neither belong in core?