Bug 224591 - Deploy Ref/RefPtr in ReplaceSelectionCommand
Summary: Deploy Ref/RefPtr in ReplaceSelectionCommand
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-14 20:34 PDT by Ryosuke Niwa
Modified: 2021-04-15 01:30 PDT (History)
8 users (show)

See Also:


Attachments
Patch (30.99 KB, patch)
2021-04-14 20:36 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Fixed builds (31.30 KB, patch)
2021-04-14 21:03 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>