Closed Bug 46124 Opened 25 years ago Closed 23 years ago

Div doesn't repaint properly after changing its innerHTML

Categories

(Core :: Layout, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED WORKSFORME
Future

People

(Reporter: muteki, Assigned: kmcclusk)

Details

Attachments

(1 file)

I have tested the attached code with today's build (ID=2000072108), and it is failing to repaint the screen properly. Reproducible: Always Steps to reproduce: 1. Load the attached test case 2. notice only one line of text ("bababa") is shown 3. make the window invisible (minimize, put another window on the top...etc) 4. bring the window up again, notice three lines of text are shown now. <HTML> <!-- Prevent caching --> <META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <HEAD> <!-- Style definitions --> <STYLE type="text/css"> #area0 { position:absolute; visibility:visible; top:76; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} #area1 { position:absolute; visibility:visible; top:179; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} #area2 { position:absolute; visibility:visible; top:282; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} span.black { color:black;} </STYLE> <SCRIPT language="JavaScript"> <!-- function rewriteLayer (idOrPath, html, style) { var m_html = ""; if (style != null) { m_html += '<SPAN class="'+style+'">'; m_html += html; m_html += '</SPAN>'; } else m_html += html; if (document.layers) { var l = idOrPath.indexOf('.') != -1 ? eval(idOrPath) : document[idOrPath]; if (!l.ol) { var ol = l.ol = new Layer(l.clip.width, l); ol.clip.width = l.clip.width; ol.clip.height = l.clip.height; ol.bgColor = l.bgColor; l.visibility = 'hide'; ol.visibility = 'show'; } var ol = l.ol; ol.document.open(); ol.document.write(m_html); ol.document.close(); } else if (document.all || document.getElementById) { var p = idOrPath.indexOf('.'); var id = p != -1 ? idOrPath.substring(idOrPath.lastIndexOf('.') + 1) : idOrPath; if (document.all) { document.all[id].innerHTML = m_html; } else { var l = document.getElementById(id); var r = document.createRange(); r.setStartAfter(l); var docFrag = r.createContextualFragment(m_html); while (l.hasChildNodes()) l.removeChild(l.firstChild); l.appendChild(docFrag); } } } function SetScrollPos() { rewriteLayer('area0', 'bababa', 'black'); rewriteLayer('area1', 'kakaka', 'black'); rewriteLayer('area2', 'lalala', 'black'); } window.onload = SetScrollPos; //--> </SCRIPT> </HEAD> <BODY BGCOLOR='#BBBBBB'> <DIV ID="area0"></DIV> <DIV ID="area1"></DIV> <DIV ID="area2"></DIV> </BODY> </HTML>
Attached file HTML from first post
Attachment created, document.layers stripped because we don't support that. Works for me using 2000072508 win98 - NOTE: mozilla does not support innerHTML nor document.all
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
I have tested the code with 2000072608 build on NT4, and it's still failing to repaint the screen. I have simplied the code as the following. <HTML> <!-- Prevent caching --> <META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <HEAD> <!-- Style definitions --> <STYLE type="text/css"> #area0 { position:absolute; visibility:visible; top:76; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} #area1 { position:absolute; visibility:visible; top:179; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} #area2 { position:absolute; visibility:visible; top:282; left:37; width:88; height:20; color:lightgray; clip:rect(0,88,20,0);} span.black { color:black;} </STYLE> <SCRIPT language="JavaScript"> <!-- function rewriteLayer (idOrPath, html, style) { var m_html = ""; if (style != null) { m_html += '<SPAN class="'+style+'">'; m_html += html; m_html += '</SPAN>'; } else m_html += html; if (document.getElementById) { var p = idOrPath.indexOf('.'); var id = p != -1 ? idOrPath.substring(idOrPath.lastIndexOf('.') + 1) : idOrPath; var l = document.getElementById(id); var r = document.createRange(); r.setStartAfter(l); var docFrag = r.createContextualFragment(m_html); while (l.hasChildNodes()) l.removeChild(l.firstChild); l.appendChild(docFrag); } } function SetScrollPos() { rewriteLayer('area0', 'bababa', 'black'); rewriteLayer('area1', 'kakaka', 'black'); rewriteLayer('area2', 'lalala', 'black'); } window.onload = SetScrollPos; //--> </SCRIPT> </HEAD> <BODY BGCOLOR='#BBBBBB'> <DIV ID="area0"></DIV> <DIV ID="area1"></DIV> <DIV ID="area2"></DIV> </BODY> </HTML>
Status: RESOLVED → UNCONFIRMED
Priority: P3 → P2
Resolution: WORKSFORME → ---
Reproduced bug from attachment on build 2000072520, Win NT. Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Looks like a painting problem, Kevin, could you have a look, I see this if on WinNT if I load the attachment and then reload it, looks like a paint event is either dropped on the floor or not generated at all, or something like that.
Assignee: clayton → kmcclusk
This bug has been marked "future" because the original netscape engineer working on this is over-burdened. If you feel this is an error, that you or another known resource will be working on this bug,or if it blocks your work in some way -- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
massive update for QA contact.
QA Contact: petersen → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
Reporter, is this still happening? When I load the first testcase (#11931), I see three text lines, when I minimize then restore, I still see three lines. I'm using build 2001021304 on win95. Also works for Boris Zbarsky on build 2001021204 linux. Suggest worksforme.
Also works for me now, W2K build 2001022311. (I have seen this problem on earlier builds)
Need QA on Mac before I can mark this bug worksforme. CC'ing bhart, thanks man.
Keywords: qawanted
WORKSFORME Mac OS 8.6 build 2001022304. I agree that this shoudl be marked WFM.
Resolving as WORKSFORME. Thanks Bradley and ajbanck. Reporter, please reopen if you still see this in recent nightlies, thanks.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago24 years ago
Keywords: qawanted
Resolution: --- → WORKSFORME
qa contact updated.
QA Contact: gerardok → bsharma
Verified on: build: 2001-04-09-11-Mtrunk Platform: Win 2000 All the lines are visible on first load. But, when I do "Reload" only first line is displayed.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
WFM Win2K/2001070604-trunk
SPAM. HTML Element component deprecated, changing component to Layout. See bug 88132 for details.
Component: HTML Element → Layout
WORKSFORME, today's linux CVS. Closing. Reopen if spotted again.
Status: REOPENED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → WORKSFORME
QA Contact: bsharma → moied
Verified WFM with build ID 20020307 on winxp
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: