Bug Tracker

Modify

Ticket #9928 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

css selector reports wrong value for width

Reported by: RobertDeRose@… Owned by: RobertDeRose@…
Priority: low Milestone: None
Component: css Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

Test on jQuery 1.6.2

if this === ​'ul' element

var originalList = $(this);
var pages = originalList.children();
var width = originalList.parent().css('width');

and it's parent === 'div style="width:100%"'

it returns 100px instead of 100%

tested against 1.5.2, and it does the correct thing and returns 100%

Change History

comment:2 Changed 3 years ago by rwaldron

  • Owner set to RobertDeRose@…
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to css

Is this occurring in a particular browser? I can't reproduce it in Chrome:  http://gyazo.com/e4817cb5bacd4b1c4ba4971fe84b2f17.png

comment:3 Changed 3 years ago by RobertDeRose@…

  • Status changed from pending to new

That is the behavior that is unexpected... if the style sheet says 100% shouldn't it return 100% not the rendered pixel size?

in 1.5.2 it does return the 100% not the rendered pixel size.

If this was a documented change, I missed it, sorry

comment:4 Changed 3 years ago by rwaldron

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

jQuery normalizes all css property values into their pixel value.

comment:5 Changed 3 years ago by rwaldron

#9945 is a duplicate of this ticket.

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.