<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Support TouchBar in WebKit"
   href="https://bugs.webkit.org/show_bug.cgi?id=164437">bug 164437</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #294107 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Support TouchBar in WebKit"
   href="https://bugs.webkit.org/show_bug.cgi?id=164437#c30">Comment # 30</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Support TouchBar in WebKit"
   href="https://bugs.webkit.org/show_bug.cgi?id=164437">bug 164437</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=294107&amp;action=diff" name="attach_294107" title="Patch">attachment 294107</a> <a href="attachment.cgi?id=294107&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=294107&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=294107&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:750
&gt; +    case NSTextAlignmentLeft: {</span >

No need for these braces.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:755
&gt; +    case NSTextAlignmentRight: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:760
&gt; +    case NSTextAlignmentCenter: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:765
&gt; +    case NSTextAlignmentJustified: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:1043
&gt; +            NSTextAlignment textAlignment;
&gt; +            switch (editorState.postLayoutData().textAlignment) {
&gt; +            case NoAlignment:
&gt; +                textAlignment = NSTextAlignmentNatural;
&gt; +                break;
&gt; +            case LeftAlignment:
&gt; +                textAlignment = NSTextAlignmentLeft;
&gt; +                break;
&gt; +            case RightAlignment:
&gt; +                textAlignment = NSTextAlignmentRight;
&gt; +                break;
&gt; +            case CenterAlignment:
&gt; +                textAlignment = NSTextAlignmentCenter;
&gt; +                break;
&gt; +            case JustifiedAlignment:
&gt; +                textAlignment = NSTextAlignmentJustified;
&gt; +                break;
&gt; +            }</span >

I’d like to see a helper function, inlined probably, for this conversion, so we can do things like ASSERT_NOT_REACHED if it’s an unknown value rather than leaving the textAlignment uninitialized, and also so the large switch statement isn’t so distracting in the middle of the code.

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:901
&gt; +    case NSTextAlignmentLeft: {</span >

No braces needed here.

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:906
&gt; +    case NSTextAlignmentRight: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:911
&gt; +    case NSTextAlignmentCenter: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:916
&gt; +    case NSTextAlignmentJustified: {</span >

Ditto.

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:6863
&gt; +    switch ([nsResult resultType]) {
&gt; +    case NSTextCheckingTypeSpelling:
&gt; +        result.type = WebCore::TextCheckingTypeSpelling;
&gt; +        break;
&gt; +    case NSTextCheckingTypeReplacement:
&gt; +        result.type = WebCore::TextCheckingTypeReplacement;
&gt; +        break;
&gt; +    case NSTextCheckingTypeCorrection:
&gt; +        result.type = WebCore::TextCheckingTypeCorrection;
&gt; +        break;
&gt; +    default:
&gt; +        result.type = WebCore::TextCheckingTypeNone;
&gt; +    }</span >

Helper function for this conversion?

<span class="quote">&gt; Source/WebKit/mac/WebView/WebView.mm:9484
&gt; +                NSTextAlignment textAlignment;
&gt; +                switch (style-&gt;textAlign()) {
&gt; +                case RIGHT:
&gt; +                case WEBKIT_RIGHT:
&gt; +                    textAlignment = NSTextAlignmentRight;
&gt; +                    break;
&gt; +                case LEFT:
&gt; +                case WEBKIT_LEFT:
&gt; +                    textAlignment = NSTextAlignmentLeft;
&gt; +                    break;
&gt; +                case CENTER:
&gt; +                case WEBKIT_CENTER:
&gt; +                    textAlignment = NSTextAlignmentCenter;
&gt; +                    break;
&gt; +                case JUSTIFY:
&gt; +                    textAlignment = NSTextAlignmentJustified;
&gt; +                    break;
&gt; +                case TASTART:
&gt; +                    textAlignment = style-&gt;isLeftToRightDirection() ? NSTextAlignmentLeft : NSTextAlignmentRight;
&gt; +                    break;
&gt; +                case TAEND:
&gt; +                    textAlignment = style-&gt;isLeftToRightDirection() ? NSTextAlignmentRight : NSTextAlignmentLeft;
&gt; +                    break;
&gt; +                }</span >

Helper function for this?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>