#1372 new
Victor

Element.clonePosition uses border-box-width/border-box-height

Reported by Victor | August 23rd, 2012 @ 06:15 PM

Element.clonePosition uses border-box-width and border-box-height to calculate dimensions of source element, but sets width and height of content.

In other words, it uses border-box model to get dimensions from source, but uses content-box model to set dimensions on target.

Example: http://jsfiddle.net/S6exj/ - DIVs will have different width after clonePosition().

In this example clonePosition() calculates width of source element including its content, padding and border (50px content + 2 x 5px padding + 2 x 1px border = 62px), and sets content-width of target to that value, but target itself has its own padding and border, and its resulting border-box-width will be not 62px but 74px. Cloning element's width and height becomes non-trivial task.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages