javascript style.display = "none" does not work on some items

RESOLVED INVALID

Status

()

RESOLVED INVALID
7 years ago
3 years ago

People

(Reporter: olivier.houdas, Unassigned)

Tracking

({qawanted})

8 Branch
x86_64
Windows 7
qawanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

7 years ago
Created attachment 579641 [details]
BugSpanDisplayNone.zip

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Build ID: 20111120135848

Steps to reproduce:

I execuded a script which hides some items and displays some others with 
style.display = "inline"
and
style.display = "none"


Actual results:

it works on some items, but not for all.
In the attached page :
When clicking "Suivant" (right under page 1/3) it should hide page 1 and show only page 2, but it shows both page 1 and 2.
If clicking Suivant under Page 2, then it hides page 2 and shows page 3, but Page 1 remains visible
I added a test in the function which displays and hides items, and FiltrePage1 is detected, so style.display = "none" is applied to that SPAN tag, but it does not have any effect, whereas it has an effect when applied on Page 2 or Page 3.
Look for //DEBUG// in the code of the attached page, and uncomment those lines for this test.


Expected results:

It should show only one page at a time, as it does with Firefox 3.6 and 4.0, with Chrome, with Opera 8 and with IE 4.0, 5.0 and 9.0 (not tested with other versions, but basically, this page has been working everywhere and for a couple of years)
(Reporter)

Comment 1

7 years ago
Created attachment 579642 [details]
the HTML example page with the missing scripts

The HTML example page with the missing scripts (but this did not influence reproducing the bug, it only triggered warnings when trying in IE 9.0).
Attachment #579641 - Attachment is obsolete: true

Comment 2

7 years ago
Confirmed working as described in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24 ID:20111103063747

See failure in Mozilla/5.0 (Windows NT 5.1; rv:11.0a1) Gecko/20111207 Firefox/11.0a1 ID:20111207031110

No errors in error console...
This could use both a simplified testcase (attached to the bug, single file) and a regression window.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Whiteboard: regressionwindow-wanted,qawanted

Updated

7 years ago
Keywords: qawanted, regressionwindow-wanted
Whiteboard: regressionwindow-wanted,qawanted
Attachment #579642 - Attachment mime type: application/octet-stream → application/zip
(Reporter)

Comment 4

7 years ago
Further analysis :
It is the HTML tag
<P ALIGN='CENTER'>
which screws up the behavior.

See attached simplified page (removing the line "<P ALIGN='CENTER'>" makes it work correctly)
(Reporter)

Comment 5

7 years ago
Created attachment 582198 [details]
Simplified page (removed most of the HTML not useful to demonstrate the bug)
The page has this markup (with the irrelevant parts removed):

  <p>
    <span>
      <a><h2></h2></a>
      <table>...</table>
    </span>

An HTML5-compliant parser closes the <p> when it sees the <h2>, so the DOM looks like this:

  P
   SPAN
    A
  H2
   A
  TABLE

and so forth.  In particular, the table there is no longer contained in the span, so changing display styles on the span does absolutely nothing to hide it.  This is almost certainly a behavior change from the old parser, and almost certainly purposeful.

The page should be using <div>, not <span> for things that are meant to contain blocks.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Component: Layout → HTML: Parser
QA Contact: layout → parser
Resolution: --- → INVALID
Unsurprisingly, other browsers that implement the HTML5 parsing algorithm have the same behavior.
Keywords: regressionwindow-wanted
You need to log in before you can comment on or make changes to this bug.