Remove RenderSizedBox.

Make old users of RenderSizedBox use RenderConstrainedBox.
Change the semantics of BoxDecoration.apply* to actually apply the provided constraints to the current constraints, rather than the previous behaviour of merging them neutrally.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1189603003.
This commit is contained in:
Hixie
2015-06-15 15:51:56 -07:00
parent 1f1946c798
commit 6db8f15d3c
3 changed files with 4 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ void main() {
initUnit();
test("padding", () {
var size = new RenderSizedBox(desiredSize: new sky.Size(double.INFINITY, 100.0));
var size = new RenderConstrainedBox(additionalConstraints: new BoxConstraints().applyHeight(100.0));
var inner = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)), child: size);
var padding = new RenderPadding(padding: new EdgeDims.all(50.0), child: inner);
var block = new RenderBlock(children: [padding]);

View File

@@ -3,7 +3,7 @@ CONSOLE: TestRenderView enabled
CONSOLE:
PAINT FOR FRAME #1 ----------------------------------------------
1 | TestDisplayList() constructor: 800.0 x 600.0
1 | paintChild RenderSizedBox at Point(0.0, 0.0)
1 | paintChild RenderDecoratedBox at Point(0.0, 0.0)
1 | | TestDisplayList() constructor: 800.0 x 600.0
1 | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 600.0), Paint(Color(0xff00ff00)))
------------------------------------------------------------------------

View File

@@ -15,10 +15,8 @@ void main() {
initUnit();
test("should size to render view", () {
RenderSizedBox root = new RenderSizedBox(
child: new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00))
)
RenderBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00))
);
new TestRenderView(root);
expect(root.size.width, equals(sky.view.width));