Opened 10 years ago

Closed 4 years ago

#8543 closed enhancement (wontfix)

implied units of measurement for absolutely positioned elements in ie (but not ff or safari)

Reported by: ptwobrussell Owned by: Eugene Lazutkin
Priority: high Milestone: 1.11
Component: HTML Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

I noticed tonight that IE (7) allows you omit units of measurement when styling something that is absolutely positioned. So you can say:

dojo.style("foo", {
  position : "absolute",
  top : 200 //ok to omit units for ie. it assumes pixels
});

For Firefox (3) and Safari (latest) however, you have to provide an explicit unit of measurement -- which in the previous case means providing "200px" for "top". If you don't provide those units of measurements, the style simply does not apply at all and you're left wondering where your node is at (which in many/most cases, it simply won't even be visible on the screen.)

To put an interesting twist on this though - FF and Safari did accept an integer value without the "px" when in quirks mode, but when providing a strict doctype, they did not. So, I guess that makes sense...sort of.

I recommend we provide the "px" implicitly whenever someone is using dojo.style for an absolutely positioned elements. This seems like one of those edge cases that Dojo should be eliminating across the board.

If this seems reasonable, I can provide the patch -- hopefully won't add too many bytes to Base.

Change History (5)

comment:1 Changed 10 years ago by bill

Component: CoreHTML
Owner: changed from anonymous to sjmiles

comment:2 Changed 10 years ago by James Burke

Milestone: tbdfuture

I would be concerned about the size of a patch to fix this: we would have to detect all style values that accept px values? Feel free to work up a patch, but it feels heavyweight.

At the very least though, a doc update seems in order.

comment:3 Changed 10 years ago by James Burke

(In [16518]) Refs #8543: doc update for note about pixel values. \!strict

comment:4 Changed 7 years ago by bill

Owner: changed from sjmiles to Eugene Lazutkin
Status: newassigned

Eugene, should we wontfix this one?

comment:5 Changed 4 years ago by dylan

Milestone: future1.11
Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.