Open Bug 231333 Opened 21 years ago Updated 2 years ago

Unexpected persist when the persisted attribute name contains another

Categories

(Core :: XUL, defect)

defect

Tracking

()

People

(Reporter: phnixwxz1, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

(deleted), application/vnd.mozilla.xul+xml
Details
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.4) Gecko/20030624
Build Identifier: Most recent

For the following element definition:
<window
 id="window"
 persist="abcdefg">

if I execute the following JavaScript:
  document.documentElement.setAttribute('abcde', 'abcde');
  document.documentElement.setAttribute('cdefg', 'cdefg');

attributes 'abcde' and 'cdefg' are all incorrectly persisted in localstore.rdf.

This is caused by the following code in
content/xul/document/src/nsXULDocument.cpp:1163
        if (persist.Find(attr) >= 0) {
            rv = Persist(aElement, kNameSpaceID_None, aAttribute);
            if (NS_FAILED(rv)) return rv;
        }

More presice matching should be used.


Reproducible: Always

Steps to Reproduce:
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Attached file test persist bug (deleted) —
This bug still exists in FireFox 1.0.7.  See attached test case. 
For the first time, all attributes('abcdefg', 'abcde', 'cdefg', 'xyz') have
their assigned values (same as their name).  After alerting, their values are
changed to '1234567', '12345', '34567', '789', respectively.  
When the xul is reloaded, their values should be '1234567', 'abcde', 'cdefg',
'xyz', respectively, which the actual values are '1234567', '12345', '34567', 'xyz'.

The attributes 'abcde' and 'cdefg' are mistakenly persisted.
Assignee: hyatt → nobody
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
QA Contact: shrir → xptoolkit.xul
Hardware: PC → All
Blocks: 251273
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
I confirmed the bug still exists in Firefox 3.6.10 and Minefield 4.0b7pre.
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: