<!DOCTYPE html>
<html>
<head>
<title>This tests that we layout both subtrees when they change the same time with selection on.</title>
</head>
<body>
<div>
  <svg height="30" width="200">
    <text id=first x="0" y="15">first</text>
  </svg>
</div>
<div>
  <svg height="30" width="200">
    <text id=second x="0" y="15">second</text>
  </svg>
</div>

<script>
if (window.testRunner)
  testRunner.waitUntilDone();
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(document.getElementById("second"));
selection.addRange(range);

setTimeout(function() {
  document.getElementById("first").textContent = "second";
  document.getElementById("second").textContent = "first";
  if (window.testRunner)
    testRunner.notifyDone();
}, 0);
</script>
</body>
</html>
