I can only quote Dr. Michael Kay, saying:
The XPath 1.0 specification defines that a path expression (or a
union expression) returns a node-set, that is, an unordered set of nodes.
Some host languages, for example XSLT 1.0, specify that node-sets are always
processed in document order. But you appear (as far as I can tell) to be
invoking XPath from some Microsoft API, and I've no idea what that API says
about the processing order: it's up to the XPath host language to define it,
or it could choose to leave it undefined.
And, if major browsers should ever adopt XPath 2.0:
This changes in XPath 2.0, which specifies that path expressions and union
expressions return a sequence of distinct nodes in document order.
In your case, this simply means: Do not use the |
or union
operator if the order of the result set and duplicates matter to you. Use a predicate that contains or
(the path expressions you have now edited out of your question) if such an expression return the results in the same order for both Firefox and Chrome.
But in general, the document order cannot be guaranteed for node-sets, since unorderedness is a property of sets:
The second important point is that the order in which the elements of a set are listed is irrelevant (unlike for a sequence or tuple) (from: Set(mathematics)).
Still, many implementations of XPath 1.0 return the "items" in a node-set in document-order - not because they are obliged to do so by the specification, but because in many cases, returning results in document order really makes sense.
There are several very similar questions already, for example this question or this one.