[Webkit-unassigned] [Bug 36481] Web Inspector: Edit Tag Names

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 23 23:54:12 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36481





--- Comment #6 from Pavel Feldman <pfeldman at chromium.org>  2010-03-23 23:54:12 PST ---
> I am a big fan of the structured mode. Mostly because it typically handles
> errors more gracefully.

I actually think this is very wrong. I came from the IDE business where it is
considered a classical mistake. Although this approach is very appealing to the
implementor from the strict coding point of view, developers do not use
structured editing. Do you use anything like that in your coding life? Things
like IDE's ability to add classes / attributes via the tree view to the left? I
bet you don't.

The right way of handling this is free flow editing with syntax highlighting
and error underline. It is much more flexible and much, much more usable and
faster. Fixing attribute value while typing element's body is a nightmare using
structured editing. And I think that even with no highlighting and error
detection free text editing would be more usable. You just open an editor field
for the user to type things in.

> At the very least, if I want to create an element right
> now the first thing that comes to mind is _not_ "Edit HTML". Instead I'd rather
> $0.appendChild(document.createElement(...).

The real reason here is that you don't want to mess with context menu and html
parsing (scrolling to the end). You would much rather type a lot in the
console. And you don't use structured console editing - it is free flow. And
you are nor afraid to make mistakes :P.

> 
>   - Edit Tag

This really should be triggered as double click on the tag name as well (as we
do for attributes). Context menu action is only useful for discoverability.

>   - Add Child Element
>   - Add Child Text Node

I don't want to make such a decision early. I am not yet sure I'll do text or I
want to wrap it with <span>. Or I changed my mind as I was doing it. As pointed
out above, I'd like simple text area where I can put my html and surround it
with <span> half-baked.

>   - Add Previous Sibling
>   - Add Next Sibling

These are formally correct, but Insert Above and Insert Below look much more
friendly.
> 
> I actually don't even know what it does. Shame on me. 
> 
> What do you mean by property wrappers? Just generic properties added to the
> node via JS? Can anyone think of things I should copy other than Attributes and
> Children?

Custom properties added to the node via JS was what I was talking about. Local
action such as tweaking tag name makes you responsible for preserving literally
everything, including js properties and element identity (references to it in
JS). I am not sure you can achieve this (and that is probably the reason behind
the lack of such an action in FB). Edit As HTML removes this responsibility
from you.
I know that people would use this for design purposes (probably to toggle
between div and span - I've never needed such a thing for anything else), but
those loosing references to their objects would be surprised. How do we manage
this?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list