demos/Collage/fabric.js
function parseStyleAttribute(element) {
    var oStyle = { },
        style = element.getAttribute('style');
    if (style) {
      if (typeof style == 'string') {
        style = style.replace(/;$/, '').split(';').forEach(function (current) {
            var attr = current.split(':');
            oStyle[normalizeAttr(attr[0].trim().toLowerCase())] = attr[1].trim();
        });
      } else {
        for (var prop in style) {
          if (typeof style[prop] !== 'undefined') {
            oStyle[normalizeAttr(prop.toLowerCase())] = style[prop];
          }
        }
      }
    }
    return oStyle;
  }
function parseStyleAttribute(element) {
    var oStyle = { },
        style = element.getAttribute('style');
    if (style) {
      if (typeof style == 'string') {
        style = style.replace(/;$/, '').split(';').forEach(function (current) {
            var attr = current.split(':');
            oStyle[normalizeAttr(attr[0].trim().toLowerCase())] = attr[1].trim();
        });
      } else {
        for (var prop in style) {
          if (typeof style[prop] !== 'undefined') {
            oStyle[normalizeAttr(prop.toLowerCase())] = style[prop];
          }
        }
      }
    }
    return oStyle;
  }
function parseStyleAttribute ( element ) { var oStyle = { } , style = element . getAttribute ( 'style' ) ; if ( style ) { if ( typeof style == 'string' ) { style = style . replace ( / ;$ / , '' ) . split ( ';' ) . forEach ( function ( current ) { var attr = current . split ( ':' ) ; oStyle [ normalizeAttr ( attr [ 0 ] . trim ( ) . toLowerCase ( ) ) ] = attr [ 1 ] . trim ( ) ; } ) ; } else { for ( var prop in style ) { if ( typeof style [ prop ] !== 'undefined' ) { oStyle [ normalizeAttr ( prop . toLowerCase ( ) ) ] = style [ prop ] ; } } } } return oStyle ; }
Parses "style" attribute, retuning an object with values
@static
@memberOf fabric
@method parseStyleAttribute
@param {SVGElement} element Element to parse
@return {Object} Objects with values parsed from style attribute of an element
Parses style attribute retuning an object with values