|
Line 0
a/LayoutTests/fast/forms/validation-message-clone.html_sec1
|
|
|
1 |
<!DOCTYPE html> |
| 2 |
<head> |
| 3 |
<script src="../js/resources/js-test-pre.js"></script> |
| 4 |
<script src="resources/common.js"></script> |
| 5 |
</head> |
| 6 |
<body> |
| 7 |
<p>There are two text fields. The first one should have a validation message bubble, and another should have no validation message.</p> |
| 8 |
<form action="validation-message-clone.html"> |
| 9 |
<div style="height:100px;"><input required></div> |
| 10 |
<div style="height:100px;" id=dest></div> |
| 11 |
<div><input type=submit id=submit></div> |
| 12 |
<div id=console></div> |
| 13 |
</form> |
| 14 |
|
| 15 |
<script> |
| 16 |
var original = document.getElementsByTagName('input')[0]; |
| 17 |
var lastInOriginalShadow; |
| 18 |
var lastInClonedShadow; |
| 19 |
$('submit').click(); |
| 20 |
setTimeout(cloneElementWithValidationMessage, 0); |
| 21 |
if (window.layoutTestController) |
| 22 |
layoutTestController.waitUntilDone(); |
| 23 |
|
| 24 |
function cloneElementWithValidationMessage() { |
| 25 |
$('dest').appendChild(original.cloneNode()); |
| 26 |
setTimeout(confirmNoBubble, 0); |
| 27 |
} |
| 28 |
|
| 29 |
function confirmNoBubble() { |
| 30 |
if (!window.layoutTestController) |
| 31 |
return; |
| 32 |
|
| 33 |
lastInOriginalShadow = internals.shadowRoot(original).lastChild; |
| 34 |
shouldBeTrue('internals.shadowPseudoId(lastInOriginalShadow) == "-webkit-validation-bubble"'); |
| 35 |
lastInClonedShadow = internals.shadowRoot($('dest').firstChild).lastChild; |
| 36 |
shouldBeFalse('internals.shadowPseudoId(lastInClonedShadow) == "-webkit-validation-bubble"'); |
| 37 |
layoutTestController.notifyDone(); |
| 38 |
} |
| 39 |
</script> |
| 40 |
|
| 41 |
</body> |