protected function parseStyleAttribute()
    {
        if (!$this->element->hasAttribute('style')) {
            // possible if style attribute has been removed
            if ($this->styleString !== '') {
                $this->styleString = '';
                $this->properties = [];
            }

            return;
        }

        // if style attribute is not changed
        if ($this->element->getAttribute('style') === $this->styleString) {
            return;
        }

        // save style attribute as is (without trimming)
        $this->styleString = $this->element->getAttribute('style');

        $styleString = trim($this->styleString, ' ;');

        if ($styleString === '') {
            $this->properties = [];

            return;
        }

        $properties = explode(';', $styleString);

        foreach ($properties as $property) {
            list($name, $value) = explode(':', $property);

            $name = trim($name);
            $value = trim($value);

            $this->properties[$name] = $value;
        }
    }