| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'box.dart'; | 7 import 'box.dart'; |
| 8 import 'object.dart'; | 8 import 'object.dart'; |
| 9 | 9 |
| 10 enum FontWeight { | 10 enum FontWeight { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 _layoutRoot.rootElement = _document.createElement('p'); | 168 _layoutRoot.rootElement = _document.createElement('p'); |
| 169 inline = inlineValue; | 169 inline = inlineValue; |
| 170 } | 170 } |
| 171 | 171 |
| 172 final sky.Document _document = new sky.Document(); | 172 final sky.Document _document = new sky.Document(); |
| 173 final sky.LayoutRoot _layoutRoot = new sky.LayoutRoot(); | 173 final sky.LayoutRoot _layoutRoot = new sky.LayoutRoot(); |
| 174 | 174 |
| 175 InlineBase _inline; | 175 InlineBase _inline; |
| 176 BoxConstraints _constraintsForCurrentLayout; | 176 BoxConstraints _constraintsForCurrentLayout; |
| 177 | 177 |
| 178 String get inline => _inline; | 178 InlineBase get inline => _inline; |
| 179 void set inline (InlineBase value) { | 179 void set inline (InlineBase value) { |
| 180 _inline = value; | 180 _inline = value; |
| 181 _layoutRoot.rootElement.setChild(_inline._toDOM(_document)); | 181 _layoutRoot.rootElement.setChild(_inline._toDOM(_document)); |
| 182 markNeedsLayout(); | 182 markNeedsLayout(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 sky.Element _layout(BoxConstraints constraints) { | 185 sky.Element _layout(BoxConstraints constraints) { |
| 186 _layoutRoot.maxWidth = constraints.maxWidth; | 186 _layoutRoot.maxWidth = constraints.maxWidth; |
| 187 _layoutRoot.minWidth = constraints.minWidth; | 187 _layoutRoot.minWidth = constraints.minWidth; |
| 188 _layoutRoot.minHeight = constraints.minHeight; | 188 _layoutRoot.minHeight = constraints.minHeight; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 240 } |
| 241 | 241 |
| 242 // we should probably expose a way to do precise (inter-glpyh) hit testing | 242 // we should probably expose a way to do precise (inter-glpyh) hit testing |
| 243 | 243 |
| 244 String debugDescribeSettings(String prefix) { | 244 String debugDescribeSettings(String prefix) { |
| 245 String result = '${super.debugDescribeSettings(prefix)}'; | 245 String result = '${super.debugDescribeSettings(prefix)}'; |
| 246 result += '${prefix}inline: ${inline}\n'; | 246 result += '${prefix}inline: ${inline}\n'; |
| 247 return result; | 247 return result; |
| 248 } | 248 } |
| 249 } | 249 } |
| OLD | NEW |