<?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>142658</bug_id>
          
          <creation_ts>2015-03-13 00:08:45 -0700</creation_ts>
          <short_desc>Web Inspector: Show Documentation for Prototype Functions in Object Tree API view</short_desc>
          <delta_ts>2026-01-12 09:09:14 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1076875</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-03-13 00:08:45 -0700</bug_when>
    <thetext>* SUMMARY
Show Documentation for Prototype Functions in Object Tree API view.

It is useful to see the &quot;API&quot; of objects in the ObjectTree view. We already show the parameter list for methods. However it would be nicer to go one step further and show documentation for the Functions/Properties/whatever of the object. Perhaps when hovering the function / Object in the ObjectTree API view.

This really has two parts:

  1. UI for Documentation
  2. Hook for getting Documentation to show


* IDEA

Provided by Browser:

  console.documentation = Symbol(&quot;documentation&quot;)

User Authored Object with documentation:

  // Class

  class Point {
    constructor(x, y) {
      this._x = x;
      this._y = y;
    },

    moveBy(x, y) {
      this._x += x;
      this._y += y;
    },

    moveBy2(x=0, y=0) {
      this.moveBy(x, y);
    },
  };

  // Documentation

  Point[console.documentation] = {
    description: &quot;Mutable two dimensional point.&quot;
  };

  Point.prototype.moveBy[console.documentation] = {
    description: &quot;Translate point by `x` and `y`.&quot;,
    references: [Point],
    parameters: {
      x: {type: &quot;number&quot;, description: &quot;x translation&quot;},
      y: {type: &quot;number&quot;, description: &quot;y translation&quot;},
    },
  };

  Point.prototype.moveBy2[console.documentation] = {
    description: &quot;Translate point by optional `x` and `y`. Deprecated. Use `moveBy`.&quot;,
    references: [Point, Point.prototype.moveBy],
    parameters: {
      x: {type: &quot;number&quot;, optional: true, description: &quot;x translation&quot;, defaultValue: 0},
      y: {type: &quot;number&quot;, optional: true, description: &quot;y translation&quot;, defaultValue: 0},
    },
  }


* NOTES
- The structure of the documentation objects will take though. It would help to study existing &quot;JSDoc, JavaScript, *Doc&quot; documentation schemes to see what information is useful.
- Should we instead try to parse this information from source? That is not as accurate as just asking the object. This could be something generated from source as loaded separately, for example via a &quot;//# documentationURL=library.js.doc&quot; (akin to SourceMap&apos;s sourceMappingURL). After all this is mostly useful for public object APIs.
- Built-in and Native can be given documentation in the same way that we add in parameter lists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1076876</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-03-13 00:09:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/20149853&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>