[Webkit-unassigned] [Bug 62092] setting innerText to an empty string on editable div loses focus

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 25 19:01:09 PDT 2011


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





--- Comment #56 from Darin Adler <darin at apple.com>  2011-09-25 19:01:08 PST ---
(From update of attachment 108615)
View in context: https://bugs.webkit.org/attachment.cgi?id=108615&action=review

> Source/WebCore/dom/Position.h:123
> +    void willRemoveNode(Node*);

This is going to require a bit of thought.

It's not good to have this function in a dom class, but not have code to ensure it is called any time a node is removed from its parent. The corresponding function in WebCore::Range is always called by the DOM itself, while this function is only called by editing machinery. There's no easy way to tell that when looking at this class, and in fact it would be reasonable to expect the other approach.

The question is whether we are redefining Position objects so they automatically update in this fashion, or if this is a function to be called voluntarily only by editing code, and not part of the DOM itself. Either would be OK, but this current version is half and half.

If this function is meant to be called only by editing machinery, it should probably not be in a class in the dom directory, or at the very least should have editing in its name. Although a function for editing that is baked into a basic class is an anti-pattern. The many editing-related functions in Node are a design mistake.

-- 
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