Closed
Bug 157984
Opened 24 years ago
Closed 24 years ago
Javascript/DOM "setting a property that has only a getter" javascript error for style.left and style.top
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: info, Assigned: jst)
Details
Attachments
(1 file)
|
1.24 KB,
text/html
|
Details |
Mozilla 1.0
Error occurs when trying to set
document.getElementById('layername')style.left = value;
and the same with style.top
I only present this error because it works fine in Netscape 6,
but produces the "setting a property that has only a getter" error in venkman.
Comment 1•24 years ago
|
||
->DOM Style
Could you provide a small attached testcase?
URL: general
Component: JavaScript Engine → DOM Style
Comment 2•24 years ago
|
||
Setting default owner and QA -
info@moabutah.com:
1. Could you paste the exact error you're seeing in Venkman?
2. Could you attach a reduced testcase via the "Create a New Attachment"
link above?
Thanks, that will speed things along -
Assignee: rogerl → jst
QA Contact: pschwartau → ian
Comment 3•24 years ago
|
||
info@moabutah.com reports:
"Sorry guys, its sort of a false alarm :-(
When preparing the test document for you I noticed that the
HTML comment at the top of the document which produced the error
had some arbitrary HTML code in it (not sure how that happened)
i.e.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4<br><br> 01 Transitional//EN">
A layer was over this text (which became viewable in the page)
and I didn't see it.
Strangely, this did not affect anything in Netscape or MSIE.
And most of the JS functions in the document still worked except
the ones in the attached test document"
------------
I will attach this HTML file below -
Comment 4•24 years ago
|
||
Comment 5•24 years ago
|
||
I can confirm that with the error in the <!DOCTYPE tag, the
<div> in the testcase does not move.
With the error removed, however, the <div> moves fine.
Therefore resolving this bug as invalid.
info@moabutah.com: thank you for diagnosing this one for us,
and for providing a testcase -
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Comment 6•24 years ago
|
||
Um... I don't see any errors when clicking the buttons in that attachment....
The error in the doctype should _not_ have triggered JS errors...
Comment 7•24 years ago
|
||
Ah. Nevermind. There were no errors thrown; just lack of movement.
That behavior is correct, and here is the reason. The code basically does:
foo.style.left = 180;
This is not actually valid, since the "180" must be treated as a CSS length and
CSS lengths must have a unit on them (eg "180px"). However in _quirks_ mode we
allow such a construct.
The malformed doctype is treated as an unknown doctype and puts us in standards
mode, in which the invalid CSS is ignored. Correcting the doctype results in a
doctype that puts us in quirks mode, so things work.
Verified invalid.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•