| 390 | }; |
| 391 | |
| 392 | void SVGNodeConstructor::ParseCSSStyle(const DOMNode* xmlNode, CSSMapper* mapper) { |
| 393 | std::shared_ptr<DOMNode> child = xmlNode->firstChild; |
| 394 | while (child) { |
| 395 | if (child->type == DOMNodeType::Text) { |
| 396 | auto css = child->name; |
| 397 | CSSParser parser(css); |
| 398 | parser.parse(); |
| 399 | for (const auto& rule : parser.getRules()) { |
| 400 | mapper->insert({rule.selector, rule.declarations}); |
| 401 | } |
| 402 | } |
| 403 | child = child->nextSibling; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | std::shared_ptr<SVGNode> SVGNodeConstructor::ConstructSVGNode(const ConstructionContext& context, |
| 408 | const DOMNode* xmlNode) { |