Any @namespace rules must follow all @charset and @import rules and precede all other non-ignored at-rules and rule sets in a style sheet.
According to IETC WebKit is the only engin which gets this wrong (is too lenient on when you can use @namespace):
I'm not sure how much this matters in practice.
Weird, we had an effort to ensure such restrictions right some time ago. Apparently, this case was missed.