aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual/dialog/stacking.html
blob: 221498a558696686ad3dd35de8eb819f21ffb224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Dialog Visual Test</title>
	<link rel="stylesheet" href="../../../themes/base/all.css">
	<script src="../../../external/jquery/jquery.js"></script>
	<script src="../../../ui/core.js"></script>
	<script src="../../../ui/widget.js"></script>
	<script src="../../../ui/mouse.js"></script>
	<script src="../../../ui/draggable.js"></script>
	<script src="../../../ui/position.js"></script>
	<script src="../../../ui/resizable.js"></script>
	<script src="../../../ui/button.js"></script>
	<script src="../../../ui/dialog.js"></script>

	<script>
	$(function() {
		var iframeDialog = $( "#dialog-iframe" ).dialog({
				position: {
					my: "right-90 center"
				},
				height: 400
			}),

			scrollingDialog = $( "#dialog-scrolling" ).dialog({
				maxHeight: 200,
				position: {
					my: "left+90 center"
				}
			}),

			otherDialog = $( "#dialog-other" ).dialog({
				width: 200,
				height: 150
			});
	});
	</script>
</head>
<body>

<p>WHAT: Two dialogs, one embedding an iframe, one having just scrollable content.</p>
<p>EXPECTED: When focusing on one or the other dialog, it shouldn't affect how the content is displayed on the other dialog. It shouldn't reload the iframe or reset the scroll.</p>


<div id="dialog-iframe" title="Dialog that embeds an iframe">
	<iframe src="animated.html" height="400"></iframe>
</div>

<div id="dialog-scrolling" title="Dialog with scroll">
	<p style="height:600px;background:#eee">a bunch of content</p>
</div>

<div id="dialog-other" title="placeholder">Just another dialog to test stacking</div>

</body>
</html>
> = 50; private int penalty; private boolean isFlagged; private int breakClass = -1; /** * Create a new KnuthPenalty. * * @param w the width of this penalty * @param p the penalty value of this penalty * @param f is this penalty flagged? * @param pos the Position stored in this penalty * @param isAuxiliary is this penalty auxiliary? */ public KnuthPenalty(int w, int p, boolean f, Position pos, boolean isAuxiliary) { super(w, pos, isAuxiliary); penalty = p; isFlagged = f; } /** * Create a new KnuthPenalty. * * @param w the width of this penalty * @param p the penalty value of this penalty * @param f is this penalty flagged? * @param breakClass the break class of this penalty (one of * {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE}, * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}) * @param pos the Position stored in this penalty * @param isAuxiliary is this penalty auxiliary? */ public KnuthPenalty(int w, int p, boolean f, int breakClass, Position pos, boolean isAuxiliary) { this(w, p, f, pos, isAuxiliary); this.breakClass = breakClass; } private static String getBreakClassName(int breakClass) { return AbstractBreaker.getBreakClassName(breakClass); } /** * Get the penalty's value as a {@link java.lang.String}. * (Mainly used in {@link #toString()} methods, to improve readability * of the trace logs.) * * @param penaltyValue the penalty value * @return the penalty value as a {@link java.lang.String} */ protected static String valueOf(int penaltyValue) { String result = (penaltyValue < 0) ? "-" : ""; int tmpValue = Math.abs(penaltyValue); result += (tmpValue == KnuthElement.INFINITE) ? "INFINITE" : String.valueOf(tmpValue); return result; } /** {@inheritDoc} */ public boolean isPenalty() { return true; } /** * @return the penalty value of this penalty. */ public int getP() { return penalty; } /** * Sets a new penalty value. * @param p the new penalty value */ public void setP(int p) { this.penalty = p; } /** @return true is this penalty is a flagged one. */ public boolean isFlagged() { return isFlagged; } /** {@inheritDoc} */ public boolean isForcedBreak() { return penalty == -KnuthElement.INFINITE; } /** * @return the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, * EN_ODD_PAGE) */ public int getBreakClass() { return breakClass; } /** {@inheritDoc} */ public String toString() { StringBuffer sb = new StringBuffer(64); if (isAuxiliary()) { sb.append("aux. "); } sb.append("penalty"); sb.append(" p="); sb.append(valueOf(this.penalty)); if (this.isFlagged) { sb.append(" [flagged]"); } sb.append(" w="); sb.append(getW()); if (isForcedBreak()) { sb.append(" (forced break, ") .append(getBreakClassName(this.breakClass)) .append(")"); } else if (this.penalty >= 0 && this.breakClass != -1) { //penalty corresponding to a keep constraint sb.append(" (keep constraint, ") .append(getBreakClassName(this.breakClass)) .append(")"); } return sb.toString(); } }