MCPcopy Create free account
hub / github.com/Tencent/tgfx / ParseCSSStyle

Method ParseCSSStyle

src/svg/SVGNodeConstructor.cpp:392–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390};
391
392void 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
407std::shared_ptr<SVGNode> SVGNodeConstructor::ConstructSVGNode(const ConstructionContext& context,
408 const DOMNode* xmlNode) {

Callers

nothing calls this directly

Calls 2

parseMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected