Closed Bug 1311168 Opened 8 years ago Closed 8 years ago

Handle DocumentFragment in Reps

Categories

(DevTools :: Shared Components, defect, P2)

49 Branch
defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

STR:
1. Open the console
2. Enter ```
var docfrag = document.createDocumentFragment();
var browserList = ["Internet Explorer", "Firefox", "Safari",
    "Chrome", "Opera"];
browserList.forEach(function(e, i) {
  var li = document.createElement("li");
  li.textContent = e;
  li.id = "li-" + i;
  li.classList.add("list-element");
  docfrag.appendChild(li);
});
console.log(docfrag);```

Expected result : 
DocumentFragment is displayed like an array, i.e. `DocumentFragment [<li>, <li>, ...]`

Actual result : 
It looks like it is rendered by the Grip rep, and displays `DocumentFragment {}`
There doesn't seem to be a rep made specifically for DocumentFragment... Which rep should handle this?
Flags: needinfo?(chevobbe.nicolas)
It should be handled by GripArray (http://searchfox.org/mozilla-central/source/devtools/client/shared/components/reps/grip-array.js).
BTW, I already made the change, I'm waiting on Bug  1307938 to land (which should be soon, since there's a patch waiting for review), so I can write meaningful tests ( without 1307938 , nodes are displayed as object, e.g.  HTMLBodyElement instead of <body> ).
Flags: needinfo?(chevobbe.nicolas)
Status: NEW → ASSIGNED
Comment on attachment 8807754 [details]
Bug 1311168 - Handle document fragment in grip array rep;

https://reviewboard.mozilla.org/r/90796/#review91164

Thanks for the patch, looks great to me!


Just one nit: the commit message is like follows:
Bug 1311168 - Handle document fragment in grip array rep. r=Honza;

While it should be rather like so (not the semicolon position):
Bug 1311168 - Handle document fragment in grip array rep; r=Honza


Honza
Attachment #8807754 - Flags: review?(odvarko) → review+
(In reply to Jan Honza Odvarko [:Honza] from comment #4)
> Comment on attachment 8807754 [details]
> Bug 1311168 - Handle document fragment in grip array rep. ;
> 
> https://reviewboard.mozilla.org/r/90796/#review91164
> 
> Thanks for the patch, looks great to me!
> 
> 
> Just one nit: the commit message is like follows:
> Bug 1311168 - Handle document fragment in grip array rep. r=Honza;
> 
> While it should be rather like so (not the semicolon position):
> Bug 1311168 - Handle document fragment in grip array rep; r=Honza
> 
> 
> Honza

I'll amend the commit message, thanks for the review :)
Pushed by chevobbe.nicolas@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e852aef463a6
Handle document fragment in grip array rep; r=Honza
https://hg.mozilla.org/mozilla-central/rev/e852aef463a6
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: