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

Side by Side Diff: pkg/analyzer/lib/src/task/html.dart

Issue 1516073002: Parse HTML files with keeping original attributes case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/html_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.src.task.html; 5 library analyzer.src.task.html;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/context/cache.dart'; 9 import 'package:analyzer/src/context/cache.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 } 307 }
308 308
309 outputs[HTML_DOCUMENT] = new Document(); 309 outputs[HTML_DOCUMENT] = new Document();
310 outputs[HTML_DOCUMENT_ERRORS] = <AnalysisError>[ 310 outputs[HTML_DOCUMENT_ERRORS] = <AnalysisError>[
311 new AnalysisError( 311 new AnalysisError(
312 target.source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message]) 312 target.source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message])
313 ]; 313 ];
314 outputs[LINE_INFO] = new LineInfo(<int>[0]); 314 outputs[LINE_INFO] = new LineInfo(<int>[0]);
315 } else { 315 } else {
316 HtmlParser parser = new HtmlParser(content, generateSpans: true); 316 HtmlParser parser = new HtmlParser(content,
317 generateSpans: true, lowercaseAttrName: false);
317 parser.compatMode = 'quirks'; 318 parser.compatMode = 'quirks';
318 Document document = parser.parse(); 319 Document document = parser.parse();
319 // 320 //
320 // Convert errors. 321 // Convert errors.
321 // 322 //
322 List<AnalysisError> errors = <AnalysisError>[]; 323 List<AnalysisError> errors = <AnalysisError>[];
323 // TODO(scheglov) https://github.com/dart-lang/sdk/issues/24643 324 // TODO(scheglov) https://github.com/dart-lang/sdk/issues/24643
324 // List<ParseError> parseErrors = parser.errors; 325 // List<ParseError> parseErrors = parser.errors;
325 // for (ParseError parseError in parseErrors) { 326 // for (ParseError parseError in parseErrors) {
326 // if (parseError.errorCode == 'expected-doctype-but-got-start-tag') { 327 // if (parseError.errorCode == 'expected-doctype-but-got-start-tag') {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 * The content of the fragment. 391 * The content of the fragment.
391 */ 392 */
392 final String content; 393 final String content;
393 394
394 /** 395 /**
395 * Initialize a newly created script fragment to have the given [offset] and 396 * Initialize a newly created script fragment to have the given [offset] and
396 * [content]. 397 * [content].
397 */ 398 */
398 ScriptFragment(this.offset, this.line, this.column, this.content); 399 ScriptFragment(this.offset, this.line, this.column, this.content);
399 } 400 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/html_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698