Value FunLocalName::evaluate(EvaluationContext& context) const { if (argCount() > 0) { Value a = arg(0)->evaluate(context); if (!a.isNodeSet()) return ""; Node* node = a.toNodeSet(&context).firstNode(); return node ? expandedNameLocalPart(node) : ""; } return expandedNameLocalPart(context.node.get()); }
Value FunLocalName::evaluate() const { if (argumentCount() > 0) { Value a = argument(0).evaluate(); if (!a.isNodeSet()) return emptyString(); Node* node = a.toNodeSet().firstNode(); return node ? expandedNameLocalPart(node) : emptyString(); } return expandedNameLocalPart(evaluationContext().node.get()); }
static inline String expandedName(Node* node) { AtomicString prefix; switch (node->getNodeType()) { case Node::kElementNode: prefix = toElement(node)->prefix(); break; case Node::kAttributeNode: prefix = toAttr(node)->prefix(); break; default: break; } return prefix.isEmpty() ? expandedNameLocalPart(node) : prefix + ":" + expandedNameLocalPart(node); }
static inline String expandedName(Node* node) { const AtomicString& prefix = node->prefix(); return prefix.isEmpty() ? expandedNameLocalPart(node) : prefix + ":" + expandedNameLocalPart(node); }