Summary: | Selection API: Extend lifetime of selection live range to preserve expando properties | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Darin Adler <darin> | ||||||
Component: | HTML Editing | Assignee: | Darin Adler <darin> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, cdumez, esprehn+autocc, ews-watchlist, kangil.han, kondapallykalyan, mifenton, rniwa, sam, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 216325 | ||||||||
Attachments: |
|
Description
Darin Adler
2020-09-18 18:52:20 PDT
Created attachment 409186 [details]
Patch
Created attachment 409188 [details]
Patch
Comment on attachment 409188 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409188&action=review > LayoutTests/editing/selection/expando.html:5 > +function collectGarbage() Why not just include LayoutTests/resources/gc.js? > LayoutTests/editing/selection/expando.html:19 > +var repetitions = 20; Maybe use const? > LayoutTests/editing/selection/expando.html:23 > + var count = 0; Maybe use let? > LayoutTests/editing/selection/expando.html:26 > + var range = document.createRange(); Ditto. > LayoutTests/editing/selection/expando.html:41 > + var count = 0; Ditto. > LayoutTests/editing/selection/expando.html:44 > + getSelection().setBaseAndExtent(document, 0, document, 1); > + getSelection().getRangeAt(0).expando = 1; I think another scenario we should consider is modifying selection after this. Comment on attachment 409188 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409188&action=review >> LayoutTests/editing/selection/expando.html:5 >> +function collectGarbage() > > Why not just include LayoutTests/resources/gc.js? Done. >> LayoutTests/editing/selection/expando.html:19 >> +var repetitions = 20; > > Maybe use const? Done. >> LayoutTests/editing/selection/expando.html:23 >> + var count = 0; > > Maybe use let? Done. >> LayoutTests/editing/selection/expando.html:26 >> + var range = document.createRange(); > > Ditto. Done. >> LayoutTests/editing/selection/expando.html:44 >> + getSelection().getRangeAt(0).expando = 1; > > I think another scenario we should consider is modifying selection after this. OK, will add some more tests for that. Committed r267313: <https://trac.webkit.org/changeset/267313> |