fix layout.js for opera 12

Opera 12.16 fix, because a `document.documentElement` has a `currentStyle` property. And a test `layout on elements with display: none ancestors` failed.