If you are asking about what a user agent should do, for the case of bgcolor on the <body>
element, that's defined for HTML5 in the Rendering Section, where it says:
When a body element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy color value, and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'background-color' property to the resulting color.