parses a style class node name
197524
function parse_node_name(name)
{
	// is it a "modifier" style class
	let is_a_modifier = false

	// detect modifier style classes
	if (starts_with(name, '&'))
	{
		name = name.substring('&'.length)
		is_a_modifier = true
	}

	// support old-school CSS syntax
	if (starts_with(name, '.'))
	{
		name = name.substring('.'.length)
	}

	// if there is a trailing colon in the style class name - trim it
	// (Python people with yaml-alike syntax)
	if (ends_with(name, ':'))
	{
		name = name.substring(0, name.length - ':'.length)
		// throw new Error(`Remove the trailing colon at line: ${original_line}`)
	}

	return { name, is_a_modifier }
}
476200
function validate_child_style_class_types(parent_node_names, names)
{
	for (let parent of parent_node_names)
	{
		// if it's a pseudoclass, it can't contain any style classes
		if (is_pseudo_class(parent) && not_empty(names))
		{
			throw new Error(`A style class declaration "${names[0]}" found inside a pseudoclass "${parent}". Pseudoclasses (:hover, etc) can't contain child style classes.`)
		}

		// if it's a media query style class, it must contain only pseudoclasses
		if (is_media_query(parent))
		{
			const non_pseudoclass = names.filter(x => !is_pseudo_class(x))[0]

			if (non_pseudoclass)
			{
				throw new Error(`A non-pseudoclass "${non_pseudoclass}" found inside a media query style class "${parent}". Media query style classes can only contain pseudoclasses (:hover, etc).`)
			}
		}
		
		// if it's a keyframes style class, it must contain only keyframe selectors
		if (is_keyframes(parent)) {
			const non_keyframe_selector = names.filter(x => !is_keyframe_selector(x))[0]

			if (non_keyframe_selector) 
			{
				throw new Error(`A non-keyframe-selector "${non_keyframe_selector}" found inside a keyframes style class "${parent}". Keyframes style classes can only contain keyframe selectors (from, 100%, etc).`);
			}
		}
	}
}
307649
def process_style_style( element )
      style_name = element.attribute("#{@style_ns}:name").value.gsub(/\./, "_");
      parent_name = element.attribute("#{@style_ns}:parent-style-name");
      if (parent_name) then
        parent_name = parent_name.value.gsub(/\./,"_")
        if (@style_info[parent_name]) then
          @style_info[style_name] = DeclarationBlock.new(
            @style_info[parent_name] )
        end
      elsif (@style_info[style_name] == nil) then
        @style_info[style_name] = DeclarationBlock.new( )
      end

      element.elements.each do |child|
        process_style( style_name, child )
      end
    end
1136691
def _parse_node(graph, text):
    """"""
    match = _NODEPAT.match(text)
    if match is not None:
        node = match.group(1)
        graph.node(node, label=match.group(2), shape='circle')
        return node
    match = _LEAFPAT.match(text)
    if match is not None:
        node = match.group(1)
        graph.node(node, label=match.group(2), shape='box')
        return node
    raise ValueError('Unable to parse node: {0}'.format(text))
14673
function(node, att, style) {
        style = style || node.style;
        var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,
            val = '';

        if (style) {
            if (att in CUSTOM_STYLES) {
                if (CUSTOM_STYLES[att].get) {
                    return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return
                } else if (typeof CUSTOM_STYLES[att] === 'string') {
                    att = CUSTOM_STYLES[att];
                }
            }
            val = style[att];
            if (val === '') { // TODO: is empty string sufficient?
                val = Y_DOM[GET_COMPUTED_STYLE](node, att);
            }
        }

        return val;
    }
535165
def process_style( class_name, style_element )
      if (style_element != nil) then
        style_element.attributes.each_attribute do |attr|
          if (@style_dispatch.has_key?(attr.expanded_name)) then
            self.send( @style_dispatch[attr.expanded_name], class_name,
              attr.name, attr.value )
          end
        end
      end
    end
929548
function parseStyles(s) {
  var parser = new parserlib.css.Parser();
  var result = { property: Object.create(null), priority: Object.create(null) };
  parser.addListener("property", function(e) {
    if (e.invalid) return; // Skip errors
    result.property[e.property.text] = e.value.text;
    if (e.important) result.priority[e.property.text] = 'important';
  });
  s = (''+s).replace(/^;/, '');
  parser.parseStyleAttribute(s);
  return result;
}
461056
function(styles_string) {

		styles_string = styles_string.trim();

		var styles = styles_string.split(/[\;]+/),
			result = {},
			parts,
			i = 0,
			count = styles.length,
			resultCount = 0;

		if (styles_string) {

			for (; i < count; i++) {

				styles[i] = styles[i].trim();

				if (styles[i]) {

					parts = styles[i].split(':');

					if (parts.length == 2) {

						parts[0] = parts[0].trim();
						parts[1] = parts[1].trim();
						result[parts[0]] = parts[1];
						resultCount++;

					} else {

						Lava.t("Unable to parse the style attribute");

					}

				}

			}

		}

		return resultCount ? result : null;

	}
