Bug 177906 - Update WebKit Code Style with Objective-C block syntax guidelines
Summary: Update WebKit Code Style with Objective-C block syntax guidelines
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-04 17:20 PDT by Megan Gardner
Modified: 2017-10-05 15:40 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.22 KB, patch)
2017-10-04 17:24 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (1.31 KB, patch)
2017-10-04 19:05 PDT, Megan Gardner
thorton: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews123 for ios-simulator-wk2 (1.02 MB, application/zip)
2017-10-04 20:20 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2017-10-04 17:20:32 PDT
Update Webkit Style webpage to include Obj-C blocks
Comment 1 Megan Gardner 2017-10-04 17:24:38 PDT
Created attachment 322746 [details]
Patch
Comment 2 Wenson Hsieh 2017-10-04 18:44:55 PDT
Comment on attachment 322746 [details]
Patch

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

> Websites/webkit.org/code-style.md:237
> +[](#spacing-function-paren) In Objective-C, do not place spaces between the start of a block and its aguments, or start of a block and its opening brace.

"aguments" => "arguments"

"or start of" => "or the start of"

> Websites/webkit.org/code-style.md:259
> +block = ^ (int, int) {

Hm...it seems official Apple style documentation uses this style: <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW2>. I see both spaces before and after the parens (like `^ (double firstValue, double secondValue) {`) and also spaces only after the end paren (like `^(double firstValue, double secondValue) {`), but not an example of both spaces being omitted.
Comment 3 Megan Gardner 2017-10-04 19:05:03 PDT
Comment on attachment 322746 [details]
Patch

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

>> Websites/webkit.org/code-style.md:259
>> +block = ^ (int, int) {
> 
> Hm...it seems official Apple style documentation uses this style: <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW2>. I see both spaces before and after the parens (like `^ (double firstValue, double secondValue) {`) and also spaces only after the end paren (like `^(double firstValue, double secondValue) {`), but not an example of both spaces being omitted.

Oh, I looked at that over and over, and I reduced it incorrectly, thank you. I'll redo this.
Comment 4 Megan Gardner 2017-10-04 19:05:50 PDT
Created attachment 322764 [details]
Patch
Comment 5 Build Bot 2017-10-04 20:20:45 PDT
Comment on attachment 322764 [details]
Patch

Attachment 322764 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4761808

New failing tests:
accessibility/ios-simulator/video-elements-ios.html
Comment 6 Build Bot 2017-10-04 20:20:46 PDT
Created attachment 322770 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 7 Megan Gardner 2017-10-05 15:39:47 PDT
https://trac.webkit.org/changeset/222935/webkit
Comment 8 Radar WebKit Bug Importer 2017-10-05 15:40:31 PDT
<rdar://problem/34844976>