Closed Bug 289741 Opened 20 years ago Closed 20 years ago

moving div with javascript does not work with doctype html 4.01

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Assigned: bugzilla)

References

()

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

When using the doctype for html 4.01 (<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">) the javascript
for moving 2 div's won't work.
http://krijn.net/new/temp.html and http://krijn.net/new/temp2.html have exactly
the same source, but with one difference. the first one has no doctype. The
javascript works fine. At temp2 there is a doctype, and the exact same code
doesn't work.
Tried comments before the doctype, but that didn't fix the problem.

Reproducible: Always

Steps to Reproduce:
1. Go to the url's in the details section
2. Press the button at both sites
3. Notice how the code works @ temp, but not @ temp2

Actual Results:  
Without doctype the javascript works, with doctype html 4.01 it doesn't.

Expected Results:  
Moved the two divs

Default theme. Bug in 1.0 / 1.0.1 / 1.0.2 maybe earlier
Attached file not working file (obsolete) —
This is the file working
Comment on attachment 180221 [details]
not working file

this file doesn't work. outcomment the doctype and it does.
Attachment #180221 - Attachment description: working file → not working file
The doctype controls whether or not the page gets rendered using quirks mode, so
that is the reason there is a different behavior. Whether or not this is a bug,
I don't know. Could you attach a _reduced_ test case that shows what works and
what doesn't?
Attached file small testcase
Small testcase with one direction. Outcomment doctype for working page.
Attachment #180221 - Attachment is obsolete: true
When you use 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

you will need to define the units of the position, eg:

document.getElementById('object').style.left= variable + "px";

works fine

I have no idea if this is intended bahaviour.
yes, in standards compliance mode the units are required. --> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: