Applies a style rule on the document
@param string $selector
@param string $style
@return InlineStyle self
431024
public function applyRule($selector, $style)
    {
        if($selector) {
            $nodes = $this->_getNodesForCssSelector($selector);
            $style = $this->_styleToArray($style);

            foreach($nodes as $node) {
                $current = $node->hasAttribute("style") ?
                    $this->_styleToArray($node->getAttribute("style")) :
                    array();

                $current = $this->_mergeStyles($current, $style);

                $node->setAttribute("style", $this->_arrayToStyle($current));
            }
        }

        return $this;
    }
987393
private function convertToParagraph(string $selector): self {
        $nodes = $this->document()->find($selector);

        foreach ($nodes as $node) {
            $tagNodes = $node->find('a, blockquote, dl, div, img, ol, p, pre, table, ul');

            if (!$tagNodes->count()) {
                $this->replaceElementsWithPara($node);
            } else {
                $replacements = $this->getReplacementNodes($node);

                $node->contents()->remove();
                $node->append($replacements);
            }
        }

        return $this;
    }
30141
public static function addCssStyle($style, &$htmlOptions)
    {
        if (is_array($style)) {
            $style = implode('; ', $style);
        }
        $style = rtrim($style, ';');
        $htmlOptions['style'] = isset($htmlOptions['style'])
            ? rtrim($htmlOptions['style'], ';') . '; ' . $style
            : $style;
    }
724112
public function withSelector(DocumentSelector $selector): DocumentSource
    {
        $source = clone $this;
        $source->setSelector($selector);

        return $source;
    }
717274
public function mouseover($selector)
    {
        $element = $this->resolver->findOrFail($selector);

        $this->driver->getMouse()->mouseMove($element->getCoordinates());

        return $this;
    }
57249
public static void applyStyle(Element element, Style style) {
		if (style != null && element != null) {
			if (style instanceof ShapeStyle) {
				applyShapeStyle(element, (ShapeStyle) style);
			} else if (style instanceof FontStyle) {
				FontStyle fontStyle = (FontStyle) style;
				element.getStyle().setProperty("fontSize", "" + fontStyle.getFontSize());
				element.getStyle().setProperty("color", fontStyle.getFillColor());
				element.getStyle().setProperty("fontFamily", fontStyle.getFontFamily());
				element.getStyle().setProperty("fontWeight", fontStyle.getFontWeight());
				element.getStyle().setProperty("fontStyle", fontStyle.getFontStyle());
			} else if (style instanceof PictureStyle) {
				PictureStyle picturStyle = (PictureStyle) style;
				if (SC.isIE()) { //TODO: it's a VML decoder, why make this check?
					element.getStyle().setProperty("filter", "alpha(opacity=" + 100 * picturStyle.getOpacity() + ")");
				} else {
					element.setAttribute("style", "opacity:" + picturStyle.getOpacity() + ";");
				}
			}
		}
	}
745732
public function setStyle($cssStyle) {
		if (is_int($cssStyle)) {
			return $this->addToMember($this->class, CssRef::buttonStyles()[$cssStyle]);
		}
		if (JString::startsWith($cssStyle, "btn-")===false) {
			$cssStyle="btn".$cssStyle;
		}
		return $this->addToMemberCtrl($this->class, $cssStyle, CssRef::buttonStyles());
	}
1101131
public function style($value, $replace = false)
    {
        if ($replace) {
            return parent::attr('style', $value);
        }
        if (!isset($this->attributeList['style'])) {
            $this->attributeList['style'] = '';
        }
        $this->attributeList['style'] .= $value;

        return $this;
    }
1080345
function merge(Style $style)
    {
        $shorthand_properties = array("background", "border", "border_bottom", "border_color", "border_left", "border_radius", "border_right", "border_style", "border_top", "border_width", "flex", "font", "list_style", "margin", "padding", "transform");
        //treat the !important attribute
        //if old rule has !important attribute, override with new rule only if
        //the new rule is also !important
        foreach ($style->_props as $prop => $val) {
            $can_merge = false;
            if (isset($style->_important_props[$prop])) {
                $this->_important_props[$prop] = true;
                $can_merge = true;
            } else if (!isset($this->_important_props[$prop])) {
                $can_merge = true;
            }

            if ($can_merge) {
                //see __set and __get, on all assignments clear cache!
                $this->_prop_cache[$prop] = null;
                $this->_props[$prop] = $val;

                // Clear out "inherit" shorthand properties if specific properties have been set
                $shorthands = array_filter($shorthand_properties, function($el) use ($prop) {
                    return ( strpos($prop, $el."_") !== false );
                });
                foreach ($shorthands as $shorthand) {
                    if (array_key_exists($shorthand, $this->_props) && $this->_props[$shorthand] === "inherit") {
                        unset($this->_props[$shorthand]);
                    }
                } 
            }
        }

        if (isset($style->_props["font_size"])) {
            $this->__font_size_calculated = false;
        }
    }
382777
public function inline($style, array $attr = null)
    {
        $attr = $this->escaper->attr(
            $this->fixInlineAttr($attr)
        );
        return "<style {$attr}>{$style}</style>";
    }
1188786
public static function apply($str, $styles)
    {
        Arguments::validate($str, ['string']);
        Arguments::validate($styles, ['string', 'array']);

        if(!is_array($styles)) { $styles = [$styles]; }
        foreach($styles as $style) {
            $str = self::_apply($str, $style);
        }
        return $str;
    }
1333181
public function setStyle(array $style = [], $update = true)
    {
        $this->style = $update
            ? array_merge($this->style, $style)
            : $style;

        return $this;
    }
303294
public function setStyle(string $style): Bootstrap3Button
    {
        if (in_array($style, $this->supported_styles) === true) {
            $this->style = $style;
        } else {
            $this->style = 'default';
        }

        return $this;
    }
1015603
function inlineAllStyles(element) {
  let styles = getComputedStyle(element);
  for(let key in styles) {
    if(styles.hasOwnProperty(key)) {
      element.style[key] = styles[key];
    }
  }

  for(let i = 0; i < element.childNodes.length; i++) {
    let node = element.childNodes[i];
    if(node.nodeType === 1) {
      inlineAllStyles(node);
    }
  }
}
760755
private function mapAllInlineStylesToHtmlAttributes(\DOMXPath $xPath)
    {
        /** @var \DOMElement $node */
        foreach ($this->getAllNodesWithStyleAttribute($xPath) as $node) {
            $inlineStyleDeclarations = $this->parseCssDeclarationsBlock($node->getAttribute('style'));
            $this->mapCssToHtmlAttributes($inlineStyleDeclarations, $node);
        }
    }
36689
public function setSelector(string $selector)
    {
        if (empty($selector)) {
            Throw new TokenException('Empty selectors are not allowed.');
        }

        $this->selector = $selector;
    }
250493
protected function applyStylesToElement($element, $styles)
    {
        foreach ($styles as $tag => $data) {
            $element['attributes'][$tag] = $data;
        }

        return $element;
    }