| 152 | } |
| 153 | |
| 154 | void insertDeclarationIfNeeded(const CSSStyleDeclaration& declaration, |
| 155 | FlatMap<AttributeId, const CSSStyleDeclaration*>& bestStyleDeclarationByKey) { |
| 156 | auto attributeId = declaration.attribute.id; |
| 157 | |
| 158 | auto it = bestStyleDeclarationByKey.try_emplace(attributeId, &declaration); |
| 159 | if (!it.second) { |
| 160 | if (shouldReplaceDeclaration(*it.first->second, declaration)) { |
| 161 | it.first->second = &declaration; |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void CSSNode::insertDeclarations(const CSSDocument& cssDocument, |
| 167 | const CSSStyleNode& styleNode, |
no test coverage detected