Attribute value change sometimes works, some not, using DOM to alter the value

RESOLVED FIXED

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: fgarcia, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061008 Minefield/3.0a1

I am performing a generic DOM processing for the content of HTML documents. I insert placeholders for values in the document and dynamically change them when the document is loaded. I find that the values of certain elements are not processed, when similar values have been processed before.

In order to simplify the report I have simulated the work I am trying to do in the following example (see test case). It is a HTML document with two input text fields, a span surrounding a list, and again the same input text fields (with different ids and names).

<html>
  <head> ... script comes here ... </head>

  <body onLoad=process()>
    <input id="inp1" name="textfield" type="text" value="[name]">&nbsp;&nbsp;&nbsp;
    <input id="inp2" name="age" type="text" value="[age]" size="3"><br>

    <span id="sp1"> 
      <ul>
        <li>One car</li>
        <li>Two cars</li>
        <li>Three cars</li>
      </ul>
    </span>
    
    <!-- Uncomment this and comment the previous span. Then you will not experiment the wrong behaviour -->
    <!--<span id="sp1"> Something to talk about later </span> -->
	
    <br>
    <input id="inp3" name="textfield1" type="text" value="[name]">&nbsp;&nbsp;&nbsp;
    <input id="inp4" name="age1" type="text" value="[age]" size="3">
  </body>
</html>

You can see the script I am using in the attached testcase (you can consider it is over-elaborated, but as I have commented before, the example I am showing is a simplification of the original, and the original must be processed in that way)

The fact is that the value of the inputs 'inp3' and 'inp4' seem not to change. But looking at the generated source you can see that the inputs have the new values, but they are not displayed. Moreover, clicking the reset button, you can see the new values in the inputs.

Things become stranger if you change the content of the span tag (comment span in line 60 and uncomment span in line 69.) If the span tag does not contain a list but a simple text, then the document is displayed as expected.      

I cannot understand why the type of content of the span between the two set of input text fields alters the way the second set is displayed.

The problem appears in Firefox, Mozilla and Netscape.



Reproducible: Always

Steps to Reproduce:
1. Open the test case (you will see the problem)
2. Comment span in line 60 and uncomment span in line 69
3. You will see the expected correct behaviour

Actual Results:  
I see:

Adam   28
      
•	One car 
•	Two cars 
•	Three cars 

[name]   [age]   Reset

Expected Results:  
Adam   28
      
•	One car 
•	Two cars 
•	Three cars 

Adam   28   Reset
(Reporter)

Comment 1

11 years ago
Created attachment 241710 [details]
Test case
Confirming - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061007 SeaMonkey/1.5a

Not quite sure what's going on here; the values in DOM Inspector reflect the new settings.  This might be a layout issue...
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

11 years ago
Keywords: clean-report, testcase
(Reporter)

Comment 3

11 years ago
Perhaps it is usefull for you to Know that I have checked the test case against several versións of Netscape, Mozilla and Firefox (always on Windows 2000 Professional SP4) and the bug appears from the following versions:
- Netscape: from version 7.2 (6.01, 6.1, 6.2, 6.2.1, 6.2.2, 6.2.3, 7.0, 7.01, 7.02, 7.1 OK)
- Mozilla: from version 1.6 (1.4, 1.4.1, 1.5 OK)
- Firefox: from version 0.8

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
This was fixed by the fix for bug 424698.

The reason there is a dependency on the <span>s is that you have a block-inside-inline construction, which causes a lot more layout object recreation of the sort discussed in bug 424698.

As far as comment 2 goes, what was happening was a pure DOM issue.  There is a difference between the value attribute (which DOM inspector shows) and the value DOM property (which is what the control displays).
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Depends on: 424698
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.