Browse Source

Add inline-block and shrink-to-fit tests.

Michael Ragazzon 5 năm trước cách đây
mục cha
commit
e4d137447f

+ 31 - 0
Tests/Data/VisualTests/inline_block.rml

@@ -0,0 +1,31 @@
+<rml>
+<head>
+    <title>Inline-block</title>
+    <link type="text/rcss" href="../style.rcss"/>
+	<meta name="Description" content="Inline-block" />
+	<style>
+		body {
+			background: #ddd;
+			color: #444;
+		}
+		.float {
+			float: left;
+			color: #393;
+		}
+		.iblock {
+			display: inline-block;
+			color: #33c;
+		}
+	</style>
+</head>
+
+<body>
+<div>The following text <div class="iblock">is an inline-block</div> and should flow naturally.</div>
+<hr/>
+<div>Left filler text <div class="iblock">meets an inline-block<br/>with a line-break</div> right filler text.</div>
+<hr/>
+<div>Left filler text. <div class="iblock">An inline-block. <p>A paragraph</p> Filler text.</div> Right filler text.</div>
+<hr/>
+<div>Left filler text. <div class="iblock">An inline-block. <div class="float">A float</div> Filler text.</div> Right filler text.</div>
+</body>
+</rml>

+ 52 - 0
Tests/Data/VisualTests/shrink_to_fit.rml

@@ -0,0 +1,52 @@
+<rml>
+<head>
+    <title>Shrink-to-fit</title>
+    <link type="text/rcss" href="../style.rcss"/>
+	<link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#shrink-to-fit-float" />
+	<meta name="Description" content="Shrink-to-fit width" />
+	<style>
+		body {
+			background: #ddd;
+			color: #444;
+		}
+		body > div {
+			clear: both;
+			position: relative;
+			height: 50px;
+		}
+		body > div > * {
+			border: 2px #888;
+			color: black;
+			background: #ccf;
+		}
+		.absolute {
+			position: absolute;
+		}
+		.float {
+			float: left;
+		}
+		.iblock {
+			display: inline-block;
+		}
+	</style>
+</head>
+
+<body>
+<p>The following boxes should all appear the same, with the background and border tightly packed around the word 'BOX'.</p>
+<div>
+	<span>BOX</span>
+</div>
+<div>
+	<div class="absolute">BOX</div>
+</div>
+<div>
+	<div class="float">BOX</div>
+</div>
+<div>
+	<span class="float">BOX</span>
+</div>
+<div>
+	<div class="iblock">BOX</div>
+</div>
+</body>
+</rml>