<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:sapce element contains non-breaking space characters, but shouldn’t"
   href="https://bugs.webkit.org/show_bug.cgi?id=165515#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:sapce element contains non-breaking space characters, but shouldn’t"
   href="https://bugs.webkit.org/show_bug.cgi?id=165515">bug 165515</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=296374&amp;action=diff" name="attach_296374" title="Possible fix (no tests and no change log)">attachment 296374</a> <a href="attachment.cgi?id=296374&amp;action=edit" title="Possible fix (no tests and no change log)">[details]</a></span>
Possible fix (no tests and no change log)

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

<span class="quote">&gt;&gt; Source/WebCore/editing/cocoa/HTMLConverter.mm:2252
&gt;&gt; +                        nbspMode = characterData.parentElement() ? static_cast&lt;ENBSPMode&gt;(downcast&lt;CSSPrimitiveValue&gt;(*_caches-&gt;computedStylePropertyForElement(*characterData.parentElement(), CSSPropertyWebkitNbspMode).get())) : NBNORMAL;
&gt; 
&gt; Perhaps the chance of encountering an non-breaking space is low enough that we can use afford to use propertyValueForNode() and do a string compare instead of using computedStylePropertyForElement().</span >

Seems clear we *could* do that even if non-breaking spaces are relatively common, because the textTransform logic below calls propertyValueForNode once per string already. So calling it a second time couldn’t make things more than twice as slow.

I have to admit, I am not really an expert on the philosophy behind how the HTMLConverter works, but I see no harm in making this change.</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>