mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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
31 lines
971 B
Plaintext
31 lines
971 B
Plaintext
<style>
|
|
border-box {
|
|
background-color: pink;
|
|
box-sizing: border-box;
|
|
max-width: 300px;
|
|
padding: 0 5%;
|
|
}
|
|
</style>
|
|
<container style="width: 400px">
|
|
<border-box>
|
|
<p>Even though the width of 'border-box' stays the same after it reaches 300px, the width available to its children decreases as its padding continues to expand. Because the padding is based off the width before it's constrained by min/max. This tests that we continue to layout the contents of border-box even when its own width remains the same.</p>
|
|
</div>
|
|
</container>
|
|
|
|
<script>
|
|
import "../resources/third_party/unittest/unittest.dart";
|
|
import "../resources/unit.dart";
|
|
|
|
import "dart:sky";
|
|
|
|
void main() {
|
|
initUnit();
|
|
|
|
test("paragraph width should shrink", () {
|
|
expect(document.querySelector("p").offsetWidth, equals(260));
|
|
document.querySelector("container").style["width"] = "800px";
|
|
expect(document.querySelector("p").offsetWidth, equals(220));
|
|
});
|
|
}
|
|
</script>
|