MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getAttributesForClass

Method getAttributesForClass

valdi/src/valdi/runtime/CSS/CSSDocument.cpp:132–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132Result<Ref<CSSAttributes>> CSSDocument::getAttributesForClass(const StringBox& className) const {
133 const auto& it = _rootNode.ruleIndex->classRules.find(className);
134 if (it == _rootNode.ruleIndex->classRules.end()) {
135 return Error(STRING_FORMAT("Could not find CSS rule '{}'", className));
136 }
137
138 return Valdi::makeShared<CSSAttributes>(it->second.styles);
139}
140
141const ResourceId& CSSDocument::getResourceId() const {
142 return _resourceId;

Callers 6

TEST_PFunction · 0.45
createViewFactoryMethod · 0.45
forceBindAttributesMethod · 0.45
createViewFactoryMethod · 0.45
runtimeGetCSSModuleMethod · 0.45

Calls 3

endMethod · 0.65
ErrorInterface · 0.50
findMethod · 0.45

Tested by 1

TEST_PFunction · 0.36