I spent a bit more time trying out different things and here's what I found
1- <div dir="foo"></div>
is not filtered out even if the value does not match rtl
or ltr
2- <div dir></div>
is also not filtered out
This line has can be selected with [dir="foo"]
This line can be selected with div[dir=""]
So I can technically make
<div dir="carousel">
// slides
</div>
work but I have a feeling that you might be interested in preventing this behavior. I will wait and see what you think.