<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Dijit.place unit test</title>
	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../css/dijitTests.css";

		body {
			height: 100%;
			padding: 0px;
			margin: 0px;
		}

		.aroundNode {
			position: absolute;
			width: 20px;
			height: 20px;
			background: yellow;
		}
		
		#popup {
			position: absolute;
			width: 75px;
			background: blue;
			color: white;
		}
	</style>
	<script type="text/javascript" src="../../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: false"></script>
	<script type="text/javascript" src="../_testCommon.js"></script>

	<script type="text/javascript">
		dojo.require("doh.runner");
		dojo.require("dijit.dijit");


		dojo.addOnLoad(function(){

			// The around nodes
			var aroundTop = dojo.byId("aroundTop"),
				aroundBottom = dojo.byId("aroundBottom"),
				aroundLeft = dojo.byId("aroundLeft"),
				aroundRight = dojo.byId("aroundRight");
	
			// The popup (aka dropdown)
			var popup = dojo.byId("popup");

			doh.register("dijit._base.place",
				[
					function placeOnScreenTL(t){
						// Place popup at (10,7)... dijit.placeOnScreen() should choose the top-left corner, because
						// any of the other corner would make the popup go partially off the screen
						var ret = dijit.placeOnScreen(popup, {x: 10, y:7}, ["TR", "BR", "BL", "TL"]);

						doh.is("TL", ret.corner, "top left corner chosen");
						doh.is("10px", popup.style.left, "x coord");
						doh.is("7px", popup.style.top, "y coord");
						doh.is(75, ret.w, "it's 75px wide");
					},
					function placeOnScreenTR(t){
						// Place popup at top right... dijit.placeOnScreen() should choose the top-right corner, because
						// any of the other corner would make the popup go partially off the screen
						var viewport = dijit.getViewport(),
							ret = dijit.placeOnScreen(popup, {x: viewport.w-10, y:7}, ["TL", "BR", "TR", "BL"]),
							popupCoords = dojo.coords(popup);

						doh.is("TR", ret.corner, "top left corner chosen");
						doh.is(viewport.w-10, popupCoords.l + popupCoords.w, "x coord");
						doh.is("7px", popup.style.top, "y coord");
						doh.is(75, ret.w, "it's 75px wide");
					},
					function placeOnScreenAroundNodeT(t){
						// Dropdown from "aroundTop" node. Should pick the second choice, since the first
						// goes offscreen.
						var ret = dijit.placeOnScreenAroundNode(popup, aroundTop, {
							"TL": "BL",	// aroundTop's top-left corner with the popup's bottom-left corner (fails)
							"BL": "TL",	// aroundTop's bottom-left corner with the popup's top-left corner (works)
							"BR": "TR"	// aroundTop's bottom-left corner with the popup's top-left corner (works)
						});

						doh.is("BL", ret.aroundCorner, "around corner");
						doh.is("TL", ret.corner, "popup's corner");
						doh.is("20px", popup.style.top, "underneath around node");
						doh.is(dojo.coords(aroundTop).l+"px", popup.style.left, "left sides aligned");
					},
					function placeOnScreenAroundNodeTooltip(t){
						// Same as above test except that shape of drop down changes depending on where it's positioned.
						// Simulates tooltip placement (tooltip shape changes b/c of the arrow).
						// Should pick the third choice this time
						
						function layoutNode(node, aroundCorner, nodeCorner){
							node.style.width = (nodeCorner == "TL" ? "5000px" : "75px");
						}
						var ret = dijit.placeOnScreenAroundNode(popup, aroundTop, {
							"TL": "BL",	// aroundTop's top-left corner with the popup's bottom-left corner (fails)
							"BL": "TL",	// aroundTop's bottom-left corner with the popup's top-left corner (works)
							"BR": "TR"	// aroundTop's bottom-left corner with the popup's top-left corner (works)
						}, layoutNode);

						doh.is("BR", ret.aroundCorner, "around corner");
						doh.is("TR", ret.corner, "popup's corner");
						doh.is("20px", popup.style.top, "underneath around node");
						doh.is(dojo.coords(aroundTop).l+dojo.coords(aroundTop).w,
							dojo.coords(popup).l+dojo.coords(popup).w,
							"right sides aligned");
					},
					function placeOnScreenAroundNodeB(t){
						// Dropdown from "aroundBottom" node. Should go above aroundNode so that
						// popup doesn't go offscreen
						var ret = dijit.placeOnScreenAroundNode(popup, aroundBottom, {
							"BL": "TL",	// aroundBottom's bottom-left corner with the popup's top-left corner (fails)
							"TL": "BL",	// aroundBottom's top-left corner with the popup's bottom-left corner (works)
							"BR": "TR"	// aroundBottom's bottom-left corner with the popup's top-left corner (fails)
						});

						doh.is("TL", ret.aroundCorner, "around corner");
						doh.is("BL", ret.corner, "popup's corner");
						doh.is(dojo.coords(aroundBottom).t, dojo.coords(popup).t + dojo.coords(popup).h, "above around node");<commit_msg>Use dojo.position() in dijit tests, instead of dojo.coords(). The one strange thing is the tooltip test, where the height is reported as a fractional value, but apparently that's expected because the height of some node w/in Tooltip is specified as em/%.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Dijit.place unit test</title>
	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../css/dijitTests.css";

		body {
			height: 100%;
			padding: 0px;
			margin: 0px;
		}

		.aroundNode {
			position: absolute;
			width: 20px;
			height: 20px;
			background: yellow;
		}
		
		#popup {
			position: absolute;
			width: 75px;
			background: blue;
			color: white;
		}
	</style>
	<script type="text/javascript" src="../../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: false"></script>
	<script type="text/javascript" src="../_testCommon.js"></script>

	<script type="text/javascript">
		dojo.require("doh.runner");
		dojo.require("dijit.dijit");


		dojo.addOnLoad(function(){

			// The around nodes
			var aroundTop = dojo.byId("aroundTop"),
				aroundBottom = dojo.byId("aroundBottom"),
				aroundLeft = dojo.byId("aroundLeft"),
				aroundRight = dojo.byId("aroundRight");
	
			// The popup (aka dropdown)
			var popup = dojo.byId("popup");

			doh.register("dijit._base.place",
				[
					function placeOnScreenTL(t){
						// Place popup at (10,7)... dijit.placeOnScreen() should choose the top-left corner, because
						// any of the other corner would make the popup go partially off the screen
						var ret = dijit.placeOnScreen(popup, {x: 10, y:7}, ["TR", "BR", "BL", "TL"]);

						doh.is("TL", ret.corner, "top left corner chosen");
						doh.is("10px", popup.style.left, "x coord");
						doh.is("7px", popup.style.top, "y coord");
						doh.is(75, ret.w, "it's 75px wide");
					},
					function placeOnScreenTR(t){
						// Place popup at top right... dijit.placeOnScreen() should choose the top-right corner, because
						// any of the other corner would make the popup go partially off the screen
						var viewport = dijit.getViewport(),
							ret = dijit.placeOnScreen(popup, {x: viewport.w-10, y:7}, ["TL", "BR", "TR", "BL"]),
							popupCoords = dojo.position(popup);

						doh.is("TR", ret.corner, "top left corner chosen");
						doh.is(viewport.w-10, popupCoords.x + popupCoords.w, "x coord");
						doh.is("7px", popup.style.top, "y coord");
						doh.is(75, ret.w, "it's 75px wide");
					},
					function placeOnScreenAroundNodeT(t){
						// Dropdown from "aroundTop" node. Should pick the second choice, since the first
						// goes offscreen.
						var ret = dijit.placeOnScreenAroundNode(popup, aroundTop, {
							"TL": "BL",	// aroundTop's top-left corner with the popup's bottom-left corner (fails)
							"BL": "TL",	// aroundTop's bottom-left corner with the popup's top-left corner (works)
							"BR": "TR"	// aroundTop's bottom-left corner with the popup's top-left corner (works)
						});

						doh.is("BL", ret.aroundCorner, "around corner");
						doh.is("TL", ret.corner, "popup's corner");
						doh.is("20px", popup.style.top, "underneath around node");
						doh.is(dojo.position(aroundTop).x+"px", popup.style.left, "left sides aligned");
					},
					function placeOnScreenAroundNodeTooltip(t){
						// Same as above test except that shape of drop down changes depending on where it's positioned.
						// Simulates tooltip placement (tooltip shape changes b/c of the arrow).
						// Should pick the third choice this time
						
						function layoutNode(node, aroundCorner, nodeCorner){
							node.style.width = (nodeCorner == "TL" ? "5000px" : "75px");
						}
						var ret = dijit.placeOnScreenAroundNode(popup, aroundTop, {
							"TL": "BL",	// aroundTop's top-left corner with the popup's bottom-left corner (fails)
							"BL": "TL",	// aroundTop's bottom-left corner with the popup's top-left corner (works)
							"BR": "TR"	// aroundTop's bottom-left corner with the popup's top-left corner (works)
						}, layoutNode);

						doh.is("BR", ret.aroundCorner, "around corner");
						doh.is("TR", ret.corner, "popup's corner");
						doh.is("20px", popup.style.top, "underneath around node");
						doh.is(dojo.position(aroundTop).x+dojo.position(aroundTop).w,
							dojo.position(popup).x+dojo.position(popup).w,
							"right sides aligned");
					},
					function placeOnScreenAroundNodeB(t){
						// Dropdown from "aroundBottom" node. Should go above aroundNode so that
						// popup doesn't go offscreen
						var ret = dijit.placeOnScreenAroundNode(popup, aroundBottom, {
							"BL": "TL",	// aroundBottom's bottom-left corner with the popup's top-left corner (fails)
							"TL": "BL",	// aroundBottom's top-left corner with the popup's bottom-left corner (works)
							"BR": "TR"	// aroundBottom's bottom-left corner with the popup's top-left corner (fails)
						});

						doh.is("TL", ret.aroundCorner, "around corner");
						doh.is("BL", ret.corner, "popup's corner");
						doh.is(dojo.position(aroundBottom).y, dojo.position(popup).y + dojo.position(popup).h, "above around node");
{'fraction_non_alphanumeric': 0.15617899832065593, 'fraction_numerical': 0.009878494517435542, 'mean_word_length': 3.0839048003227107, 'pattern_counts': {'":': 18, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3588971', 'n_tokens_mistral': 4297, 'n_tokens_neox': 3308, 'n_words': 909}