blob: 44decf5c739b7dfb11c0ab817075fcce2b63ef78 [file] [log] [blame]
div { width:100px; height:100px;}
div#outsideDiv:before { content:"> "; }
div#outsideDiv:hover:before { display: block; content:"< "; }
Test for <a href=""></a>
Hover the mouse over the "Block" text. The test passes if the "Block" text is not moved above ">". This test ensures
that the "before" element after hover is inserted in the same position.
<div id="console"></div>
<div id="outsideDiv" onmouseover="checkTestResult()"><span id="span">Inline</span><div id="insideDiv">Block</p></div>
function getElementTop(elementId)
var elem = document.getElementById(elementId);
return elem.getBoundingClientRect().top;
function simulateMouseMove()
var outsideDivTop = getElementTop("outsideDiv");
if (window.eventSender)
eventSender.mouseMoveTo(50, outsideDivTop);
function checkTestResult()
var outsideDivTop = getElementTop("outsideDiv");
var insideDivTop = getElementTop("insideDiv");
document.getElementById("console").innerText = (insideDivOriginalTop != insideDivTop) ? "FAIL" : "PASS";
if (window.testRunner)
document.getElementById("outsideDiv").style.visibility = 'hidden';
if (window.testRunner)
// Capture the initial values for inside div top
var insideDivOriginalTop = getElementTop("insideDiv");
// Remove the span so that the "before" element is the only remaining child of the anonymous block
// that initially contained "before" and span.
var span = document.getElementById("span");
var outsideDiv = document.getElementById("outsideDiv");
if (window.testRunner) {