It's possible to create new <body> elements by editing <head> as HTML

Assigned to


3 years ago
4 months ago


(Reporter: arni2033, Assigned: kshitijakarkar)



Firefox Tracking Flags

(Not tracked)


(Whiteboard: [btpp-backlog], URL)


(1 attachment)



3 years ago
Created attachment 8700786 [details]
testcase 1 - add [div] after [style] to get new [body] elements.htm

>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20151221030239
1. Open page "testcase 1" or "data:" url in the form above
2. Open devtools -> Inspector
3. Right-click <head> in markup view, click "Edit as HTML"
4. Click between "</style>" and "</head>", type "<div>" without quotes. Press Ctrl+Enter to save
5. Repeat Steps 3-4 several times

Result:       New <body> is created after Step 4 every time
Expectations: No new <body> elements


3 years ago
Attachment #8700786 - Attachment description: 2015.12.22 01-18-12.htm → testcase 1 - add [div] after [style] to get new [body] elements.htm


3 years ago
Has STR: --- → yes

Comment 1

3 years ago
yes new body is created every time.
Triaging. Filter on CLIMBING SHOES.
Ever confirmed: true
Priority: -- → P3
Whiteboard: [btpp-backlog]

Comment 3

3 years ago
I want to solve for this bug. Can you help me on how should I approach for it?
(In reply to kshitija from comment #3)
> I want to solve for this bug. Can you help me on how should I approach for
> it?
First of all, make sure you go through our contribution guide here:
And once you have the dev environment set up, make sure you are able to make changes, build, and test your changes.
Once that's in place, you'll be able to work on a fix.
The file where the HTML is changed is: /devtools/server/actors/inspector.js and in particular, the method called `setOuterHTML`.
You can browse the code online too using the DXR tool, here is a link to this method:
As you can see, there's a comment in this method about "special cases". I'm guessing that this bug is yet another special case that should be handled somehow in this code.
Brian (bgrins) worked on this feature originally, so he will be able to help you much better than me on this.
I suggest you try and investigate this issue first a little bit and then come back with questions here by setting the "need info" flag to bgrins.
Assignee: nobody → kshitijakarkar


4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.