Bug 160663 - Align Selection API with the specification
Summary: Align Selection API with the specification
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://www.w3.org/TR/selection-api/#...
Keywords: WebExposed
Depends on:
Blocks: 160667
  Show dependency treegraph
Reported: 2016-08-08 10:49 PDT by Chris Dumez
Modified: 2016-08-08 13:32 PDT (History)
17 users (show)

See Also:

Patch (47.31 KB, patch)
2016-08-08 10:55 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (47.91 KB, patch)
2016-08-08 11:05 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (47.09 KB, patch)
2016-08-08 13:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-08 10:49:00 PDT
Align Selection API with the specification:
- https://www.w3.org/TR/selection-api/#idl-def-Selection

In particular, the following changes need to be made:
- Mark parameters as non-nullable when they should be.
- Mark parameters as mandatory when they should be.
- Use "unsigned long" type for offsets instead of "long".
Comment 1 Chris Dumez 2016-08-08 10:55:17 PDT
Created attachment 285572 [details]
Comment 2 Chris Dumez 2016-08-08 11:05:20 PDT
Created attachment 285573 [details]
Comment 3 Ryosuke Niwa 2016-08-08 13:00:52 PDT
Comment on attachment 285573 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=285573&action=review

> Source/WebCore/page/DOMSelection.idl:63
> +    void setBaseAndExtent(Node baseNode, unsigned long baseOffset, Node extentNode, unsigned long extentOffset);

I think we should preserve the old behavior of clearing selection when baseNode/extentNode is null.
Filed https://github.com/w3c/selection-api/issues/72.
Comment 4 Chris Dumez 2016-08-08 13:02:45 PDT
Created attachment 285579 [details]
Comment 5 Chris Dumez 2016-08-08 13:31:56 PDT
Comment on attachment 285579 [details]

Clearing flags on attachment: 285579

Committed r204263: <http://trac.webkit.org/changeset/204263>
Comment 6 Chris Dumez 2016-08-08 13:32:03 PDT
All reviewed patches have been landed.  Closing bug.