Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
YUI.add('stylesheet', function (Y, NAME) {
2
 
3
/**
4
 * The StyleSheet component is a module for creating and modifying CSS
5
 * stylesheets.
6
 *
7
 * @module stylesheet
8
 */
9
var d      = Y.config.doc,
10
    p      = d.createElement('p'), // Have to hold the node (see notes)
11
    workerStyle = p.style, // worker style collection
12
    isString = Y.Lang.isString,
13
    selectors = {},
14
    sheets = {},
15
    floatAttr = ('cssFloat' in workerStyle) ? 'cssFloat' : 'styleFloat',
16
    _toCssText,
17
    _unsetOpacity,
18
    _unsetProperty,
19
    OPACITY = 'opacity',
20
    FLOAT   = 'float',
21
    EMPTY   = '';
22
 
23
// Normalizes the removal of an assigned style for opacity.  IE uses the filter
24
// property.
25
_unsetOpacity = (OPACITY in workerStyle) ?
26
    function (style) { style.opacity = EMPTY; } :
27
    function (style) { style.filter = EMPTY; };
28
 
29
// Normalizes the removal of an assigned style for a given property.  Expands
30
// shortcut properties if necessary and handles the various names for the float
31
// property.
32
workerStyle.border = "1px solid red";
33
workerStyle.border = EMPTY; // IE doesn't unset child properties
34
_unsetProperty = workerStyle.borderLeft ?
35
    function (style,prop) {
36
        var p;
37
        if (prop !== floatAttr && prop.toLowerCase().indexOf(FLOAT) != -1) {
38
            prop = floatAttr;
39
        }
40
        if (isString(style[prop])) {
41
            switch (prop) {
42
                case OPACITY:
43
                case 'filter' : _unsetOpacity(style); break;
44
                case 'font'   :
45
                    style.font       = style.fontStyle = style.fontVariant =
46
                    style.fontWeight = style.fontSize  = style.lineHeight  =
47
                    style.fontFamily = EMPTY;
48
                    break;
49
                default       :
50
                    for (p in style) {
51
                        if (p.indexOf(prop) === 0) {
52
                            style[p] = EMPTY;
53
                        }
54
                    }
55
            }
56
        }
57
    } :
58
    function (style,prop) {
59
        if (prop !== floatAttr && prop.toLowerCase().indexOf(FLOAT) != -1) {
60
            prop = floatAttr;
61
        }
62
        if (isString(style[prop])) {
63
            if (prop === OPACITY) {
64
                _unsetOpacity(style);
65
            } else {
66
                style[prop] = EMPTY;
67
            }
68
        }
69
    };
70
 
71
/**
72
 * Create an instance of StyleSheet to encapsulate a css stylesheet.
73
 * The constructor can be called using function or constructor syntax.
74
 * <pre><code>var sheet = Y.StyleSheet(..);</pre></code>
75
 * or
76
 * <pre><code>var sheet = new Y.StyleSheet(..);</pre></code>
77
 *
78
 * The first parameter passed can be any of the following things:
79
 * <ul>
80
 *   <li>The desired string name to register a new empty sheet</li>
81
 *   <li>The string name of an existing StyleSheet instance</li>
82
 *   <li>The unique guid generated for an existing StyleSheet instance</li>
83
 *   <li>The id of an existing <code>&lt;link&gt;</code> or <code>&lt;style&gt;</code> node</li>
84
 *   <li>The node reference for an existing <code>&lt;link&gt;</code> or <code>&lt;style&gt;</code> node</li>
85
 *   <li>The Y.Node instance wrapping an existing <code>&lt;link&gt;</code> or <code>&lt;style&gt;</code> node</li>
86
 *   <li>A chunk of css text to create a new stylesheet from</li>
87
 * </ul>
88
 *
89
 * <p>If a string is passed, StyleSheet will first look in its static name
90
 * registry for an existing sheet, then in the DOM for an element with that id.
91
 * If neither are found and the string contains the { character, it will be
92
 * used as a the initial cssText for a new StyleSheet.  Otherwise, a new empty
93
 * StyleSheet is created, assigned the string value as a name, and registered
94
 * statically by that name.</p>
95
 *
96
 * <p>The optional second parameter is a string name to register the sheet as.
97
 * This param is largely useful when providing a node id/ref or chunk of css
98
 * text to create a populated instance.</p>
99
 *
100
 * @class StyleSheet
101
 * @constructor
102
 * @param seed {String|HTMLElement|Node} a style or link node, its id, or a
103
 *              name or guid of a StyleSheet, or a string of css text
104
 * @param name {String} (optional) name to register instance for future static
105
 *              access
106
 */
107
function StyleSheet(seed, name) {
108
    var head,
109
        node,
110
        sheet,
111
        cssRules = {},
112
        _rules,
113
        _insertRule,
114
        _deleteRule,
115
        i,r,sel;
116
 
117
    // Factory or constructor
118
    if (!(Y.instanceOf(this, StyleSheet))) {
119
        return new StyleSheet(seed,name);
120
    }
121
 
122
    // Extract the DOM node from Node instances
123
    if (seed) {
124
        if (Y.Node && seed instanceof Y.Node) {
125
            node = seed._node;
126
        } else if (seed.nodeName) {
127
            node = seed;
128
        // capture the DOM node if the string is an id
129
        } else if (isString(seed)) {
130
            if (seed && sheets[seed]) {
131
                return sheets[seed];
132
            }
133
            node = d.getElementById(seed.replace(/^#/,EMPTY));
134
        }
135
 
136
        // Check for the StyleSheet in the static registry
137
        if (node && sheets[Y.stamp(node)]) {
138
            return sheets[Y.stamp(node)];
139
        }
140
    }
141
 
142
 
143
    // Create a style node if necessary
144
    if (!node || !/^(?:style|link)$/i.test(node.nodeName)) {
145
        node = d.createElement('style');
146
        node.type = 'text/css';
147
    }
148
 
149
    if (isString(seed)) {
150
        // Create entire sheet from seed cssText
151
        if (seed.indexOf('{') != -1) {
152
            // Not a load-time fork because low run-time impact and IE fails
153
            // test for s.styleSheet at page load time (oddly)
154
            if (node.styleSheet) {
155
                node.styleSheet.cssText = seed;
156
            } else {
157
                node.appendChild(d.createTextNode(seed));
158
            }
159
        } else if (!name) {
160
            name = seed;
161
        }
162
    }
163
 
164
    // Make sure the node is attached to the appropriate head element
165
    if (!node.parentNode || node.parentNode.nodeName.toLowerCase() !== 'head') {
166
        head = (node.ownerDocument || d).getElementsByTagName('head')[0];
167
        // styleSheet isn't available on the style node in FF2 until appended
168
        // to the head element.  style nodes appended to body do not affect
169
        // change in Safari.
170
        head.appendChild(node);
171
    }
172
 
173
    // Begin setting up private aliases to the important moving parts
174
    // 1. The stylesheet object
175
    // IE stores StyleSheet under the "styleSheet" property
176
    // Safari doesn't populate sheet for xdomain link elements
177
    sheet = node.sheet || node.styleSheet;
178
 
179
    // 2. The style rules collection
180
    // IE stores the rules collection under the "rules" property
181
    _rules = sheet && ('cssRules' in sheet) ? 'cssRules' : 'rules';
182
 
183
    // 3. The method to remove a rule from the stylesheet
184
    // IE supports removeRule
185
    _deleteRule = ('deleteRule' in sheet) ?
186
        function (i) { sheet.deleteRule(i); } :
187
        function (i) { sheet.removeRule(i); };
188
 
189
    // 4. The method to add a new rule to the stylesheet
190
    // IE supports addRule with different signature
191
    _insertRule = ('insertRule' in sheet) ?
192
        function (sel,css,i) { sheet.insertRule(sel+' {'+css+'}',i); } :
193
        function (sel,css,i) { sheet.addRule(sel,css,i); };
194
 
195
    // 5. Initialize the cssRules map from the node
196
    // xdomain link nodes forbid access to the cssRules collection, so this
197
    // will throw an error.
198
    // TODO: research alternate stylesheet, @media
199
    for (i = sheet[_rules].length - 1; i >= 0; --i) {
200
        r   = sheet[_rules][i];
201
        sel = r.selectorText;
202
 
203
        if (cssRules[sel]) {
204
            cssRules[sel].style.cssText += ';' + r.style.cssText;
205
            _deleteRule(i);
206
        } else {
207
            cssRules[sel] = r;
208
        }
209
    }
210
 
211
    // Cache the instance by the generated Id
212
    StyleSheet.register(Y.stamp(node),this);
213
 
214
    // Register the instance by name if provided or defaulted from seed
215
    if (name) {
216
        StyleSheet.register(name,this);
217
    }
218
 
219
    // Public API
220
    Y.mix(this,{
221
        /**
222
         * Get the unique stamp for this StyleSheet instance
223
         *
224
         * @method getId
225
         * @return {Number} the static id
226
         */
227
        getId : function () { return Y.stamp(node); },
228
 
229
        /**
230
         * Enable all the rules in the sheet
231
         *
232
         * @method enable
233
         * @return {StyleSheet}
234
         * @chainable
235
         */
236
        enable : function () { sheet.disabled = false; return this; },
237
 
238
        /**
239
         * Disable all the rules in the sheet.  Rules may be changed while the
240
         * StyleSheet is disabled.
241
         *
242
         * @method disable
243
         * @return {StyleSheet}
244
         * @chainable
245
         */
246
        disable : function () { sheet.disabled = true; return this; },
247
 
248
        /**
249
         * Returns false if the StyleSheet is disabled.  Otherwise true.
250
         *
251
         * @method isEnabled
252
         * @return {Boolean}
253
         */
254
        isEnabled : function () { return !sheet.disabled; },
255
 
256
        /**
257
         * <p>Set style properties for a provided selector string.
258
         * If the selector includes commas, it will be split into individual
259
         * selectors and applied accordingly.  If the selector string does not
260
         * have a corresponding rule in the sheet, it will be added.</p>
261
         *
262
         * <p>The object properties in the second parameter must be the JavaScript
263
         * names of style properties.  E.g. fontSize rather than font-size.</p>
264
         *
265
         * <p>The float style property will be set by any of &quot;float&quot;,
266
         * &quot;styleFloat&quot;, or &quot;cssFloat&quot;.</p>
267
         *
268
         * @method set
269
         * @param sel {String} the selector string to apply the changes to
270
         * @param css {Object} Object literal of style properties and new values
271
         * @return {StyleSheet}
272
         * @chainable
273
         */
274
        set : function (sel,css) {
275
            var rule = cssRules[sel],
276
                multi = sel.split(/\s*,\s*/),i,
277
                idx;
278
 
279
            // IE's addRule doesn't support multiple comma delimited selectors
280
            if (multi.length > 1) {
281
                for (i = multi.length - 1; i >= 0; --i) {
282
                    this.set(multi[i], css);
283
                }
284
                return this;
285
            }
286
 
287
            // Some selector values can cause IE to hang
288
            if (!StyleSheet.isValidSelector(sel)) {
289
                Y.log("Invalid selector '"+sel+"' passed to set (ignoring).",'error','StyleSheet');
290
                return this;
291
            }
292
 
293
            // Opera throws an error if there's a syntax error in assigned
294
            // cssText. Avoid this using a worker style collection, then
295
            // assigning the resulting cssText.
296
            if (rule) {
297
                rule.style.cssText = StyleSheet.toCssText(css,rule.style.cssText);
298
            } else {
299
                idx = sheet[_rules].length;
300
                css = StyleSheet.toCssText(css);
301
 
302
                // IE throws an error when attempting to addRule(sel,'',n)
303
                // which would crop up if no, or only invalid values are used
304
                if (css) {
305
                    _insertRule(sel, css, idx);
306
 
307
                    // Safari replaces the rules collection, but maintains the
308
                    // rule instances in the new collection when rules are
309
                    // added/removed
310
                    cssRules[sel] = sheet[_rules][idx];
311
                }
312
            }
313
            return this;
314
        },
315
 
316
        /**
317
         * <p>Unset style properties for a provided selector string, removing
318
         * their effect from the style cascade.</p>
319
         *
320
         * <p>If the selector includes commas, it will be split into individual
321
         * selectors and applied accordingly.  If there are no properties
322
         * remaining in the rule after unsetting, the rule is removed.</p>
323
         *
324
         * <p>The style property or properties in the second parameter must be the
325
         * JavaScript style property names. E.g. fontSize rather than font-size.</p>
326
         *
327
         * <p>The float style property will be unset by any of &quot;float&quot;,
328
         * &quot;styleFloat&quot;, or &quot;cssFloat&quot;.</p>
329
         *
330
         * @method unset
331
         * @param sel {String} the selector string to apply the changes to
332
         * @param css {String|Array} style property name or Array of names
333
         * @return {StyleSheet}
334
         * @chainable
335
         */
336
        unset : function (sel,css) {
337
            var rule = cssRules[sel],
338
                multi = sel.split(/\s*,\s*/),
339
                remove = !css,
340
                rules, i;
341
 
342
            // IE's addRule doesn't support multiple comma delimited selectors
343
            // so rules are mapped internally by atomic selectors
344
            if (multi.length > 1) {
345
                for (i = multi.length - 1; i >= 0; --i) {
346
                    this.unset(multi[i], css);
347
                }
348
                return this;
349
            }
350
 
351
            if (rule) {
352
                if (!remove) {
353
                    css = Y.Array(css);
354
 
355
                    workerStyle.cssText = rule.style.cssText;
356
                    for (i = css.length - 1; i >= 0; --i) {
357
                        _unsetProperty(workerStyle,css[i]);
358
                    }
359
 
360
                    if (workerStyle.cssText) {
361
                        rule.style.cssText = workerStyle.cssText;
362
                    } else {
363
                        remove = true;
364
                    }
365
                }
366
 
367
                if (remove) { // remove the rule altogether
368
                    rules = sheet[_rules];
369
                    for (i = rules.length - 1; i >= 0; --i) {
370
                        if (rules[i] === rule) {
371
                            delete cssRules[sel];
372
                            _deleteRule(i);
373
                            break;
374
                        }
375
                    }
376
                }
377
            }
378
            return this;
379
        },
380
 
381
        /**
382
         * Get the current cssText for a rule or the entire sheet.  If the
383
         * selector param is supplied, only the cssText for that rule will be
384
         * returned, if found.  If the selector string targets multiple
385
         * selectors separated by commas, the cssText of the first rule only
386
         * will be returned.  If no selector string, the stylesheet's full
387
         * cssText will be returned.
388
         *
389
         * @method getCssText
390
         * @param sel {String} Selector string
391
         * @return {String}
392
         */
393
        getCssText : function (sel) {
394
            var rule, css, selector;
395
 
396
            if (isString(sel)) {
397
                // IE's addRule doesn't support multiple comma delimited
398
                // selectors so rules are mapped internally by atomic selectors
399
                rule = cssRules[sel.split(/\s*,\s*/)[0]];
400
 
401
                return rule ? rule.style.cssText : null;
402
            } else {
403
                css = [];
404
                for (selector in cssRules) {
405
                    if (cssRules.hasOwnProperty(selector)) {
406
                        rule = cssRules[selector];
407
                        css.push(rule.selectorText+" {"+rule.style.cssText+"}");
408
                    }
409
                }
410
                return css.join("\n");
411
            }
412
        }
413
    });
414
 
415
}
416
 
417
_toCssText = function (css,base) {
418
    var f    = css.styleFloat || css.cssFloat || css[FLOAT],
419
        trim = Y.Lang.trim,
420
        prop;
421
 
422
    // A very difficult to repro/isolate IE 9 beta (and Platform Preview 7) bug
423
    // was reduced to this line throwing the error:
424
    // "Invalid this pointer used as target for method call"
425
    // It appears that the style collection is corrupted. The error is
426
    // catchable, so in a best effort to work around it, replace the
427
    // p and workerStyle and try the assignment again.
428
    try {
429
        workerStyle.cssText = base || EMPTY;
430
    } catch (e) {
431
        Y.log("Worker style collection corrupted. Replacing.", "warn", "StyleSheet");
432
        p = d.createElement('p');
433
        workerStyle = p.style;
434
        workerStyle.cssText = base || EMPTY;
435
    }
436
 
437
    if (f && !css[floatAttr]) {
438
        css = Y.merge(css);
439
        delete css.styleFloat; delete css.cssFloat; delete css[FLOAT];
440
        css[floatAttr] = f;
441
    }
442
 
443
    for (prop in css) {
444
        if (css.hasOwnProperty(prop)) {
445
            try {
446
                // IE throws Invalid Value errors and doesn't like whitespace
447
                // in values ala ' red' or 'red '
448
                workerStyle[prop] = trim(css[prop]);
449
            }
450
            catch (ex) {
451
                Y.log('Error assigning property "'+prop+'" to "'+css[prop]+
452
                          "\" (ignored):\n"+ex.message,'warn','StyleSheet');
453
            }
454
        }
455
    }
456
    return workerStyle.cssText;
457
};
458
 
459
Y.mix(StyleSheet, {
460
    /**
461
     * <p>Converts an object literal of style properties and values into a string
462
     * of css text.  This can then be assigned to el.style.cssText.</p>
463
     *
464
     * <p>The optional second parameter is a cssText string representing the
465
     * starting state of the style prior to alterations.  This is most often
466
     * extracted from the eventual target's current el.style.cssText.</p>
467
     *
468
     * @method toCssText
469
     * @param css {Object} object literal of style properties and values
470
     * @param cssText {String} (optional) starting cssText value
471
     * @return {String} the resulting cssText string
472
     * @static
473
     */
474
    toCssText : ((OPACITY in workerStyle) ? _toCssText :
475
        // Wrap IE's toCssText to catch opacity.  The copy/merge is to preserve
476
        // the input object's integrity, but if float and opacity are set, the
477
        // input will be copied twice in IE.  Is there a way to avoid this
478
        // without increasing the byte count?
479
        function (css, cssText) {
480
            if (OPACITY in css) {
481
                css = Y.merge(css,{
482
                        filter: 'alpha(opacity='+(css.opacity*100)+')'
483
                      });
484
                delete css.opacity;
485
            }
486
            return _toCssText(css,cssText);
487
        }),
488
 
489
    /**
490
     * Registers a StyleSheet instance in the static registry by the given name
491
     *
492
     * @method register
493
     * @param name {String} the name to assign the StyleSheet in the registry
494
     * @param sheet {StyleSheet} The StyleSheet instance
495
     * @return {Boolean} false if no name or sheet is not a StyleSheet
496
     *              instance. true otherwise.
497
     * @static
498
     */
499
    register : function (name,sheet) {
500
        return !!(name && sheet instanceof StyleSheet &&
501
                  !sheets[name] && (sheets[name] = sheet));
502
    },
503
 
504
    /**
505
     * <p>Determines if a selector string is safe to use.  Used internally
506
     * in set to prevent IE from locking up when attempting to add a rule for a
507
     * &quot;bad selector&quot;.</p>
508
     *
509
     * <p>Bad selectors are considered to be any string containing unescaped
510
     * `~!@$%^&()+=|{}[];'"?< or space. Also forbidden are . or # followed by
511
     * anything other than an alphanumeric.  Additionally -abc or .-abc or
512
     * #_abc or '# ' all fail.  There are likely more failure cases, so
513
     * please file a bug if you encounter one.</p>
514
     *
515
     * @method isValidSelector
516
     * @param sel {String} the selector string
517
     * @return {Boolean}
518
     * @static
519
     */
520
    isValidSelector : function (sel) {
521
        var valid = false;
522
 
523
        if (sel && isString(sel)) {
524
 
525
            if (!selectors.hasOwnProperty(sel)) {
526
                // TEST: there should be nothing but white-space left after
527
                // these destructive regexs
528
                selectors[sel] = !/\S/.test(
529
                    // combinators
530
                    sel.replace(/\s+|\s*[+~>]\s*/g,' ').
531
                    // attribute selectors (contents not validated)
532
                    replace(/([^ ])\[.*?\]/g,'$1').
533
                    // pseudo-class|element selectors (contents of parens
534
                    // such as :nth-of-type(2) or :not(...) not validated)
535
                    replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,'$1').
536
                    // element tags
537
                    replace(/(?:^| )[a-z0-6]+/ig,' ').
538
                    // escaped characters
539
                    replace(/\\./g,EMPTY).
540
                    // class and id identifiers
541
                    replace(/[.#]\w[\w\-]*/g,EMPTY));
542
            }
543
 
544
            valid = selectors[sel];
545
        }
546
 
547
        return valid;
548
    }
549
},true);
550
 
551
Y.StyleSheet = StyleSheet;
552
 
553
/*
554
 
555
NOTES
556
 * Style node must be added to the head element.  Safari does not honor styles
557
   applied to StyleSheet objects on style nodes in the body.
558
 * StyleSheet object is created on the style node when the style node is added
559
   to the head element in Firefox 2 (and maybe 3?)
560
 * The cssRules collection is replaced after insertRule/deleteRule calls in
561
   Safari 3.1.  Existing Rules are used in the new collection, so the collection
562
   cannot be cached, but the rules can be.
563
 * Opera requires that the index be passed with insertRule.
564
 * Same-domain restrictions prevent modifying StyleSheet objects attached to
565
   link elements with remote href (or "about:blank" or "javascript:false")
566
 * Same-domain restrictions prevent reading StyleSheet cssRules/rules
567
   collection of link elements with remote href (or "about:blank" or
568
   "javascript:false")
569
 * Same-domain restrictions result in Safari not populating node.sheet property
570
   for link elements with remote href (et.al)
571
 * IE names StyleSheet related properties and methods differently (see code)
572
 * IE converts tag names to upper case in the Rule's selectorText
573
 * IE converts empty string assignment to complex properties to value settings
574
   for all child properties.  E.g. style.background = '' sets non-'' values on
575
   style.backgroundPosition, style.backgroundColor, etc.  All else clear
576
   style.background and all child properties.
577
 * IE assignment style.filter = '' will result in style.cssText == 'FILTER:'
578
 * All browsers support Rule.style.cssText as a read/write property, leaving
579
   only opacity needing to be accounted for.
580
 * Benchmarks of style.property = value vs style.cssText += 'property: value'
581
   indicate cssText is slightly slower for single property assignment.  For
582
   multiple property assignment, cssText speed stays relatively the same where
583
   style.property speed decreases linearly by the number of properties set.
584
   Exception being Opera 9.27, where style.property is always faster than
585
   style.cssText.
586
 * Opera 9.5b throws a syntax error when assigning cssText with a syntax error.
587
 * Opera 9.5 doesn't honor rule.style.cssText = ''.  Previous style persists.
588
   You have to remove the rule altogether.
589
 * Stylesheet properties set with !important will trump inline style set on an
590
   element or in el.style.property.
591
 * Creating a worker style collection like document.createElement('p').style;
592
   will fail after a time in FF (~5secs of inactivity).  Property assignments
593
   will not alter the property or cssText.  It may be the generated node is
594
   garbage collected and the style collection becomes inert (speculation).
595
 * IE locks up when attempting to add a rule with a selector including at least
596
   characters {[]}~`!@%^&*()+=|? (unescaped) and leading _ or -
597
   such as addRule('-foo','{ color: red }') or addRule('._abc','{...}')
598
 * IE's addRule doesn't support comma separated selectors such as
599
   addRule('.foo, .bar','{..}')
600
 * IE throws an error on valid values with leading/trailing white space.
601
 * When creating an entire sheet at once, only FF2/3 & Opera allow creating a
602
   style node, setting its innerHTML and appending to head.
603
 * When creating an entire sheet at once, Safari requires the style node to be
604
   created with content in innerHTML of another element.
605
 * When creating an entire sheet at once, IE requires the style node content to
606
   be set via node.styleSheet.cssText
607
 * When creating an entire sheet at once in IE, styleSheet.cssText can't be
608
   written until node.type = 'text/css'; is performed.
609
 * When creating an entire sheet at once in IE, load-time fork on
610
   var styleNode = d.createElement('style'); _method = styleNode.styleSheet ?..
611
   fails (falsey).  During run-time, the test for .styleSheet works fine
612
 * Setting complex properties in cssText will SOMETIMES allow child properties
613
   to be unset
614
   set         unset              FF2  FF3  S3.1  IE6  IE7  Op9.27  Op9.5
615
   ----------  -----------------  ---  ---  ----  ---  ---  ------  -----
616
   border      -top               NO   NO   YES   YES  YES  YES     YES
617
               -top-color         NO   NO   YES             YES     YES
618
               -color             NO   NO   NO              NO      NO
619
   background  -color             NO   NO   YES             YES     YES
620
               -position          NO   NO   YES             YES     YES
621
               -position-x        NO   NO   NO              NO      NO
622
   font        line-height        YES  YES  NO    NO   NO   NO      YES
623
               -style             YES  YES  NO              YES     YES
624
               -size              YES  YES  NO              YES     YES
625
               -size-adjust       ???  ???  n/a   n/a  n/a  ???     ???
626
   padding     -top               NO   NO   YES             YES     YES
627
   margin      -top               NO   NO   YES             YES     YES
628
   list-style  -type              YES  YES  YES             YES     YES
629
               -position          YES  YES  YES             YES     YES
630
   overflow    -x                 NO   NO   YES             n/a     YES
631
 
632
   ??? - unsetting font-size-adjust has the same effect as unsetting font-size
633
 * FireFox and WebKit populate rule.cssText as "SELECTOR { CSSTEXT }", but
634
   Opera and IE do not.
635
 * IE6 and IE7 silently ignore the { and } if passed into addRule('.foo','{
636
   color:#000}',0).  IE8 does not and creates an empty rule.
637
 * IE6-8 addRule('.foo','',n) throws an error.  Must supply *some* cssText
638
*/
639
 
640
 
641
 
642
}, '3.18.1', {"requires": ["yui-base"]});