[Webkit-unassigned] [Bug 108987] "Select all" doesn't select anything when a contenteditable="false" element is present

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 30 21:35:38 PDT 2013


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





--- Comment #58 from Santosh Mahto <santosh.ma at samsung.com>  2013-09-30 21:34:34 PST ---

> 
> > Source/WebCore/ChangeLog:9
> > +        Test: editing/selection/select-all-with-div-noneditable.html
> > +
> 
> This line should appear after the long description but before the list of files and function names.

Sorry I will update.
> 
> > Source/WebCore/ChangeLog:16
> > +        But editableRootPosition, highestRootEditablePosition and
> > +        rootEditablePosition return 0 for nonediatble element due to which
> > +        the check for position to be under same highestRootEditable element
> > +        fails.
> 
> This doesn't justify the change. Why should that matter at all?  It appears to be that this is a bug in VisibleSelection, not PositionIterator.

Why you think that cause of issue is around VisibleSelection?
What I found is:
<div id= = "1" contenteditable = true> 
<div id = "2" contenteditable = false> 
</div>
<p>This is candidate</p>
</div>

In above scenario the  selectAll range  startPosition anchornode is div(id = "2") and
end position  is <p>.
since div(id="2") is disable the check that div and p are under same editableContent(div id ="1") fails setting startPosition to NULL (in Cannonical position)

and if startposition is NULL we make it equal to end position. so final selection is caret selection.

and the fix is in isCandidate()
Basically I am ignoring position with empty noneditable position and blockheight to be a candidate.

Overall it looks fine to me considering the tricky editing code.

Please suggest if you have something in mind.

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