Bug 178429

Summary: Expand r209943 to suppress paste during provisional navigation as well
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bfulgham, commit-queue, dbates, dino, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Tim Horton 2017-10-17 23:44:47 PDT
Expand r209943 to suppress paste during provisional navigation as well
Comment 1 Tim Horton 2017-10-17 23:45:09 PDT
Created attachment 324101 [details]
Patch
Comment 2 Sam Weinig 2017-10-18 02:25:31 PDT
Comment on attachment 324101 [details]
Patch

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

> Source/WebCore/editing/Editor.cpp:459
> +    if (m_frame.mainFrame().loader().shouldSuppressKeyboardInput())
> +        return false;

Given that paste can be triggered from something that isn't the keyboard, this seems like a weird check here.  That probably implies shouldSuppressKeyboardInput() needs a better name to indicate what it really wants.
Comment 3 Sam Weinig 2017-10-18 05:26:22 PDT
Comment on attachment 324101 [details]
Patch

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

>> Source/WebCore/editing/Editor.cpp:459
>> +        return false;
> 
> Given that paste can be triggered from something that isn't the keyboard, this seems like a weird check here.  That probably implies shouldSuppressKeyboardInput() needs a better name to indicate what it really wants.

Also, I think canPaste() gets called after we dispatch the paste events.  Perhaps a better place for this would be in EditorCommands.cpp in enabledPaste?
Comment 4 Sam Weinig 2017-10-18 05:28:24 PDT
(In reply to Sam Weinig from comment #3)
> Also, I think canPaste() gets called after we dispatch the paste events. 
> Perhaps a better place for this would be in EditorCommands.cpp in
> enabledPaste?

Ha, enabledPaste just calls canPaste() :).  So it looks like it probably does block the paste events (but perhaps you should add a test for it).
Comment 5 Tim Horton 2017-10-18 10:47:16 PDT
(In reply to Sam Weinig from comment #2)
> Comment on attachment 324101 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=324101&action=review
> 
> > Source/WebCore/editing/Editor.cpp:459
> > +    if (m_frame.mainFrame().loader().shouldSuppressKeyboardInput())
> > +        return false;
> 
> Given that paste can be triggered from something that isn't the keyboard,
> this seems like a weird check here.  That probably implies
> shouldSuppressKeyboardInput() needs a better name to indicate what it really
> wants.

Yes, that is true.

(In reply to Sam Weinig from comment #4)
> Ha, enabledPaste just calls canPaste() :).  So it looks like it probably
> does block the paste events (but perhaps you should add a test for it).

I'll add that to the existing test.
Comment 6 Tim Horton 2017-10-18 16:30:39 PDT
Created attachment 324181 [details]
Patch
Comment 7 WebKit Commit Bot 2017-10-19 13:43:45 PDT
Comment on attachment 324181 [details]
Patch

Clearing flags on attachment: 324181

Committed r223708: <https://trac.webkit.org/changeset/223708>
Comment 8 WebKit Commit Bot 2017-10-19 13:43:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2017-11-15 13:03:57 PST
<rdar://problem/35568708>