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

Function shouldReplaceDeclaration

valdi/src/valdi/runtime/CSS/CSSNode.cpp:143–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143inline bool shouldReplaceDeclaration(const CSSStyleDeclaration& existing, const CSSStyleDeclaration& newDeclaration) {
144 if (newDeclaration.priority < existing.priority) {
145 return false;
146 }
147 if (newDeclaration.priority > existing.priority) {
148 return true;
149 }
150
151 return newDeclaration.order > existing.order;
152}
153
154void insertDeclarationIfNeeded(const CSSStyleDeclaration& declaration,
155 FlatMap<AttributeId, const CSSStyleDeclaration*>& bestStyleDeclarationByKey) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected