Bug 53588 - Web Inspector: Make TextViewer editable (ala IDE)
Summary: Web Inspector: Make TextViewer editable (ala IDE)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 50553 (view as bug list)
Depends on: 53299 54388 54448 54661 54866 55373 55769 56084 56743
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-02 06:26 PST by Andrey Adaikin
Modified: 2011-04-27 11:31 PDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Adaikin 2011-02-02 06:26:47 PST
Make TextViewer editable. Now it's possible to make changes in live-edit mode using double-click to start editing. Would be better to have its content editable like in classic IDEs.

Here is an overview of the plan to accomplish this:

1) Migrate from TABLE to DIV.

2) Implement editing (aka IDE) via HTML5's contentEditable.

3) Add new UI elements to support the IDE functionality (e.g. indicator that the source code has been changed, Save and Revert buttons and etc.).

4) Support the changes on the backend side, remove Live Editing in favor of the IDE.

5) Rename TextViewer to TextEditor.
Comment 1 Andrey Adaikin 2011-02-02 06:28:56 PST
*** Bug 50553 has been marked as a duplicate of this bug. ***
Comment 2 Boris Bokowski 2011-02-14 10:20:52 PST
Have you considered reusing one of the available open source web-based editors?

For example, here's a pointer to the editor from the Orion project (http://wiki.eclipse.org/Orion): https://github.com/orion-oti/Orion-Client/tree/master/bundles/org.eclipse.orion.client.editor

Also, I am wondering what you mean by "the IDE functionality" - as it happens, I have some experience with that :-) - are you trying to grow the Web Inspector into a more complete development environment? How much are you planning to go in that direction? Support version control systems? Support editing server-side files that are not HTML, JavaScript or CSS, such as PHP, Python, and Java? Curious minds want to know!
Comment 3 Andrey Adaikin 2011-02-15 05:16:41 PST
Hi Boris,
I checked a few existing editors, but then came to a conclusion that it will be easier and faster to just extend the read-only viewer that we already have in the Web Inspector. And our viewer is already carefully optimized to deal with very large files (500K+ LoC), whereas it seemed that for other editors we would have to do the optimization work again.

By "the IDE functionality" in this bug I meant just an editor for now, so it might have sounded a bit confusing :) The closest goal is to replace the live-edit mode with an editor.
Comment 4 Boris Bokowski 2011-02-15 19:21:28 PST
FWIW, the Orion editor does scale to files with a million lines without problems. It's quite fun to edit a file with 1.5M lines. I think it's the first time I've hit Ctrl+L (goto line) and entered 1000000 as the line number :-)
Comment 5 Pavel Feldman 2011-02-15 23:58:47 PST
@Boris. A bit of context for you.

We are not that ambitious yet. It is just that our users start editing JavaScript and CSS in place and we'd like to make this experience smooth for them. No talk of editing server-side scripts or such. We leave it to you, we are debugging solution. Our priorities are:

Deployment:
- Everything is bundled with the product, nothing is served from the web
- If we decide to bundle third party code, it should be BSD. EPL is problematic.

Operation:
- Viewing of X00KLOC files
- Smooth scrolling
- Source code analysis, syntax highlighting implemented on client side
- Native selection model (including text drag'n'drop)
- support for IME

So far, editor effort is not that large (2-3KLOC), so we are playing with it locally. Integrating with backends will be interesting (i.e. pushing results of the editing into the cloud using WebDAV or similar), but not in v1.

If you are interested in contributing Orion editor into the WebKit (or providing it with appropriate license), we should definitely talk.
Comment 6 Patrick Mueller 2011-02-16 06:29:19 PST
(In reply to comment #5)
...
> - If we decide to bundle third party code, it should be BSD. EPL is problematic.
...
> If you are interested in contributing Orion editor into the WebKit (or providing it with appropriate license), we should definitely talk.

If licensing is an issue, and even if it isn't, we could think about making the "editor" pluggable, and then replaceable via extensions.  I assume there isn't a bug open up on that topic yet, is there?  (extendable/replaceable "editor").  

I use "editor" in quotes, because I don't know what all that entails.  Folks probably think the HTML DOM view is an "editor" - well, it is, of sources, but it's not really a text editor like we know text editors.  Should it be replaceable also?  But really thinking about "script" view/editors vs all the other views we have - CSS, images, etc.

Would be a fun topic for someone with time on their hands (NOT SIGNING UP FOR IT RIGHT NOW! :-)
Comment 7 Timothy Hatcher 2011-02-16 12:01:36 PST
This bug is deja vu. (See bug 33001.)
Comment 8 Andrey Adaikin 2011-02-17 07:34:36 PST
Yep, I reused much of Pavel's ideas and code from his canvas-based editor.
Comment 9 Boris Bokowski 2011-02-18 14:58:11 PST
(In reply to comment #5)
> If you are interested in contributing Orion editor into the WebKit (or providing it with appropriate license), we should definitely talk.

@Pavel, I've started the licensing discussion on our side. I think BSD is a possibility (for reasons too complicated to explain here, the most likely outcome is going to be a dual license: EPL and three-clause BSD). As you can imagine, this is going to take a few weeks in the best case.

Any chance you could send somebody to our planning meeting in Palo Alto, March 17 and 18? See http://wiki.eclipse.org/Orion/Planning_Meeting
Comment 10 Andrey Adaikin 2011-04-01 05:13:40 PDT
It is in the HEAD, marking RESOLVED.
Comment 11 Boris Bokowski 2011-04-27 11:31:17 PDT
(In reply to comment #5)
> If you are interested in contributing Orion editor into the WebKit (or providing it with appropriate license), we should definitely talk.

The Orion client-side code (this includes the editor) is now licensed under a three-clause BSD license as well as the EPL. Are you still interested?