udacity / frontend-grading-engine

Providing immediate feedback for front-end code
MIT License
132 stars 172 forks source link

getting shorthand or used value css property may result in a test failing #25

Open notetiene opened 7 years ago

notetiene commented 7 years ago

When using the window.getComputedStyle method to get a CSS value, it may not return the actual value. Depending on the browser implementation, the browser can return an empty String or a deliberately wrong value (for security in that case).

As an example, getting the padding shorthand CSS property in Firefox will fail because it complies to the CSS specifications (surprisingly Chrome doesn't).

It might be worth complying to the various browser implementations. See https://developer.mozilla.org/en-US/docs/Web/CSS/used_value#Difference_from_computed_values