I trying to rearrange layouts when device screen is resized, so i do this:
if(screenOrientation == SCREEN_ORIENTATION_LANDSCAPE) {
document.querySelector("html /deep/ [landscape-horizontal]").removeAttribute('vertical');
document.querySelector("html /deep/ [landscape-horizontal]").setAttribute('horizontal', '');
}
This is working in the desktop machine correctly, but in mobile (both android phone, tablet and iOS simulator) i got this error:
"Uncaught SyntaxError: Failed to execute 'webkitMatchesSelector' on 'Element': 'html /deep/ [landscape-horizontal]' is not a valid selector.", source: bower_components/platform/platform.js (0)
Any ideas? Thanks!
I solved this problem via CSS:
Now i change "landscape" and "portrait" attributes in body on screen size changes. This is working in all browsers.
With Platform version ≥0.4.0 you can now use the
/deep/
combinator without fear, it's been polyfilled for non-native browsers.There's currently an open issue to support this in the Shadow DOM polyfill. It works on Chrome 35+, because that's using native shadow dom.