Bug Tracker

Modify

Ticket #11533 (closed bug: plugin)

Opened 15 months ago

Last modified 15 months ago

Normalize css.clip

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

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.

Change History

comment:1 Changed 15 months ago by SineSwiper

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;

comment:2 Changed 15 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to plugin

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.

comment:3 Changed 15 months ago by SineSwiper

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

comment:4 Changed 15 months ago by dmethvin

Neither belong in core?

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.