The state *is* correct when the tab activation event occurs. In fact, the assertion in this test that check the state are passing.
So as developer, your code is not affected by that, if you check the state they're perfectly fine. Here the issue is another: because the DOM node is one for very tab of a window, we change the attributes once the tab is selected. That means, that you can have the DOM node that still have the previous value if you checked before the update is made.

I agree that we should do a better check, as I wrote in the comment, but this is not affecting the high level API neither the developer code in any way.