This is consistent with other functions such as HTMLElement::offset_width and fixes a crash for the included test. Returning an offset of zero is not correct for this case, but this is still an improvement to not crash.
Crypto::fill_with_secure_random