Add support for style.width in %. Improve switch test case.