flutter_flutter/tests/lowlevel/style-basic.sky
Ojan Vafai b9f182a6bd Stop rendering text inside flex boxes.
Text can only only inside paragraphs and inlines. This patch makes it
so we stop putting such text nodes in the render tree at all if their
parent is not a paragraph or an inline.

This is the final step in making it so that we don't create anonymous
renderers, which fixes a crash in the new custom layout code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1077473002
2015-04-09 11:40:03 -07:00

50 lines
1.5 KiB
Plaintext

<!DOCTYPE html>
<html>
<import src="../resources/dump-as-text.sky" />
<style>
#id1 { order: 1; }
.class2 { order: 2; }
tag-name-3 { order: 3; }
.class4.class4 { order: 4; }
.class5#id5 { order: 5; }
tag-name-6.class6#id6 { order: 6; }
</style>
<body>
<div id="tests">
<div id="id1"></div>
<div class="class2"></div>
<tag-name-3></tag-name-3>
<div class="class4 class4"></div>
<div class="class5" id="id5"></div>
<tag-name-6 class="class6" id="id6"></tag-name-6>
</div>
<div id="log"></div>
<script>
import "dart:sky";
main() {
var tests = document.getElementById("tests");
var log = document.getElementById("log");
var i = 1;
for (Element element = tests.firstElementChild; element != null; element = element.nextElementSibling) {
var order = int.parse(window.getComputedStyle(element)["order"]);
var p = document.createElement("p");
var text = (order == i) ? "PASS" : "FAIL";
text += ": <"
+ element.tagName
+ " class="
+ element.classList.toString()
+ " id=" + element.getAttribute("id").toString()
+ "> order was "
+ order.toString();
if (order != i)
text += " expected " + i;
p.textContent = text;
log.appendChild(p);
++i;
}
}
</script>
</body>
</html>