Why even test inputType here?  If x-inputmode is set to digits, shouldn't we always honor it?

I'm not sure what the right thing to do for <input type=tel inputmode=digits> would be. If we let type override inputmode in that case, then should type=search should probably also override inputmode=digits?  What I means is, you might want to check the actual specified type, not the return value of mapInputType.