Files
sdk/client/html/src/TextWrappingImplementation.dart
T
nweiz@google.com 4b756816ea Add a script for determining which DOM methods correspond to which HTML methods.
Ultimately, this will be used for generating documentation. Currently, though,
it just prints out information to the console.

This also includes some annotations to the HTML library, where the DOM
correspondence couldn't be auto-detected.

Review URL: http://codereview.chromium.org//8548019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1767 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 23:39:59 +00:00

32 lines
1.0 KiB
Dart

// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class TextWrappingImplementation extends CharacterDataWrappingImplementation implements Text {
/** @domName Document.createTextNode */
factory TextWrappingImplementation(String content) {
return new TextWrappingImplementation._wrap(
dom.document.createTextNode(content));
}
TextWrappingImplementation._wrap(ptr) : super._wrap(ptr);
String get wholeText() => _ptr.wholeText;
Text replaceWholeText([String content = null]) {
if (content === null) {
return LevelDom.wrapText(_ptr.replaceWholeText());
} else {
return LevelDom.wrapText(_ptr.replaceWholeText(content));
}
}
Text splitText([int offset = null]) {
if (offset === null) {
return LevelDom.wrapText(_ptr.splitText());
} else {
return LevelDom.wrapText(_ptr.splitText(offset));
}
}
}