<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:sam&#64;webkit.org" title="Sam Weinig &lt;sam&#64;webkit.org&gt;"> <span class="fn">Sam Weinig</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Enhance EditorState to include TypingAttributes, alignment, and color"
   href="https://bugs.webkit.org/show_bug.cgi?id=154424">bug 154424</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 #271713 Flags</td>
           <td>review+
           </td>
           <td>review?
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Enhance EditorState to include TypingAttributes, alignment, and color"
   href="https://bugs.webkit.org/show_bug.cgi?id=154424#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Enhance EditorState to include TypingAttributes, alignment, and color"
   href="https://bugs.webkit.org/show_bug.cgi?id=154424">bug 154424</a>
              from <span class="vcard"><a class="email" href="mailto:sam&#64;webkit.org" title="Sam Weinig &lt;sam&#64;webkit.org&gt;"> <span class="fn">Sam Weinig</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=271713&amp;action=diff" name="attach_271713" title="Patch">attachment 271713</a> <a href="attachment.cgi?id=271713&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/WebKit2/Shared/EditorState.h:95
&gt; +        WebCore::Color textColor { WebCore::Color::black };</span >

Since not every platform has these implemented, should they remain enabled? Can we refactor at all to make these supported on all platforms?

<span class="quote">&gt; Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:160
&gt; +        if (RenderStyle* style = Editor::styleForSelectionStart(&amp;frame, nodeToRemove)) {
&gt; +            NSFont *font = style-&gt;fontCascade().primaryFont().getNSFont();
&gt; +            NSFontTraitMask traits = [[NSFontManager sharedFontManager] traitsOfFont:font];
&gt; +
&gt; +            if (traits &amp; NSBoldFontMask)
&gt; +                postLayoutData.typingAttributes |= AttributeBold;
&gt; +            if (traits &amp; NSItalicFontMask)
&gt; +                postLayoutData.typingAttributes |= AttributeItalics;
&gt; +            </span >

Can this be done by doing:

if (style-&gt;fontCascade().weight() == FontWeightBold)
    postLayoutData.typingAttributes |= AttributeBold;
if (style-&gt;fontCascade().italic() == FontItalicOn)
    postLayoutData.typingAttributes |= AttributeItalics;

or 

just look at the style itself?

<span class="quote">&gt; Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:200
&gt; +                nodeToRemove-&gt;remove(ASSERT_NO_EXCEPTION);
&gt; +        }</span >

Can any of this be shared across Mac and iOS?</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>