Bug 74755
Summary: | Web Inspector: Make HTML editable in Resources panel | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <me> |
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | apavlov, burg, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, yurys |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Nikita Vasilyev
Would be nice to be able edit HTML the save way as JS (Chrome only) and CSS.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Timothy Hatcher
What would editing the HTML do on save? A full reload?
Nikita Vasilyev
A full reload would discard all changes unless we save them somewhere. I don't see how it's going to work.
1. The simple solution.
Don't reload anything. Create a revision for a file, fire onResourceContentCommitted (Chrome only), and allow to save it.
2. The perfect solution.
Update a corresponding node if it present in the DOM at the moment.
Example:
<html>
<head></head>
<body>
<h1>Header</h1>
<div>content</div>
<script>
onload = function() {
var element = document.createElement('div');
element.textContent = 'More content';
document.body.insertBefore(element, document.querySelector('div'));
}
</script>
</body>
</html>
Replacing "<div>content</div>" with "<div class=content>bla-blah</div>" should update the former node, but don't touch the div element inserted via JS.
I don't know yet how to make the perfect solution work, so I suggest to start with the simple one.
Pavel Feldman
HTML free flow editing has always been an interesting problem to tackle, but I don't think we are doing it any time soon. A valid request though.
Nikita Vasilyev
I think I can tackle "the simple solution". Is there any chance it will be applied?
Timothy Hatcher
What is the point of the simple solution?
Nikita Vasilyev
Inspector as an HTML editor. Mix it with DevTools Autosave and you can save the file and (optionally) do full reload.
Nikita Vasilyev
(forgot the link)
Chrome DevTools Autosave: https://github.com/NV/chrome-devtools-autosave/
Pavel Feldman
(In reply to comment #4)
> I think I can tackle "the simple solution". Is there any chance it will be applied?
I am not sure we are ready for that. I am fine with implementing this behind a flag as an experiment though. It might drive more feedback from people that are now trying to edit within the tools.