Closed Bug 161452 Opened 22 years ago Closed 21 years ago

Twisty icon remains after deleting all its children

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: yuanyi21, Assigned: yuanyi21)

References

Details

Attachments

(1 file, 1 obsolete file)

Steps:
1. open manage bookmars
2. create a folder named "a"
3. create a folder named "b" under "a"
4. remove b

actual result: "a" still has a twisty icon.

expected result: twisty icon should disappear.

same problem in addressbook.
Attached patch proposed patch (obsolete) — Splinter Review
Keywords: patch
Jan, could you spare some to review this?
Keywords: nsbeta1, review
I see this in two other places. Will this patch address those as well?

1) Have a MailNews window open in threaded news connected to an IMAP server.
Delete the children of a threaded message with another IMAP client (maybe moz
running on a different computer, maybe a web client, etc). Observe that even
though there is only one message left in the "thread" a non-functional twisty
remains behind.

2) Read news in Show Only Unread mode with threads turned on. Read all the
messages in the thread. Collapse all threads "/" Observe there is one read
message with a non-functional twisty left over in the thread.
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
Eric, this patch only affects default views; the thread pane is a custom view
and many issues it has are specific to that implementation.
Comment on attachment 94310 [details] [diff] [review]
proposed patch

Interestingly hidden just below the bottom of the patch is a comment suggesting
almost exactly what is done, although the code would have to change slightly if
it was to be placed there. Also you probably only need to invalidate the parent
row's primary cell (although you probably copied that mistake from somewher
else). And you misspelled the first "Its". As for the first change, it looks
right to make the test match the comment. Note again that this test is done
after the content is removed.
Neil, thanks for the review. This patch is over a year, I can not recall the
detail of those tricky code. Feel free to take it.
ccing neil.
Comment on attachment 94310 [details] [diff] [review]
proposed patch

The attachment is incorrect, it should be clearing the Fill flag, not the other
two, anyway I tried this on bookmarks and it failed because of a bug in
bookmarks, and I spent ages hunting it down :-(
Attachment #94310 - Flags: review?(varga) → review-
Attached patch Corrected patchSplinter Review
Attachment #94310 - Attachment is obsolete: true
Attachment #131894 - Flags: review?(varga)
Comment on attachment 131894 [details] [diff] [review]
Corrected patch

This looks much cleaner
r=varga
Attachment #131894 - Flags: review?(varga) → review+
Attachment #131894 - Flags: superreview?(dveditz+bmo)
*** Bug 88273 has been marked as a duplicate of this bug. ***
*** Bug 73827 has been marked as a duplicate of this bug. ***
*** Bug 221263 has been marked as a duplicate of this bug. ***
The nsTreeRows.h and nsXULTreeBuilder.cpp changes seem pretty straightforward --
what does the nsXULContentBuilder.cpp change fix?
The comment correctly describes what we want to happen i.e. always call
SetContainerAttrs. Perhaps if I quote from nsXULContentBuilder.cpp?
        if (aNewMatch) {
            // If there's no new match, then go ahead an update the
            // container attributes now.
            SetContainerAttrs(content, aOldMatch);
        }
    }

    if (aNewMatch) {
        // Get the content node to which we were bound
        Value value;
        PRBool hasassignment =
            aNewMatch->mAssignments.GetAssignmentFor(mContentVar, &value);

        NS_ASSERTION(hasassignment, "no content assignment");
        if (! hasassignment)
            return NS_ERROR_UNEXPECTED;

        nsIContent* content = VALUE_TO_ICONTENT(value);

        // Update the 'empty' attribute. Do this *first*, because
        // we may decide to nuke aNewMatch in a minute...
        SetContainerAttrs(content, aNewMatch);
Attachment #131894 - Flags: superreview?(dveditz+bmo) → superreview?(bryner)
Attachment #131894 - Flags: superreview?(bryner) → superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 117856 has been marked as a duplicate of this bug. ***
*** Bug 148538 has been marked as a duplicate of this bug. ***
*** Bug 199352 has been marked as a duplicate of this bug. ***
*** Bug 217056 has been marked as a duplicate of this bug. ***
*** Bug 122075 has been marked as a duplicate of this bug. ***
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: