-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-ui-3] Add test text-overflow and pointer event interaction
This is to reflect the spec change introduced by w3c/csswg-drafts#1637
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<meta charset="utf-8"> | ||
<title>CSS Basic User Interface Test: interacting with the ellipsis</title> | ||
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-ui/#text-overflow"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<meta name="flags" content="ahem interact dom should"> | ||
<meta name="assert" content="Pointer events on the ellipsis should be dispatched to the elided inline element if there's one, rather than directly to the block."> | ||
<style> | ||
#test { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
margin-left: -100px; | ||
width: 2.5em; | ||
height: 1em; | ||
white-space: pre; | ||
font: 100px/1 ahem; | ||
color: blue; | ||
} | ||
#discard { | ||
float: left; | ||
} | ||
</style> | ||
|
||
<div id=discard>First, click the blue box. </div> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div id="test"><span id="inner"> </span></div> | ||
<script> | ||
document.getElementById("test").addEventListener("click", red); | ||
document.getElementById("inner").addEventListener("click", green) | ||
function red() { | ||
document.getElementById("test").style.color="red"; | ||
document.getElementById("discard").remove(); | ||
document.children[0].className=""; | ||
} | ||
function green(e) { | ||
document.getElementById("test").style.color="green"; | ||
document.getElementById("discard").remove(); | ||
document.children[0].className=""; | ||
e.stopPropagation(); | ||
} | ||
</script> |