From 1e60c915f947444d524185ffed761f17a274226b Mon Sep 17 00:00:00 2001
From: Simon Martin
Date: Sat, 23 Jul 2016 15:29:46 +0200
Subject: [PATCH] Issue #12421: tidy should also check .html files
---
python/tidy/servo_tidy/tidy.py | 13 +-
tests/html/acid1.html | 124 +++++++++---------
tests/html/acid2.html | 2 +-
tests/html/active_selector.html | 20 +--
tests/html/background.html | 34 ++---
tests/html/border_collapse_test.html | 2 +-
tests/html/form_html5_validations.html | 6 +-
tests/html/inline_bg_color_simple.html | 2 +-
tests/html/input_whitespace_regression.html | 2 +-
tests/html/lipsum-large.html | 6 +-
tests/html/lipsum.html | 6 +-
tests/html/longcat.html | 28 ++--
...rflow_scroll_with_nested_fixed_height.html | 6 +-
tests/html/percentage-body-height.html | 6 +-
tests/html/service-worker/dashboard-page.html | 6 +-
tests/html/service-worker/demo_iframe.html | 8 +-
tests/html/service-worker/index.html | 2 +-
tests/html/service-worker/profile.html | 6 +-
tests/html/test-websocket.html | 106 +++++++--------
tests/html/test_bg_color.html | 2 +-
tests/html/test_class_helloworld.html | 30 ++---
tests/html/test_inline_border.html | 2 +-
tests/html/test_local_bookmark.html | 6 +-
.../html/test_mouse_down_mouse_up_click.html | 12 +-
tests/html/test_overflow_hidden.html | 4 +-
tests/html/test_target_pseudoselector.html | 4 +-
tests/html/test_textarea_input.html | 14 +-
tests/html/test_underline_helloworld.html | 2 +-
tests/html/tiny_test.html | 2 +-
tests/wpt/mozilla/tests/css/acid1_a.html | 106 +++++++--------
tests/wpt/mozilla/tests/css/acid2.html | 2 +-
.../tests/css/after_block_iteration_ref.html | 2 +-
..._formatting_context_float_placement_a.html | 20 +--
...ormatting_context_float_placement_ref.html | 18 +--
.../tests/css/box_shadow_blur_fixed.html | 2 +-
.../tests/css/box_shadow_blur_fixed_ref.html | 2 +-
.../css/flex-item-assign-inline-size.html | 6 +-
.../float_clearance_intrinsic_width_a.html | 24 ++--
.../float_clearance_intrinsic_width_ref.html | 20 +--
.../tests/css/float_intrinsic_height.html | 42 +++---
.../tests/css/float_intrinsic_height_ref.html | 38 +++---
.../css/fonts/takao-p-gothic/COPYING.html | 4 +-
.../wpt/mozilla/tests/css/height_compute.html | 12 +-
.../tests/css/height_compute_reset.html | 12 +-
.../mozilla/tests/css/hide_after_create.html | 32 ++---
.../tests/css/hide_after_create_ref.html | 10 +-
.../tests/css/iframe/hide_and_show.html | 28 ++--
.../tests/css/iframe/hide_and_show_ref.html | 16 +--
.../inline_block_border_intrinsic_size_a.html | 14 +-
...nline_block_border_intrinsic_size_ref.html | 12 +-
.../tests/css/inline_whitespace_a.html | 24 ++--
.../tests/css/inline_whitespace_b.html | 26 ++--
.../tests/css/inline_whitespace_ref.html | 22 ++--
.../mozilla/tests/css/input_alignment_a.html | 8 +-
.../tests/css/input_alignment_ref.html | 2 +-
.../mozilla/tests/css/input_placeholder.html | 2 +-
.../tests/css/input_placeholder_ref.html | 2 +-
.../mozilla/tests/css/input_whitespace.html | 2 +-
.../tests/css/input_whitespace_ref.html | 2 +-
.../tests/css/linebreak_inline_span_a.html | 4 +-
.../tests/css/linebreak_inline_span_b.html | 4 +-
.../mozilla/tests/css/object_element_b.html | 2 +-
...overflow_position_abs_inside_normal_a.html | 4 +-
.../position_abs_cb_with_non_cb_kid_a.html | 8 +-
.../tests/css/position_abs_nested_a.html | 4 +-
.../tests/css/position_abs_nested_b.html | 4 +-
.../tests/css/position_abs_pseudo_a.html | 6 +-
.../tests/css/position_abs_pseudo_b.html | 6 +-
.../css/position_abs_replaced_simple_b.html | 2 +-
.../tests/css/pseudo_content_with_layers.html | 4 +-
.../mozilla/tests/css/table_auto_width.html | 26 ++--
.../tests/css/table_auto_width_ref.html | 26 ++--
.../tests/css/text_align_complex_a.html | 80 +++++------
.../tests/css/text_align_complex_ref.html | 42 +++---
.../tests/css/transform_optimization.html | 54 ++++----
.../tests/css/transform_optimization_ref.html | 40 +++---
tests/wpt/mozilla/tests/mozilla/calc.html | 2 +-
.../canvas/drawimage_html_image_13.html | 2 +-
.../tests/mozilla/element_parentOffset.html | 20 +--
.../tests/mozilla/iframe_replacement.html | 28 ++--
.../tests/mozilla/img_width_height.html | 12 +-
.../mozilla/tests/mozilla/parentnodes.html | 2 +-
.../mozilla/tests/mozilla/preferences.html | 26 ++--
.../tests/mozilla/resources/ssl.https.html | 2 +-
.../mozilla/webgl/tex_image_2d_mipmap.html | 2 +-
85 files changed, 696 insertions(+), 691 deletions(-)
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 81c360aa190..61251983e19 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -27,7 +27,7 @@ MAX_LICENSE_LINESPAN = max(len(license.splitlines()) for license in licenses)
# File patterns to include in the non-WPT tidy check.
FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c",
"*.h", "Cargo.lock", "*.py", "*.sh",
- "*.toml", "*.webidl", "*.json"]
+ "*.toml", "*.webidl", "*.json", "*.html"]
# File patterns that are ignored for all tidy and lint checks.
FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc"]
@@ -44,6 +44,11 @@ IGNORED_FILES = [
os.path.join(".", "tests", "wpt", "metadata-css", "MANIFEST.json"),
os.path.join(".", "components", "script", "dom", "webidls", "ForceTouchEvent.webidl"),
os.path.join(".", "support", "android", "openssl.sh"),
+ # Ignore those files since the issues reported are on purpose
+ os.path.join(".", "tests", "html", "bad-line-ends.html"),
+ os.path.join(".", "tests", "unit", "net", "parsable_mime", "text"),
+ os.path.join(".", "tests", "wpt", "mozilla", "tests", "css", "fonts"),
+ os.path.join(".", "tests", "wpt", "mozilla", "tests", "css", "pre_with_tab.html"),
# FIXME(pcwalton, #11679): This is a workaround for a tidy error on the quoted string
# `"__TEXT,_info_plist"` inside an attribute.
os.path.join(".", "components", "servo", "platform", "macos", "mod.rs"),
@@ -148,7 +153,7 @@ def filter_files(start_dir, only_changed_files, progress):
def check_license(file_name, lines):
- if any(file_name.endswith(ext) for ext in (".toml", ".lock", ".json")):
+ if any(file_name.endswith(ext) for ext in (".toml", ".lock", ".json", ".html")):
raise StopIteration
while lines and (lines[0].startswith(EMACS_HEADER) or lines[0].startswith(VIM_HEADER)):
lines = lines[1:]
@@ -168,7 +173,7 @@ def check_modeline(file_name, lines):
def check_length(file_name, idx, line):
- if file_name.endswith(".lock") or file_name.endswith(".json"):
+ if file_name.endswith(".lock") or file_name.endswith(".json") or file_name.endswith(".html"):
raise StopIteration
# Prefer shorter lines when shell scripting.
if file_name.endswith(".sh"):
@@ -672,7 +677,7 @@ def collect_errors_for_files(files_to_check, checking_functions, line_checking_f
def get_wpt_files(only_changed_files, progress):
- wpt_dir = os.path.join(".", "tests", "wpt", "web-platform-tests" + os.sep)
+ wpt_dir = os.path.join(".", "tests", "wpt" + os.sep)
file_iter = get_file_list(os.path.join(wpt_dir), only_changed_files)
(has_element, file_iter) = is_iter_empty(file_iter)
if not has_element:
diff --git a/tests/html/acid1.html b/tests/html/acid1.html
index 88d5b325bd2..c78419966e8 100644
--- a/tests/html/acid1.html
+++ b/tests/html/acid1.html
@@ -1,11 +1,11 @@
-
- display/box/float/clear test
-
-
-
-
-
- -
- toggle
-
- -
-
- -
- the way
-
- -
-
- the world ends
-
-
-
- -
- i grow old
-
- -
- pluot?
-
-
-
-
- bar maids,
-
-
-
- sing to me, erbarme dich
-
-
-
-
- This is a nonsensical document, but syntactically valid HTML 4.0. All
- 100%-conformant CSS1 agents should be able to render the document
+
+
+
+ -
+ toggle
+
+ -
+
+ -
+ the way
+
+ -
+
+ the world ends
+
+
+
+ -
+ i grow old
+
+ -
+ pluot?
+
+
+
+
+ bar maids,
+
+
+
+ sing to me, erbarme dich
+
+
+
+
+ This is a nonsensical document, but syntactically valid HTML 4.0. All
+ 100%-conformant CSS1 agents should be able to render the document
elements above this paragraph indistinguishably (to the pixel) from this
-
- reference rendering,
- (except font rasterization and form widgets). All discrepancies
-should be traceable to CSS1 implementation shortcomings. Once you have
-finished evaluating this test, you can return to the parent page.
-
-
+
+ reference rendering,
+ (except font rasterization and form widgets). All discrepancies
+should be traceable to CSS1 implementation shortcomings. Once you have
+finished evaluating this test, you can return to the parent page.
+
+
diff --git a/tests/html/acid2.html b/tests/html/acid2.html
index 9c7712a22f7..8c8c1800169 100755
--- a/tests/html/acid2.html
+++ b/tests/html/acid2.html
@@ -142,4 +142,4 @@