Skip to content

Commit

Permalink
Merge pull request flutter#6 from dart-lang/html
Browse files Browse the repository at this point in the history
rename package to `html`
  • Loading branch information
John Messerly committed Mar 5, 2015
2 parents b2ecd40 + d97252a commit bc85b35
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 46 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# changelog

This file contains highlights of what changes on each version of the html5lib
This file contains highlights of what changes on each version of the html
package.

#### Rename to package:html 0.12.0
* package has been renamed to `html`

#### Pub version 0.12.0
* switch from `source_maps`' `Span` class to `source_span`'s
`SourceSpan` class.
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
html5lib in Pure Dart
=====================
html5 parser in dart
====================

This is a pure [Dart][dart] [html5 parser][html5parse]. It's a port of
[html5lib](http://code.google.com/p/html5lib/) from Python. Since it's 100%
Expand All @@ -14,7 +14,7 @@ Installation
Add this to your `pubspec.yaml` (or create it):
```yaml
dependencies:
html5lib: any
html: any
```
Then run the [Pub Package Manager][pub] (comes with the Dart SDK):
Expand All @@ -25,8 +25,8 @@ Usage
Parsing HTML is easy!
```dart
import 'package:html5lib/parser.dart' show parse;
import 'package:html5lib/dom.dart';
import 'package:html/parser.dart' show parse;
import 'package:html/dom.dart';

main() {
var document = parse(
Expand All @@ -43,10 +43,7 @@ Running Tests
-------------

```bash
# From Dart SVN checkout
./tools/build.py -m release
./tools/test.py -m release html5lib
./tools/test.py -m release -r drt html5lib
./test/run.sh
```

[dart]: http://www.dartlang.org/
Expand Down
4 changes: 2 additions & 2 deletions lib/parser.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// This library has a parser for HTML5 documents, that lets you parse HTML
/// easily from a script or server side application:
///
/// import 'package:html5lib/parser.dart' show parse;
/// import 'package:html5lib/dom.dart';
/// import 'package:html/parser.dart' show parse;
/// import 'package:html/dom.dart';
/// main() {
/// var document = parse(
/// '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!');
Expand Down
4 changes: 2 additions & 2 deletions lib/src/css_class_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// BSD-style license that can be found in the LICENSE file.

// TODO(jmesserly): everything in this file is copied straight from "dart:html".
library html5lib.dom.src;
library html.dom.src;

import 'dart:collection';
import 'package:html5lib/dom.dart';
import 'package:html/dom.dart';

class ElementCssClassSet extends CssClassSetImpl {
final Element _element;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/inputstream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HtmlInputStream {
// Unfortunately dart:io InputStream is async only, which won't work.
throw new ArgumentError("'source' must be a String or "
"List<int> (of bytes). You can also pass a RandomAccessFile if you"
"`import 'package:html5lib/parser_console.dart'` and call "
"`import 'package:html/parser_console.dart'` and call "
"`useConsole()`.");
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/src/query_selector.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// Query selector implementation for html5lib's DOM.
library html5lib.src.query;
/// Query selector implementation for our DOM.
library html.src.query;

import 'package:csslib/parser.dart' as css;
import 'package:csslib/parser.dart' show TokenKind;
import 'package:csslib/visitor.dart'; // the CSSOM
import 'package:html5lib/dom.dart';
import 'package:html5lib/src/constants.dart' show isWhitespaceCC;
import 'package:html/dom.dart';
import 'package:html/src/constants.dart' show isWhitespaceCC;

bool matches(Node node, String selector) =>
new SelectorEvaluator().matches(node, _parseSelectorList(selector));
Expand Down
2 changes: 1 addition & 1 deletion lib/src/tokenizer.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library tokenizer;

import 'dart:collection';
import 'package:html5lib/parser.dart' show HtmlParser;
import 'package:html/parser.dart' show HtmlParser;
import 'constants.dart';
import 'inputstream.dart';
import 'token.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/treebuilder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
library treebuilder;

import 'dart:collection';
import 'package:html5lib/dom.dart';
import 'package:html5lib/parser.dart' show getElementNameTuple;
import 'package:html/dom.dart';
import 'package:html/parser.dart' show getElementNameTuple;
import 'package:source_span/source_span.dart';
import 'constants.dart';
import 'list_proxy.dart';
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: html5lib
name: html
version: 0.12.1-dev
author: Dart Team <misc@dartlang.org>
description: A library for working with HTML documents.
Expand Down
4 changes: 2 additions & 2 deletions test/dom_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
library dom_test;

import 'package:unittest/unittest.dart';
import 'package:html5lib/dom.dart';
import 'package:html5lib/parser.dart';
import 'package:html/dom.dart';
import 'package:html/parser.dart';

main() {
group('Element', () {
Expand Down
8 changes: 4 additions & 4 deletions test/parser_feature_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
library parser_feature_test;

import 'package:unittest/unittest.dart';
import 'package:html5lib/dom.dart';
import 'package:html5lib/parser.dart';
import 'package:html5lib/src/constants.dart';
import 'package:html5lib/src/treebuilder.dart';
import 'package:html/dom.dart';
import 'package:html/parser.dart';
import 'package:html/src/constants.dart';
import 'package:html/src/treebuilder.dart';

main() {
test('doctype is cloneable', () {
Expand Down
8 changes: 4 additions & 4 deletions test/parser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as pathos;
import 'package:unittest/unittest.dart';
import 'package:html5lib/dom.dart';
import 'package:html5lib/parser.dart';
import 'package:html5lib/parser_console.dart' as parser_console;
import 'package:html5lib/src/inputstream.dart' as inputstream;
import 'package:html/dom.dart';
import 'package:html/parser.dart';
import 'package:html/parser_console.dart' as parser_console;
import 'package:html/src/inputstream.dart' as inputstream;
import 'support.dart';

// Run the parse error checks
Expand Down
6 changes: 3 additions & 3 deletions test/selectors/level1_baseline_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
///
/// Note, unlike the original we don't operate in-browser on a DOM loaded into
/// an iframe, but instead operate over a parsed DOM.
library html5lib.test.selectors.level1_baseline_test;
library html.test.selectors.level1_baseline_test;

import 'dart:io';
import 'package:html5lib/dom.dart';
import 'package:html5lib/parser.dart';
import 'package:html/dom.dart';
import 'package:html/parser.dart';
import 'package:unittest/unittest.dart';
import 'level1_lib.dart' hide test;
import 'selectors.dart';
Expand Down
6 changes: 3 additions & 3 deletions test/selectors/level1_lib.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/// As usual with ports: being faithful to the original style is more important
/// than other style goals, as it reduces friction to integrating changes
/// from upstream.
library html5lib.test.selectors.level1_lib;
library html.test.selectors.level1_lib;

import 'package:html5lib/dom.dart';
import 'package:html/dom.dart';
import 'package:unittest/unittest.dart' as unittest;

Document doc;
Expand Down Expand Up @@ -280,7 +280,7 @@ traverse(Node elem, fn) {
fn(elem);
}

// Dart note: changed this since html5lib doens't support nextNode yet.
// Dart note: changed this since our DOM API doesn't support nextNode yet.
for (var node in elem.nodes) {
traverse(node, fn);
}
Expand Down
2 changes: 1 addition & 1 deletion test/selectors/selectors.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Test for the Selectors API ported from
/// <https://github.com/w3c/web-platform-tests/tree/master/selectors-api>
library html5lib.test.selectors.selectors;
library html.test.selectors.selectors;

// Bit-mapped flags to indicate which tests the selector is suitable for
var TEST_QSA_BASELINE =
Expand Down
6 changes: 3 additions & 3 deletions test/support.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ library support;
import 'dart:io';
import 'dart:collection';
import 'package:path/path.dart' as path;
import 'package:html5lib/src/treebuilder.dart';
import 'package:html5lib/dom.dart';
import 'package:html5lib/dom_parsing.dart';
import 'package:html/src/treebuilder.dart';
import 'package:html/dom.dart';
import 'package:html/dom_parsing.dart';

typedef TreeBuilder TreeBuilderFactory(bool namespaceHTMLElements);

Expand Down
6 changes: 3 additions & 3 deletions test/tokenizer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'dart:io';
import 'dart:mirrors';
import 'package:path/path.dart' as pathos;
import 'package:unittest/unittest.dart';
import 'package:html5lib/src/char_encodings.dart';
import 'package:html5lib/src/token.dart';
import 'package:html5lib/src/tokenizer.dart';
import 'package:html/src/char_encodings.dart';
import 'package:html/src/token.dart';
import 'package:html/src/tokenizer.dart';
import 'package:utf/utf.dart';
import 'support.dart';

Expand Down

0 comments on commit bc85b35

Please sign in to comment.