<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>120088</bug_id>
          
          <creation_ts>2013-08-20 14:13:34 -0700</creation_ts>
          <short_desc>Define Clipboard::hasData() only when building with drag support</short_desc>
          <delta_ts>2013-08-20 15:05:01 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Daniel Bates">dbates</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>kangil.han</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>919225</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:13:34 -0700</bug_when>
    <thetext>Following up from Darin Adler&apos;s remark in comment 11 bug #119949, define Clipboard::hasData() only when building with drag support enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919229</commentid>
    <comment_count>1</comment_count>
      <attachid>209229</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:20:21 -0700</bug_when>
    <thetext>Created attachment 209229
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919230</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:22:06 -0700</bug_when>
    <thetext>Should we also add a ENABLE(DRAG_SUPPORT) guard around Pasteboard::hasData()?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919233</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:26:44 -0700</bug_when>
    <thetext>Would it be better to move the definition of hasData() to another place in the file so as to avoid mixing it with the Clipboard IDL functions and/or to more closely match its position in Clipboard.h? Having said that, I like that hasData() is grouped with logically related functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919241</commentid>
    <comment_count>4</comment_count>
      <attachid>209229</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-08-20 14:41:11 -0700</bug_when>
    <thetext>Comment on attachment 209229
Patch

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

&gt; Source/WebCore/dom/Clipboard.cpp:116
&gt; +#if ENABLE(DRAG_SUPPORT)
&gt;  bool Clipboard::hasData()
&gt;  {
&gt;      return m_pasteboard-&gt;hasData();
&gt;  }
&gt; +#endif

I suggest moving it down to the DRAG_SUPPORT part of the file. I chose that over littering the file with #if statements.

Note that this function does *not* belong in the same family as functions like getData; if it was suitable for exposure to the web as getData is, it would have to check canReadData and return false unconditionally in that case. It’s really a function just for internal use.

&gt; Source/WebCore/dom/Clipboard.h:85
&gt;          static PassRefPtr&lt;Clipboard&gt; createForDragAndDrop();
&gt;          static PassRefPtr&lt;Clipboard&gt; createForDragAndDrop(ClipboardAccessPolicy, const DragData&amp;);
&gt; +        bool hasData();

Should not be grouped with the create functions in a single paragraph. Just include another blank line, please.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919243</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:48:32 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; &gt; Source/WebCore/dom/Clipboard.cpp:116
&gt; &gt; +#if ENABLE(DRAG_SUPPORT)
&gt; &gt;  bool Clipboard::hasData()
&gt; &gt;  {
&gt; &gt;      return m_pasteboard-&gt;hasData();
&gt; &gt;  }
&gt; &gt; +#endif
&gt; 
&gt; I suggest moving it down to the DRAG_SUPPORT part of the file. I chose that over littering the file with #if statements.
&gt; [...]

Will move definition to the DRAG_SUPPORT part of the file.

&gt; &gt; Source/WebCore/dom/Clipboard.h:85
&gt; &gt;          static PassRefPtr&lt;Clipboard&gt; createForDragAndDrop();
&gt; &gt;          static PassRefPtr&lt;Clipboard&gt; createForDragAndDrop(ClipboardAccessPolicy, const DragData&amp;);
&gt; &gt; +        bool hasData();
&gt; 
&gt; Should not be grouped with the create functions in a single paragraph. Just include another blank line, please.

Will add empty line above hasData() declaration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919247</commentid>
    <comment_count>6</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2013-08-20 14:51:48 -0700</bug_when>
    <thetext>Committed r154360: &lt;http://trac.webkit.org/changeset/154360&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>919249</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-08-20 15:05:01 -0700</bug_when>
    <thetext>After you landed this, I figured out what I really want to do (and will do soon). Just have the caller get at the pasteboard directly instead of having this forwarding function. So I’ll be removing this function entirely.

Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>209229</attachid>
            <date>2013-08-20 14:20:21 -0700</date>
            <delta_ts>2013-08-20 14:41:11 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-120088-20130820142021.patch</filename>
            <type>text/plain</type>
            <size>2291</size>
            <attacher name="Daniel Bates">dbates</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU0MzUwCm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DbGlwYm9hcmQuaAppbmRleCA2OTZk
MTgxZmE3ZGI4NGIxMTJhY2FhMDA0NTQ4ZWMyMDdiZGJkNmViLi5mYWI5ODMxYjQ3YThjOTM0ZGQz
ZDM0MjM1OTM5MzQ4ODMxMmQ4Y2FjIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9kb20vQ2xp
cGJvYXJkLmgKKysrIGIvU291cmNlL1dlYkNvcmUvZG9tL0NsaXBib2FyZC5oCkBAIC01OSw4ICs1
OSw2IEBAIG5hbWVzcGFjZSBXZWJDb3JlIHsKIAogICAgICAgICBQYXNzUmVmUHRyPEZpbGVMaXN0
PiBmaWxlcygpIGNvbnN0OwogCi0gICAgICAgIGJvb2wgaGFzRGF0YSgpOwotCiAgICAgICAgIHZv
aWQgY2xlYXJEYXRhKGNvbnN0IFN0cmluZyYgdHlwZSk7CiAgICAgICAgIHZvaWQgY2xlYXJEYXRh
KCk7CiAKQEAgLTg0LDYgKzgyLDcgQEAgbmFtZXNwYWNlIFdlYkNvcmUgewogI2lmIEVOQUJMRShE
UkFHX1NVUFBPUlQpCiAgICAgICAgIHN0YXRpYyBQYXNzUmVmUHRyPENsaXBib2FyZD4gY3JlYXRl
Rm9yRHJhZ0FuZERyb3AoKTsKICAgICAgICAgc3RhdGljIFBhc3NSZWZQdHI8Q2xpcGJvYXJkPiBj
cmVhdGVGb3JEcmFnQW5kRHJvcChDbGlwYm9hcmRBY2Nlc3NQb2xpY3ksIGNvbnN0IERyYWdEYXRh
Jik7CisgICAgICAgIGJvb2wgaGFzRGF0YSgpOwogCiAgICAgICAgIGJvb2wgZHJvcEVmZmVjdElz
VW5pbml0aWFsaXplZCgpIGNvbnN0IHsgcmV0dXJuIG1fZHJvcEVmZmVjdCA9PSAidW5pbml0aWFs
aXplZCI7IH0KIAo=
</data>
<flag name="review"
          id="231217"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>