[Webkit-unassigned] [Bug 52846] InsertUnorderedList breaks up paragraphs when they contain non-editable elements.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 31 15:42:16 PST 2011


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





--- Comment #8 from Raffaele <alberthilbert at gmail.com>  2011-01-31 15:42:16 PST ---
> How do we ensure that the entire paragraph is editable if we allow start/end to cross editing boundary?
> For example, if we had <div contenteditable="false">hello <span contenteditable="true">world</span></div>,
> and the caret is inside the span, we shouldn't be listifying "hello world".


I'm aware of this kind of problem but I consider it largely independent of this bug.
Even now (without my patch), in a situation like the one you described, the behavior of 'insertList' is wrong.
If you put an editable span inside a non-editable paragraph, you clearly want the user allowed to modify the content of the span, not the nature of the paragraph (from plain paragraph to list item) nor the nature of the span itself (from span to list item or worst inserting a list inside it where only phrasing content is allowed).
In such a situation "insertList" command should not be available at all (queryCommandEnabled should return false).
I think when 'insertList' is invoked we must look for the nearest non-phrasing content ancestor of the element containing the caret. That is the element 'insertList' will be acting on.
Now, if its parent element is editable the execution can go on, otherwise it stops without making changes to the document.
To realize the above project we must have a way to determine if an element is of phrasing content category*.
For that reason, within the discussion relative to another WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=45866), I proposed to add a new method to the HTMLElemet class: isPhrasingContent().
Unfortunately I have got virtually no feedback on my idea.

> Also, please don't just fix InsertUnorderedList. At least InsertOrderedList must also be fixed.

My patch already fixes either 'InsertUnorderedList' or 'InsertOrderedList'.

* At the moment the paragraph element which 'insertList' will be acting on is determined by looking for the nearest ancestor with css style property 'display' set to 'block'. That is not correct because there can be elements with 'display' property set to 'block' that are in fact children of a paragraph. For example display math equations are displayed as block but they don't break the paragraph where they lie in.

Raffaele

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