I pasted the code from the example into two files, one .html and one .css file. I the switched the order of the layers to B and then A, so that important styles in B take precedence over important styles in A.
I then used Firefox Developer Tools to inspect the h1 element, and while the computed panel shows the box shadow styled as declared in layer B, in the rules panel this is crossed out and instead the rule from the unlayered h1 style block is used.
So my question now is whether there is a reason for this or whether this is a bug in the Developer Tools?