Edited: I reported this bug to Apple and now its closed, tested on beta iOS 9.0 (13A4254v) and works correctly.
Edited for better explanation:
I have a bunch of articles in a web page, all wrapped into a div (column). These articles have a class with absolute position, and fixed width and height.
there is a button to apply: - a translate3d to the wrapper/column - a window.history.pushState
All the styles are applied correctly to all the articles, but when i push the button and after the pushState, all/some of the nth-child() styles are not applied correctly (left, top and width). If i change the :nth-child() to :nth-of-type() all works correctly after the pushState.
The problem seems to be visible when safari determines to activate the possibility to switch into reader mode, after pushing the click button and affects to the translate3d elements (hardware accelerated).
It happends on Safari iOS8 using iPad2, iPad3 retina and 4. it don't happends using an iPad mini retina. Using iOS7 and before all works correctly, but no works using iOS8.
Code:
<html>
<head>
<meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0, user-scalable = 1.0">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
body {
position: relative;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
#column {
-webkit-transition: 0.35s; transition: 0.35s;
-webkit-transform: translate3d(0px, 0px, 0px);
position: absolute;
top: 10px;
left: 10px;
border: 1px solid Grey;
width: 300px;
height: 225px;
}
.moveColumn {
-webkit-transform: translate3d(200px, 0px, 0px) !important;
}
article {
position: absolute;
overflow: hidden;
}
article:nth-child(1) {
left: 0;
top: 0;
width: 300px;
height: 300px;
background-color: Red;
}
article:nth-child(2) {
left: 0px;
top: 305px;
width: 605px;
height: 300px;
background-color: Blue;
}
article:nth-child(3) {
left: 305px;
top: 0;
width: 300px;
height: 300px;
background-color: Green;
}
.button {
position: absolute;
left: 10px;
top: 250px;
background-color: Grey;
}
</style>
<script language="javascript">
var veces = 0;
function moveColumn() {
var column = document.querySelector('#column');
column.classList.toggle('moveColumn');
var obj = {};
obj.sectionId = "section";
window.history.pushState(obj, "TITLE", "/?vp=" + veces);
veces++;
}
</script>
</head>
<body>
<div id="column">
<article>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu urna quam. Duis et pellentesque ipsum, vitae varius erat. Nullam fringilla libero id est aliquet gravida. Quisque efficitur, quam bibendum posuere auctor, turpis arcu pulvinar sapien, interdum iaculis purus metus id velit. In in lorem ac dolor feugiat luctus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi viverra velit sed massa viverra consequat id eu tortor. Ut scelerisque massa ut leo rutrum blandit.
Maecenas sit amet facilisis nulla, nec convallis nunc. Ut gravida, erat eget eleifend viverra, elit lacus ultrices turpis, vitae molestie felis tellus ac eros. Integer semper vitae sapien sit amet placerat. Praesent in sodales massa. Aliquam erat volutpat. Etiam maximus massa a scelerisque cursus. Pellentesque facilisis enim nec diam viverra facilisis. Morbi non nibh nulla. Praesent erat urna, porta sit amet dui eu, porta pulvinar metus. Nam quam odio, laoreet in nisi in, porta efficitur purus. In fringilla magna ac accumsan commodo.</article>
<article>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu urna quam. Duis et pellentesque ipsum, vitae varius erat. Nullam fringilla libero id est aliquet gravida. Quisque efficitur, quam bibendum posuere auctor, turpis arcu pulvinar sapien, interdum iaculis purus metus id velit. In in lorem ac dolor feugiat luctus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi viverra velit sed massa viverra consequat id eu tortor. Ut scelerisque massa ut leo rutrum blandit.
Maecenas sit amet facilisis nulla, nec convallis nunc. Ut gravida, erat eget eleifend viverra, elit lacus ultrices turpis, vitae molestie felis tellus ac eros. Integer semper vitae sapien sit amet placerat. Praesent in sodales massa. Aliquam erat volutpat. Etiam maximus massa a scelerisque cursus. Pellentesque facilisis enim nec diam viverra facilisis. Morbi non nibh nulla. Praesent erat urna, porta sit amet dui eu, porta pulvinar metus. Nam quam odio, laoreet in nisi in, porta efficitur purus. In fringilla magna ac accumsan commodo.</article>
<article>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu urna quam. Duis et pellentesque ipsum, vitae varius erat. Nullam fringilla libero id est aliquet gravida. Quisque efficitur, quam bibendum posuere auctor, turpis arcu pulvinar sapien, interdum iaculis purus metus id velit. In in lorem ac dolor feugiat luctus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi viverra velit sed massa viverra consequat id eu tortor. Ut scelerisque massa ut leo rutrum blandit.
Maecenas sit amet facilisis nulla, nec convallis nunc. Ut gravida, erat eget eleifend viverra, elit lacus ultrices turpis, vitae molestie felis tellus ac eros. Integer semper vitae sapien sit amet placerat. Praesent in sodales massa. Aliquam erat volutpat. Etiam maximus massa a scelerisque cursus. Pellentesque facilisis enim nec diam viverra facilisis. Morbi non nibh nulla. Praesent erat urna, porta sit amet dui eu, porta pulvinar metus. Nam quam odio, laoreet in nisi in, porta efficitur purus. In fringilla magna ac accumsan commodo.</article>
</div>
<div class="button" onclick="javascript:moveColumn();"> Click me to move column</div>
</body>
</html>
have you experienced something like that?