Bug Tracker

Modify

Ticket #12324 (closed bug: fixed)

Opened 21 months ago

Last modified 20 months ago

cssNormalTransform can produce wrong values

Reported by: anonymous Owned by: mikesherov
Priority: high Milestone: 1.8.1
Component: css Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:

Description

In jQuery 1.8 there is an cssNormalTransform property that holds numerical default values for CSS properties whose “computed style” evaluates to “normal”. These fixed values may be just wrong in some cases. E.g. for “line-height” the CSS spec clearly states that the the computed value in such a case is “normal” and the user agent can choose a “reasonable” value. Values between 1.0 to 1.2 are recommended.

In most cases the value may be 1.0. But for some elements (e.g. <textarea>) it is different in most browsers.

The same may be true for “line-height”.

jQuery should just return “normal” in these cases (as it did in previous versions).

Change History

comment:1 Changed 21 months ago by mikesherov

  • Owner set to anonymous
  • Status changed from new to pending
  • Component changed from unfiled to css

Can you provide a test case that proves line-height is wrong in certain cases?

comment:2 Changed 20 months ago by anonymous

  • Status changed from pending to new

Okay, here’s a test case:  http://jsfiddle.net/u9yV9/ As you can see, jQuery calculates the “line-height” as “1”. When you hover the textarea with the mouse, “line-height: 1” is explicitly set via CSS. If jQuery was correct, there should be no noticeable difference, but you can see that the actual line height changes.

comment:3 Changed 20 months ago by mikesherov

  • Owner changed from anonymous to mikesherov
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Milestone changed from None to 1.8.1

Thanks! Fix to come shortly.

comment:5 Changed 20 months ago by Mike Sherov

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix #12324, line-height "normal" isn't always "1". Close gh-898.

Changeset: 9f86dc922ed832337d246d7baf8fd397dc837346

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.