|
126 | 126 | * (1) super chain mixes togther to make `propertiesForClass` which is |
127 | 127 | * then used to make `observedAttributes`. |
128 | 128 | * (2) properties effects and observers are created from it at `finalize` time. |
129 | | - * @param {HTMLElement} klass |
| 129 | + * |
| 130 | + * @param {HTMLElement} klass Element class |
| 131 | + * @return {Object} Object containing own properties for this class |
130 | 132 | * @private |
131 | 133 | */ |
132 | 134 | function ownPropertiesForClass(klass) { |
|
142 | 144 | /** |
143 | 145 | * Returns the `observers` array specifically on `klass`. Use for |
144 | 146 | * setting up observers. |
145 | | - * @param {HTMLElement} klass |
| 147 | + * |
| 148 | + * @param {HTMLElement} klass Element class |
| 149 | + * @return {Array} Array containing own observers for this class |
146 | 150 | * @private |
147 | 151 | */ |
148 | 152 | function ownObserversForClass(klass) { |
|
158 | 162 | /** |
159 | 163 | * Mixes `props` into `flattenedProps` but upgrades shorthand type |
160 | 164 | * syntax to { type: Type}. |
161 | | - * @param {Object} flattenedProps |
162 | | - * @param {Object} props |
| 165 | + * |
| 166 | + * @param {Object} flattenedProps Bag to collect flattened properties into |
| 167 | + * @param {Object} props Bag of properties to add to `flattenedProps` |
| 168 | + * @return {Objecg} The input `flattenedProps` bag |
163 | 169 | * @private |
164 | 170 | */ |
165 | 171 | function flattenProperties(flattenedProps, props) { |
|
178 | 184 | * constructor's `config.properties`. This list is used to create |
179 | 185 | * (1) observedAttributes, |
180 | 186 | * (2) class property default values |
181 | | - * @param {HTMLElement} klass |
182 | | - * @return {PolymerElementProperties} |
| 187 | + * |
| 188 | + * @param {HTMLElement} klass Element class |
| 189 | + * @return {PolymerElementProperties} Flattened properties for this class |
183 | 190 | * @private |
184 | 191 | */ |
185 | 192 | function propertiesForClass(klass) { |
|
202 | 209 | * This list is created as an optimization since it is a subset of |
203 | 210 | * the list returned from `propertiesForClass`. |
204 | 211 | * This list is used in `_initializeProperties` to set property defaults. |
205 | | - * @param {HTMLElement} klass |
206 | | - * @return {PolymerElementProperties} |
| 212 | + * |
| 213 | + * @param {HTMLElement} klass Element class |
| 214 | + * @return {PolymerElementProperties} Flattened properties for this class |
| 215 | + * that have default values |
207 | 216 | * @private |
208 | 217 | */ |
209 | 218 | function propertyDefaultsForClass(klass) { |
|
224 | 233 |
|
225 | 234 | /** |
226 | 235 | * Returns true if a `klass` has finalized. Called in `ElementClass.finalize()` |
227 | | - * @param {HTMLElement} klass |
| 236 | + * @param {HTMLElement} klass Element class |
| 237 | + * @return {boolean} True if all metaprogramming for this class has been |
| 238 | + * completed |
228 | 239 | * @private |
229 | 240 | */ |
230 | 241 | function hasClassFinalized(klass) { |
|
235 | 246 | * Called by `ElementClass.finalize()`. Ensures this `klass` and |
236 | 247 | * *all superclasses* are finalized by traversing the prototype chain |
237 | 248 | * and calling `klass.finalize()`. |
238 | | - * @param {HTMLElement} klass |
| 249 | + * |
| 250 | + * @param {HTMLElement} klass Element class |
239 | 251 | * @private |
240 | 252 | */ |
241 | 253 | function finalizeClassAndSuper(klass) { |
|
252 | 264 | * a `template`. This includes creating accessors and effects |
253 | 265 | * for properties in `config` and the `template` as well as preparing the |
254 | 266 | * `template` for stamping. |
| 267 | + * |
| 268 | + * @param {HTMLElement} klass Element class |
| 269 | + * @private |
255 | 270 | */ |
256 | 271 | function finalizeClass(klass) { |
257 | 272 | klass.__finalized = true; |
|
287 | 302 | * Leverages `PropertyEffects` to create property accessors and effects |
288 | 303 | * supporting, observers, reflecting to attributes, change notification, |
289 | 304 | * computed properties, and read only properties. |
290 | | - * @param {HTMLElement} proto |
291 | | - * @param {Object} properties |
| 305 | + * @param {HTMLElement} proto Element class prototype to add accessors |
| 306 | + * and effects to |
| 307 | + * @param {Object} properties Flattened bag of property descriptors for |
| 308 | + * this class |
292 | 309 | * @private |
293 | 310 | */ |
294 | 311 | function finalizeProperties(proto, properties) { |
|
300 | 317 | /** |
301 | 318 | * Configures a `proto` based on a `observers` array. |
302 | 319 | * Leverages `PropertyEffects` to create observers. |
303 | | - * @param {HTMLElement} proto |
304 | | - * @param {Array} observers |
| 320 | + * @param {HTMLElement} proto Element class prototype to add accessors |
| 321 | + * and effects to |
| 322 | + * @param {Object} observers Flattened array of observer descriptors for |
| 323 | + * this class |
| 324 | + * @param {Object} dynamicFns Object containing keys for any properties |
| 325 | + * that are functions and should trigger the effect when the function |
| 326 | + * reference is changed |
305 | 327 | * @private |
306 | 328 | */ |
307 | | - function finalizeObservers(proto, observers, dynamicProperties) { |
| 329 | + function finalizeObservers(proto, observers, dynamicFns) { |
308 | 330 | for (let i=0; i < observers.length; i++) { |
309 | | - proto._createMethodObserver(observers[i], dynamicProperties); |
| 331 | + proto._createMethodObserver(observers[i], dynamicFns); |
310 | 332 | } |
311 | 333 | } |
312 | 334 |
|
|
359 | 381 | * and/or provide an advanced api for manipulating them. |
360 | 382 | * Also consider adding warnings when an effect cannot be changed. |
361 | 383 | * |
362 | | - * @param {HTMLElement} proto |
| 384 | + * @param {HTMLElement} proto Element class prototype to add accessors |
| 385 | + * and effects to |
363 | 386 | * @param {string} name Name of the property. |
364 | 387 | * @param {object} info Info object from which to create property effects. |
365 | 388 | * Supported keys: |
|
399 | 422 | * Configures an element `proto` to function with a given `template`. |
400 | 423 | * The element name `is` and extends `ext` must be specified for ShadyCSS |
401 | 424 | * style scoping. |
402 | | - * @param {HTMLElement} proto |
403 | | - * @param {HTMLTemplateElement} template |
| 425 | + * |
| 426 | + * @param {HTMLElement} proto Element class prototype to add accessors |
| 427 | + * and effects to |
| 428 | + * @param {HTMLTemplateElement} template Template to process and bind |
404 | 429 | * @param {string} baseURI URL against which to resolve urls in |
405 | | - * style element cssText. |
406 | | - * @param {string} is |
407 | | - * @param {string} ext |
| 430 | + * style element cssText |
| 431 | + * @param {string} is Tag name (or type extension name) for this element |
| 432 | + * @param {string=} ext For type extensions, the tag name that was extended |
408 | 433 | * @private |
409 | 434 | */ |
410 | 435 | function finalizeTemplate(proto, template, baseURI, is, ext) { |
|
470 | 495 | } |
471 | 496 |
|
472 | 497 | /** |
473 | | - * Returns the template stamped into this element's shadow root. |
| 498 | + * Returns the template that will be stamped into this element's shadow root. |
474 | 499 | * |
475 | 500 | * If a `static get is()` getter is defined, the default implementation |
476 | 501 | * will return the first `<template>` in a `dom-module` whose `id` |
|
504 | 529 | * } |
505 | 530 | * } |
506 | 531 | * |
507 | | - * @returns {HTMLTemplateElement|string} |
| 532 | + * @returns {HTMLTemplateElement|string} Template to be stamped |
508 | 533 | */ |
509 | 534 | static get template() { |
510 | 535 | if (!this.hasOwnProperty(goog.reflect.objectProperty('_template', this))) { |
|
526 | 551 | * matching this element's static `is` property. |
527 | 552 | * Note, this path should contain a trailing `/`. |
528 | 553 | * |
529 | | - * @returns {string} |
| 554 | + * @returns {string} The import path for this element class |
530 | 555 | */ |
531 | 556 | static get importPath() { |
532 | 557 | if (!this.hasOwnProperty(goog.reflect.objectProperty('_importPath', this))) { |
|
833 | 858 | */ |
834 | 859 | registrations: [], |
835 | 860 | /** |
| 861 | + * @param {HTMLElement} prototype Element prototype to log |
836 | 862 | * @private |
837 | 863 | */ |
838 | 864 | _regLog: function(prototype) { |
839 | 865 | console.log('[' + prototype.is + ']: registered') |
840 | 866 | }, |
841 | 867 | /** |
842 | 868 | * Registers a class prototype for telemetry purposes. |
| 869 | + * @param {HTMLElement} prototype Element prototype to register |
843 | 870 | * @protected |
844 | 871 | */ |
845 | 872 | register: function(prototype) { |
|
868 | 895 | * |
869 | 896 | * These properties are retained unless a value of `null` is set. |
870 | 897 | * |
871 | | - * @param {Object=} properties Bag of custom property key/values to |
| 898 | + * @param {Object=} props Bag of custom property key/values to |
872 | 899 | * apply to the document. |
873 | 900 | */ |
874 | 901 | Polymer.updateStyles = function(props) { |
|
0 commit comments