Bug 212759

Summary: Text manipulation: first and last unit in a paragraph should not contain only excluded tokens
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: HTML EditingAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mifenton, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Sihui Liu 2020-06-04 10:35:01 PDT
...
Comment 1 Sihui Liu 2020-06-04 11:00:01 PDT
Created attachment 401047 [details]
Patch
Comment 2 Wenson Hsieh 2020-06-04 16:11:04 PDT
Comment on attachment 401047 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        tokens in a ManipulationUnit are excluded, it means the ManipulationUnit is exluced and should not be 

Nit - “exluced”

> Source/WebCore/editing/TextManipulationController.cpp:417
> +                Vector<ManipulationToken> tokens;
> +                tokens.append(ManipulationToken { m_tokenIdentifier.generate(), "[]", tokenInfo(content.node.get()), true });
> +                unitsInCurrentParagraph.append(ManipulationUnit { WTFMove(tokens), *contentNode });

Nit - you probably don’t need a local variable for `tokens`. But if you want to keep the local variable, you should use an initializer list when initializing `tokens`.
Comment 3 Sihui Liu 2020-06-04 22:45:44 PDT
Created attachment 401120 [details]
Patch for landing
Comment 4 EWS 2020-06-04 23:13:35 PDT
Committed r262601: <https://trac.webkit.org/changeset/262601>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401120 [details].
Comment 5 Radar WebKit Bug Importer 2020-06-05 09:58:10 PDT
<rdar://problem/64033285>