558646
private Class<?> nodeClass(Element node) throws ClassNotFoundException {
		String className = getAttribute(node, "class");
		if (className == null) {
			return null;
		}

		return Loader.loadClass(DOMJettyWebXmlParser.class, className, true);
	}
702522
function parse_node_json(styles, children_lines, node_names)
{
	// transform this node's style lines from text to JSON properties and their values
	const style_object = styles.map(function(style)
	{
		let key   = style.substring(0, style.indexOf(':')).trim()
		let value = style.substring(style.indexOf(':') + ':'.length).trim()

		// transform dashed key to camelCase key (it's required by React)
		key = key.replace(/([-]{1}[a-z]{1})/g, character => character.substring(1).toUpperCase())

		// support old CSS syntax
		value = value.replace(/;$/, '').trim()

		// check if the value can be parsed into an integer
		if (String(parseInt(value)) === value)
		{
			value = parseInt(value)
		}

		// check if the value can be parsed into a float
		if (String(parseFloat(value)) === value)
		{
			value = parseFloat(value)
		}

		return { key, value }
	})
	// combine the styles into a JSON object
	.reduce(function(styles, style)
	{
		styles[style.key] = style.value
		return styles
	}, 
	{})

	// parse child nodes and add them to this node's JSON object
	return extend(style_object, parse_children(children_lines, node_names))
}
1135231
function parseMaxStyle(styleValue, node, parentProperty) {
		var valueInPixels;
		if (typeof styleValue === 'string') {
			valueInPixels = parseInt(styleValue, 10);

			if (styleValue.indexOf('%') !== -1) {
				// percentage * size in dimension
				valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
			}
		} else {
			valueInPixels = styleValue;
		}

		return valueInPixels;
	}
1155680
function get_node_style(node)
{
	return Object.keys(node)
	// get all CSS styles of this style class node
	.filter(property => typeof(node[property]) !== 'object')
	// for each CSS style of this style class node
	.reduce(function(style, style_property)
	{
		style[style_property] = node[style_property]
		return style
	}, 
	{})
}
664171
function (cssCtxt) {
            var classpath = cssCtxt.tplClasspath;
            var associatedTo = this.__styleTagAssociation[classpath];

            if (associatedTo) {
                return associatedTo;
            }

            if (cssCtxt.isTemplate()) {
                associatedTo = "tpl";
            } else if (cssCtxt.isWidget()) {
                associatedTo = "wgt";
            } else {
                associatedTo = "pool" + this.__NEXT_TAG_INDEX;
                this.__NEXT_TAG_INDEX += 1;
            }

            return associatedTo;
        }
859142
def parse_style(self, style):
        '''
        
        '''
        style_elements = style.split(';')
        while style_elements:
            element = style_elements.pop()
            if element.startswith('fill:'):
                return self.parse_color(element[5:])
        return None
1360349
public void parseStyleAttribute(final Reader reader, String systemID, final CssErrorHandler err, final CssContentHandler doc) throws
      IOException,
      CssException
  {
    CssTokenIterator iter = scan(reader, systemID, err);
    doc.startDocument();
    while (iter.hasNext())
    {
      CssToken tk = iter.next();
			
			if(MATCH_SEMI.apply(tk)) 
			{
				continue; //starting with ';' is allowed, Issue 238
			}
      try
      {
			
        CssDeclaration decl = handleDeclaration(tk, iter, doc, err, true);
        if (decl != null)
        {
          doc.declaration(decl);
        }
        else
        {
          // #handleDeclaration has issued errors
          return;
        }
      }
      catch (PrematureEOFException te)
      {
        // The subroutines report premature EOF to ErrHandler
        // on occurrence; if the listener rethrows it will
        // be a CssException so we don't catch it here.
        break;
      }
    }
    doc.endDocument();
  }
1125395
function( styleText, nativeNormalize ) {
			var props = [],
				name,
				parsedProps = CKEDITOR.tools.parseCssText( styleText, true, nativeNormalize );

			for ( name in parsedProps )
				props.push( name + ':' + parsedProps[ name ] );

			props.sort();

			return props.length ? ( props.join( ';' ) + ';' ) : '';
		}
342434
function(node, className) {
        var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
        return re.test(node.className);
    }