Closed Bug 309469 Opened 19 years ago Closed 18 years ago

A script placed after non-visible-text or non-form-controls elements before BODY is parsed before they are parsed

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 178258

People

(Reporter: rotemliss, Unassigned)

Details

(Keywords: testcase)

Attachments

(3 files, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.9) Gecko/20050711 Firefox/1.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.9) Gecko/20050711 Firefox/1.0.5

If I have a page with some non-visible-text elements and non-form-controls
elements - even HR or IMG included in this definition, and also the entity
"nbsp" - before a BODY element, and after them I have a script, it will be
parsed before they are parsed, and if it refers them, there will be an error. A
testcase will be attached soon, and I hope it will be clear than this explanation...

Reproducible: Always

Steps to Reproduce:
1. Open the testcase.
2. Ensure you see the text "undefined" in the first message.
3. Ensure you see a reference to a form element in the second message.

Actual Results:  
The reference to the form in the script parsed before the elements, although it
is after them, is undefined. The second, which is in the onload, is OK.

Expected Results:  
The script is parsed after the elements and the both references are OK.
Attached file Testcase (obsolete) —
Attachment #196911 - Attachment description: The first element is in the body - the reference is OK → Testcase with an alright reference - first element is in the body
Attachment #196912 - Attachment description: There is an actual text - the reference is OK → Testcase with an alright reference - actual text before the script
Please test again with a nightly trunk build:
http://mozilla.isc.org/pub/mozilla.org/firefox/nightly/latest-trunk/
I think it works in the latest nightly build (I can see the bug in Mozilla1.7).
(In reply to comment #4)
> Please test again with a nightly trunk build:
> http://mozilla.isc.org/pub/mozilla.org/firefox/nightly/latest-trunk/
> I think it works in the latest nightly build (I can see the bug in Mozilla1.7).

Already fixed indeed. Marking Resolved Worksframe.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
The bug is not completely fixed: although the tags IMG and HR are now like a visible text, with the other tags, even the entity "nbsp", the problem is still exists. I reopen the bug, and updated testcases will be uplodaded soon.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Attached file Testcase
By the way, I checked this on the official Firefox 1.5, downloaded from Mozilla FTP, on Ehad Linux 2006 Test 2 (or Mandriva Linux 2006.0).
Attachment #196910 - Attachment is obsolete: true
Attachment #196911 - Attachment is obsolete: true
Attachment #196912 - Attachment is obsolete: true
Attachment #210359 - Flags: review+
Attachment #210359 - Flags: review+
Attachment #210359 - Attachment is obsolete: true
I suppose that if I can reproduce it both in Windows and in Linux, it is in all the platforms and all the operating systems.
OS: Windows XP → All
Hardware: PC → All
This is a parser bug
With something like this:
<html>
  <head>
  </head>
  <form>
  </form>
  <script>
  </script>
</html

Current Mozilla builds make this DOM:
HTML
  HEAD
    #text:
    SCRIPT
      #text: 
  BODY
    FORM
      #text: 
    #text:

IE6 makes this DOM:
HTML
  HEAD
    TITLE
    FORM
    SCRIPT
  BODY
Status: UNCONFIRMED → NEW
Component: DOM → HTML: Parser
Ever confirmed: true
Keywords: testcase

*** This bug has been marked as a duplicate of 178258 ***
Status: NEW → RESOLVED
Closed: 19 years ago18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: