| Index: sky/sdk/lib/rendering/paragraph.dart
|
| diff --git a/sky/sdk/lib/rendering/paragraph.dart b/sky/sdk/lib/rendering/paragraph.dart
|
| index 605e0950f7b117c6d1140ed5158dd44b1800465e..23c3d6e6ef4a934e4d21ccbc92d3026bab034138 100644
|
| --- a/sky/sdk/lib/rendering/paragraph.dart
|
| +++ b/sky/sdk/lib/rendering/paragraph.dart
|
| @@ -10,6 +10,7 @@ import '../painting/text_style.dart';
|
|
|
| abstract class InlineBase {
|
| sky.Node _toDOM(sky.Document owner);
|
| + @override
|
| String toString([String prefix = '']);
|
| }
|
|
|
| @@ -20,13 +21,18 @@ class InlineText extends InlineBase {
|
|
|
| final String text;
|
|
|
| + @override
|
| sky.Node _toDOM(sky.Document owner) {
|
| return owner.createText(text);
|
| }
|
|
|
| + @override
|
| bool operator ==(other) => other is InlineText && text == other.text;
|
| +
|
| + @override
|
| int get hashCode => text.hashCode;
|
|
|
| + @override
|
| String toString([String prefix = '']) => '${prefix}InlineText: "${text}"';
|
| }
|
|
|
| @@ -39,6 +45,7 @@ class InlineStyle extends InlineBase {
|
| final TextStyle style;
|
| final List<InlineBase> children;
|
|
|
| + @override
|
| sky.Node _toDOM(sky.Document owner) {
|
| sky.Element parent = owner.createElement('t');
|
| style.applyToCSSStyle(parent.style);
|
| @@ -48,6 +55,7 @@ class InlineStyle extends InlineBase {
|
| return parent;
|
| }
|
|
|
| + @override
|
| bool operator ==(other) {
|
| if (identical(this, other))
|
| return true;
|
| @@ -62,6 +70,7 @@ class InlineStyle extends InlineBase {
|
| return true;
|
| }
|
|
|
| + @override
|
| int get hashCode {
|
| int value = 373;
|
| value = 37 * value + style.hashCode;
|
| @@ -70,6 +79,7 @@ class InlineStyle extends InlineBase {
|
| return value;
|
| }
|
|
|
| + @override
|
| String toString([String prefix = '']) {
|
| List<String> result = [];
|
| result.add('${prefix}InlineStyle:');
|
| @@ -128,12 +138,14 @@ class RenderParagraph extends RenderBox {
|
| _constraintsForCurrentLayout = constraints;
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicWidth(BoxConstraints constraints) {
|
| _layout(constraints);
|
| return constraints.constrainWidth(
|
| _applyFloatingPointHack(_layoutRoot.rootElement.minContentWidth));
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicWidth(BoxConstraints constraints) {
|
| _layout(constraints);
|
| return constraints.constrainWidth(
|
| @@ -146,14 +158,17 @@ class RenderParagraph extends RenderBox {
|
| _applyFloatingPointHack(_layoutRoot.rootElement.height));
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicHeight(constraints);
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicHeight(constraints);
|
| }
|
|
|
| + @override
|
| double computeDistanceToActualBaseline(TextBaseline baseline) {
|
| assert(!needsLayout);
|
| _layout(constraints);
|
| @@ -164,6 +179,7 @@ class RenderParagraph extends RenderBox {
|
| }
|
| }
|
|
|
| + @override
|
| void performLayout() {
|
| _layout(constraints);
|
| sky.Element root = _layoutRoot.rootElement;
|
| @@ -172,6 +188,7 @@ class RenderParagraph extends RenderBox {
|
| _applyFloatingPointHack(root.height)));
|
| }
|
|
|
| + @override
|
| void paint(PaintingCanvas canvas, Offset offset) {
|
| // Ideally we could compute the min/max intrinsic width/height with a
|
| // non-destructive operation. However, currently, computing these values
|
| @@ -189,7 +206,7 @@ class RenderParagraph extends RenderBox {
|
| }
|
|
|
| // we should probably expose a way to do precise (inter-glpyh) hit testing
|
| -
|
| + @override
|
| String debugDescribeSettings(String prefix) {
|
| String result = '${super.debugDescribeSettings(prefix)}';
|
| result += '${prefix}inline:\n${inline.toString("$prefix ")}\n';
|
|
|