Bug 224591

Summary: Deploy Ref/RefPtr in ReplaceSelectionCommand
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, ews-watchlist, iang, jiewen_tan, julian_a_gonzalez, mifenton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Fixed builds ews-feeder: commit-queue-

Description Ryosuke Niwa 2021-04-14 20:34:15 PDT
We should use smart pointers everywhere in ReplaceSelectionCommand based on the new rule we came up with.
Comment 1 Ryosuke Niwa 2021-04-14 20:36:54 PDT
Created attachment 426071 [details]
Patch
Comment 2 Jiewen Tan 2021-04-14 20:49:41 PDT
Comment on attachment 426071 [details]
Patch

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

LGTM. r=me.

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:562
> +        ScriptDisallowedScope::InMainThread scriptDisallowedScope;

Why do we need this here?
Comment 3 Ryosuke Niwa 2021-04-14 20:52:09 PDT
(In reply to Jiewen Tan from comment #2)
> Comment on attachment 426071 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=426071&action=review
> 
> LGTM. r=me.
> 
> > Source/WebCore/editing/ReplaceSelectionCommand.cpp:562
> > +        ScriptDisallowedScope::InMainThread scriptDisallowedScope;
> 
> Why do we need this here?

Because we're accessing the render objects. We don't want any script execution to happen there.
Comment 4 Ryosuke Niwa 2021-04-14 20:52:44 PDT
Huh, weird. Not sure why we didn't hit that compilation error locally.
Comment 5 Ryosuke Niwa 2021-04-14 21:03:28 PDT
Created attachment 426072 [details]
Fixed builds
Comment 6 Ryosuke Niwa 2021-04-14 21:04:38 PDT
Comment on attachment 426072 [details]
Fixed builds

This has already been reviewed by Jiewen.
Comment 7 Ryosuke Niwa 2021-04-15 00:34:54 PDT
Committed r276006 (236558@main): <https://commits.webkit.org/236558@main>
Comment 8 Radar WebKit Bug Importer 2021-04-15 00:35:16 PDT
<rdar://problem/76689476>