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

RESOLVED DUPLICATE of bug 170778

Status

()

Core
DOM: CSS Object Model
--
major
RESOLVED DUPLICATE of bug 170778
14 years ago
14 years ago

People

(Reporter: James Napolitano, Unassigned)

Tracking

({testcase})

Other Branch
x86
Windows 98
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
.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
(Reporter)

Comment 1

14 years ago
Created attachment 149041 [details]
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.
(Reporter)

Updated

14 years ago
Flags: blocking1.7?
Keywords: testcase

Updated

14 years ago
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).

Comment 3

14 years ago

*** This bug has been marked as a duplicate of 170778 ***
Status: NEW → RESOLVED
Last Resolved: 14 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.
(Reporter)

Comment 5

14 years ago
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.