Bug 192653 - Make TextInputController.legacyAttributedString take DOM nodes and offsets
Summary: Make TextInputController.legacyAttributedString take DOM nodes and offsets
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 192640
  Show dependency treegraph
 
Reported: 2018-12-12 19:21 PST by Ryosuke Niwa
Modified: 2018-12-12 20:05 PST (History)
6 users (show)

See Also:


Attachments
Updates the test API (10.37 KB, patch)
2018-12-12 19:26 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Reverted the unrelated change (10.30 KB, patch)
2018-12-12 19:39 PST, Ryosuke Niwa
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2018-12-12 19:21:51 PST
Right now, TextInputController.legacyAttributedString takes a Range object
but this makes it impossible to obtain attributed strings across shadow boundaries.

Make it take DOM nodes and offsets as in DOMSelection's setBaseAndExtent
in preparation to make HTMLConverter compatible with shadow DOM.
Comment 1 Ryosuke Niwa 2018-12-12 19:26:55 PST
Created attachment 357204 [details]
Updates the test API
Comment 2 Ryosuke Niwa 2018-12-12 19:36:51 PST
Comment on attachment 357204 [details]
Updates the test API

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

> Source/WebCore/editing/cocoa/HTMLConverter.mm:-2470
> -    auto range = selection.toNormalizedRange();
> -    ASSERT(range);
> -    return HTMLConverter { range->startPosition(), range->endPosition() }.convert();

Oops, this change shouldn't be here...
Comment 3 Ryosuke Niwa 2018-12-12 19:39:57 PST
Created attachment 357206 [details]
Reverted the unrelated change
Comment 4 Ryosuke Niwa 2018-12-12 19:54:15 PST
Committed r239149: <https://trac.webkit.org/changeset/239149>
Comment 5 Radar WebKit Bug Importer 2018-12-12 19:55:26 PST
<rdar://problem/46685404>