IAccessibleText::getAttributes() method to get text attributes. Refer to Gecko text attributes to get list of supported text attributes.
We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE