<?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>17366</bug_id>
          
          <creation_ts>2008-02-14 14:31:03 -0800</creation_ts>
          <short_desc>ContextMenu::itemAtIndex() should be static and declared for Windows port only</short_desc>
          <delta_ts>2010-06-10 15:28:07 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oleg Sukhodolsky">oleg.sukhodolsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70699</commentid>
    <comment_count>0</comment_count>
    <who name="Oleg Sukhodolsky">oleg.sukhodolsky</who>
    <bug_when>2008-02-14 14:31:03 -0800</bug_when>
    <thetext>after learning ContextMenu API I&apos;ve came to conclusion that ContextMenu::itemAtIndex() should be static.  Also it looks like it is only used in Windows port, so it looks reasonable declare it only for this port.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70701</commentid>
    <comment_count>1</comment_count>
      <attachid>19127</attachid>
    <who name="Oleg Sukhodolsky">oleg.sukhodolsky</who>
    <bug_when>2008-02-14 14:36:41 -0800</bug_when>
    <thetext>Created attachment 19127
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71260</commentid>
    <comment_count>2</comment_count>
      <attachid>19127</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-02-20 09:30:29 -0800</bug_when>
    <thetext>Comment on attachment 19127
the patch

I&apos;d prefer to not have the #if in the header. There&apos;s no harm in declaring a function that isn&apos;t defined on all platforms, especially if we might want to define and use it on other platforms in the future. Is there something I&apos;m overlooking here?

+        static ContextMenuItem* itemAtIndex(unsigned, const PlatformMenuDescription);

The &quot;const&quot; here, while not new, is not helpful. It doesn&apos;t have any effect on the type of the parameter.

Since there&apos;s no significant benefit to this patch, I&apos;m going to set it review- just because of the minor comments above. If there was a clearer benefit I might just overlook these and say review+.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71269</commentid>
    <comment_count>3</comment_count>
    <who name="Oleg Sukhodolsky">oleg.sukhodolsky</who>
    <bug_when>2008-02-20 11:30:20 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 19127 [edit])
&gt; I&apos;d prefer to not have the #if in the header. There&apos;s no harm in declaring a
&gt; function that isn&apos;t defined on all platforms, especially if we might want to
&gt; define and use it on other platforms in the future. Is there something I&apos;m
&gt; overlooking here?

there are two changes in the patch:
- the method made static, since it here is no reason to have it non-static
- ifdef added to clarify the fact that this method is not used/needed by any other platform (at least for now)

Both changes have the same purpose - clarify the API of ContextMenu.
Since you do not have documentation there it is very hard to understand what 
every method is supposed to do and whether it is needed at all.  So, these suggested changes just add some infomration (you do not need this if you are 
not a Windows port and this method doesn need &quot;this&quot;)

So this patch is about making code claerer, nothing else.

&gt; +        static ContextMenuItem* itemAtIndex(unsigned, const
&gt; PlatformMenuDescription);
&gt; 
&gt; The &quot;const&quot; here, while not new, is not helpful. It doesn&apos;t have any effect on
&gt; the type of the parameter.

I have not added &quot;const&quot; I&apos;ve just keeped it.  I can remove it if you want, btw 
there is at least one more places where &quot;const PlatformMenuDescription&quot; is used 
in this class.
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19127</attachid>
            <date>2008-02-14 14:36:41 -0800</date>
            <delta_ts>2010-06-10 15:28:07 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>context-menu.txt</filename>
            <type>text/plain</type>
            <size>2440</size>
            <attacher name="Oleg Sukhodolsky">oleg.sukhodolsky</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzMDIzMykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsOSBAQAorMjAwOC0wMi0xNCAgT2xlZyBTdWtob2RvbHNreSAgPG9sZWcuc3VraG9k
b2xza3lAc3VuLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKwor
ICAgICAgICAqIHBsYXRmb3JtL0NvbnRleHRNZW51Lmg6IGl0ZW1BdEluZGV4KCkgaXMgc3RhdGlj
IGFuZCBhbmQgZGVjbGFyZWQgb25seSBmb3IgV2luZG93cyBwb3J0LgorCiAyMDA4LTAyLTE0ICBU
aW1vdGh5IEhhdGNoZXIgIDx0aW1vdGh5QGFwcGxlLmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBi
eSBEYXJpbiBBZGxlci4KSW5kZXg6IFdlYkNvcmUvcGxhdGZvcm0vQ29udGV4dE1lbnUuaAo9PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09Ci0tLSBXZWJDb3JlL3BsYXRmb3JtL0NvbnRleHRNZW51LmgJKHJldmlzaW9uIDMwMjMy
KQorKysgV2ViQ29yZS9wbGF0Zm9ybS9Db250ZXh0TWVudS5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VdpdGhBY3Rpb24oKENvbnRleHRNZW51QWN0aW9uKXdQYXJhbSk7
CiAgICAgaWYgKCFpdGVtKQogICAgICAgICByZXR1cm47CiAgICAgbV9wYWdlLT5jb250ZXh0TWVu
dUNvbnRyb2xsZXIoKS0+Y29udGV4dE1lbnVJdGVtU2VsZWN0ZWQoaXRlbSk7Cg==
</data>
<flag name="review"
          id="8356"
          type_id="1"
          status="-"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>