Bug 177356

Summary: Require <form> to be connected
Product: WebKit Reporter: Anne van Kesteren <annevk>
Component: DOMAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, rbuis, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Comment 1 Rob Buis 2020-06-25 11:43:34 PDT
Created attachment 402755 [details]
Patch
Comment 2 Darin Adler 2020-06-26 12:41:24 PDT
Comment on attachment 402755 [details]
Patch

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

> Source/WebCore/html/HTMLFormElement.cpp:337
> +    // FIXME: duplicated in case prepareForSubmission was called.

I don’t understand what "duplicated" means here. Could we be use a few more words and be explicit.

I don’t understand what "in case prepareForSubmission was called.

This doesn’t match our "sentence-case" comment formatting.

Maybe this is the comment we want?

    // The prepareForSubmission function also does this check, but need to do it here too, since there are some code paths that bypass that function.

But honestly, I don’t know if that’s what we’re trying to say.
Comment 3 Rob Buis 2020-06-26 13:16:51 PDT
Comment on attachment 402755 [details]
Patch

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

>> Source/WebCore/html/HTMLFormElement.cpp:337
>> +    // FIXME: duplicated in case prepareForSubmission was called.
> 
> I don’t understand what "duplicated" means here. Could we be use a few more words and be explicit.
> 
> I don’t understand what "in case prepareForSubmission was called.
> 
> This doesn’t match our "sentence-case" comment formatting.
> 
> Maybe this is the comment we want?
> 
>     // The prepareForSubmission function also does this check, but need to do it here too, since there are some code paths that bypass that function.
> 
> But honestly, I don’t know if that’s what we’re trying to say.

Your statement is better. Basically I do not like to check for isConnected in two places, my wording was probably off (I guess I wrote it so that I would understand what to do, but maybe not others :)). How about "FIXME: ideally we have only one place to check isConnected in the submit process"? Or I can leave the comment off if we do not think it is a big deal.
Comment 4 Darin Adler 2020-06-26 13:29:26 PDT
Comment on attachment 402755 [details]
Patch

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

>>> Source/WebCore/html/HTMLFormElement.cpp:337
>>> +    // FIXME: duplicated in case prepareForSubmission was called.
>> 
>> I don’t understand what "duplicated" means here. Could we be use a few more words and be explicit.
>> 
>> I don’t understand what "in case prepareForSubmission was called.
>> 
>> This doesn’t match our "sentence-case" comment formatting.
>> 
>> Maybe this is the comment we want?
>> 
>>     // The prepareForSubmission function also does this check, but need to do it here too, since there are some code paths that bypass that function.
>> 
>> But honestly, I don’t know if that’s what we’re trying to say.
> 
> Your statement is better. Basically I do not like to check for isConnected in two places, my wording was probably off (I guess I wrote it so that I would understand what to do, but maybe not others :)). How about "FIXME: ideally we have only one place to check isConnected in the submit process"? Or I can leave the comment off if we do not think it is a big deal.

I would not comment that "it would be better to only check once". The best purpose for a comment is to help people the reason behind something non-obvious. So a comment here would answer "why is this check also here since it’s already checked elsewhere" or be omitted.
Comment 5 Rob Buis 2020-06-27 08:14:01 PDT
Created attachment 402955 [details]
Patch
Comment 6 EWS 2020-06-27 09:44:06 PDT
Committed r263624: <https://trac.webkit.org/changeset/263624>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402955 [details].
Comment 7 Radar WebKit Bug Importer 2020-06-27 09:45:21 PDT
<rdar://problem/64844813>