Closed Bug 244281 Opened 22 years ago Closed 22 years ago

element.style.float not working, gives javascript error "missing name after . operator"

Categories

(Core :: DOM: CSS Object Model, defect)

Other Branch
x86
Windows 98
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 170778

People

(Reporter: mozilla, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

.style.float isn't working for me at all, either to get or set the CSS "float" property. The JS Console gives me the error "missing name after . operator", and points to the "." right before "float". Likely a regression, unless I am doing something obviously wrong. Testcase to follow. Mozilla 1.7rc2 (so it's on the 1.7 Branch) Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040514
Attached file testcase1 —
Testcase. Should bring up an alert box showing the value of div1.style.float, but instead gives a JS error. Can someone else confirm this? Works fine in IE.
Flags: blocking1.7?
Keywords: testcase
Flags: blocking1.7?
Well, there is no float property in the dom css level 2, I guess. See: http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties-cssFloat When you use alert(div1.style.cssFloat); it works (also in Opera7).
*** This bug has been marked as a duplicate of 170778 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Verified. "float" is a reserved word in many languages (JavaScript included!) so the spec doesn't use it, for precisely the reason you found. Note that IE doesn't implement JavaScript but rather JScript; a similar language on the surface, but rather different underneath.
Thanks for the clarification. Sorry about filing an invalid bug. I'll be sure to discuss things like this in the forums from now on before filing. (I had asked on IRC, but got no response).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: