Closed Bug 587147 Opened 14 years ago Closed 14 years ago

Group view fails to work after inspecting the second element

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: msucan, Assigned: msucan)

References

Details

(Whiteboard: [kd4b5])

Attachments

(1 file)

STR: 1. Open a web page. 2. Open the Inspector. 3. Click an element. 4. Open a group in the style panel. 5. Inspect another element. 6. Try to reopen the same group in the style panel. Expected result: the group is open. Actual result: the group fails to open.
Attached patch fix + test code (deleted) — Splinter Review
This patch fixes the bug and provides automated test code for the group view expand/collapse functionality. A note on the fix: The styleGroup views were only created once, when the CssHtmlTree object was constructed. However, the #groups element is cleared each time the user highlights a new element in the page (see the _populateMainTemplates() method which invokes the _template() method, that clears the destination element each time - in this case #groups). This resulted in having stale DOM elements that were no longer displayed, because they were not re-added. My fix is minimal in its intent: I simply moved the createStyleGroupView() method call in the highlight() method - no code re-org, no major changes. A more elaborate fix would be to improve the code to no longer need a whole UI rebuild each time the user highlights a new element in the web page. This could be done nicely - we could only rebuild the properties view within each styleGroupView, when they already exist. If you want the more elaborate approach, please let me know and I'll update the patch.
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Attachment #465985 - Flags: feedback?(jwalker)
Let's stick with the simple fix. Joe is not around to provide feedback now.
Whiteboard: [kd4b5]
Attachment #465985 - Flags: feedback?(jwalker) → feedback?(rcampbell)
Comment on attachment 465985 [details] [diff] [review] fix + test code I think this looks reasonable. I am a fan of the test code!
Attachment #465985 - Flags: feedback?(rcampbell) → feedback+
I have merged this fix into the main patches from bug 582596.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: