[Webkit-unassigned] [Bug 27046] Implement CSSOM DocumentView.caretRangeFromPoint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 17 12:36:51 PDT 2009


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





--- Comment #7 from Sam Weinig <sam at webkit.org>  2009-07-17 12:36:50 PDT ---
(In reply to comment #6)
> (In reply to comment #4)
> > Created an attachment (id=32694)
 --> (https://bugs.webkit.org/attachment.cgi?id=32694) [details] [details]
> > Little more work.
> 
> Hi Sam,
> 
> Thanks for implementing this!
> 
> I have several questions regarding your patch:
> 1. The CSSOM spec says that: "If ..... no insertion point indicator would have
> been inserted, or editing is not supported, the method must return null". I do
> not quite understand why it returns NULL if "editing is not supported". So, I
> changed the implementation to "return NULL if the node type is not text related
> node type". For other node types, range::create(Document*, Position, Position)
> might raise error code and hit assertion failure (for example, "input"
> element). Or rangeCompliantEquivalent takes care of that? 

I don't think limiting to just text related nodes is the right way to go since
that removes are replaced elements as well.  I used a combination of checking
for shadow tree content (input elements, etc.) and using
rangeComplientEquivalent.  The spec is not all that clear, so we should
probably confer with the editor on the intent.

> 
> 2. When calculating the coordinate relative to document, you are taking zoom
> factor into consideration. Should it also take document scrolling into
> consideration as well? Since the spec says (x, y) is coordinates in viewport.
> Or maybe we can use coordinate relative to document and let JS do  the
> computation.

All computation should be done relative to the viewport, so I think scrolling
is already accounted for, though adding tests is the way to be sure.

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