Skip to main content

Bug Tracker

Side navigation

Ticket #4302: pessimistic_combinators.html
File pessimistic_combinators.html, 1.8 KB (added by scott_h, March 22, 2009 06:34PM UTC)
��<!DOCTYPE html>

<html>

	<head>

		<title>Pessimistic Combinators (Reduced test case for jQuery bug)</title>

		<style>

			.a > div span {

				background-color: yellow;

			}

		</style>

		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

		<script>

			var s = '.a > div span';

			// This test fails for all non-' ' combinators between '.a' and 'div'.



			$(s).live('click', function(e) {

				this.style.fontStyle = 'italic';

			});



			document.addEventListener('click', function(e) {

				var t = e.target,

				    m = t.ownerDocument.querySelectorAll(s),

				    i = m.length;



				while (i) {

					if (m[--i] === t) {

						t.style.textDecoration = 'underline';

					}

				}

			}, false);

		</script>

	</head>

	<body class="a">

		<div class="a"></div>

		<div>

			<div><span>Clicking this text should make it italic and underlined.</span></div>

		</div>

	</body>

</html>

Download in other formats:

Original Format