listStyleImage not directly updated

VERIFIED FIXED in M12

Status

()

Core
DOM: CSS Object Model
P3
normal
VERIFIED FIXED
19 years ago
16 years ago

People

(Reporter: martin.honnen, Assigned: Pierre Saslawsky)

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [TESTCASE])

Attachments

(4 attachments)

(Reporter)

Description

19 years ago
I used a STYLE with a
  list-style-image
which worked. When trying to change that image with
  elementRef.style.listStyleImage = 'url(someImage.gif)';
the change got only shown after I changed the display property of the
containing list element to
  none
and then back to block. Complete example

<HTML>
<HEAD>
<STYLE>
#aListItem {
  list-style-image: url(plus.gif);
}
</STYLE>
<SCRIPT>
function changeImage () {
  var aListItem = document.getElementById('aListItem');
  aListItem.style.listStyleImage =
    aListItem.style.listStyleImage.indexOf('minus.gif') != -1 ? 'url(plus.gif)'
: 'url(minus.gif)';
  alert(aListItem.style.listStyleImage);
}
</SCRIPT>
</HEAD>
<BODY>
<UL ID="aUL">
<LI ID="aListItem">
Kibology for all.
</LI>
</UL>
<BUTTON ONCLICK="changeImage ()">
change image
</BUTTON>
<BUTTON ONCLICK="var aUL = document.getElementById('aUL'); aUL.style.display =
'none'; aUL.style.display = 'block';">
change display of list
</BUTTON>
</BODY>
</HTML>
(Reporter)

Comment 1

19 years ago
Created attachment 737 [details]
image for bug demo
(Reporter)

Comment 2

19 years ago
Created attachment 738 [details]
image for bug demo
(Reporter)

Comment 3

19 years ago
Created attachment 739 [details]
bug demo (see earlier comment for description)

Comment 4

19 years ago
Created attachment 1070 [details]
Combined prev. attachments into a single testcase

Updated

19 years ago
Whiteboard: [TESTCASE]
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
Works now, with Sept 14 build (Linux).

I get:

JavaScript Error: uncaught exception: [Exception... "Component does not have
requested interface"  code: "-2147467262" nsresult: "0x80004002
(NS_NOINTERFACE)"  location: "file:///home/shaver/mozilla/tests/8679/8679.html
Line: 10"]

when I click the "change image" button, but the image changes.  Line 10 is:
  var aListItem = document.getElementById('aListItem');
but that's almost certainly not where the error's occuring, because the style
change that follows is executed.  If I take out
    alert(aListItem.style.listStyleImage);
I don't get the error, so I think that's the problem.

I'm marking this fixed; let's deal with the exception later.

Updated

19 years ago
Status: RESOLVED → REOPENED

Comment 6

19 years ago
It seems to be fixed when using DOM to change the list-style-image property, but
when the className property is changed to a another class with a different
list-style-image, this bug is creeps up again.

See:
http://m1.aol.com/supersamat/dom/toc/table-of-contents.htm
and for a screenshot'ed explanation if not understood:
http://m1.aol.com/supersamat/dom/toc/moz-bug/liststyleimage.html

I've only tested on Win32. I did not feel like filing a new bug since this is
just a variation of 8862 (this one).

Updated

19 years ago
Resolution: FIXED → ---
Target Milestone: M12

Comment 7

19 years ago
Clearing FIXED resolution due to reopen.

Comment 8

19 years ago
Assigning to Pierre, the new style system owner. Changing the className should,
especially in this case, cause recreation of frames for the element. Pierre,
feel free to discuss this with me when you get to it.
Assignee: vidur → pierre
Status: REOPENED → NEW
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 9

19 years ago
Fixed checked in nsGenericHTMLElement.cpp v1.136 per Vidur's suggestion.
Component: DOM Level 2 → DOM Style
Taking QA Contact on all open or unverified DOM Style bugs...
QA Contact: vidur → ian
seems to work now
Status: RESOLVED → VERIFIED
For the record, the fix for this bug was completely incorrect and just blew away
everything for class attribute changes instead of using the correct style change
mechanisms.  The correct fix was made in bug 21225.
You need to log in before you can comment on or make changes to this bug.