Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Side by Side Diff: lib/safe_html.dart

Issue 55143003: webui fixes for 0.8.9 (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(sigmund): move this library to a shared package? or make part of 5 // TODO(sigmund): move this library to a shared package? or make part of
6 // dart:html? 6 // dart:html?
7 library safe_html; 7 library safe_html;
8 8
9 import 'package:meta/meta.dart';
10
11 /** Declares a string that is a well-formed HTML fragment. */ 9 /** Declares a string that is a well-formed HTML fragment. */
12 // TODO(sigmund): delete this type now that Element.html is safe by default. 10 // TODO(sigmund): delete this type now that Element.html is safe by default.
13 class SafeHtml { 11 class SafeHtml {
14 12
15 /** Underlying html string. */ 13 /** Underlying html string. */
16 String _html; 14 String _html;
17 15
18 /** 16 /**
19 * dart:html now supports sanitizing elements. You can add any node 17 * dart:html now supports sanitizing elements. You can add any node
20 * directly in your bindings instead of creating instances of SafeHtml. 18 * directly in your bindings instead of creating instances of SafeHtml.
(...skipping 16 matching lines...) Expand all
37 35
38 // TODO(sigmund): provide a constructor that takes or creates a Uri and 36 // TODO(sigmund): provide a constructor that takes or creates a Uri and
39 // validates that it is safe (not a javascript: scheme, for example) 37 // validates that it is safe (not a javascript: scheme, for example)
40 SafeUri.unsafe(this._uri); 38 SafeUri.unsafe(this._uri);
41 39
42 String toString() => _uri; 40 String toString() => _uri;
43 41
44 operator ==(other) => other is SafeUri && _uri == other._uri; 42 operator ==(other) => other is SafeUri && _uri == other._uri;
45 int get hashCode => _uri.hashCode; 43 int get hashCode => _uri.hashCode;
46 } 44 }
OLDNEW
« no previous file with comments | « lib/observe/observable.dart ('k') | lib/src/code_printer.dart » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698