From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- layout/style/test/Ahem.ttf | Bin 0 -> 12480 bytes layout/style/test/BitPattern.woff | Bin 0 -> 6248 bytes layout/style/test/ListCSSProperties.cpp | 178 + layout/style/test/ParseCSS.cpp | 80 + layout/style/test/additional_sheets_helper.html | 7 + layout/style/test/animation_utils.js | 935 ++ layout/style/test/browser.toml | 19 + layout/style/test/browser_bug453896.js | 16 + layout/style/test/browser_sourcemap.js | 41 + layout/style/test/browser_sourcemap_comment.js | 47 + layout/style/test/browser_sourceurl_comment.js | 43 + layout/style/test/bug1382568-iframe.html | 8 + layout/style/test/bug1729861.js | 81 + layout/style/test/bug453896_iframe.html | 66 + layout/style/test/bug517224.sjs | 27 + layout/style/test/bug732209-css.sjs | 30 + layout/style/test/ccd-quirks.html | 129 + layout/style/test/ccd-standards.html | 128 + layout/style/test/ccd.sjs | 71 + layout/style/test/chrome/bug418986-2.js | 318 + layout/style/test/chrome/bug535806-css.css | 1 + layout/style/test/chrome/bug535806-html.html | 8 + layout/style/test/chrome/bug535806-xul.xhtml | 8 + .../style/test/chrome/chrome-only-media-queries.js | 34 + layout/style/test/chrome/chrome.toml | 51 + layout/style/test/chrome/display_mode.html | 122 + layout/style/test/chrome/display_mode_reflow.html | 84 + .../test/chrome/display_mode_reflow_iframe.html | 23 + layout/style/test/chrome/hover_empty.html | 4 + layout/style/test/chrome/hover_helper.html | 270 + layout/style/test/chrome/import_useless1.css | 3 + layout/style/test/chrome/import_useless2.css | 3 + layout/style/test/chrome/match.png | Bin 0 -> 1210 bytes layout/style/test/chrome/mismatch.png | Bin 0 -> 1573 bytes layout/style/test/chrome/moz_document_helper.html | 2 + layout/style/test/chrome/test_bug1157097.html | 27 + layout/style/test/chrome/test_bug1346623.html | 60 + layout/style/test/chrome/test_bug1371453.html | 33 + layout/style/test/chrome/test_bug418986-2.xhtml | 29 + layout/style/test/chrome/test_bug511909.html | 194 + layout/style/test/chrome/test_bug535806.xhtml | 43 + .../chrome/test_chrome_only_media_queries.html | 84 + ...onstructable_stylesheets_chrome_only_rules.html | 11 + layout/style/test/chrome/test_display_mode.html | 39 + .../test/chrome/test_display_mode_reflow.html | 41 + layout/style/test/chrome/test_hover.html | 29 + .../style/test/chrome/test_moz_document_rules.html | 97 + .../chrome/test_moz_document_serialization.html | 58 + .../test/chrome/test_scrollbar_inline_size.html | 36 + .../chrome/test_stylesheet_clone_import_rule.html | 86 + layout/style/test/css_properties_like_longhand.js | 1 + layout/style/test/descriptor_database.js | 142 + layout/style/test/empty.html | 1 + layout/style/test/file_animations_async_tests.html | 77 + layout/style/test/file_animations_omta_scroll.html | 392 + .../test/file_animations_omta_scroll_rtl.html | 112 + .../file_animations_with_disabled_properties.html | 50 + layout/style/test/file_bug1055933_circle-xxl.png | Bin 0 -> 4857 bytes layout/style/test/file_bug1089417_iframe.html | 17 + layout/style/test/file_bug1375944.html | 13 + layout/style/test/file_bug1381233.html | 4 + layout/style/test/file_bug1443344.css | 1 + layout/style/test/file_bug645998-1.css | 1 + layout/style/test/file_bug645998-2.css | 1 + layout/style/test/file_bug829816.css | Bin 0 -> 76 bytes .../file_computed_style_bfcache_display_none.html | 6 + .../file_computed_style_bfcache_display_none2.html | 6 + .../style/test/file_font_loading_api_vframe.html | 2 + layout/style/test/file_shared_sheet_caching.css | 3 + layout/style/test/file_shared_sheet_caching.html | 12 + ..._value_serialization_individual_transforms.html | 65 + layout/style/test/flexbox_layout_testcases.js | 1317 ++ layout/style/test/gen-css-properties.py | 24 + layout/style/test/gtest/ImportScannerTest.cpp | 119 + layout/style/test/gtest/StyloParsingBench.cpp | 116 + layout/style/test/gtest/example.css | 2925 ++++ .../test/gtest/generate_example_stylesheet.py | 16 + layout/style/test/gtest/moz.build | 24 + layout/style/test/mapped.css | 3 + layout/style/test/mapped.css^headers^ | 1 + layout/style/test/mapped2.css | 4 + layout/style/test/mapped2.css^headers^ | 2 + layout/style/test/media_queries_iframe.html | 15 + layout/style/test/media_queries_iframe2.html | 37 + layout/style/test/mochitest.toml | 783 + layout/style/test/moz.build | 152 + layout/style/test/mq_changes_child.html | 8 + layout/style/test/neverending_font_load.sjs | 5 + layout/style/test/neverending_stylesheet_load.sjs | 5 + layout/style/test/post-redirect-1.css | 1 + layout/style/test/post-redirect-2.css | 1 + layout/style/test/post-redirect-3.css | 1 + layout/style/test/property_database.js | 14128 +++++++++++++++++++ layout/style/test/redirect.sjs | 4 + layout/style/test/redundant_font_download.sjs | 63 + layout/style/test/slow_broken_sheet.sjs | 19 + layout/style/test/slow_load.sjs | 29 + layout/style/test/slow_ok_sheet.sjs | 21 + layout/style/test/sourcemap_css.html | 11 + layout/style/test/style_attribute_tests.js | 25 + layout/style/test/support/1x1-transparent.png | Bin 0 -> 89 bytes layout/style/test/support/blue-100x100.png | Bin 0 -> 40279 bytes .../style/test/support/external-variable-url.css | 3 + layout/style/test/test_acid3_test46.html | 140 + layout/style/test/test_addSheet.html | 44 + layout/style/test/test_additional_sheets.html | 310 + .../test/test_align_justify_computed_values.html | 484 + layout/style/test/test_all_shorthand.html | 157 + layout/style/test/test_animations.html | 2107 +++ layout/style/test/test_animations_async_tests.html | 24 + .../test/test_animations_dynamic_changes.html | 65 + .../test_animations_effect_timing_duration.html | 81 + .../test_animations_effect_timing_enddelay.html | 141 + .../test_animations_effect_timing_iterations.html | 68 + .../test_animations_event_handler_attribute.html | 204 + layout/style/test/test_animations_event_order.html | 710 + .../style/test/test_animations_iterationstart.html | 53 + layout/style/test/test_animations_omta.html | 2969 ++++ layout/style/test/test_animations_omta_scroll.html | 25 + .../test/test_animations_omta_scroll_rtl.html | 25 + layout/style/test/test_animations_omta_start.html | 187 + layout/style/test/test_animations_pausing.html | 79 + .../style/test/test_animations_playbackrate.html | 94 + layout/style/test/test_animations_reverse.html | 64 + .../test/test_animations_styles_on_event.html | 66 + .../test/test_animations_variable_changes.html | 58 + .../test_animations_with_disabled_properties.html | 33 + layout/style/test/test_any_dynamic.html | 49 + layout/style/test/test_area_url_cursor.html | 34 + layout/style/test/test_asyncopen.html | 54 + .../style/test/test_at_rule_parse_serialize.html | 43 + .../test/test_attribute_selector_eof_behavior.html | 18 + .../test/test_backdrop_filter_enabled_state.html | 21 + layout/style/test/test_background_blend_mode.html | 57 + ...border_device_pixel_rounding_initial_style.html | 20 + layout/style/test/test_box_size_keywords.html | 170 + layout/style/test/test_bug1055933.html | 41 + layout/style/test/test_bug1089417.html | 47 + layout/style/test/test_bug1112014.html | 89 + layout/style/test/test_bug1203766.html | 112 + layout/style/test/test_bug1232829.html | 37 + layout/style/test/test_bug1292447.html | 350 + layout/style/test/test_bug1330375.html | 59 + layout/style/test/test_bug1371488.html | 23 + layout/style/test/test_bug1375944.html | 34 + layout/style/test/test_bug1382568.html | 14 + layout/style/test/test_bug1394302.html | 32 + layout/style/test/test_bug1443344-1.html | 48 + layout/style/test/test_bug1443344-2.html | 48 + layout/style/test/test_bug1451199-1.html | 42 + layout/style/test/test_bug1451199-2.html | 43 + layout/style/test/test_bug1490890.html | 112 + layout/style/test/test_bug1505254.html | 152 + layout/style/test/test_bug160403.html | 73 + layout/style/test/test_bug1729861.html | 26 + layout/style/test/test_bug200089.html | 30 + layout/style/test/test_bug221428.html | 68 + layout/style/test/test_bug229915.html | 95 + layout/style/test/test_bug302186.html | 508 + layout/style/test/test_bug319381.html | 67 + layout/style/test/test_bug357614.html | 73 + layout/style/test/test_bug363146.html | 62 + layout/style/test/test_bug372770.html | 85 + layout/style/test/test_bug373293.html | 29 + layout/style/test/test_bug377947.html | 110 + layout/style/test/test_bug379440.html | 74 + layout/style/test/test_bug379741.html | 43 + layout/style/test/test_bug382027.html | 37 + layout/style/test/test_bug383075.html | 84 + layout/style/test/test_bug387615.html | 53 + layout/style/test/test_bug389464.html | 48 + layout/style/test/test_bug391034.html | 71 + layout/style/test/test_bug391221.html | 43 + layout/style/test/test_bug397427.html | 91 + layout/style/test/test_bug399349.html | 80 + layout/style/test/test_bug401046.html | 82 + layout/style/test/test_bug405818.html | 72 + layout/style/test/test_bug412901.html | 42 + layout/style/test/test_bug413958.html | 75 + layout/style/test/test_bug418986-2.html | 32 + layout/style/test/test_bug437915.html | 70 + layout/style/test/test_bug450191.html | 64 + layout/style/test/test_bug470769.html | 31 + layout/style/test/test_bug499655.html | 45 + layout/style/test/test_bug499655.xhtml | 48 + layout/style/test/test_bug517224.html | 45 + layout/style/test/test_bug524175.html | 28 + layout/style/test/test_bug525952.html | 46 + layout/style/test/test_bug534804.html | 89 + layout/style/test/test_bug573255.html | 32 + layout/style/test/test_bug580685.html | 41 + layout/style/test/test_bug621351.html | 35 + layout/style/test/test_bug635286.html | 52 + layout/style/test/test_bug645998.html | 29 + layout/style/test/test_bug652486.html | 192 + layout/style/test/test_bug657143.html | 120 + layout/style/test/test_bug667520.html | 50 + layout/style/test/test_bug716226.html | 52 + layout/style/test/test_bug732153.html | 22 + layout/style/test/test_bug732209.html | 95 + layout/style/test/test_bug73586.html | 189 + layout/style/test/test_bug74880.html | 119 + layout/style/test/test_bug765590.html | 21 + layout/style/test/test_bug771043.html | 69 + layout/style/test/test_bug795520.html | 39 + layout/style/test/test_bug798843_pref.html | 53 + layout/style/test/test_bug829816.html | 56 + layout/style/test/test_bug874919.html | 55 + ...st_bug887741_at-rules_in_declaration_lists.html | 75 + layout/style/test/test_bug892929.html | 74 + layout/style/test/test_bug98997.html | 144 + layout/style/test/test_cascade.html | 91 + layout/style/test/test_ch_ex_no_infloops.html | 60 + .../style/test/test_change_hint_optimizations.html | 57 + layout/style/test/test_clip-path_polygon.html | 40 + layout/style/test/test_color_rounding.html | 38 + .../test/test_compute_data_with_start_struct.html | 87 + layout/style/test/test_computed_style.html | 664 + .../test_computed_style_bfcache_display_none.html | 60 + .../style/test/test_computed_style_difference.html | 104 + .../test/test_computed_style_grid_with_pseudo.html | 91 + .../test_computed_style_in_created_document.html | 52 + .../test/test_computed_style_min_size_auto.html | 129 + .../style/test/test_computed_style_no_flush.html | 63 + .../style/test/test_computed_style_no_pseudo.html | 53 + layout/style/test/test_computed_style_prefs.html | 94 + layout/style/test/test_condition_text.html | 74 + ...e_stylesheets_chrome_only_rules_in_content.html | 17 + .../test/test_counter_descriptor_storage.html | 268 + layout/style/test/test_counter_style.html | 121 + .../style/test/test_crash_with_content_policy.html | 75 + layout/style/test/test_css_cross_domain.html | 158 + .../style/test/test_css_cross_domain_no_orb.html | 147 + layout/style/test/test_css_eof_handling.html | 268 + layout/style/test/test_css_escape_api.html | 94 + .../test_css_function_mismatched_parenthesis.html | 63 + .../test/test_css_loader_crossorigin_data_url.html | 17 + .../style/test/test_css_parse_error_smoketest.html | 160 + layout/style/test/test_css_supports.html | 134 + layout/style/test/test_css_supports_variables.html | 247 + layout/style/test/test_cue_restrictions.html | 34 + .../test/test_custom_content_inheritance.html | 24 + layout/style/test/test_default_bidi_css.html | 80 + layout/style/test/test_default_computed_style.html | 58 + layout/style/test/test_descriptor_storage.html | 118 + .../style/test/test_descriptor_syntax_errors.html | 53 + layout/style/test/test_display_mode.html | 70 + .../style/test/test_dont_use_document_colors.html | 201 + .../style/test/test_dont_use_document_fonts.html | 116 + .../test/test_dynamic_change_causing_reflow.html | 1014 ++ layout/style/test/test_exposed_prop_accessors.html | 41 + layout/style/test/test_extra_inherit_initial.html | 109 + .../style/test/test_first_letter_restrictions.html | 56 + .../style/test/test_first_line_restrictions.html | 56 + .../test/test_flexbox_child_display_values.xhtml | 178 + .../test/test_flexbox_flex_grow_and_shrink.html | 154 + layout/style/test/test_flexbox_flex_shorthand.html | 280 + layout/style/test/test_flexbox_focus_order.html | 83 + layout/style/test/test_flexbox_layout.html | 184 + layout/style/test/test_flexbox_order.html | 194 + layout/style/test/test_flexbox_order_abspos.html | 217 + layout/style/test/test_flexbox_order_table.html | 198 + layout/style/test/test_flexbox_reflow_counts.html | 199 + layout/style/test/test_flushing_frame.html | 40 + layout/style/test/test_font_face_cascade.html | 35 + layout/style/test/test_font_face_parser.html | 386 + layout/style/test/test_font_family_parsing.html | 272 + .../style/test/test_font_family_serialization.html | 51 + layout/style/test/test_font_loading_api.html | 1895 +++ .../test/test_garbage_at_end_of_declarations.html | 156 + layout/style/test/test_grid_computed_values.html | 113 + .../style/test/test_grid_container_shorthands.html | 271 + layout/style/test/test_grid_item_shorthands.html | 153 + .../test/test_grid_shorthand_serialization.html | 221 + layout/style/test/test_group_insertRule.html | 243 + layout/style/test/test_hover_on_part.html | 52 + layout/style/test/test_hover_quirk.html | 118 + .../test/test_html_attribute_computed_values.html | 84 + layout/style/test/test_ident_escaping.html | 56 + layout/style/test/test_img_src_causing_reflow.html | 36 + layout/style/test/test_import_preload.html | 22 + layout/style/test/test_inherit_computation.html | 176 + layout/style/test/test_inherit_storage.html | 120 + layout/style/test/test_initial_computation.html | 159 + layout/style/test/test_initial_storage.html | 134 + layout/style/test/test_invalidation_basic.html | 45 + layout/style/test/test_keyframes_rules.html | 134 + .../style/test/test_keyframes_vendor_prefix.html | 167 + .../test/test_load_events_on_stylesheets.html | 176 + layout/style/test/test_logical_properties.html | 422 + layout/style/test/test_marker_restrictions.html | 35 + layout/style/test/test_mask_image_CORS.html | 63 + layout/style/test/test_media_queries.html | 867 ++ layout/style/test/test_media_queries_dynamic.html | 207 + layout/style/test/test_media_query_list.html | 373 + .../style/test/test_media_query_serialization.html | 53 + layout/style/test/test_moz_device_pixel_ratio.html | 73 + layout/style/test/test_moz_prefixed_cursor.html | 14 + .../test/test_mq_any_hover_and_any_pointer.html | 97 + layout/style/test/test_mq_changes_in_iframe.html | 54 + layout/style/test/test_mq_hover_and_pointer.html | 127 + .../test/test_mq_prefers_contrast_dynamic.html | 82 + .../test_mq_prefers_reduced_motion_dynamic.html | 86 + .../style/test/test_mql_event_listener_leaks.html | 43 + layout/style/test/test_namespace_rule.html | 461 + .../test/test_non_content_accessible_env_vars.html | 39 + .../test_non_content_accessible_properties.html | 85 + .../test/test_non_content_accessible_pseudos.html | 69 + .../test/test_non_content_accessible_values.html | 172 + .../style/test/test_non_matching_sheet_media.html | 30 + layout/style/test/test_of_type_selectors.xhtml | 97 + .../style/test/test_overscroll_behavior_pref.html | 24 + layout/style/test/test_page_parser.html | 93 + layout/style/test/test_parse_eof.html | 69 + layout/style/test/test_parse_ident.html | 56 + layout/style/test/test_parse_rule.html | 261 + layout/style/test/test_parse_url.html | 195 + .../test/test_parser_diagnostics_unprintables.html | 220 + layout/style/test/test_pixel_lengths.html | 61 + .../style/test/test_placeholder_restrictions.html | 57 + layout/style/test/test_pointer-events.html | 114 + layout/style/test/test_position_float_display.html | 111 + layout/style/test/test_position_sticky.html | 89 + .../test/test_prefers_contrast_color_pairs.html | 49 + layout/style/test/test_priority_preservation.html | 141 + layout/style/test/test_property_database.html | 173 + layout/style/test/test_property_syntax_errors.html | 155 + layout/style/test/test_pseudo_display_fixup.html | 29 + layout/style/test/test_pseudoelement_parsing.html | 43 + layout/style/test/test_pseudoelement_state.html | 185 + layout/style/test/test_query_container_for.html | 62 + .../style/test/test_redundant_font_download.html | 131 + layout/style/test/test_reframe_cb.html | 56 + layout/style/test/test_reframe_image_loading.html | 29 + layout/style/test/test_reframe_input.html | 48 + layout/style/test/test_reframe_pseudo_element.html | 46 + layout/style/test/test_rem_unit.html | 80 + layout/style/test/test_restyle_table_wrapper.html | 33 + .../test/test_restyles_in_smil_animation.html | 137 + layout/style/test/test_revert.html | 103 + layout/style/test/test_root_node_display.html | 74 + layout/style/test/test_rule_insertion.html | 240 + layout/style/test/test_rules_out_of_sheets.html | 115 + layout/style/test/test_selectors.html | 1348 ++ layout/style/test/test_setPropertyWithNull.html | 47 + layout/style/test/test_shape_outside_CORS.html | 59 + layout/style/test/test_shared_sheet_caching.html | 35 + layout/style/test/test_sheet_privilege.html | 33 + .../test/test_shorthand_property_getters.html | 248 + .../test/test_specified_value_serialization.html | 281 + layout/style/test/test_style_attr_listener.html | 52 + layout/style/test/test_style_attribute_quirks.html | 18 + .../style/test/test_style_attribute_standards.html | 19 + .../test/test_style_struct_copy_constructors.html | 93 + layout/style/test/test_stylesheet_additions.html | 68 + .../test/test_stylesheet_clone_font_face.html | 26 + layout/style/test/test_supports_rules.html | 88 + .../style/test/test_system_font_serialization.html | 84 + .../test/test_text_decoration_shorthands.html | 136 + layout/style/test/test_transitions.html | 787 ++ .../style/test/test_transitions_and_reframes.html | 298 + .../style/test/test_transitions_and_restyles.html | 48 + layout/style/test/test_transitions_and_zoom.html | 49 + layout/style/test/test_transitions_at_start.html | 39 + layout/style/test/test_transitions_bug537151.html | 51 + .../test/test_transitions_cancel_near_end.html | 82 + ...st_transitions_computed_value_combinations.html | 170 + .../test/test_transitions_computed_values.html | 113 + .../test/test_transitions_dynamic_changes.html | 106 + layout/style/test/test_transitions_events.html | 294 + .../style/test/test_transitions_per_property.html | 3245 +++++ ...test_transitions_replacement_on_busy_frame.html | 100 + ..._transitions_replacement_with_setKeyframes.html | 88 + .../test/test_transitions_step_functions.html | 131 + layout/style/test/test_unclosed_parentheses.html | 262 + layout/style/test/test_unicode_range_loading.html | 366 + layout/style/test/test_units_angle.html | 52 + layout/style/test/test_units_frequency.html | 56 + layout/style/test/test_units_length.html | 60 + layout/style/test/test_units_time.html | 47 + layout/style/test/test_use_counters.html | 159 + layout/style/test/test_user_sheet_shadow_dom.html | 48 + layout/style/test/test_value_cloning.html | 181 + layout/style/test/test_value_computation.html | 236 + layout/style/test/test_value_storage.html | 365 + .../test/test_variable_serialization_computed.html | 79 + .../test_variable_serialization_specified.html | 116 + layout/style/test/test_variables.html | 129 + layout/style/test/test_variables_loop.html | 31 + layout/style/test/test_variables_order.html | 53 + layout/style/test/test_video_object_fit.html | 53 + .../test_viewport_scrollbar_causing_reflow.html | 130 + layout/style/test/test_viewport_units.html | 66 + layout/style/test/test_visited_image_loading.html | 68 + .../test/test_visited_image_loading_empty.html | 68 + layout/style/test/test_visited_lying.html | 97 + layout/style/test/test_visited_pref.html | 112 + layout/style/test/test_visited_reftests.html | 210 + .../style/test/test_webkit_device_pixel_ratio.html | 73 + layout/style/test/test_webkit_flex_display.html | 46 + layout/style/test/unstyled-frame.css | 0 layout/style/test/unstyled-frame.xml | 4 + layout/style/test/unstyled.css | 2 + layout/style/test/unstyled.xml | 3 + layout/style/test/viewport_units_iframe.html | 6 + layout/style/test/visited-lying-inner.html | 8 + layout/style/test/visited-pref-iframe.html | 7 + layout/style/test/visited_image_loading.sjs | 83 + layout/style/test/visited_image_loading_frame.html | 15 + .../test/visited_image_loading_frame_empty.html | 15 + 410 files changed, 69570 insertions(+) create mode 100644 layout/style/test/Ahem.ttf create mode 100644 layout/style/test/BitPattern.woff create mode 100644 layout/style/test/ListCSSProperties.cpp create mode 100644 layout/style/test/ParseCSS.cpp create mode 100644 layout/style/test/additional_sheets_helper.html create mode 100644 layout/style/test/animation_utils.js create mode 100644 layout/style/test/browser.toml create mode 100644 layout/style/test/browser_bug453896.js create mode 100644 layout/style/test/browser_sourcemap.js create mode 100644 layout/style/test/browser_sourcemap_comment.js create mode 100644 layout/style/test/browser_sourceurl_comment.js create mode 100644 layout/style/test/bug1382568-iframe.html create mode 100644 layout/style/test/bug1729861.js create mode 100644 layout/style/test/bug453896_iframe.html create mode 100644 layout/style/test/bug517224.sjs create mode 100644 layout/style/test/bug732209-css.sjs create mode 100644 layout/style/test/ccd-quirks.html create mode 100644 layout/style/test/ccd-standards.html create mode 100644 layout/style/test/ccd.sjs create mode 100644 layout/style/test/chrome/bug418986-2.js create mode 100644 layout/style/test/chrome/bug535806-css.css create mode 100644 layout/style/test/chrome/bug535806-html.html create mode 100644 layout/style/test/chrome/bug535806-xul.xhtml create mode 100644 layout/style/test/chrome/chrome-only-media-queries.js create mode 100644 layout/style/test/chrome/chrome.toml create mode 100644 layout/style/test/chrome/display_mode.html create mode 100644 layout/style/test/chrome/display_mode_reflow.html create mode 100644 layout/style/test/chrome/display_mode_reflow_iframe.html create mode 100644 layout/style/test/chrome/hover_empty.html create mode 100644 layout/style/test/chrome/hover_helper.html create mode 100644 layout/style/test/chrome/import_useless1.css create mode 100644 layout/style/test/chrome/import_useless2.css create mode 100644 layout/style/test/chrome/match.png create mode 100644 layout/style/test/chrome/mismatch.png create mode 100644 layout/style/test/chrome/moz_document_helper.html create mode 100644 layout/style/test/chrome/test_bug1157097.html create mode 100644 layout/style/test/chrome/test_bug1346623.html create mode 100644 layout/style/test/chrome/test_bug1371453.html create mode 100644 layout/style/test/chrome/test_bug418986-2.xhtml create mode 100644 layout/style/test/chrome/test_bug511909.html create mode 100644 layout/style/test/chrome/test_bug535806.xhtml create mode 100644 layout/style/test/chrome/test_chrome_only_media_queries.html create mode 100644 layout/style/test/chrome/test_constructable_stylesheets_chrome_only_rules.html create mode 100644 layout/style/test/chrome/test_display_mode.html create mode 100644 layout/style/test/chrome/test_display_mode_reflow.html create mode 100644 layout/style/test/chrome/test_hover.html create mode 100644 layout/style/test/chrome/test_moz_document_rules.html create mode 100644 layout/style/test/chrome/test_moz_document_serialization.html create mode 100644 layout/style/test/chrome/test_scrollbar_inline_size.html create mode 100644 layout/style/test/chrome/test_stylesheet_clone_import_rule.html create mode 100644 layout/style/test/css_properties_like_longhand.js create mode 100644 layout/style/test/descriptor_database.js create mode 100644 layout/style/test/empty.html create mode 100644 layout/style/test/file_animations_async_tests.html create mode 100644 layout/style/test/file_animations_omta_scroll.html create mode 100644 layout/style/test/file_animations_omta_scroll_rtl.html create mode 100644 layout/style/test/file_animations_with_disabled_properties.html create mode 100644 layout/style/test/file_bug1055933_circle-xxl.png create mode 100644 layout/style/test/file_bug1089417_iframe.html create mode 100644 layout/style/test/file_bug1375944.html create mode 100644 layout/style/test/file_bug1381233.html create mode 100644 layout/style/test/file_bug1443344.css create mode 100644 layout/style/test/file_bug645998-1.css create mode 100644 layout/style/test/file_bug645998-2.css create mode 100644 layout/style/test/file_bug829816.css create mode 100644 layout/style/test/file_computed_style_bfcache_display_none.html create mode 100644 layout/style/test/file_computed_style_bfcache_display_none2.html create mode 100644 layout/style/test/file_font_loading_api_vframe.html create mode 100644 layout/style/test/file_shared_sheet_caching.css create mode 100644 layout/style/test/file_shared_sheet_caching.html create mode 100644 layout/style/test/file_specified_value_serialization_individual_transforms.html create mode 100644 layout/style/test/flexbox_layout_testcases.js create mode 100644 layout/style/test/gen-css-properties.py create mode 100644 layout/style/test/gtest/ImportScannerTest.cpp create mode 100644 layout/style/test/gtest/StyloParsingBench.cpp create mode 100644 layout/style/test/gtest/example.css create mode 100644 layout/style/test/gtest/generate_example_stylesheet.py create mode 100644 layout/style/test/gtest/moz.build create mode 100644 layout/style/test/mapped.css create mode 100644 layout/style/test/mapped.css^headers^ create mode 100644 layout/style/test/mapped2.css create mode 100644 layout/style/test/mapped2.css^headers^ create mode 100644 layout/style/test/media_queries_iframe.html create mode 100644 layout/style/test/media_queries_iframe2.html create mode 100644 layout/style/test/mochitest.toml create mode 100644 layout/style/test/moz.build create mode 100644 layout/style/test/mq_changes_child.html create mode 100644 layout/style/test/neverending_font_load.sjs create mode 100644 layout/style/test/neverending_stylesheet_load.sjs create mode 100644 layout/style/test/post-redirect-1.css create mode 100644 layout/style/test/post-redirect-2.css create mode 100644 layout/style/test/post-redirect-3.css create mode 100644 layout/style/test/property_database.js create mode 100644 layout/style/test/redirect.sjs create mode 100644 layout/style/test/redundant_font_download.sjs create mode 100644 layout/style/test/slow_broken_sheet.sjs create mode 100644 layout/style/test/slow_load.sjs create mode 100644 layout/style/test/slow_ok_sheet.sjs create mode 100644 layout/style/test/sourcemap_css.html create mode 100644 layout/style/test/style_attribute_tests.js create mode 100644 layout/style/test/support/1x1-transparent.png create mode 100644 layout/style/test/support/blue-100x100.png create mode 100644 layout/style/test/support/external-variable-url.css create mode 100644 layout/style/test/test_acid3_test46.html create mode 100644 layout/style/test/test_addSheet.html create mode 100644 layout/style/test/test_additional_sheets.html create mode 100644 layout/style/test/test_align_justify_computed_values.html create mode 100644 layout/style/test/test_all_shorthand.html create mode 100644 layout/style/test/test_animations.html create mode 100644 layout/style/test/test_animations_async_tests.html create mode 100644 layout/style/test/test_animations_dynamic_changes.html create mode 100644 layout/style/test/test_animations_effect_timing_duration.html create mode 100644 layout/style/test/test_animations_effect_timing_enddelay.html create mode 100644 layout/style/test/test_animations_effect_timing_iterations.html create mode 100644 layout/style/test/test_animations_event_handler_attribute.html create mode 100644 layout/style/test/test_animations_event_order.html create mode 100644 layout/style/test/test_animations_iterationstart.html create mode 100644 layout/style/test/test_animations_omta.html create mode 100644 layout/style/test/test_animations_omta_scroll.html create mode 100644 layout/style/test/test_animations_omta_scroll_rtl.html create mode 100644 layout/style/test/test_animations_omta_start.html create mode 100644 layout/style/test/test_animations_pausing.html create mode 100644 layout/style/test/test_animations_playbackrate.html create mode 100644 layout/style/test/test_animations_reverse.html create mode 100644 layout/style/test/test_animations_styles_on_event.html create mode 100644 layout/style/test/test_animations_variable_changes.html create mode 100644 layout/style/test/test_animations_with_disabled_properties.html create mode 100644 layout/style/test/test_any_dynamic.html create mode 100644 layout/style/test/test_area_url_cursor.html create mode 100644 layout/style/test/test_asyncopen.html create mode 100644 layout/style/test/test_at_rule_parse_serialize.html create mode 100644 layout/style/test/test_attribute_selector_eof_behavior.html create mode 100644 layout/style/test/test_backdrop_filter_enabled_state.html create mode 100644 layout/style/test/test_background_blend_mode.html create mode 100644 layout/style/test/test_border_device_pixel_rounding_initial_style.html create mode 100644 layout/style/test/test_box_size_keywords.html create mode 100644 layout/style/test/test_bug1055933.html create mode 100644 layout/style/test/test_bug1089417.html create mode 100644 layout/style/test/test_bug1112014.html create mode 100644 layout/style/test/test_bug1203766.html create mode 100644 layout/style/test/test_bug1232829.html create mode 100644 layout/style/test/test_bug1292447.html create mode 100644 layout/style/test/test_bug1330375.html create mode 100644 layout/style/test/test_bug1371488.html create mode 100644 layout/style/test/test_bug1375944.html create mode 100644 layout/style/test/test_bug1382568.html create mode 100644 layout/style/test/test_bug1394302.html create mode 100644 layout/style/test/test_bug1443344-1.html create mode 100644 layout/style/test/test_bug1443344-2.html create mode 100644 layout/style/test/test_bug1451199-1.html create mode 100644 layout/style/test/test_bug1451199-2.html create mode 100644 layout/style/test/test_bug1490890.html create mode 100644 layout/style/test/test_bug1505254.html create mode 100644 layout/style/test/test_bug160403.html create mode 100644 layout/style/test/test_bug1729861.html create mode 100644 layout/style/test/test_bug200089.html create mode 100644 layout/style/test/test_bug221428.html create mode 100644 layout/style/test/test_bug229915.html create mode 100644 layout/style/test/test_bug302186.html create mode 100644 layout/style/test/test_bug319381.html create mode 100644 layout/style/test/test_bug357614.html create mode 100644 layout/style/test/test_bug363146.html create mode 100644 layout/style/test/test_bug372770.html create mode 100644 layout/style/test/test_bug373293.html create mode 100644 layout/style/test/test_bug377947.html create mode 100644 layout/style/test/test_bug379440.html create mode 100644 layout/style/test/test_bug379741.html create mode 100644 layout/style/test/test_bug382027.html create mode 100644 layout/style/test/test_bug383075.html create mode 100644 layout/style/test/test_bug387615.html create mode 100644 layout/style/test/test_bug389464.html create mode 100644 layout/style/test/test_bug391034.html create mode 100644 layout/style/test/test_bug391221.html create mode 100644 layout/style/test/test_bug397427.html create mode 100644 layout/style/test/test_bug399349.html create mode 100644 layout/style/test/test_bug401046.html create mode 100644 layout/style/test/test_bug405818.html create mode 100644 layout/style/test/test_bug412901.html create mode 100644 layout/style/test/test_bug413958.html create mode 100644 layout/style/test/test_bug418986-2.html create mode 100644 layout/style/test/test_bug437915.html create mode 100644 layout/style/test/test_bug450191.html create mode 100644 layout/style/test/test_bug470769.html create mode 100644 layout/style/test/test_bug499655.html create mode 100644 layout/style/test/test_bug499655.xhtml create mode 100644 layout/style/test/test_bug517224.html create mode 100644 layout/style/test/test_bug524175.html create mode 100644 layout/style/test/test_bug525952.html create mode 100644 layout/style/test/test_bug534804.html create mode 100644 layout/style/test/test_bug573255.html create mode 100644 layout/style/test/test_bug580685.html create mode 100644 layout/style/test/test_bug621351.html create mode 100644 layout/style/test/test_bug635286.html create mode 100644 layout/style/test/test_bug645998.html create mode 100644 layout/style/test/test_bug652486.html create mode 100644 layout/style/test/test_bug657143.html create mode 100644 layout/style/test/test_bug667520.html create mode 100644 layout/style/test/test_bug716226.html create mode 100644 layout/style/test/test_bug732153.html create mode 100644 layout/style/test/test_bug732209.html create mode 100644 layout/style/test/test_bug73586.html create mode 100644 layout/style/test/test_bug74880.html create mode 100644 layout/style/test/test_bug765590.html create mode 100644 layout/style/test/test_bug771043.html create mode 100644 layout/style/test/test_bug795520.html create mode 100644 layout/style/test/test_bug798843_pref.html create mode 100644 layout/style/test/test_bug829816.html create mode 100644 layout/style/test/test_bug874919.html create mode 100644 layout/style/test/test_bug887741_at-rules_in_declaration_lists.html create mode 100644 layout/style/test/test_bug892929.html create mode 100644 layout/style/test/test_bug98997.html create mode 100644 layout/style/test/test_cascade.html create mode 100644 layout/style/test/test_ch_ex_no_infloops.html create mode 100644 layout/style/test/test_change_hint_optimizations.html create mode 100644 layout/style/test/test_clip-path_polygon.html create mode 100644 layout/style/test/test_color_rounding.html create mode 100644 layout/style/test/test_compute_data_with_start_struct.html create mode 100644 layout/style/test/test_computed_style.html create mode 100644 layout/style/test/test_computed_style_bfcache_display_none.html create mode 100644 layout/style/test/test_computed_style_difference.html create mode 100644 layout/style/test/test_computed_style_grid_with_pseudo.html create mode 100644 layout/style/test/test_computed_style_in_created_document.html create mode 100644 layout/style/test/test_computed_style_min_size_auto.html create mode 100644 layout/style/test/test_computed_style_no_flush.html create mode 100644 layout/style/test/test_computed_style_no_pseudo.html create mode 100644 layout/style/test/test_computed_style_prefs.html create mode 100644 layout/style/test/test_condition_text.html create mode 100644 layout/style/test/test_constructable_stylesheets_chrome_only_rules_in_content.html create mode 100644 layout/style/test/test_counter_descriptor_storage.html create mode 100644 layout/style/test/test_counter_style.html create mode 100644 layout/style/test/test_crash_with_content_policy.html create mode 100644 layout/style/test/test_css_cross_domain.html create mode 100644 layout/style/test/test_css_cross_domain_no_orb.html create mode 100644 layout/style/test/test_css_eof_handling.html create mode 100644 layout/style/test/test_css_escape_api.html create mode 100644 layout/style/test/test_css_function_mismatched_parenthesis.html create mode 100644 layout/style/test/test_css_loader_crossorigin_data_url.html create mode 100644 layout/style/test/test_css_parse_error_smoketest.html create mode 100644 layout/style/test/test_css_supports.html create mode 100644 layout/style/test/test_css_supports_variables.html create mode 100644 layout/style/test/test_cue_restrictions.html create mode 100644 layout/style/test/test_custom_content_inheritance.html create mode 100644 layout/style/test/test_default_bidi_css.html create mode 100644 layout/style/test/test_default_computed_style.html create mode 100644 layout/style/test/test_descriptor_storage.html create mode 100644 layout/style/test/test_descriptor_syntax_errors.html create mode 100644 layout/style/test/test_display_mode.html create mode 100644 layout/style/test/test_dont_use_document_colors.html create mode 100644 layout/style/test/test_dont_use_document_fonts.html create mode 100644 layout/style/test/test_dynamic_change_causing_reflow.html create mode 100644 layout/style/test/test_exposed_prop_accessors.html create mode 100644 layout/style/test/test_extra_inherit_initial.html create mode 100644 layout/style/test/test_first_letter_restrictions.html create mode 100644 layout/style/test/test_first_line_restrictions.html create mode 100644 layout/style/test/test_flexbox_child_display_values.xhtml create mode 100644 layout/style/test/test_flexbox_flex_grow_and_shrink.html create mode 100644 layout/style/test/test_flexbox_flex_shorthand.html create mode 100644 layout/style/test/test_flexbox_focus_order.html create mode 100644 layout/style/test/test_flexbox_layout.html create mode 100644 layout/style/test/test_flexbox_order.html create mode 100644 layout/style/test/test_flexbox_order_abspos.html create mode 100644 layout/style/test/test_flexbox_order_table.html create mode 100644 layout/style/test/test_flexbox_reflow_counts.html create mode 100644 layout/style/test/test_flushing_frame.html create mode 100644 layout/style/test/test_font_face_cascade.html create mode 100644 layout/style/test/test_font_face_parser.html create mode 100644 layout/style/test/test_font_family_parsing.html create mode 100644 layout/style/test/test_font_family_serialization.html create mode 100644 layout/style/test/test_font_loading_api.html create mode 100644 layout/style/test/test_garbage_at_end_of_declarations.html create mode 100644 layout/style/test/test_grid_computed_values.html create mode 100644 layout/style/test/test_grid_container_shorthands.html create mode 100644 layout/style/test/test_grid_item_shorthands.html create mode 100644 layout/style/test/test_grid_shorthand_serialization.html create mode 100644 layout/style/test/test_group_insertRule.html create mode 100644 layout/style/test/test_hover_on_part.html create mode 100644 layout/style/test/test_hover_quirk.html create mode 100644 layout/style/test/test_html_attribute_computed_values.html create mode 100644 layout/style/test/test_ident_escaping.html create mode 100644 layout/style/test/test_img_src_causing_reflow.html create mode 100644 layout/style/test/test_import_preload.html create mode 100644 layout/style/test/test_inherit_computation.html create mode 100644 layout/style/test/test_inherit_storage.html create mode 100644 layout/style/test/test_initial_computation.html create mode 100644 layout/style/test/test_initial_storage.html create mode 100644 layout/style/test/test_invalidation_basic.html create mode 100644 layout/style/test/test_keyframes_rules.html create mode 100644 layout/style/test/test_keyframes_vendor_prefix.html create mode 100644 layout/style/test/test_load_events_on_stylesheets.html create mode 100644 layout/style/test/test_logical_properties.html create mode 100644 layout/style/test/test_marker_restrictions.html create mode 100644 layout/style/test/test_mask_image_CORS.html create mode 100644 layout/style/test/test_media_queries.html create mode 100644 layout/style/test/test_media_queries_dynamic.html create mode 100644 layout/style/test/test_media_query_list.html create mode 100644 layout/style/test/test_media_query_serialization.html create mode 100644 layout/style/test/test_moz_device_pixel_ratio.html create mode 100644 layout/style/test/test_moz_prefixed_cursor.html create mode 100644 layout/style/test/test_mq_any_hover_and_any_pointer.html create mode 100644 layout/style/test/test_mq_changes_in_iframe.html create mode 100644 layout/style/test/test_mq_hover_and_pointer.html create mode 100644 layout/style/test/test_mq_prefers_contrast_dynamic.html create mode 100644 layout/style/test/test_mq_prefers_reduced_motion_dynamic.html create mode 100644 layout/style/test/test_mql_event_listener_leaks.html create mode 100644 layout/style/test/test_namespace_rule.html create mode 100644 layout/style/test/test_non_content_accessible_env_vars.html create mode 100644 layout/style/test/test_non_content_accessible_properties.html create mode 100644 layout/style/test/test_non_content_accessible_pseudos.html create mode 100644 layout/style/test/test_non_content_accessible_values.html create mode 100644 layout/style/test/test_non_matching_sheet_media.html create mode 100644 layout/style/test/test_of_type_selectors.xhtml create mode 100644 layout/style/test/test_overscroll_behavior_pref.html create mode 100644 layout/style/test/test_page_parser.html create mode 100644 layout/style/test/test_parse_eof.html create mode 100644 layout/style/test/test_parse_ident.html create mode 100644 layout/style/test/test_parse_rule.html create mode 100644 layout/style/test/test_parse_url.html create mode 100644 layout/style/test/test_parser_diagnostics_unprintables.html create mode 100644 layout/style/test/test_pixel_lengths.html create mode 100644 layout/style/test/test_placeholder_restrictions.html create mode 100644 layout/style/test/test_pointer-events.html create mode 100644 layout/style/test/test_position_float_display.html create mode 100644 layout/style/test/test_position_sticky.html create mode 100644 layout/style/test/test_prefers_contrast_color_pairs.html create mode 100644 layout/style/test/test_priority_preservation.html create mode 100644 layout/style/test/test_property_database.html create mode 100644 layout/style/test/test_property_syntax_errors.html create mode 100644 layout/style/test/test_pseudo_display_fixup.html create mode 100644 layout/style/test/test_pseudoelement_parsing.html create mode 100644 layout/style/test/test_pseudoelement_state.html create mode 100644 layout/style/test/test_query_container_for.html create mode 100644 layout/style/test/test_redundant_font_download.html create mode 100644 layout/style/test/test_reframe_cb.html create mode 100644 layout/style/test/test_reframe_image_loading.html create mode 100644 layout/style/test/test_reframe_input.html create mode 100644 layout/style/test/test_reframe_pseudo_element.html create mode 100644 layout/style/test/test_rem_unit.html create mode 100644 layout/style/test/test_restyle_table_wrapper.html create mode 100644 layout/style/test/test_restyles_in_smil_animation.html create mode 100644 layout/style/test/test_revert.html create mode 100644 layout/style/test/test_root_node_display.html create mode 100644 layout/style/test/test_rule_insertion.html create mode 100644 layout/style/test/test_rules_out_of_sheets.html create mode 100644 layout/style/test/test_selectors.html create mode 100644 layout/style/test/test_setPropertyWithNull.html create mode 100644 layout/style/test/test_shape_outside_CORS.html create mode 100644 layout/style/test/test_shared_sheet_caching.html create mode 100644 layout/style/test/test_sheet_privilege.html create mode 100644 layout/style/test/test_shorthand_property_getters.html create mode 100644 layout/style/test/test_specified_value_serialization.html create mode 100644 layout/style/test/test_style_attr_listener.html create mode 100644 layout/style/test/test_style_attribute_quirks.html create mode 100644 layout/style/test/test_style_attribute_standards.html create mode 100644 layout/style/test/test_style_struct_copy_constructors.html create mode 100644 layout/style/test/test_stylesheet_additions.html create mode 100644 layout/style/test/test_stylesheet_clone_font_face.html create mode 100644 layout/style/test/test_supports_rules.html create mode 100644 layout/style/test/test_system_font_serialization.html create mode 100644 layout/style/test/test_text_decoration_shorthands.html create mode 100644 layout/style/test/test_transitions.html create mode 100644 layout/style/test/test_transitions_and_reframes.html create mode 100644 layout/style/test/test_transitions_and_restyles.html create mode 100644 layout/style/test/test_transitions_and_zoom.html create mode 100644 layout/style/test/test_transitions_at_start.html create mode 100644 layout/style/test/test_transitions_bug537151.html create mode 100644 layout/style/test/test_transitions_cancel_near_end.html create mode 100644 layout/style/test/test_transitions_computed_value_combinations.html create mode 100644 layout/style/test/test_transitions_computed_values.html create mode 100644 layout/style/test/test_transitions_dynamic_changes.html create mode 100644 layout/style/test/test_transitions_events.html create mode 100644 layout/style/test/test_transitions_per_property.html create mode 100644 layout/style/test/test_transitions_replacement_on_busy_frame.html create mode 100644 layout/style/test/test_transitions_replacement_with_setKeyframes.html create mode 100644 layout/style/test/test_transitions_step_functions.html create mode 100644 layout/style/test/test_unclosed_parentheses.html create mode 100644 layout/style/test/test_unicode_range_loading.html create mode 100644 layout/style/test/test_units_angle.html create mode 100644 layout/style/test/test_units_frequency.html create mode 100644 layout/style/test/test_units_length.html create mode 100644 layout/style/test/test_units_time.html create mode 100644 layout/style/test/test_use_counters.html create mode 100644 layout/style/test/test_user_sheet_shadow_dom.html create mode 100644 layout/style/test/test_value_cloning.html create mode 100644 layout/style/test/test_value_computation.html create mode 100644 layout/style/test/test_value_storage.html create mode 100644 layout/style/test/test_variable_serialization_computed.html create mode 100644 layout/style/test/test_variable_serialization_specified.html create mode 100644 layout/style/test/test_variables.html create mode 100644 layout/style/test/test_variables_loop.html create mode 100644 layout/style/test/test_variables_order.html create mode 100644 layout/style/test/test_video_object_fit.html create mode 100644 layout/style/test/test_viewport_scrollbar_causing_reflow.html create mode 100644 layout/style/test/test_viewport_units.html create mode 100644 layout/style/test/test_visited_image_loading.html create mode 100644 layout/style/test/test_visited_image_loading_empty.html create mode 100644 layout/style/test/test_visited_lying.html create mode 100644 layout/style/test/test_visited_pref.html create mode 100644 layout/style/test/test_visited_reftests.html create mode 100644 layout/style/test/test_webkit_device_pixel_ratio.html create mode 100644 layout/style/test/test_webkit_flex_display.html create mode 100644 layout/style/test/unstyled-frame.css create mode 100644 layout/style/test/unstyled-frame.xml create mode 100644 layout/style/test/unstyled.css create mode 100644 layout/style/test/unstyled.xml create mode 100644 layout/style/test/viewport_units_iframe.html create mode 100644 layout/style/test/visited-lying-inner.html create mode 100644 layout/style/test/visited-pref-iframe.html create mode 100644 layout/style/test/visited_image_loading.sjs create mode 100644 layout/style/test/visited_image_loading_frame.html create mode 100644 layout/style/test/visited_image_loading_frame_empty.html (limited to 'layout/style/test') diff --git a/layout/style/test/Ahem.ttf b/layout/style/test/Ahem.ttf new file mode 100644 index 0000000000..ac81cb0316 Binary files /dev/null and b/layout/style/test/Ahem.ttf differ diff --git a/layout/style/test/BitPattern.woff b/layout/style/test/BitPattern.woff new file mode 100644 index 0000000000..e4e8244057 Binary files /dev/null and b/layout/style/test/BitPattern.woff differ diff --git a/layout/style/test/ListCSSProperties.cpp b/layout/style/test/ListCSSProperties.cpp new file mode 100644 index 0000000000..13ac6ae93d --- /dev/null +++ b/layout/style/test/ListCSSProperties.cpp @@ -0,0 +1,178 @@ +/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* build (from code) lists of all supported CSS properties */ + +#include +#include +#include +#include "mozilla/ArrayUtils.h" + +// Do not consider properties not valid in style rules +#define CSS_PROP_LIST_EXCLUDE_NOT_IN_STYLE + +// Need an extra level of macro nesting to force expansion of method_ +// params before they get pasted. +#define STRINGIFY_METHOD(method_) #method_ + +struct PropertyInfo { + const char* propName; + const char* domName; + const char* pref; +}; + +const PropertyInfo gLonghandProperties[] = { + +#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) publicname_ +#define CSS_PROP_LONGHAND(name_, id_, method_, flags_, pref_, ...) \ + {#name_, STRINGIFY_METHOD(method_), pref_}, + +#include "mozilla/ServoCSSPropList.h" + +#undef CSS_PROP_LONGHAND +#undef CSS_PROP_PUBLIC_OR_PRIVATE + +}; + +/* + * These are the properties for which domName in the above list should + * be used. They're in the same order as the above list, with some + * items skipped. + */ +const char* gLonghandPropertiesWithDOMProp[] = { + +#define CSS_PROP_LIST_EXCLUDE_INTERNAL +#define CSS_PROP_LONGHAND(name_, ...) #name_, + +#include "mozilla/ServoCSSPropList.h" + +#undef CSS_PROP_LONGHAND +#undef CSS_PROP_LIST_EXCLUDE_INTERNAL + +}; + +const PropertyInfo gShorthandProperties[] = { + +#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) publicname_ +#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ + {#name_, STRINGIFY_METHOD(method_), pref_}, +#define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, flags_, pref_) \ + {#name_, #method_, pref_}, + +#include "mozilla/ServoCSSPropList.h" + +#undef CSS_PROP_ALIAS +#undef CSS_PROP_SHORTHAND +#undef CSS_PROP_PUBLIC_OR_PRIVATE + +}; + +/* see gLonghandPropertiesWithDOMProp */ +const char* gShorthandPropertiesWithDOMProp[] = { + +#define CSS_PROP_LIST_EXCLUDE_INTERNAL +#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) #name_, +#define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, flags_, pref_) #name_, + +#include "mozilla/ServoCSSPropList.h" + +#undef CSS_PROP_ALIAS +#undef CSS_PROP_SHORTHAND +#undef CSS_PROP_LIST_EXCLUDE_INTERNAL + +}; + +#undef STRINGIFY_METHOD + +const char* gInaccessibleProperties[] = { + // Don't print the properties that aren't accepted by the parser, per + // CSSParserImpl::ParseProperty + "-x-cols", + "-x-lang", + "-x-span", + "-x-text-scale", + "-moz-default-appearance", + "-moz-theme", + "-moz-inert", + "-moz-script-level", // parsed by UA sheets only + "-moz-math-variant", + "-moz-math-display", // parsed by UA sheets only + "-moz-top-layer", // parsed by UA sheets only + "-moz-min-font-size-ratio", // parsed by UA sheets only + "-moz-box-collapse", // chrome-only internal properties + "-moz-subtree-hidden-only-visually", // chrome-only internal properties + "-moz-user-focus", // chrome-only internal properties + "-moz-window-input-region-margin", // chrome-only internal properties + "-moz-window-opacity", // chrome-only internal properties + "-moz-window-transform", // chrome-only internal properties + "-moz-window-transform-origin", // chrome-only internal properties + "-moz-window-shadow", // chrome-only internal properties +}; + +inline int is_inaccessible(const char* aPropName) { + for (unsigned j = 0; j < MOZ_ARRAY_LENGTH(gInaccessibleProperties); ++j) { + if (strcmp(aPropName, gInaccessibleProperties[j]) == 0) return 1; + } + return 0; +} + +void print_array(const char* aName, const PropertyInfo* aProps, + unsigned aPropsLength, const char* const* aDOMProps, + unsigned aDOMPropsLength) { + printf("var %s = [\n", aName); + + int first = 1; + unsigned j = 0; // index into DOM prop list + for (unsigned i = 0; i < aPropsLength; ++i) { + const PropertyInfo* p = aProps + i; + + if (is_inaccessible(p->propName)) + // inaccessible properties never have DOM props, so don't + // worry about incrementing j. The assertion below will + // catch if they do. + continue; + + if (first) + first = 0; + else + printf(",\n"); + + printf("\t{ name: \"%s\", prop: ", p->propName); + if (j >= aDOMPropsLength || strcmp(p->propName, aDOMProps[j]) != 0) + printf("null"); + else { + ++j; + if (strncmp(p->domName, "Moz", 3) == 0) + printf("\"%s\"", p->domName); + else + // lowercase the first letter + printf("\"%c%s\"", p->domName[0] + 32, p->domName + 1); + } + if (p->pref[0]) { + printf(", pref: \"%s\"", p->pref); + } + printf(" }"); + } + + if (j != aDOMPropsLength) { + fprintf(stderr, "Assertion failure %s:%d\n", __FILE__, __LINE__); + fprintf(stderr, "j==%d, aDOMPropsLength == %d\n", j, aDOMPropsLength); + exit(1); + } + + printf("\n];\n\n"); +} + +int main() { + print_array("gLonghandProperties", gLonghandProperties, + MOZ_ARRAY_LENGTH(gLonghandProperties), + gLonghandPropertiesWithDOMProp, + MOZ_ARRAY_LENGTH(gLonghandPropertiesWithDOMProp)); + print_array("gShorthandProperties", gShorthandProperties, + MOZ_ARRAY_LENGTH(gShorthandProperties), + gShorthandPropertiesWithDOMProp, + MOZ_ARRAY_LENGTH(gShorthandPropertiesWithDOMProp)); + return 0; +} diff --git a/layout/style/test/ParseCSS.cpp b/layout/style/test/ParseCSS.cpp new file mode 100644 index 0000000000..04e37d48e2 --- /dev/null +++ b/layout/style/test/ParseCSS.cpp @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +// vim:cindent:ts=8:et:sw=4: +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This file is meant to be used with |#define CSS_REPORT_PARSE_ERRORS| + * in mozilla/dom/html/style/src/nsCSSScanner.h uncommented, and the + * |#ifdef DEBUG| block in nsCSSScanner::OutputError (in + * nsCSSScanner.cpp in the same directory) used (even if not a debug + * build). + */ + +#include "nsXPCOM.h" +#include "nsCOMPtr.h" + +#include "nsIFile.h" +#include "nsNetUtil.h" + +#include "nsContentCID.h" +#include "mozilla/StyleSheetInlines.h" +#include "mozilla/css/Loader.h" + +using namespace mozilla; + +static already_AddRefed FileToURI(const char* aFilename, + nsresult* aRv = 0) { + nsCOMPtr lf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, aRv)); + NS_ENSURE_TRUE(lf, nullptr); + // XXX Handle relative paths somehow. + lf->InitWithNativePath(nsDependentCString(aFilename)); + + nsIURI* uri = nullptr; + nsresult rv = NS_NewFileURI(&uri, lf); + if (aRv) *aRv = rv; + return uri; +} + +static int ParseCSSFile(nsIURI* aSheetURI) { + RefPtr = new mozilla::css::Loader(); + RefPtr sheet; + loader->LoadSheetSync(aSheetURI, getter_AddRefs(sheet)); + NS_ASSERTION(sheet, "sheet load failed"); + /* This can happen if the file can't be found (e.g. you + * ask for a relative path and xpcom/io rejects it) + */ + if (!sheet) return -1; + bool complete; + sheet->GetComplete(complete); + NS_ASSERTION(complete, "synchronous load did not complete"); + if (!complete) return -2; + return 0; +} + +int main(int argc, char** argv) { + if (argc < 2) { + fprintf(stderr, "%s [FILE]...\n", argv[0]); + } + nsresult rv = NS_InitXPCOM(nullptr, nullptr, nullptr); + if (NS_FAILED(rv)) return (int)rv; + + int res = 0; + for (int i = 1; i < argc; ++i) { + const char* filename = argv[i]; + + printf("\nParsing %s.\n", filename); + + nsCOMPtr uri = FileToURI(filename, &rv); + if (rv == NS_ERROR_OUT_OF_MEMORY) { + fprintf(stderr, "Out of memory.\n"); + return 1; + } + if (uri) res = ParseCSSFile(uri); + } + + NS_ShutdownXPCOM(nullptr); + + return res; +} diff --git a/layout/style/test/additional_sheets_helper.html b/layout/style/test/additional_sheets_helper.html new file mode 100644 index 0000000000..306ddbf5bd --- /dev/null +++ b/layout/style/test/additional_sheets_helper.html @@ -0,0 +1,7 @@ + + + + + some text + + diff --git a/layout/style/test/animation_utils.js b/layout/style/test/animation_utils.js new file mode 100644 index 0000000000..6f7ededcd4 --- /dev/null +++ b/layout/style/test/animation_utils.js @@ -0,0 +1,935 @@ +//---------------------------------------------------------------------- +// +// Common testing functions +// +//---------------------------------------------------------------------- + +function advance_clock(milliseconds) { + SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(milliseconds); +} + +// Test-element creation/destruction and event checking +(function () { + var gElem; + var gEventsReceived = []; + + function new_div(style) { + return new_element("div", style); + } + + // Creates a new |tagname| element with inline style |style| and appends + // it as a child of the element with ID 'display'. + // The element will also be given the class 'target' which can be used + // for additional styling. + function new_element(tagname, style) { + if (gElem) { + ok(false, "test author forgot to call done_div/done_elem"); + } + if (typeof style != "string") { + ok(false, "test author forgot to pass argument"); + } + if (!document.getElementById("display")) { + ok(false, "no 'display' element to append to"); + } + gElem = document.createElement(tagname); + gElem.setAttribute("style", style); + gElem.classList.add("target"); + document.getElementById("display").appendChild(gElem); + return [gElem, getComputedStyle(gElem, "")]; + } + + function listen() { + if (!gElem) { + ok(false, "test author forgot to call new_div before listen"); + } + gEventsReceived = []; + function listener(event) { + gEventsReceived.push(event); + } + gElem.addEventListener("animationstart", listener); + gElem.addEventListener("animationiteration", listener); + gElem.addEventListener("animationend", listener); + } + + function check_events(eventsExpected, desc) { + // This function checks that the list of eventsExpected matches + // the received events -- but it only checks the properties that + // are present on eventsExpected. + is( + gEventsReceived.length, + eventsExpected.length, + "number of events received for " + desc + ); + for ( + var i = 0, + i_end = Math.min(eventsExpected.length, gEventsReceived.length); + i != i_end; + ++i + ) { + var exp = eventsExpected[i]; + var rec = gEventsReceived[i]; + for (var prop in exp) { + if (prop == "elapsedTime") { + // Allow floating point error. + ok( + Math.abs(rec.elapsedTime - exp.elapsedTime) < 0.000002, + "events[" + + i + + "]." + + prop + + " for " + + desc + + " received=" + + rec.elapsedTime + + " expected=" + + exp.elapsedTime + ); + } else { + is( + rec[prop], + exp[prop], + "events[" + i + "]." + prop + " for " + desc + ); + } + } + } + for (var i = eventsExpected.length; i < gEventsReceived.length; ++i) { + ok(false, "unexpected " + gEventsReceived[i].type + " event for " + desc); + } + gEventsReceived = []; + } + + function done_element() { + if (!gElem) { + ok( + false, + "test author called done_element/done_div without matching" + + " call to new_element/new_div" + ); + } + gElem.remove(); + gElem = null; + if (gEventsReceived.length) { + ok(false, "caller should have called check_events"); + } + } + + [new_div, new_element, listen, check_events, done_element].forEach(function ( + fn + ) { + window[fn.name] = fn; + }); + window.done_div = done_element; +})(); + +function px_to_num(str) { + return Number(String(str).match(/^([\d.]+)px$/)[1]); +} + +function bezier(x1, y1, x2, y2) { + // Cubic bezier with control points (0, 0), (x1, y1), (x2, y2), and (1, 1). + function x_for_t(t) { + var omt = 1 - t; + return 3 * omt * omt * t * x1 + 3 * omt * t * t * x2 + t * t * t; + } + function y_for_t(t) { + var omt = 1 - t; + return 3 * omt * omt * t * y1 + 3 * omt * t * t * y2 + t * t * t; + } + function t_for_x(x) { + // Binary subdivision. + var mint = 0, + maxt = 1; + for (var i = 0; i < 30; ++i) { + var guesst = (mint + maxt) / 2; + var guessx = x_for_t(guesst); + if (x < guessx) { + maxt = guesst; + } else { + mint = guesst; + } + } + return (mint + maxt) / 2; + } + return function bezier_closure(x) { + if (x == 0) { + return 0; + } + if (x == 1) { + return 1; + } + return y_for_t(t_for_x(x)); + }; +} + +function step_end(nsteps) { + return function step_end_closure(x) { + return Math.floor(x * nsteps) / nsteps; + }; +} + +function step_start(nsteps) { + var stepend = step_end(nsteps); + return function step_start_closure(x) { + return 1.0 - stepend(1.0 - x); + }; +} + +var gTF = { + ease: bezier(0.25, 0.1, 0.25, 1), + linear: function (x) { + return x; + }, + ease_in: bezier(0.42, 0, 1, 1), + ease_out: bezier(0, 0, 0.58, 1), + ease_in_out: bezier(0.42, 0, 0.58, 1), + step_start: step_start(1), + step_end: step_end(1), +}; + +function is_approx(float1, float2, error, desc) { + ok( + Math.abs(float1 - float2) < error, + desc + ": " + float1 + " and " + float2 + " should be within " + error + ); +} + +function findKeyframesRule(name) { + for (var i = 0; i < document.styleSheets.length; i++) { + var match = [].find.call(document.styleSheets[i].cssRules, function (rule) { + return rule.type == CSSRule.KEYFRAMES_RULE && rule.name == name; + }); + if (match) { + return match; + } + } + return undefined; +} + +// Checks if off-main thread animation (OMTA) is available, and if it is, runs +// the provided callback function. If OMTA is not available or is not +// functioning correctly, the second callback, aOnSkip, is run instead. +// +// This function also does an internal test to verify that OMTA is working at +// all so that if OMTA is not functioning correctly when it is expected to +// function only a single failure is produced. +// +// Since this function relies on various asynchronous operations, the caller is +// responsible for calling SimpleTest.waitForExplicitFinish() before calling +// this and SimpleTest.finish() within aTestFunction and aOnSkip. +// +// specialPowersForPrefs exists because some SpecialPowers objects apparently +// can get prefs and some can't; callers that would normally have one of the +// latter but can get their hands on one of the former can pass it in +// explicitly. +function runOMTATest(aTestFunction, aOnSkip, specialPowersForPrefs) { + const OMTAPrefKey = "layers.offmainthreadcomposition.async-animations"; + var utils = SpecialPowers.DOMWindowUtils; + if (!specialPowersForPrefs) { + specialPowersForPrefs = SpecialPowers; + } + var expectOMTA = + utils.layerManagerRemote && + // ^ Off-main thread animation cannot be used if off-main + // thread composition (OMTC) is not available + specialPowersForPrefs.getBoolPref(OMTAPrefKey); + + isOMTAWorking() + .then(function (isWorking) { + if (expectOMTA) { + if (isWorking) { + aTestFunction(); + } else { + // We only call this when we know it will fail as otherwise in the + // regular success case we will end up inflating the "passed tests" + // count by 1 + ok(isWorking, "OMTA should work"); + aOnSkip(); + } + } else { + todo( + isWorking, + "OMTA should ideally work, though we don't expect it to work on " + + "this platform/configuration" + ); + aOnSkip(); + } + }) + .catch(function (err) { + ok(false, err); + aOnSkip(); + }); + + function isOMTAWorking() { + // Create keyframes rule + const animationName = "a6ce3091ed85"; // Random name to avoid clashes + var ruleText = + "@keyframes " + + animationName + + " { from { opacity: 0.5 } to { opacity: 0.5 } }"; + var style = document.createElement("style"); + style.appendChild(document.createTextNode(ruleText)); + document.head.appendChild(style); + + // Create animation target + var div = document.createElement("div"); + document.body.appendChild(div); + + // Give the target geometry so it is eligible for layerization + div.style.width = "100px"; + div.style.height = "100px"; + div.style.backgroundColor = "white"; + + // Common clean up code + var cleanUp = function () { + div.remove(); + style.remove(); + if (utils.isTestControllingRefreshes) { + utils.restoreNormalRefresh(); + } + }; + + return waitForDocumentLoad() + .then(loadPaintListener) + .then(function () { + // Put refresh driver under test control and flush all pending style, + // layout and paint to avoid the situation that waitForPaintsFlush() + // receives unexpected MozAfterpaint event for those pending + // notifications. + utils.advanceTimeAndRefresh(0); + return waitForPaintsFlushed(); + }) + .then(function () { + div.style.animation = animationName + " 10s"; + + return waitForPaintsFlushed(); + }) + .then(function () { + var opacity = utils.getOMTAStyle(div, "opacity"); + cleanUp(); + return Promise.resolve(opacity == 0.5); + }) + .catch(function (err) { + cleanUp(); + return Promise.reject(err); + }); + } + + function waitForDocumentLoad() { + return new Promise(function (resolve, reject) { + if (document.readyState === "complete") { + resolve(); + } else { + window.addEventListener("load", resolve); + } + }); + } + + function loadPaintListener() { + return new Promise(function (resolve, reject) { + if (typeof window.waitForAllPaints !== "function") { + var script = document.createElement("script"); + script.onload = resolve; + script.onerror = function () { + reject(new Error("Failed to load paint listener")); + }; + script.src = "/tests/SimpleTest/paint_listener.js"; + var firstScript = document.scripts[0]; + firstScript.parentNode.insertBefore(script, firstScript); + } else { + resolve(); + } + }); + } +} + +// Common architecture for setting up a series of asynchronous animation tests +// +// Usage example: +// +// addAsyncAnimTest(function *() { +// .. do work .. +// yield functionThatReturnsAPromise(); +// .. do work .. +// }); +// runAllAsyncAnimTests().then(SimpleTest.finish()); +// +(function () { + var tests = []; + + window.addAsyncAnimTest = function (generator) { + tests.push(generator); + }; + + // Returns a promise when all tests have run + window.runAllAsyncAnimTests = function (aOnAbort) { + // runAsyncAnimTest returns a Promise that is resolved when the + // test is finished so we can chain them together + return tests.reduce(function (sequence, test) { + return sequence.then(function () { + return runAsyncAnimTest(test, aOnAbort); + }); + }, Promise.resolve() /* the start of the sequence */); + }; + + // Takes a generator function that represents a test case. Each point in the + // test case that waits asynchronously for some result yields a Promise that + // is resolved when the asynchronous action has completed. By chaining these + // intermediate results together we run the test to completion. + // + // This method itself returns a Promise that is resolved when the generator + // function has completed. + // + // This arrangement is based on add_task() which is currently only available + // in mochitest-chrome (bug 872229). If add_task becomes available in + // mochitest-plain, we can remove this function and use add_task instead. + function runAsyncAnimTest(aTestFunc, aOnAbort) { + var generator; + + function step(arg) { + var next; + try { + next = generator.next(arg); + } catch (e) { + return Promise.reject(e); + } + if (next.done) { + return Promise.resolve(next.value); + } + return Promise.resolve(next.value).then(step, function (err) { + throw err; + }); + } + + // Put refresh driver under test control + SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(0); + + // Run test + var promise = aTestFunc(); + if (!promise.then) { + generator = promise; + promise = step(); + } + return promise + .catch(function (err) { + ok(false, err.message); + if (typeof aOnAbort == "function") { + aOnAbort(); + } + }) + .then(function () { + // Restore clock + SpecialPowers.DOMWindowUtils.restoreNormalRefresh(); + }); + } +})(); + +//---------------------------------------------------------------------- +// +// Helper functions for testing animated values on the compositor +// +//---------------------------------------------------------------------- + +const RunningOn = { + MainThread: 0, + Compositor: 1, + Either: 2, + TodoMainThread: 3, + TodoCompositor: 4, +}; + +const ExpectComparisonTo = { + Pass: 1, + Fail: 2, +}; + +(function () { + window.omta_todo_is = function ( + elem, + property, + expected, + runningOn, + desc, + pseudo + ) { + return omta_is_approx( + elem, + property, + expected, + 0, + runningOn, + desc, + ExpectComparisonTo.Fail, + pseudo + ); + }; + + window.omta_is = function ( + elem, + property, + expected, + runningOn, + desc, + pseudo + ) { + return omta_is_approx( + elem, + property, + expected, + 0, + runningOn, + desc, + ExpectComparisonTo.Pass, + pseudo + ); + }; + + // Many callers of this method will pass 'undefined' for + // expectedComparisonResult. + window.omta_is_approx = function ( + elem, + property, + expected, + tolerance, + runningOn, + desc, + expectedComparisonResult, + pseudo + ) { + // Check input + // FIXME: Auto generate this array. + const omtaProperties = [ + "transform", + "translate", + "rotate", + "scale", + "offset-path", + "offset-distance", + "offset-rotate", + "offset-anchor", + "offset-position", + "opacity", + "background-color", + ]; + if (!omtaProperties.includes(property)) { + ok(false, property + " is not an OMTA property"); + return; + } + var normalize; + var compare; + var normalizedToString = JSON.stringify; + switch (property) { + case "offset-path": + case "offset-distance": + case "offset-rotate": + case "offset-anchor": + case "offset-position": + case "translate": + case "rotate": + case "scale": + if (runningOn == RunningOn.MainThread) { + normalize = value => value; + compare = function (a, b, error) { + return a == b; + }; + break; + } + // fall through + case "transform": + normalize = convertTo3dMatrix; + compare = matricesRoughlyEqual; + normalizedToString = convert3dMatrixToString; + break; + case "opacity": + normalize = parseFloat; + compare = function (a, b, error) { + return Math.abs(a - b) <= error; + }; + break; + default: + normalize = value => value; + compare = function (a, b, error) { + return a == b; + }; + break; + } + + if (!!expected.compositorValue) { + const originalNormalize = normalize; + normalize = value => + !!value.compositorValue + ? originalNormalize(value.compositorValue) + : originalNormalize(value); + } + + // Get actual values + var compositorStr = SpecialPowers.DOMWindowUtils.getOMTAStyle( + elem, + property, + pseudo + ); + var computedStr = window.getComputedStyle(elem, pseudo)[property]; + + // Prepare expected value + var expectedValue = normalize(expected); + if (expectedValue === null) { + ok( + false, + desc + + ": test author should provide a valid 'expected' value" + + " - got " + + expected.toString() + ); + return; + } + + // Check expected value appears in the right place + var actualStr; + switch (runningOn) { + case RunningOn.Either: + runningOn = + compositorStr !== "" ? RunningOn.Compositor : RunningOn.MainThread; + actualStr = compositorStr !== "" ? compositorStr : computedStr; + break; + + case RunningOn.Compositor: + if (compositorStr === "") { + ok(false, desc + ": should be animating on compositor"); + return; + } + actualStr = compositorStr; + break; + + case RunningOn.TodoMainThread: + todo( + compositorStr === "", + desc + ": should NOT be animating on compositor" + ); + actualStr = compositorStr === "" ? computedStr : compositorStr; + break; + + case RunningOn.TodoCompositor: + todo( + compositorStr !== "", + desc + ": should be animating on compositor" + ); + actualStr = compositorStr !== "" ? computedStr : compositorStr; + break; + + default: + if (compositorStr !== "") { + ok(false, desc + ": should NOT be animating on compositor"); + return; + } + actualStr = computedStr; + break; + } + + var okOrTodo = + expectedComparisonResult == ExpectComparisonTo.Fail ? todo : ok; + + // Compare animated value with expected + var actualValue = normalize(actualStr); + // Note: the actualStr should be empty string when using todoCompositor, so + // actualValue is null in this case. However, compare() should handle null + // well. + okOrTodo( + compare(expectedValue, actualValue, tolerance), + desc + + " - got " + + actualStr + + ", expected " + + normalizedToString(expectedValue) + ); + + // For transform-like properties, if we have multiple transform-like + // properties, the OMTA value and getComputedStyle() must be different, + // so use this flag to skip the following tests. + // FIXME: Putting this property on the expected value is a little bit odd. + // It's not really a product of the expected value, but rather the kind of + // test we're running. That said, the omta_is, omta_todo_is etc. methods are + // already pretty complex and adding another parameter would probably + // complicate things too much so this is fine for now. If we extend these + // functions any more, though, we should probably reconsider this API. + if (expected.usesMultipleProperties) { + return; + } + + if (typeof expected.computed !== "undefined") { + // For some tests we specify a separate computed value for comparing + // with getComputedStyle. + // + // In particular, we do this for the individual transform functions since + // the form returned from getComputedStyle() reflects the individual + // properties (e.g. 'translate: 100px') while the form we read back from + // the compositor represents the combined result of all the transform + // properties as a single transform matrix (e.g. [0, 0, 0, 0, 100, 0]). + // + // Despite the fact that we can't directly compare the OMTA value against + // the getComputedStyle value in this case, it is still worth checking the + // result of getComputedStyle since it will help to alert us if some + // discrepancy arises between the way we calculate values on the main + // thread and compositor. + okOrTodo( + computedStr == expected.computed, + desc + ": Computed style should be equal to " + expected.computed + ); + } else if (actualStr === compositorStr) { + // For compositor animations do an additional check that they match + // the value calculated on the main thread + var computedValue = normalize(computedStr); + if (computedValue === null) { + ok( + false, + desc + + ": test framework should parse computed style" + + " - got " + + computedStr + ); + return; + } + okOrTodo( + compare(computedValue, actualValue, 0.0), + desc + + ": OMTA style and computed style should be equal" + + " - OMTA " + + actualStr + + ", computed " + + computedStr + ); + } + }; + + window.matricesRoughlyEqual = function (a, b, tolerance) { + // Error handle if a or b is invalid. + if (!a || !b) { + return false; + } + + tolerance = tolerance || 0.00011; + for (var i = 0; i < 4; i++) { + for (var j = 0; j < 4; j++) { + var diff = Math.abs(a[i][j] - b[i][j]); + if (diff > tolerance || isNaN(diff)) { + return false; + } + } + } + return true; + }; + + // Converts something representing an transform into a 3d matrix in + // column-major order. + // The following are supported: + // "matrix(...)" + // "matrix3d(...)" + // [ 1, 0, 0, ... ] + // { a: 1, ty: 23 } etc. + window.convertTo3dMatrix = function (matrixLike) { + if (typeof matrixLike == "string") { + return convertStringTo3dMatrix(matrixLike); + } else if (Array.isArray(matrixLike)) { + return convertArrayTo3dMatrix(matrixLike); + } else if (typeof matrixLike == "object") { + return convertObjectTo3dMatrix(matrixLike); + } + return null; + }; + + // In future most of these methods should be able to be replaced + // with DOMMatrix + window.isInvertible = function (matrix) { + return getDeterminant(matrix) != 0; + }; + + // Converts strings of the format "matrix(...)" and "matrix3d(...)" to a 3d + // matrix + function convertStringTo3dMatrix(str) { + if (str == "none") { + return convertArrayTo3dMatrix([1, 0, 0, 1, 0, 0]); + } + var result = str.match("^matrix(3d)?\\("); + if (result === null) { + return null; + } + + return convertArrayTo3dMatrix( + str + .substring(result[0].length, str.length - 1) + .split(",") + .map(function (component) { + return Number(component); + }) + ); + } + + // Takes an array of numbers of length 6 (2d matrix) or 16 (3d matrix) + // representing a matrix specified in column-major order and returns a 3d + // matrix represented as an array of arrays + function convertArrayTo3dMatrix(array) { + if (array.length == 6) { + return convertObjectTo3dMatrix({ + a: array[0], + b: array[1], + c: array[2], + d: array[3], + e: array[4], + f: array[5], + }); + } else if (array.length == 16) { + return [ + array.slice(0, 4), + array.slice(4, 8), + array.slice(8, 12), + array.slice(12, 16), + ]; + } + return null; + } + + // Return the first defined value in args. + function defined(...args) { + return args.find(arg => typeof arg !== "undefined"); + } + + // Takes an object of the form { a: 1.1, e: 23 } and builds up a 3d matrix + // with unspecified values filled in with identity values. + function convertObjectTo3dMatrix(obj) { + return [ + [ + defined(obj.a, obj.sx, obj.m11, 1), + obj.b || obj.m12 || 0, + obj.m13 || 0, + obj.m14 || 0, + ], + [ + obj.c || obj.m21 || 0, + defined(obj.d, obj.sy, obj.m22, 1), + obj.m23 || 0, + obj.m24 || 0, + ], + [obj.m31 || 0, obj.m32 || 0, defined(obj.sz, obj.m33, 1), obj.m34 || 0], + [ + obj.e || obj.tx || obj.m41 || 0, + obj.f || obj.ty || obj.m42 || 0, + obj.tz || obj.m43 || 0, + defined(obj.m44, 1), + ], + ]; + } + + function convert3dMatrixToString(matrix) { + if (is2d(matrix)) { + return ( + "matrix(" + + [ + matrix[0][0], + matrix[0][1], + matrix[1][0], + matrix[1][1], + matrix[3][0], + matrix[3][1], + ].join(", ") + + ")" + ); + } + return ( + "matrix3d(" + + matrix + .reduce(function (outer, inner) { + return outer.concat(inner); + }) + .join(", ") + + ")" + ); + } + + function is2d(matrix) { + return ( + matrix[0][2] === 0 && + matrix[0][3] === 0 && + matrix[1][2] === 0 && + matrix[1][3] === 0 && + matrix[2][0] === 0 && + matrix[2][1] === 0 && + matrix[2][2] === 1 && + matrix[2][3] === 0 && + matrix[3][2] === 0 && + matrix[3][3] === 1 + ); + } + + function getDeterminant(matrix) { + if (is2d(matrix)) { + return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]; + } + + return ( + matrix[0][3] * matrix[1][2] * matrix[2][1] * matrix[3][0] - + matrix[0][2] * matrix[1][3] * matrix[2][1] * matrix[3][0] - + matrix[0][3] * matrix[1][1] * matrix[2][2] * matrix[3][0] + + matrix[0][1] * matrix[1][3] * matrix[2][2] * matrix[3][0] + + matrix[0][2] * matrix[1][1] * matrix[2][3] * matrix[3][0] - + matrix[0][1] * matrix[1][2] * matrix[2][3] * matrix[3][0] - + matrix[0][3] * matrix[1][2] * matrix[2][0] * matrix[3][1] + + matrix[0][2] * matrix[1][3] * matrix[2][0] * matrix[3][1] + + matrix[0][3] * matrix[1][0] * matrix[2][2] * matrix[3][1] - + matrix[0][0] * matrix[1][3] * matrix[2][2] * matrix[3][1] - + matrix[0][2] * matrix[1][0] * matrix[2][3] * matrix[3][1] + + matrix[0][0] * matrix[1][2] * matrix[2][3] * matrix[3][1] + + matrix[0][3] * matrix[1][1] * matrix[2][0] * matrix[3][2] - + matrix[0][1] * matrix[1][3] * matrix[2][0] * matrix[3][2] - + matrix[0][3] * matrix[1][0] * matrix[2][1] * matrix[3][2] + + matrix[0][0] * matrix[1][3] * matrix[2][1] * matrix[3][2] + + matrix[0][1] * matrix[1][0] * matrix[2][3] * matrix[3][2] - + matrix[0][0] * matrix[1][1] * matrix[2][3] * matrix[3][2] - + matrix[0][2] * matrix[1][1] * matrix[2][0] * matrix[3][3] + + matrix[0][1] * matrix[1][2] * matrix[2][0] * matrix[3][3] + + matrix[0][2] * matrix[1][0] * matrix[2][1] * matrix[3][3] - + matrix[0][0] * matrix[1][2] * matrix[2][1] * matrix[3][3] - + matrix[0][1] * matrix[1][0] * matrix[2][2] * matrix[3][3] + + matrix[0][0] * matrix[1][1] * matrix[2][2] * matrix[3][3] + ); + } +})(); + +//---------------------------------------------------------------------- +// +// Promise wrappers for paint_listener.js +// +//---------------------------------------------------------------------- + +// Returns a Promise that resolves once all paints have completed +function waitForPaints() { + return new Promise(function (resolve, reject) { + waitForAllPaints(resolve); + }); +} + +// As with waitForPaints but also flushes pending style changes before waiting +function waitForPaintsFlushed() { + return new Promise(function (resolve, reject) { + waitForAllPaintsFlushed(resolve); + }); +} + +function waitForVisitedLinkColoring(visitedLink, waitProperty, waitValue) { + function checkLink(resolve) { + if ( + SpecialPowers.DOMWindowUtils.getVisitedDependentComputedStyle( + visitedLink, + "", + waitProperty + ) == waitValue + ) { + // Our link has been styled as visited. Resolve. + resolve(true); + } else { + // Our link is not yet styled as visited. Poll for completion. + setTimeout(checkLink, 0, resolve); + } + } + return new Promise(function (resolve, reject) { + checkLink(resolve); + }); +} diff --git a/layout/style/test/browser.toml b/layout/style/test/browser.toml new file mode 100644 index 0000000000..7c16123562 --- /dev/null +++ b/layout/style/test/browser.toml @@ -0,0 +1,19 @@ +[DEFAULT] +support-files = [ + "bug453896_iframe.html", + "media_queries_iframe.html", + "mapped.css", + "mapped.css^headers^", + "mapped2.css", + "mapped2.css^headers^", + "sourcemap_css.html" +] + +["browser_bug453896.js"] + +["browser_sourcemap.js"] + +["browser_sourcemap_comment.js"] + +["browser_sourceurl_comment.js"] + diff --git a/layout/style/test/browser_bug453896.js b/layout/style/test/browser_bug453896.js new file mode 100644 index 0000000000..6b8e180c38 --- /dev/null +++ b/layout/style/test/browser_bug453896.js @@ -0,0 +1,16 @@ +add_task(async function () { + let uri = getRootDirectory(gTestPath) + "bug453896_iframe.html"; + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: uri, + }, + function (browser) { + return SpecialPowers.spawn(browser, [], async function () { + var fake_window = { ok: ok }; + content.wrappedJSObject.run(fake_window); + }); + } + ); +}); diff --git a/layout/style/test/browser_sourcemap.js b/layout/style/test/browser_sourcemap.js new file mode 100644 index 0000000000..56ad067818 --- /dev/null +++ b/layout/style/test/browser_sourcemap.js @@ -0,0 +1,41 @@ +add_task(async function () { + let uri = "http://example.com/browser/layout/style/test/sourcemap_css.html"; + info(`URI is ${uri}`); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: uri, + }, + async function (browser) { + await SpecialPowers.spawn(browser, [], function () { + let seenSheets = 0; + + for (let i = 0; i < content.document.styleSheets.length; ++i) { + let sheet = content.document.styleSheets[i]; + + info(`Checking ${sheet.href}`); + if (/mapped\.css/.test(sheet.href)) { + is( + sheet.sourceMapURL, + "mapped.css.map", + "X-SourceMap header took effect" + ); + seenSheets |= 1; + } else if (/mapped2\.css/.test(sheet.href)) { + is( + sheet.sourceMapURL, + "mapped2.css.map", + "SourceMap header took effect" + ); + seenSheets |= 2; + } else { + ok(false, "sheet does not have source map URL"); + } + } + + is(seenSheets, 3, "seen all source-mapped sheets"); + }); + } + ); +}); diff --git a/layout/style/test/browser_sourcemap_comment.js b/layout/style/test/browser_sourcemap_comment.js new file mode 100644 index 0000000000..e0bbff8de4 --- /dev/null +++ b/layout/style/test/browser_sourcemap_comment.js @@ -0,0 +1,47 @@ +add_task(async function () { + // Test text and expected results. + let test_cases = [ + ["/*# sourceMappingURL=here*/", "here"], + ["/*# sourceMappingURL=here */", "here"], + ["/*@ sourceMappingURL=here*/", "here"], + ["/*@ sourceMappingURL=there*/ /*# sourceMappingURL=here*/", "here"], + ["/*# sourceMappingURL=here there */", "here"], + + ["/*# sourceMappingURL= here */", ""], + ["/*# sourceMappingURL=*/", ""], + ["/*# sourceMappingUR=here */", ""], + ["/*! sourceMappingURL=here */", ""], + ["/*# sourceMappingURL = here */", ""], + ["/* # sourceMappingURL=here */", ""], + ]; + + let page = "\n\n\n"; + for (let i = 0; i < test_cases.length; ++i) { + page += `\n`; + } + page += "some text"; + + let uri = "data:text/html;base64," + btoa(page); + info(`URI is ${uri}`); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: uri, + }, + async function (browser) { + await SpecialPowers.spawn(browser, [test_cases], function (tests) { + for (let i = 0; i < content.document.styleSheets.length; ++i) { + let sheet = content.document.styleSheets[i]; + + info(`Checking sheet #${i}`); + is( + sheet.sourceMapURL, + tests[i][1], + `correct source map for sheet ${i}` + ); + } + }); + } + ); +}); diff --git a/layout/style/test/browser_sourceurl_comment.js b/layout/style/test/browser_sourceurl_comment.js new file mode 100644 index 0000000000..9baf6c9ce5 --- /dev/null +++ b/layout/style/test/browser_sourceurl_comment.js @@ -0,0 +1,43 @@ +add_task(async function () { + // Test text and expected results. + let test_cases = [ + ["/*# sourceURL=here*/", "here"], + ["/*# sourceURL=here */", "here"], + ["/*@ sourceURL=here*/", "here"], + ["/*@ sourceURL=there*/ /*# sourceURL=here*/", "here"], + ["/*# sourceURL=here there */", "here"], + + ["/*# sourceURL= here */", ""], + ["/*# sourceURL=*/", ""], + ["/*# sourceUR=here */", ""], + ["/*! sourceURL=here */", ""], + ["/*# sourceURL = here */", ""], + ["/* # sourceURL=here */", ""], + ]; + + let page = "\n\n\n"; + for (let i = 0; i < test_cases.length; ++i) { + page += `\n`; + } + page += "some text"; + + let uri = "data:text/html;base64," + btoa(page); + info(`URI is ${uri}`); + + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: uri, + }, + async function (browser) { + await SpecialPowers.spawn(browser, [test_cases], function (tests) { + for (let i = 0; i < content.document.styleSheets.length; ++i) { + let sheet = content.document.styleSheets[i]; + + info(`Checking sheet #${i}`); + is(sheet.sourceURL, tests[i][1], `correct source URL for sheet ${i}`); + } + }); + } + ); +}); diff --git a/layout/style/test/bug1382568-iframe.html b/layout/style/test/bug1382568-iframe.html new file mode 100644 index 0000000000..b1448703e5 --- /dev/null +++ b/layout/style/test/bug1382568-iframe.html @@ -0,0 +1,8 @@ + + + diff --git a/layout/style/test/bug1729861.js b/layout/style/test/bug1729861.js new file mode 100644 index 0000000000..dbfa060ab1 --- /dev/null +++ b/layout/style/test/bug1729861.js @@ -0,0 +1,81 @@ +// # Bug 1729861 + +// Expected values. Format: [name, pref_off_value, pref_on_value] +var expected_values = [ + [ + "device-aspect-ratio", + screen.width + "/" + screen.height, + window.innerWidth + "/" + window.innerHeight, + ], + ["device-height", screen.height + "px", window.innerHeight + "px"], + ["device-width", screen.width + "px", window.innerWidth + "px"], +]; + +// Create a line containing a CSS media query and a rule to set the bg color. +var mediaQueryCSSLine = function (key, val, color) { + return ( + "@media (" + + key + + ": " + + val + + ") { #" + + key + + " { background-color: " + + color + + "; } }\n" + ); +}; + +var green = "rgb(0, 128, 0)"; +var blue = "rgb(0, 0, 255)"; + +// Set a pref value asynchronously, returning a promise that resolves +// when it succeeds. +var pushPref = function (key, value) { + return SpecialPowers.pushPrefEnv({ set: [[key, value]] }); +}; + +// Set the resistFingerprinting pref to the given value, and then check that the background +// color has been updated properly as a result of re-evaluating the media queries. +var checkColorForPref = async function (setting, testDivs, expectedColor) { + await pushPref("privacy.resistFingerprinting", setting); + for (let div of testDivs) { + let color = window.getComputedStyle(div).backgroundColor; + is(color, expectedColor, "background for '" + div.id + "' is " + color); + } +}; + +var test = async function () { + // If the "off" and "on" expected values are the same, we can't actually + // test anything here. (Might this be the case on mobile?) + let skipTest = false; + for (let [key, offVal, onVal] of expected_values) { + if (offVal == onVal) { + todo(false, "Unable to test because '" + key + "' is invariant"); + return; + } + } + + let css = + ".test { margin: 1em; padding: 1em; color: white; width: max-content; font: 2em monospace }\n"; + + // Create a test element for each of the media queries we're checking, and append the matching + // "on" and "off" media queries to the CSS. + let testDivs = []; + for (let [key, offVal, onVal] of expected_values) { + let div = document.createElement("div"); + div.textContent = key; + div.setAttribute("class", "test"); + div.setAttribute("id", key); + testDivs.push(div); + document.getElementById("display").appendChild(div); + css += mediaQueryCSSLine(key, onVal, "green"); + css += mediaQueryCSSLine(key, offVal, "blue"); + } + document.getElementById("test-css").textContent = css; + + // Check that the test elements change color as expected when we flip the resistFingerprinting pref. + await checkColorForPref(true, testDivs, green); + await checkColorForPref(false, testDivs, blue); + await checkColorForPref(true, testDivs, green); +}; diff --git a/layout/style/test/bug453896_iframe.html b/layout/style/test/bug453896_iframe.html new file mode 100644 index 0000000000..e5414cc0df --- /dev/null +++ b/layout/style/test/bug453896_iframe.html @@ -0,0 +1,66 @@ + + + + Bug 453896 Test middle frame + + + + + + + + + + diff --git a/layout/style/test/bug517224.sjs b/layout/style/test/bug517224.sjs new file mode 100644 index 0000000000..bd1fe4f336 --- /dev/null +++ b/layout/style/test/bug517224.sjs @@ -0,0 +1,27 @@ +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + switch (request.queryString) { + case "reset": + response.setHeader("Content-Type", "application/ecmascript", false); + setState("imageloaded", ""); + break; + case "image": + setState("imageloaded", "imageloaded"); + response.setStatusLine("1.1", 302, "Found"); + // redirect to a solid blue image + response.setHeader( + "Location", + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12NgYPgPAAEDAQDZqt2zAAAAAElFTkSuQmCC" + ); + response.setHeader("Content-Type", "text/plain", false); + break; + case "result": + response.setHeader("Content-Type", "application/ecmascript", false); + var state = getState("imageloaded"); + response.write( + "is('" + state + "', '', 'image should not have been loaded')\n" + ); + response.write("SimpleTest.finish()"); + break; + } +} diff --git a/layout/style/test/bug732209-css.sjs b/layout/style/test/bug732209-css.sjs new file mode 100644 index 0000000000..a572cf3942 --- /dev/null +++ b/layout/style/test/bug732209-css.sjs @@ -0,0 +1,30 @@ +function handleRequest(request, response) { + // First item will be the ID; other items are optional + var query = request.queryString.split(/&/); + + response.setHeader("Content-Type", "text/css", false); + + if (query.indexOf("cors-anonymous") != -1) { + response.setHeader("Access-Control-Allow-Origin", "*", false); + } else if ( + query.indexOf("cors-credentials") != -1 && + request.hasHeader("Origin") + ) { + response.setHeader( + "Access-Control-Allow-Origin", + request.getHeader("Origin"), + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + } + + response.write( + "#" + + query[0] + + " { color: green !important }" + + "\n" + + "#" + + query[0] + + ".reverse { color: red !important }" + ); +} diff --git a/layout/style/test/ccd-quirks.html b/layout/style/test/ccd-quirks.html new file mode 100644 index 0000000000..570b5d5a1b --- /dev/null +++ b/layout/style/test/ccd-quirks.html @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

+

+
+

+

+

+
+

+

+

+
+

+

+

+
+
+

+

+

+
+

+

+

+
+

+

+

+
+

+

+

+ + diff --git a/layout/style/test/ccd-standards.html b/layout/style/test/ccd-standards.html new file mode 100644 index 0000000000..693402df4c --- /dev/null +++ b/layout/style/test/ccd-standards.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

+

+
+

+

+

+
+

+

+

+
+

+

+

+
+
+

+

+

+
+

+

+

+
+

+

+

+
+

+

+

+ + diff --git a/layout/style/test/ccd.sjs b/layout/style/test/ccd.sjs new file mode 100644 index 0000000000..22a4294d59 --- /dev/null +++ b/layout/style/test/ccd.sjs @@ -0,0 +1,71 @@ +const DEBUG_all_valid = false; +const DEBUG_all_stub = false; + +function handleRequest(request, response) { + // Decode the query string to know what test we're doing. + + // character 1: 'I' = text/css response, 'J' = text/html response + let responseCSS = request.queryString[0] == "I"; + + // character 2: redirection type - we only care about whether we're + // ultimately same-origin with the requesting document ('A', 'D') or + // not ('B', 'C'). + let sameOrigin = + request.queryString[1] == "A" || request.queryString[1] == "D"; + + // character 3: '1' = syntactically valid, '2' = invalid, '3' = http error + let malformed = request.queryString[2] == "2"; + let httpError = request.queryString[2] == "3"; + + // character 4: loaded with or @import (no action required) + + // character 5: loading document mode: 'q' = quirks, 's' = standards + let quirksMode = request.queryString[4] == "q"; + + // Our response contains a CSS rule that selects an element whose + // ID is the first four characters of the query string. + let selector = "#" + request.queryString.substring(0, 4); + + // "Malformed" responses wrap the CSS rule in the construct + // {} ... + // This mimics what the CSS parser might see if an actual HTML + // document were fed to it. Because CSS parsers recover from + // errors by skipping tokens until they find something + // recognizable, a style rule appearing where I wrote '...' above + // will be honored! + let leader = malformed ? "{}" : ""; + let trailer = malformed ? "" : ""; + + // Standards mode documents will ignore the style sheet if it is being + // served as text/html (regardless of its contents). Quirks mode + // documents will ignore the style sheet if it is being served as + // text/html _and_ it is not same-origin. Regardless, style sheets + // are ignored if they come as the body of an HTTP error response. + // + // Style sheets that should be ignored paint the element red; those + // that should be honored paint it lime. + let color = + (responseCSS || (quirksMode && sameOrigin)) && !httpError ? "lime" : "red"; + + // For debugging the test itself, we have the capacity to make every style + // sheet well-formed, or every style sheet do nothing. + if (DEBUG_all_valid) { + // In this mode, every test chip should turn blue. + response.setHeader("Content-Type", "text/css"); + response.write(selector + "{background-color:blue}\n"); + } else if (DEBUG_all_stub) { + // In this mode, every test chip for a case where the true test + // sheet would be honored, should turn red. + response.setHeader("Content-Type", "text/css"); + response.write(selector + "{}\n"); + } else { + // Normal operation. + if (httpError) { + response.setStatusLine(request.httpVersion, 500, "Internal Server Error"); + } + response.setHeader("Content-Type", responseCSS ? "text/css" : "text/html"); + response.write( + leader + selector + "{background-color:" + color + "}" + trailer + "\n" + ); + } +} diff --git a/layout/style/test/chrome/bug418986-2.js b/layout/style/test/chrome/bug418986-2.js new file mode 100644 index 0000000000..6d2af235c3 --- /dev/null +++ b/layout/style/test/chrome/bug418986-2.js @@ -0,0 +1,318 @@ +// # Bug 418986, part 2. + +const is_chrome_window = window.location.protocol === "chrome:"; + +const HTML_NS = "http://www.w3.org/1999/xhtml"; + +// Expected values. Format: [name, pref_off_value, pref_on_value] +// If pref_*_value is an array with two values, then we will match +// any value in between those two values. If a value is null, then +// we skip the media query. +var expected_values = [ + ["color", null, 8], + ["color-index", null, 0], + ["aspect-ratio", null, window.innerWidth + "/" + window.innerHeight], + [ + "device-aspect-ratio", + screen.width + "/" + screen.height, + window.innerWidth + "/" + window.innerHeight, + ], + ["device-height", screen.height + "px", window.innerHeight + "px"], + ["device-width", screen.width + "px", window.innerWidth + "px"], + ["grid", null, 0], + ["height", window.innerHeight + "px", window.innerHeight + "px"], + ["monochrome", null, 0], + // Square is defined as portrait: + [ + "orientation", + null, + window.innerWidth > window.innerHeight ? "landscape" : "portrait", + ], + ["resolution", null, "96dpi"], + [ + "resolution", + [ + 0.999 * window.devicePixelRatio + "dppx", + 1.001 * window.devicePixelRatio + "dppx", + ], + "1dppx", + ], + ["width", window.innerWidth + "px", window.innerWidth + "px"], + ["-moz-device-pixel-ratio", window.devicePixelRatio, 1], + [ + "-moz-device-orientation", + screen.width > screen.height ? "landscape" : "portrait", + window.innerWidth > window.innerHeight ? "landscape" : "portrait", + ], +]; + +// These media queries return value 0 or 1 when the pref is off. +// When the pref is on, they should not match. +var suppressed_toggles = [ + // Not available on most OSs. + "-moz-scrollbar-end-backward", + "-moz-scrollbar-end-forward", + "-moz-scrollbar-start-backward", + "-moz-scrollbar-start-forward", + "-moz-gtk-csd-available", + "-moz-gtk-csd-minimize-button", + "-moz-gtk-csd-maximize-button", + "-moz-gtk-csd-close-button", + "-moz-gtk-csd-reversed-placement", +]; + +var toggles_enabled_in_content = []; + +// Read the current OS. +var OS = SpecialPowers.Services.appinfo.OS; + +// __keyValMatches(key, val)__. +// Runs a media query and returns true if key matches to val. +var keyValMatches = (key, val) => + matchMedia("(" + key + ":" + val + ")").matches; + +// __testMatch(key, val)__. +// Attempts to run a media query match for the given key and value. +// If value is an array of two elements [min max], then matches any +// value in-between. +var testMatch = function (key, val) { + if (val === null) { + return; + } else if (Array.isArray(val)) { + ok( + keyValMatches("min-" + key, val[0]) && + keyValMatches("max-" + key, val[1]), + "Expected " + key + " between " + val[0] + " and " + val[1] + ); + } else { + ok(keyValMatches(key, val), "Expected " + key + ":" + val); + } +}; + +// __testToggles(resisting)__. +// Test whether we are able to match the "toggle" media queries. +var testToggles = function (resisting) { + suppressed_toggles.forEach(function (key) { + var exists = keyValMatches(key, 0) || keyValMatches(key, 1); + if (!toggles_enabled_in_content.includes(key) && !is_chrome_window) { + ok(!exists, key + " should not exist."); + } else { + ok(exists, key + " should exist."); + if (resisting) { + ok( + keyValMatches(key, 0) && !keyValMatches(key, 1), + "Should always match as false" + ); + } + } + }); +}; + +// __generateHtmlLines(resisting)__. +// Create a series of div elements that look like: +// `
resolution
`, +// where each line corresponds to a different media query. +var generateHtmlLines = function (resisting) { + let fragment = document.createDocumentFragment(); + expected_values.forEach(function ([key, offVal, onVal]) { + let val = resisting ? onVal : offVal; + if (val) { + let div = document.createElementNS(HTML_NS, "div"); + div.setAttribute("class", "spoof"); + div.setAttribute("id", key); + div.textContent = key; + fragment.appendChild(div); + } + }); + suppressed_toggles.forEach(function (key) { + let div = document.createElementNS(HTML_NS, "div"); + div.setAttribute("class", "suppress"); + div.setAttribute("id", key); + div.textContent = key; + fragment.appendChild(div); + }); + return fragment; +}; + +// __cssLine__. +// Creates a line of css that looks something like +// `@media (resolution: 1ppx) { .spoof#resolution { background-color: green; } }`. +var cssLine = function (query, clazz, id, color) { + return ( + "@media " + + query + + " { ." + + clazz + + "#" + + id + + " { background-color: " + + color + + "; } }\n" + ); +}; + +// __constructQuery(key, val)__. +// Creates a CSS media query from key and val. If key is an array of +// two elements, constructs a range query (using min- and max-). +var constructQuery = function (key, val) { + return Array.isArray(val) + ? "(min-" + key + ": " + val[0] + ") and (max-" + key + ": " + val[1] + ")" + : "(" + key + ": " + val + ")"; +}; + +// __mediaQueryCSSLine(key, val, color)__. +// Creates a line containing a CSS media query and a CSS expression. +var mediaQueryCSSLine = function (key, val, color) { + if (val === null) { + return ""; + } + return cssLine(constructQuery(key, val), "spoof", key, color); +}; + +// __suppressedMediaQueryCSSLine(key, color)__. +// Creates a CSS line that matches the existence of a +// media query that is supposed to be suppressed. +var suppressedMediaQueryCSSLine = function (key, color, suppressed) { + let query = "(" + key + ": 0), (" + key + ": 1)"; + return cssLine(query, "suppress", key, color); +}; + +// __generateCSSLines(resisting)__. +// Creates a series of lines of CSS, each of which corresponds to +// a different media query. If the query produces a match to the +// expected value, then the element will be colored green. +var generateCSSLines = function (resisting) { + let lines = ".spoof { background-color: red;}\n"; + expected_values.forEach(function ([key, offVal, onVal]) { + lines += mediaQueryCSSLine(key, resisting ? onVal : offVal, "green"); + }); + lines += + ".suppress { background-color: " + (resisting ? "green" : "red") + ";}\n"; + suppressed_toggles.forEach(function (key) { + if ( + !toggles_enabled_in_content.includes(key) && + !resisting && + !is_chrome_window + ) { + lines += "#" + key + " { background-color: green; }\n"; + } else { + lines += suppressedMediaQueryCSSLine(key, "green"); + } + }); + return lines; +}; + +// __green__. +// Returns the computed color style corresponding to green. +var green = "rgb(0, 128, 0)"; + +// __testCSS(resisting)__. +// Creates a series of divs and CSS using media queries to set their +// background color. If all media queries match as expected, then +// all divs should have a green background color. +var testCSS = function (resisting) { + document.getElementById("display").appendChild(generateHtmlLines(resisting)); + document.getElementById("test-css").textContent = generateCSSLines(resisting); + let cssTestDivs = document.querySelectorAll(".spoof,.suppress"); + for (let div of cssTestDivs) { + let color = window.getComputedStyle(div).backgroundColor; + ok(color === green, "CSS for '" + div.id + "'"); + } +}; + +// __testOSXFontSmoothing(resisting)__. +// When fingerprinting resistance is enabled, the `getComputedStyle` +// should always return `undefined` for `MozOSXFontSmoothing`. +var testOSXFontSmoothing = function (resisting) { + let div = document.createElementNS(HTML_NS, "div"); + div.style.MozOsxFontSmoothing = "unset"; + document.documentElement.appendChild(div); + let readBack = window.getComputedStyle(div).MozOsxFontSmoothing; + div.remove(); + let smoothingPref = SpecialPowers.getBoolPref( + "layout.css.osx-font-smoothing.enabled", + false + ); + is( + readBack, + resisting ? "" : smoothingPref ? "auto" : "", + "-moz-osx-font-smoothing" + ); +}; + +// __sleep(timeoutMs)__. +// Returns a promise that resolves after the given timeout. +var sleep = function (timeoutMs) { + return new Promise(function (resolve, reject) { + window.setTimeout(resolve); + }); +}; + +// __testMediaQueriesInPictureElements(resisting)__. +// Test to see if media queries are properly spoofed in picture elements +// when we are resisting fingerprinting. +var testMediaQueriesInPictureElements = async function (resisting) { + const MATCH = "/tests/layout/style/test/chrome/match.png"; + let container = document.getElementById("pictures"); + let testImages = []; + for (let [key, offVal, onVal] of expected_values) { + let expected = resisting ? onVal : offVal; + if (expected) { + let picture = document.createElementNS(HTML_NS, "picture"); + let query = constructQuery(key, expected); + ok(matchMedia(query).matches, `${query} should match`); + + let source = document.createElementNS(HTML_NS, "source"); + source.setAttribute("srcset", MATCH); + source.setAttribute("media", query); + + let image = document.createElementNS(HTML_NS, "img"); + image.setAttribute("title", key + ":" + expected); + image.setAttribute("class", "testImage"); + image.setAttribute("src", "/tests/layout/style/test/chrome/mismatch.png"); + image.setAttribute("alt", key); + + testImages.push(image); + + picture.appendChild(source); + picture.appendChild(image); + container.appendChild(picture); + } + } + const matchURI = new URL(MATCH, document.baseURI).href; + await sleep(0); + for (let testImage of testImages) { + is( + testImage.currentSrc, + matchURI, + "Media query '" + testImage.title + "' in picture should match." + ); + } +}; + +// __pushPref(key, value)__. +// Set a pref value asynchronously, returning a promise that resolves +// when it succeeds. +var pushPref = function (key, value) { + return new Promise(function (resolve, reject) { + SpecialPowers.pushPrefEnv({ set: [[key, value]] }, resolve); + }); +}; + +// __test(isContent)__. +// Run all tests. +var test = async function (isContent) { + for (prefValue of [false, true]) { + await pushPref("privacy.resistFingerprinting", prefValue); + let resisting = prefValue && isContent; + expected_values.forEach(function ([key, offVal, onVal]) { + testMatch(key, resisting ? onVal : offVal); + }); + testToggles(resisting); + testCSS(resisting); + if (OS === "Darwin") { + testOSXFontSmoothing(resisting); + } + await testMediaQueriesInPictureElements(resisting); + } +}; diff --git a/layout/style/test/chrome/bug535806-css.css b/layout/style/test/chrome/bug535806-css.css new file mode 100644 index 0000000000..bda339f776 --- /dev/null +++ b/layout/style/test/chrome/bug535806-css.css @@ -0,0 +1 @@ +fooBar[fooBar] { color: green; } diff --git a/layout/style/test/chrome/bug535806-html.html b/layout/style/test/chrome/bug535806-html.html new file mode 100644 index 0000000000..e4395da3f3 --- /dev/null +++ b/layout/style/test/chrome/bug535806-html.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/layout/style/test/chrome/bug535806-xul.xhtml b/layout/style/test/chrome/bug535806-xul.xhtml new file mode 100644 index 0000000000..3d9a82b91e --- /dev/null +++ b/layout/style/test/chrome/bug535806-xul.xhtml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/layout/style/test/chrome/chrome-only-media-queries.js b/layout/style/test/chrome/chrome-only-media-queries.js new file mode 100644 index 0000000000..aaf313a526 --- /dev/null +++ b/layout/style/test/chrome/chrome-only-media-queries.js @@ -0,0 +1,34 @@ +const CHROME_ONLY_TOGGLES = [ + "-moz-is-glyph", + "-moz-print-preview", + "-moz-scrollbar-start-backward", + "-moz-scrollbar-start-forward", + "-moz-scrollbar-end-backward", + "-moz-scrollbar-end-forward", + "-moz-overlay-scrollbars", + "-moz-mac-big-sur-theme", + "-moz-menubar-drag", + "-moz-windows-accent-color-in-titlebar", + "-moz-swipe-animation-enabled", + "-moz-gtk-csd-available", + "-moz-gtk-csd-minimize-button", + "-moz-gtk-csd-maximize-button", + "-moz-gtk-csd-close-button", + "-moz-gtk-csd-reversed-placement", + "-moz-panel-animations", +]; + +// Non-parseable queries can be tested directly in +// `test_chrome_only_media_queries.html`. +const CHROME_ONLY_QUERIES = [ + "(-moz-platform: linux)", + "(-moz-platform: windows)", + "(-moz-platform: macos)", + "(-moz-platform: android)", + "(-moz-content-prefers-color-scheme: dark)", + "(-moz-content-prefers-color-scheme: light)", + "(-moz-gtk-theme-family: unknown)", + "(-moz-gtk-theme-family: adwaita)", + "(-moz-gtk-theme-family: breeze)", + "(-moz-gtk-theme-family: yaru)", +]; diff --git a/layout/style/test/chrome/chrome.toml b/layout/style/test/chrome/chrome.toml new file mode 100644 index 0000000000..8c4c6045d8 --- /dev/null +++ b/layout/style/test/chrome/chrome.toml @@ -0,0 +1,51 @@ +[DEFAULT] +skip-if = ["os == 'android'"] +support-files = [ + "bug418986-2.js", + "bug535806-css.css", + "bug535806-html.html", + "bug535806-xul.xhtml", + "hover_helper.html", + "match.png", + "mismatch.png", +] + +["test_bug418986-2.xhtml"] + +["test_bug511909.html"] + +["test_bug535806.xhtml"] + +["test_bug1157097.html"] + +["test_bug1346623.html"] + +["test_bug1371453.html"] + +["test_chrome_only_media_queries.html"] +support-files = ["chrome-only-media-queries.js"] + +["test_constructable_stylesheets_chrome_only_rules.html"] + +["test_display_mode.html"] +support-files = ["display_mode.html"] +tags = "fullscreen" + +["test_display_mode_reflow.html"] +support-files = ["display_mode_reflow.html"] +tags = "fullscreen" + +["test_hover.html"] +skip-if = ["true"] # bug 1346353 + +["test_moz_document_rules.html"] + +["test_moz_document_serialization.html"] + +["test_scrollbar_inline_size.html"] + +["test_stylesheet_clone_import_rule.html"] +support-files = [ + "import_useless1.css", + "import_useless2.css", +] diff --git a/layout/style/test/chrome/display_mode.html b/layout/style/test/chrome/display_mode.html new file mode 100644 index 0000000000..a4a0afb57e --- /dev/null +++ b/layout/style/test/chrome/display_mode.html @@ -0,0 +1,122 @@ + + + + + + Test for Display Mode + + + + + + +Mozilla Bug 1104916 + +

+ +
+
+ + diff --git a/layout/style/test/chrome/display_mode_reflow.html b/layout/style/test/chrome/display_mode_reflow.html new file mode 100644 index 0000000000..7b2a118cd6 --- /dev/null +++ b/layout/style/test/chrome/display_mode_reflow.html @@ -0,0 +1,84 @@ + + + + + + Test for Display Mode + + + + + + +Mozilla Bug 1256084 + +

+ +
+
+ + diff --git a/layout/style/test/chrome/display_mode_reflow_iframe.html b/layout/style/test/chrome/display_mode_reflow_iframe.html new file mode 100644 index 0000000000..c05880ce7f --- /dev/null +++ b/layout/style/test/chrome/display_mode_reflow_iframe.html @@ -0,0 +1,23 @@ + + + + Display Mode Reflow inner frame + + + + + +
+
+ + diff --git a/layout/style/test/chrome/hover_empty.html b/layout/style/test/chrome/hover_empty.html new file mode 100644 index 0000000000..7879e1ce9f --- /dev/null +++ b/layout/style/test/chrome/hover_empty.html @@ -0,0 +1,4 @@ + + + + diff --git a/layout/style/test/chrome/hover_helper.html b/layout/style/test/chrome/hover_helper.html new file mode 100644 index 0000000000..b1ae14e8cc --- /dev/null +++ b/layout/style/test/chrome/hover_helper.html @@ -0,0 +1,270 @@ + + + + Test for :hover + + + + + +Mozilla Bug +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ + diff --git a/layout/style/test/chrome/import_useless1.css b/layout/style/test/chrome/import_useless1.css new file mode 100644 index 0000000000..37e1a3d1d9 --- /dev/null +++ b/layout/style/test/chrome/import_useless1.css @@ -0,0 +1,3 @@ +.unlikely_to_match_anything { + color: black; +} diff --git a/layout/style/test/chrome/import_useless2.css b/layout/style/test/chrome/import_useless2.css new file mode 100644 index 0000000000..37e1a3d1d9 --- /dev/null +++ b/layout/style/test/chrome/import_useless2.css @@ -0,0 +1,3 @@ +.unlikely_to_match_anything { + color: black; +} diff --git a/layout/style/test/chrome/match.png b/layout/style/test/chrome/match.png new file mode 100644 index 0000000000..d3f299bf58 Binary files /dev/null and b/layout/style/test/chrome/match.png differ diff --git a/layout/style/test/chrome/mismatch.png b/layout/style/test/chrome/mismatch.png new file mode 100644 index 0000000000..8f9da3f00f Binary files /dev/null and b/layout/style/test/chrome/mismatch.png differ diff --git a/layout/style/test/chrome/moz_document_helper.html b/layout/style/test/chrome/moz_document_helper.html new file mode 100644 index 0000000000..8b331b19e0 --- /dev/null +++ b/layout/style/test/chrome/moz_document_helper.html @@ -0,0 +1,2 @@ + +
diff --git a/layout/style/test/chrome/test_bug1157097.html b/layout/style/test/chrome/test_bug1157097.html new file mode 100644 index 0000000000..febf4952fb --- /dev/null +++ b/layout/style/test/chrome/test_bug1157097.html @@ -0,0 +1,27 @@ + +Test for bug 1157097 + + + + +

+ diff --git a/layout/style/test/chrome/test_bug1346623.html b/layout/style/test/chrome/test_bug1346623.html new file mode 100644 index 0000000000..027f839ace --- /dev/null +++ b/layout/style/test/chrome/test_bug1346623.html @@ -0,0 +1,60 @@ + + + + Test for bug 1346623 + + + + + +Mozilla Bug 1346623 +
+ +
+
+
+
+ + diff --git a/layout/style/test/chrome/test_bug1371453.html b/layout/style/test/chrome/test_bug1371453.html new file mode 100644 index 0000000000..6b3b4cb6eb --- /dev/null +++ b/layout/style/test/chrome/test_bug1371453.html @@ -0,0 +1,33 @@ + + + +Test for Bug 1371453 + + + + + + + diff --git a/layout/style/test/chrome/test_bug418986-2.xhtml b/layout/style/test/chrome/test_bug418986-2.xhtml new file mode 100644 index 0000000000..152cac004e --- /dev/null +++ b/layout/style/test/chrome/test_bug418986-2.xhtml @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/layout/style/test/chrome/test_bug511909.html b/layout/style/test/chrome/test_bug511909.html new file mode 100644 index 0000000000..fa28bbe854 --- /dev/null +++ b/layout/style/test/chrome/test_bug511909.html @@ -0,0 +1,194 @@ + + +@media and @-moz-document testcases + + + + + + + + + + + + + + + + + + + + + + + + Mozilla Bug 511909 +

+ + + +
+
default style
+
+This line should be pink
+ +This line should be green
+ +This line should be blue
+ +
@-moz-document {...}
+
+This line should be pink
+
@media screen {...}
+
+This line should be green
+
@-moz-document {
+   @media screen {...}
+}
+
+This line should be blue
+
@media print {
+  @-moz-document regexp("not_this_url"),}
+    #mx {
+        color: pink;
+    }
+  }
+}
+
+This line should be pink
+
@-moz-document regexp("not_this_url"){
+  @media print ,}
+    #mxx {
+      color: blue;
+    }
+  }
+}
+
+This line should be blue
+
@media screen {
+  @-moz-documen {...}
+}
+
+This line should be green
+
@media screen {
+  @-moz-document {
+    @media screen {...}
+  }
+}
+
+This line should be blue
+ + + diff --git a/layout/style/test/chrome/test_bug535806.xhtml b/layout/style/test/chrome/test_bug535806.xhtml new file mode 100644 index 0000000000..7f4ec286bc --- /dev/null +++ b/layout/style/test/chrome/test_bug535806.xhtml @@ -0,0 +1,43 @@ + + + + + + + diff --git a/layout/style/test/chrome/test_chrome_only_media_queries.html b/layout/style/test/chrome/test_chrome_only_media_queries.html new file mode 100644 index 0000000000..1a2fb098c0 --- /dev/null +++ b/layout/style/test/chrome/test_chrome_only_media_queries.html @@ -0,0 +1,84 @@ + +Test for parsing of non-content-exposed media-queries. + + + + diff --git a/layout/style/test/chrome/test_constructable_stylesheets_chrome_only_rules.html b/layout/style/test/chrome/test_constructable_stylesheets_chrome_only_rules.html new file mode 100644 index 0000000000..4d9647ba27 --- /dev/null +++ b/layout/style/test/chrome/test_constructable_stylesheets_chrome_only_rules.html @@ -0,0 +1,11 @@ + + +Test for chrome-only rules in constructable stylesheets + + diff --git a/layout/style/test/chrome/test_display_mode.html b/layout/style/test/chrome/test_display_mode.html new file mode 100644 index 0000000000..69e72d5ab8 --- /dev/null +++ b/layout/style/test/chrome/test_display_mode.html @@ -0,0 +1,39 @@ + + + + + + Test for Display Mode + + + + + + + +Mozilla Bug 1104916 + +
+
+ + diff --git a/layout/style/test/chrome/test_display_mode_reflow.html b/layout/style/test/chrome/test_display_mode_reflow.html new file mode 100644 index 0000000000..01022207f3 --- /dev/null +++ b/layout/style/test/chrome/test_display_mode_reflow.html @@ -0,0 +1,41 @@ + + + + + + Test for Display Mode + + + + + + + +Mozilla Bug 1256084 +

+ +
+
+ + diff --git a/layout/style/test/chrome/test_hover.html b/layout/style/test/chrome/test_hover.html new file mode 100644 index 0000000000..019f537e8c --- /dev/null +++ b/layout/style/test/chrome/test_hover.html @@ -0,0 +1,29 @@ + + + + Test for :hover + + + + + +Mozilla Bug +
+ +
+
+
+
+ + diff --git a/layout/style/test/chrome/test_moz_document_rules.html b/layout/style/test/chrome/test_moz_document_rules.html new file mode 100644 index 0000000000..c28fc964ed --- /dev/null +++ b/layout/style/test/chrome/test_moz_document_rules.html @@ -0,0 +1,97 @@ + + + + Test for @-moz-document rules + + + + + +Mozilla Bug 398962 + +
+
+
+ + diff --git a/layout/style/test/chrome/test_moz_document_serialization.html b/layout/style/test/chrome/test_moz_document_serialization.html new file mode 100644 index 0000000000..0707880507 --- /dev/null +++ b/layout/style/test/chrome/test_moz_document_serialization.html @@ -0,0 +1,58 @@ + + + + + Test for Bug + + + + + +
+
+
+ + diff --git a/layout/style/test/chrome/test_scrollbar_inline_size.html b/layout/style/test/chrome/test_scrollbar_inline_size.html new file mode 100644 index 0000000000..31161a9caf --- /dev/null +++ b/layout/style/test/chrome/test_scrollbar_inline_size.html @@ -0,0 +1,36 @@ + + +Test for env(scrollbar-inline-size) + + + + +
+
+ diff --git a/layout/style/test/chrome/test_stylesheet_clone_import_rule.html b/layout/style/test/chrome/test_stylesheet_clone_import_rule.html new file mode 100644 index 0000000000..37c3b9ccaa --- /dev/null +++ b/layout/style/test/chrome/test_stylesheet_clone_import_rule.html @@ -0,0 +1,86 @@ + + + + + + + + + +
This text will change colors several times.
+ + + diff --git a/layout/style/test/css_properties_like_longhand.js b/layout/style/test/css_properties_like_longhand.js new file mode 100644 index 0000000000..606de3ad68 --- /dev/null +++ b/layout/style/test/css_properties_like_longhand.js @@ -0,0 +1 @@ +var gShorthandPropertiesLikeLonghand = [{ name: "overflow", prop: "overflow" }]; diff --git a/layout/style/test/descriptor_database.js b/layout/style/test/descriptor_database.js new file mode 100644 index 0000000000..f5abc8576d --- /dev/null +++ b/layout/style/test/descriptor_database.js @@ -0,0 +1,142 @@ +/* -*- tab-width: 4; indent-tabs-mode: nil; js-indent-level: 4 -*- */ +/* vim: set shiftwidth=4 tabstop=4 autoindent cindent noexpandtab: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Each property has the following fields: +// domProp: The name of the relevant member of nsIDOM[NS]CSS2Properties +// values: Strings that are values for the descriptor and should be accepted. +// invalid_values: Things that are not values for the descriptor and +// should be rejected. + +var gCSSFontFaceDescriptors = { + "font-family": { + domProp: "fontFamily", + values: [ + '"serif"', + '"cursive"', + "seriff", + "Times New Roman", + "TimesRoman", + '"Times New Roman"', + ], + /* not clear that the generics are really invalid */ + invalid_values: [ + "sans-serif", + "Times New Roman, serif", + "'Times New Roman', serif", + "cursive", + "fantasy", + "Times )", + "Times !", + "Times ! foo", + "Times ! important", + ], + }, + "font-stretch": { + domProp: "fontStretch", + values: [ + "normal", + "ultra-condensed", + "extra-condensed", + "condensed", + "semi-condensed", + "semi-expanded", + "expanded", + "extra-expanded", + "ultra-expanded", + ], + invalid_values: ["wider", "narrower", "normal ! important", "normal )"], + }, + "font-style": { + domProp: "fontStyle", + values: ["normal", "italic", "oblique"], + invalid_values: [], + }, + "font-weight": { + domProp: "fontWeight", + values: [ + "normal", + "400", + "bold", + "100", + "200", + "300", + "500", + "600", + "700", + "800", + "900", + "107", + "399", + "401", + "699", + "710", + "calc(1001)", + "calc(100 + 1)", + "calc(1)", + "100.6", + "99", + "700 900", + "300.4 500.4", + "calc(200.4) calc(400.4)", + ], + invalid_values: ["bolder", "lighter", "1001", "0", "0 100", "100 1001"], + }, + src: { + domProp: null, + values: [ + "url(404.ttf)", + 'url("404.eot")', + "url('404.otf')", + 'url(404.ttf) format("truetype")', + "local(Times New Roman)", + "local('Times New Roman')", + 'local("Times New Roman")', + 'local("serif")', + "url(404.ttf) format(truetype)", + 'url(404.ttf) format("truetype", "opentype"), url(\'404.eot\')', + 'url(404.ttf) format("truetype", "unknown"), local(Times New Roman), url(\'404.eot\')', + ], + invalid_values: [ + 'url(404.ttf) format("truetype" "opentype")', + 'url(404.ttf) format("truetype",)', + 'local("Times New" Roman)', + "local(serif)" /* is this valid? */, + "url(404.ttf) )", + "url(404.ttf) ) foo", + "url(404.ttf) ! important", + "url(404.ttf) ! hello", + 'url(404.ttf) format("truetype", "opentype")', + ], + }, + "unicode-range": { + domProp: null, + values: [ + "U+0-10FFFF", + "U+3-7B3", + "U+3??", + "U+6A", + "U+3????", + "U+???", + "U+302-302", + "U+0-7,U+A-C", + "U+3??, U+500-513 ,U+612 , U+4????", + "U+1FFF,U+200-27F", + ], + invalid_values: [ + "U+1????-2????", + "U+0-7,A-C", + "U+100-17F,U+200-17F", + "U+100-17F,200-27F", + "U+6A!important", + "U+6A)", + ], + }, + "font-display": { + domProp: null, + values: ["auto", "block", "swap", "fallback", "optional"], + invalid_values: ["normal", "initial"], + }, +}; diff --git a/layout/style/test/empty.html b/layout/style/test/empty.html new file mode 100644 index 0000000000..734c5a1c09 --- /dev/null +++ b/layout/style/test/empty.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layout/style/test/file_animations_async_tests.html b/layout/style/test/file_animations_async_tests.html new file mode 100644 index 0000000000..9d4dfa1fed --- /dev/null +++ b/layout/style/test/file_animations_async_tests.html @@ -0,0 +1,77 @@ + + + + + Test for Bug 1086937 + + + + + + +Mozilla Bug 1086937 +
+
+
+ + diff --git a/layout/style/test/file_animations_omta_scroll.html b/layout/style/test/file_animations_omta_scroll.html new file mode 100644 index 0000000000..625b4b6c19 --- /dev/null +++ b/layout/style/test/file_animations_omta_scroll.html @@ -0,0 +1,392 @@ + + + + + + Test for css-animations running on the compositor thread with scroll-timeline + + + + + + + +
+

+
+
+
diff --git a/layout/style/test/file_animations_omta_scroll_rtl.html b/layout/style/test/file_animations_omta_scroll_rtl.html
new file mode 100644
index 0000000000..771cf6c38f
--- /dev/null
+++ b/layout/style/test/file_animations_omta_scroll_rtl.html
@@ -0,0 +1,112 @@
+
+
+
+  
+  
+  Test for css-animations running on the compositor thread with
+    scroll-timeline and right to left writing mode
+  
+  
+  
+  
+  
+
+
+  
+

+
+
+
diff --git a/layout/style/test/file_animations_with_disabled_properties.html b/layout/style/test/file_animations_with_disabled_properties.html
new file mode 100644
index 0000000000..5b206df693
--- /dev/null
+++ b/layout/style/test/file_animations_with_disabled_properties.html
@@ -0,0 +1,50 @@
+
+
+  
+  
+  
+
+
+
+ + diff --git a/layout/style/test/file_bug1055933_circle-xxl.png b/layout/style/test/file_bug1055933_circle-xxl.png new file mode 100644 index 0000000000..3223a56900 Binary files /dev/null and b/layout/style/test/file_bug1055933_circle-xxl.png differ diff --git a/layout/style/test/file_bug1089417_iframe.html b/layout/style/test/file_bug1089417_iframe.html new file mode 100644 index 0000000000..95208dbc56 --- /dev/null +++ b/layout/style/test/file_bug1089417_iframe.html @@ -0,0 +1,17 @@ + + + + Bug 1089417 + + + + + + + + diff --git a/layout/style/test/file_bug1375944.html b/layout/style/test/file_bug1375944.html new file mode 100644 index 0000000000..809ea4205b --- /dev/null +++ b/layout/style/test/file_bug1375944.html @@ -0,0 +1,13 @@ + + +
X
diff --git a/layout/style/test/file_bug1381233.html b/layout/style/test/file_bug1381233.html new file mode 100644 index 0000000000..b82d309128 --- /dev/null +++ b/layout/style/test/file_bug1381233.html @@ -0,0 +1,4 @@ + +
+ +
diff --git a/layout/style/test/file_bug1443344.css b/layout/style/test/file_bug1443344.css new file mode 100644 index 0000000000..74e81d1823 --- /dev/null +++ b/layout/style/test/file_bug1443344.css @@ -0,0 +1 @@ +#importTarget { color: red ! important } diff --git a/layout/style/test/file_bug645998-1.css b/layout/style/test/file_bug645998-1.css new file mode 100644 index 0000000000..328e6ed797 --- /dev/null +++ b/layout/style/test/file_bug645998-1.css @@ -0,0 +1 @@ +@import url("file_bug645998-2.css"); diff --git a/layout/style/test/file_bug645998-2.css b/layout/style/test/file_bug645998-2.css new file mode 100644 index 0000000000..2d5edbe217 --- /dev/null +++ b/layout/style/test/file_bug645998-2.css @@ -0,0 +1 @@ +@import url("file_bug645998-1.css"); diff --git a/layout/style/test/file_bug829816.css b/layout/style/test/file_bug829816.css new file mode 100644 index 0000000000..8f12ba6f56 Binary files /dev/null and b/layout/style/test/file_bug829816.css differ diff --git a/layout/style/test/file_computed_style_bfcache_display_none.html b/layout/style/test/file_computed_style_bfcache_display_none.html new file mode 100644 index 0000000000..d366aa68ee --- /dev/null +++ b/layout/style/test/file_computed_style_bfcache_display_none.html @@ -0,0 +1,6 @@ + + diff --git a/layout/style/test/file_computed_style_bfcache_display_none2.html b/layout/style/test/file_computed_style_bfcache_display_none2.html new file mode 100644 index 0000000000..c337ca7214 --- /dev/null +++ b/layout/style/test/file_computed_style_bfcache_display_none2.html @@ -0,0 +1,6 @@ +
Page 2
+; diff --git a/layout/style/test/file_font_loading_api_vframe.html b/layout/style/test/file_font_loading_api_vframe.html new file mode 100644 index 0000000000..51dbbbee91 --- /dev/null +++ b/layout/style/test/file_font_loading_api_vframe.html @@ -0,0 +1,2 @@ + + diff --git a/layout/style/test/file_shared_sheet_caching.css b/layout/style/test/file_shared_sheet_caching.css new file mode 100644 index 0000000000..2ceb1b7e0b --- /dev/null +++ b/layout/style/test/file_shared_sheet_caching.css @@ -0,0 +1,3 @@ +:root { + background-color: lime; +} diff --git a/layout/style/test/file_shared_sheet_caching.html b/layout/style/test/file_shared_sheet_caching.html new file mode 100644 index 0000000000..1eb9a8ce31 --- /dev/null +++ b/layout/style/test/file_shared_sheet_caching.html @@ -0,0 +1,12 @@ + + + + diff --git a/layout/style/test/file_specified_value_serialization_individual_transforms.html b/layout/style/test/file_specified_value_serialization_individual_transforms.html new file mode 100644 index 0000000000..9dcf85f955 --- /dev/null +++ b/layout/style/test/file_specified_value_serialization_individual_transforms.html @@ -0,0 +1,65 @@ + + +Test for Bug 1207734 (individual transforms) + + diff --git a/layout/style/test/flexbox_layout_testcases.js b/layout/style/test/flexbox_layout_testcases.js new file mode 100644 index 0000000000..c8990877ab --- /dev/null +++ b/layout/style/test/flexbox_layout_testcases.js @@ -0,0 +1,1317 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * For the purposes of this test, flex items are specified as a hash with a + * hash-entry for each CSS property that is to be set. In these per-property + * entries, the key is the property-name, and the value can be either of the + * following: + * (a) the property's specified value (which indicates that we don't need to + * bother checking the computed value of this particular property) + * ...OR... + * (b) an array with 2-3 entries... + * [specifiedValue, expectedComputedValue (, epsilon) ] + * ...which indicates that the property's computed value should be + * checked. The array's first entry (for the specified value) may be + * null; this means that no value should be explicitly specified for this + * property. The second entry is the property's expected computed + * value. The third (optional) entry is an epsilon value, which allows for + * fuzzy equality when testing the computed value. + * + * To allow these testcases to be re-used in both horizontal and vertical + * flex containers, we specify "width"/"min-width"/etc. using the aliases + * "_main-size", "_min-main-size", etc. The test code can map these + * placeholder names to their corresponding property-names using the maps + * defined below -- gRowPropertyMapping, gColumnPropertyMapping, etc. + * + * If the testcase needs to customize its flex container at all (e.g. by + * specifying a custom container-size), it can do so by including a hash + * called "container_properties", with propertyName:propertyValue mappings. + * (This hash can use aliased property-names like "_main-size" as well.) + */ + +// The standard main-size we'll use for our flex container when setting up +// the testcases defined below: +var gDefaultFlexContainerSize = "200px"; + +// Left-to-right versions of placeholder property-names used in +// testcases below: +var gRowPropertyMapping = { + "_main-size": "width", + "_min-main-size": "min-width", + "_max-main-size": "max-width", + "_border-main-start-width": "border-left-width", + "_border-main-end-width": "border-right-width", + "_padding-main-start": "padding-left", + "_padding-main-end": "padding-right", + "_margin-main-start": "margin-left", + "_margin-main-end": "margin-right", +}; + +// Right-to-left versions of placeholder property-names used in +// testcases below: +var gRowReversePropertyMapping = { + "_main-size": "width", + "_min-main-size": "min-width", + "_max-main-size": "max-width", + "_border-main-start-width": "border-right-width", + "_border-main-end-width": "border-left-width", + "_padding-main-start": "padding-right", + "_padding-main-end": "padding-left", + "_margin-main-start": "margin-right", + "_margin-main-end": "margin-left", +}; + +// Top-to-bottom versions of placeholder property-names used in +// testcases below: +var gColumnPropertyMapping = { + "_main-size": "height", + "_min-main-size": "min-height", + "_max-main-size": "max-height", + "_border-main-start-width": "border-top-width", + "_border-main-end-width": "border-bottom-width", + "_padding-main-start": "padding-top", + "_padding-main-end": "padding-bottom", + "_margin-main-start": "margin-top", + "_margin-main-end": "margin-bottom", +}; + +// Bottom-to-top versions of placeholder property-names used in +// testcases below: +var gColumnReversePropertyMapping = { + "_main-size": "height", + "_min-main-size": "min-height", + "_max-main-size": "max-height", + "_border-main-start-width": "border-bottom-width", + "_border-main-end-width": "border-top-width", + "_padding-main-start": "padding-bottom", + "_padding-main-end": "padding-top", + "_margin-main-start": "margin-bottom", + "_margin-main-end": "margin-top", +}; + +// The list of actual testcase definitions: +var gFlexboxTestcases = [ + // No flex properties specified --> should just use 'width' for sizing + { + items: [ + { "_main-size": ["40px", "40px"] }, + { "_main-size": ["65px", "65px"] }, + ], + }, + // flex-basis is specified: + { + items: [ + { "flex-basis": "50px", "_main-size": [null, "50px"] }, + { + "flex-basis": "20px", + "_main-size": [null, "20px"], + }, + ], + }, + // flex-basis is *large* -- sum of flex-basis values is > flex container size: + // (w/ 0 flex-shrink so we don't shrink): + { + items: [ + { + flex: "0 0 150px", + "_main-size": [null, "150px"], + }, + { + flex: "0 0 90px", + "_main-size": [null, "90px"], + }, + ], + }, + // flex-basis is *large* -- each flex-basis value is > flex container size: + // (w/ 0 flex-shrink so we don't shrink): + { + items: [ + { + flex: "0 0 250px", + "_main-size": [null, "250px"], + }, + { + flex: "0 0 400px", + "_main-size": [null, "400px"], + }, + ], + }, + // flex-basis has percentage value: + { + items: [ + { + "flex-basis": "30%", + "_main-size": [null, "60px"], + }, + { + "flex-basis": "45%", + "_main-size": [null, "90px"], + }, + ], + }, + // flex-basis has calc(percentage) value: + { + items: [ + { + "flex-basis": "calc(20%)", + "_main-size": [null, "40px"], + }, + { + "flex-basis": "calc(80%)", + "_main-size": [null, "160px"], + }, + ], + }, + // flex-basis has calc(percentage +/- length) value: + { + items: [ + { + "flex-basis": "calc(10px + 20%)", + "_main-size": [null, "50px"], + }, + { + "flex-basis": "calc(60% - 1px)", + "_main-size": [null, "119px"], + }, + ], + }, + // flex-grow is specified: + { + items: [ + { + flex: "1", + "_main-size": [null, "60px"], + }, + { + flex: "2", + "_main-size": [null, "120px"], + }, + { + flex: "0 20px", + "_main-size": [null, "20px"], + }, + ], + }, + // Same ratio as prev. testcase; making sure we handle float inaccuracy + { + items: [ + { + flex: "100000", + "_main-size": [null, "60px"], + }, + { + flex: "200000", + "_main-size": [null, "120px"], + }, + { + flex: "0.000001 20px", + "_main-size": [null, "20px"], + }, + ], + }, + // Same ratio as prev. testcase, but with items cycled and w/ + // "flex: none" & explicit size instead of "flex: 0 20px" + { + items: [ + { + flex: "none", + "_main-size": ["20px", "20px"], + }, + { + flex: "1", + "_main-size": [null, "60px"], + }, + { + flex: "2", + "_main-size": [null, "120px"], + }, + ], + }, + + // ...and now with flex-grow:[huge] to be sure we handle infinite float values + // gracefully. + { + items: [ + { + flex: "9999999999999999999999999999999999999999999999999999999", + "_main-size": [null, "200px"], + }, + ], + }, + { + items: [ + { + flex: "9999999999999999999999999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "9999999999999999999999999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "9999999999999999999999999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "9999999999999999999999999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + ], + }, + { + items: [ + { + flex: "99999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "99999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "99999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + { + flex: "99999999999999999999999999999999999", + "_main-size": [null, "50px"], + }, + ], + }, + + // And now, some testcases to check that we handle float accumulation error + // gracefully. + + // First, a testcase with just a custom-sized huge container, to be sure we'll + // be able to handle content on that scale, in the subsequent more-complex + // testcases: + { + container_properties: { + "_main-size": "9000000px", + }, + items: [ + { + flex: "1", + "_main-size": [null, "9000000px"], + }, + ], + }, + // ...and now with two flex items dividing up that container's huge size: + { + container_properties: { + "_main-size": "9000000px", + }, + items: [ + { + flex: "2", + "_main-size": [null, "6000000px"], + }, + { + flex: "1", + "_main-size": [null, "3000000px"], + }, + ], + }, + + // OK, now to actually test accumulation error. Below, we have six flex items + // splitting up the container's size, with huge differences between flex + // weights. For simplicity, I've set up the weights so that they sum exactly + // to the container's size in px. So 1 unit of flex *should* get you 1px. + // + // NOTE: The expected computed "_main-size" values for the flex items below + // appear to add up to more than their container's size, which would suggest + // that they overflow their container unnecessarily. But they don't actually + // overflow -- this discrepancy is simply because Gecko's code for reporting + // computed-sizes rounds to 6 significant figures (in particular, the method + // (nsTSubstring_CharT::AppendFloat() does this). Internally, in app-units, + // the child frames' main-sizes add up exactly to the container's main-size, + // as you'd hope & expect. + { + container_properties: { + "_main-size": "9000000px", + }, + items: [ + { + flex: "3000000", + "_main-size": [null, "3000000px"], + }, + { + flex: "1", + "_main-size": [null, "1px"], + }, + { + flex: "1", + "_main-size": [null, "1px"], + }, + { + flex: "2999999", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + { + flex: "2999998", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + { + flex: "1", + "_main-size": [null, "1px", 0.2], + }, + ], + }, + // Same flex items as previous testcase, but now reordered such that the items + // with tiny flex weights are all listed last: + { + container_properties: { + "_main-size": "9000000px", + }, + items: [ + { + flex: "3000000", + "_main-size": [null, "3000000px"], + }, + { + flex: "2999999", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + { + flex: "2999998", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + { + flex: "1", + "_main-size": [null, "1px", 0.2], + }, + { + flex: "1", + "_main-size": [null, "1px", 0.2], + }, + { + flex: "1", + "_main-size": [null, "1px", 0.2], + }, + ], + }, + // Same flex items as previous testcase, but now reordered such that the items + // with tiny flex weights are all listed first: + { + container_properties: { + "_main-size": "9000000px", + }, + items: [ + { + flex: "1", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths: + "_main-size": [null, "1px", 0.2], + }, + { + flex: "1", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths: + "_main-size": [null, "1px", 0.2], + }, + { + flex: "1", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths: + "_main-size": [null, "1px", 0.2], + }, + { + flex: "3000000", + "_main-size": [null, "3000000px"], + }, + { + flex: "2999999", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + { + flex: "2999998", + // NOTE: Expected value is off slightly, from float error when + // resolving flexible lengths & when generating computed value string: + "_main-size": [null, "3000000px"], + }, + ], + }, + + // Trying "flex: auto" (== "1 1 auto") w/ a mix of flex-grow/flex-basis values + { + items: [ + { + flex: "auto", + "_main-size": [null, "45px"], + }, + { + flex: "2", + "_main-size": [null, "90px"], + }, + { + flex: "20px 1 0", + "_main-size": [null, "65px"], + }, + ], + }, + // Same as previous, but with items cycled & different syntax + { + items: [ + { + flex: "20px", + "_main-size": [null, "65px"], + }, + { + flex: "1", + "_main-size": [null, "45px"], + }, + { + flex: "2", + "_main-size": [null, "90px"], + }, + ], + }, + { + items: [ + { + flex: "2", + "_main-size": [null, "100px"], + border: "0px dashed", + "_border-main-start-width": ["5px", "5px"], + "_border-main-end-width": ["15px", "15px"], + "_margin-main-start": ["22px", "22px"], + "_margin-main-end": ["8px", "8px"], + }, + { + flex: "1", + "_main-size": [null, "50px"], + "_margin-main-start": ["auto", "0px"], + "_padding-main-end": ["auto", "0px"], + }, + ], + }, + // Test negative flexibility: + + // Basic testcase: just 1 item (relying on initial "flex-shrink: 1") -- + // should shrink to container size. + { + items: [{ "_main-size": ["400px", "200px"] }], + }, + // ...and now with a "flex" specification and a different flex-shrink value: + { + items: [ + { + flex: "4 2 250px", + "_main-size": [null, "200px"], + }, + ], + }, + // ...and now with multiple items, which all shrink proportionally (by 50%) + // to fit to the container, since they have the same (initial) flex-shrink val + { + items: [ + { "_main-size": ["80px", "40px"] }, + { "_main-size": ["40px", "20px"] }, + { "_main-size": ["30px", "15px"] }, + { "_main-size": ["250px", "125px"] }, + ], + }, + // ...and now with positive flexibility specified. (should have no effect, so + // everything still shrinks by the same proportion, since the flex-shrink + // values are all the same). + { + items: [ + { + flex: "4 3 100px", + "_main-size": [null, "80px"], + }, + { + flex: "5 3 50px", + "_main-size": [null, "40px"], + }, + { + flex: "0 3 100px", + "_main-size": [null, "80px"], + }, + ], + }, + // ...and now with *different* flex-shrink values: + { + items: [ + { + flex: "4 2 50px", + "_main-size": [null, "30px"], + }, + { + flex: "5 3 50px", + "_main-size": [null, "20px"], + }, + { + flex: "0 0 150px", + "_main-size": [null, "150px"], + }, + ], + }, + // Same ratio as prev. testcase; making sure we handle float inaccuracy + { + items: [ + { + flex: "4 20000000 50px", + "_main-size": [null, "30px"], + }, + { + flex: "5 30000000 50px", + "_main-size": [null, "20px"], + }, + { + flex: "0 0.0000001 150px", + "_main-size": [null, "150px"], + }, + ], + }, + // Another "different flex-shrink values" testcase: + { + items: [ + { + flex: "4 2 115px", + "_main-size": [null, "69px"], + }, + { + flex: "5 1 150px", + "_main-size": [null, "120px"], + }, + { + flex: "1 4 30px", + "_main-size": [null, "6px"], + }, + { + flex: "1 0 5px", + "_main-size": [null, "5px"], + }, + ], + }, + + // ...and now with min-size (clamping the effects of flex-shrink on one item): + { + items: [ + { + flex: "4 5 75px", + "_min-main-size": "50px", + "_main-size": [null, "50px"], + }, + { + flex: "5 5 100px", + "_main-size": [null, "62.5px"], + }, + { + flex: "0 4 125px", + "_main-size": [null, "87.5px"], + }, + ], + }, + + // Test a min-size that's much larger than initial preferred size, but small + // enough that our flexed size pushes us over it: + { + items: [ + { + flex: "auto", + "_min-main-size": "110px", + "_main-size": ["50px", "125px"], + }, + { + flex: "auto", + "_main-size": [null, "75px"], + }, + ], + }, + + // Test a min-size that's much larger than initial preferred size, and is + // even larger than our positively-flexed size, so that we have to increase it + // (as a 'min violation') after we've flexed. + { + items: [ + { + flex: "auto", + "_min-main-size": "150px", + "_main-size": ["50px", "150px"], + }, + { + flex: "auto", + "_main-size": [null, "50px"], + }, + ], + }, + + // Test min-size on multiple items simultaneously: + { + items: [ + { + flex: "auto", + "_min-main-size": "20px", + "_main-size": [null, "20px"], + }, + { + flex: "9 auto", + "_min-main-size": "150px", + "_main-size": ["50px", "180px"], + }, + ], + }, + { + items: [ + { + flex: "1 1 0px", + "_min-main-size": "90px", + "_main-size": [null, "90px"], + }, + { + flex: "1 1 0px", + "_min-main-size": "80px", + "_main-size": [null, "80px"], + }, + { + flex: "1 1 40px", + "_main-size": [null, "30px"], + }, + ], + }, + + // Test a case where _min-main-size will be violated on different items in + // successive iterations of the "resolve the flexible lengths" loop + { + items: [ + { + flex: "1 2 100px", + "_min-main-size": "90px", + "_main-size": [null, "90px"], + }, + { + flex: "1 1 100px", + "_min-main-size": "70px", + "_main-size": [null, "70px"], + }, + { + flex: "1 1 100px", + "_main-size": [null, "40px"], + }, + ], + }, + + // Test some cases that have a min-size violation on one item and a + // max-size violation on another: + + // Here, both items initially grow to 100px. That violates both + // items' sizing constraints (it's smaller than the min-size and larger than + // the max-size), so we clamp both of them and sum the clamping-differences: + // + // (130px - 100px) + (50px - 100px) = (30px) + (-50px) = -20px + // + // This sum is negative, so (per spec) we freeze the item that had its + // max-size violated (the second one) and restart the algorithm. This time, + // all the available space (200px - 50px = 150px) goes to the not-yet-frozen + // first item, and that puts it above its min-size, so all is well. + { + items: [ + { + flex: "auto", + "_min-main-size": "130px", + "_main-size": [null, "150px"], + }, + { + flex: "auto", + "_max-main-size": "50px", + "_main-size": [null, "50px"], + }, + ], + }, + + // As above, both items initially grow to 100px, and that violates both items' + // constraints. However, now the sum of the clamping differences is: + // + // (130px - 100px) + (80px - 100px) = (30px) + (-20px) = 10px + // + // This sum is positive, so (per spec) we freeze the item that had its + // min-size violated (the first one) and restart the algorithm. This time, + // all the available space (200px - 130px = 70px) goes to the not-yet-frozen + // second item, and that puts it below its max-size, so all is well. + { + items: [ + { + flex: "auto", + "_min-main-size": "130px", + "_main-size": [null, "130px"], + }, + { + flex: "auto", + "_max-main-size": "80px", + "_main-size": [null, "70px"], + }, + ], + }, + + // As above, both items initially grow to 100px, and that violates both items' + // constraints. So we clamp both items and sum the clamping differences to + // see what to do next. The sum is: + // + // (80px - 100px) + (120px - 100px) = (-20px) + (20px) = 0px + // + // Per spec, if the sum is 0, we're done -- we leave both items at their + // clamped sizes. + { + items: [ + { + flex: "auto", + "_max-main-size": "80px", + "_main-size": [null, "80px"], + }, + { + flex: "auto", + "_min-main-size": "120px", + "_main-size": [null, "120px"], + }, + ], + }, + + // Test cases where flex-grow sums to less than 1: + // =============================================== + // This makes us treat the flexibilities like "fraction of free space" + // instead of weights, so that e.g. a single item with "flex-grow: 0.1" + // will only get 10% of the free space instead of all of the free space. + + // Basic cases where flex-grow sum is less than 1: + { + items: [ + { + flex: "0.1 100px", + "_main-size": [null, "110px"], // +10% of free space + }, + ], + }, + { + items: [ + { + flex: "0.8 0px", + "_main-size": [null, "160px"], // +80% of free space + }, + ], + }, + + // ... and now with two flex items: + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "110px"], // +40% of free space + }, + { + flex: "0.2 30px", + "_main-size": [null, "50px"], // +20% of free space + }, + ], + }, + + // ...and now with max-size modifying how much free space one item can take: + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "110px"], // +40% of free space + }, + { + flex: "0.2 30px", + "_max-main-size": "35px", + "_main-size": [null, "35px"], // +20% free space, then clamped + }, + ], + }, + // ...and now with a max-size smaller than our flex-basis: + // (This makes us freeze the second item right away, before we compute + // the initial free space.) + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "118px"], // +40% of 200px-70px-10px + }, + { + flex: "0.2 30px", + "_max-main-size": "10px", + "_main-size": [null, "10px"], // immediately frozen + }, + ], + }, + // ...and now with a max-size and a huge flex-basis, such that we initially + // have negative free space, which makes the "% of [original] free space" + // calculations a bit more subtle. We set the "original free space" after + // we've clamped the second item (the first time the free space is positive). + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "118px"], // +40% of free space _after freezing + // the other item_ + }, + { + flex: "0.2 150px", + "_max-main-size": "10px", + "_main-size": [null, "10px"], // clamped immediately + }, + ], + }, + + // Now with min-size modifying how much free space our items take: + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "110px"], // +40% of free space + }, + { + flex: "0.2 30px", + "_min-main-size": "70px", + "_main-size": [null, "70px"], // +20% free space, then clamped + }, + ], + }, + + // ...and now with a large enough min-size that it prevents the other flex + // item from taking its full desired portion of the original free space: + { + items: [ + { + flex: "0.4 70px", + "_main-size": [null, "80px"], // (Can't take my full +40% of + // free space due to other item's + // large min-size.) + }, + { + flex: "0.2 30px", + "_min-main-size": "120px", + "_main-size": [null, "120px"], // +20% free space, then clamped + }, + ], + }, + // ...and now with a large-enough min-size that it pushes the other flex item + // to actually shrink a bit (with default "flex-shrink:1"): + { + items: [ + { + flex: "0.3 30px", + "_main-size": [null, "20px"], // -10px, instead of desired +45px + }, + { + flex: "0.2 20px", + "_min-main-size": "180px", + "_main-size": [null, "180px"], // +160px, instead of desired +30px + }, + ], + }, + + // In this case, the items' flexibilities don't initially sum to < 1, but they + // do after we freeze the third item for violating its max-size. + { + items: [ + { + flex: "0.3 30px", + "_main-size": [null, "75px"], + // 1st loop: desires (0.3 / 5) * 150px = 9px. Tentatively granted. + // 2nd loop: desires 0.3 * 150px = 45px. Tentatively granted. + // 3rd loop: desires 0.3 * 150px = 45px. Granted +45px. + }, + { + flex: "0.2 20px", + "_max-main-size": "30px", + "_main-size": [null, "30px"], + // First loop: desires (0.2 / 5) * 150px = 6px. Tentatively granted. + // Second loop: desires 0.2 * 150px = 30px. Frozen at +10px. + }, + { + flex: "4.5 0px", + "_max-main-size": "20px", + "_main-size": [null, "20px"], + // First loop: desires (4.5 / 5) * 150px = 135px. Frozen at +20px. + }, + ], + }, + + // Make sure we calculate "original free space" correctly when one of our + // flex items will be clamped right away, due to max-size preventing it from + // growing at all: + { + // Here, the second flex item is effectively inflexible; it's + // immediately frozen at 40px since we're growing & this item's max size + // trivially prevents it from growing. This leaves us with an "original + // free space" of 60px. The first flex item takes half of that, due to + // its flex-grow value of 0.5. + items: [ + { + flex: "0.5 100px", + "_main-size": [null, "130px"], + }, + { + flex: "1 98px", + "_max-main-size": "40px", + "_main-size": [null, "40px"], + }, + ], + }, + { + // Same as previous example, but with a larger flex-basis on the second + // element (which shouldn't ultimately matter, because its max size clamps + // its size immediately anyway). + items: [ + { + flex: "0.5 100px", + "_main-size": [null, "130px"], + }, + { + flex: "1 101px", + "_max-main-size": "40px", + "_main-size": [null, "40px"], + }, + ], + }, + + { + // Here, the third flex item is effectively inflexible; it's immediately + // frozen at 0px since we're growing & this item's max size trivially + // prevents it from growing. This leaves us with an "original free space" of + // 100px. The first flex item takes 40px, and the third takes 50px, due to + // their flex values of 0.4 and 0.5. + items: [ + { + flex: "0.4 50px", + "_main-size": [null, "90px"], + }, + { + flex: "0.5 50px", + "_main-size": [null, "100px"], + }, + { + flex: "0 90px", + "_max-main-size": "0px", + "_main-size": [null, "0px"], + }, + ], + }, + { + // Same as previous example, but with slightly larger flex-grow values on + // the first and second items, which sum to 1.0 and produce slightly larger + // main sizes. This demonstrates that there's no discontinuity between the + // "< 1.0 sum" to ">= 1.0 sum" behavior, in this situation at least. + items: [ + { + flex: "0.45 50px", + "_main-size": [null, "95px"], + }, + { + flex: "0.55 50px", + "_main-size": [null, "105px"], + }, + { + flex: "0 90px", + "_max-main-size": "0px", + "_main-size": [null, "0px"], + }, + ], + }, + + // Test cases where flex-shrink sums to less than 1: + // ================================================= + // This makes us treat the flexibilities more like "fraction of (negative) + // free space" instead of weights, so that e.g. a single item with + // "flex-shrink: 0.1" will only shrink by 10% of amount that it overflows + // its container by. + // + // It gets a bit more complex when there are multiple flex items, because + // flex-shrink is scaled by the flex-basis before it's used as a weight. But + // even with that scaling, the general principal is that e.g. if the + // flex-shrink values *sum* to 0.6, then the items will collectively only + // shrink by 60% (and hence will still overflow). + + // Basic cases where flex-grow sum is less than 1: + { + items: [ + { + flex: "0 0.1 300px", + "_main-size": [null, "290px"], // +10% of (negative) free space + }, + ], + }, + { + items: [ + { + flex: "0 0.8 400px", + "_main-size": [null, "240px"], // +80% of (negative) free space + }, + ], + }, + + // ...now with two flex items, with the same flex-basis value: + { + items: [ + { + flex: "0 0.4 150px", + "_main-size": [null, "110px"], // +40% of (negative) free space + }, + { + flex: "0 0.2 150px", + "_main-size": [null, "130px"], // +20% of (negative) free space + }, + ], + }, + + // ...now with two flex items, with different flex-basis values (and hence + // differently-scaled flex factors): + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "76px"], + }, + { + flex: "0 0.1 200px", + "_main-size": [null, "184px"], + }, + ], + // Notes: + // - Free space: -100px + // - Sum of flex-shrink factors: 0.3 + 0.1 = 0.4 + // - Since that sum ^ is < 1, we'll only distribute that fraction of + // the free space. We'll distribute: -100px * 0.4 = -40px + // + // - 1st item's scaled flex factor: 0.3 * 100px = 30 + // - 2nd item's scaled flex factor: 0.1 * 200px = 20 + // - 1st item's share of distributed free space: 30/(30+20) = 60% + // - 2nd item's share of distributed free space: 20/(30+20) = 40% + // + // SO: + // - 1st item gets 60% * -40px = -24px. 100px-24px = 76px + // - 2nd item gets 40% * -40px = -16px. 200px-16px = 184px + }, + + // ...now with min-size modifying how much one item can shrink: + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "70px"], + }, + { + flex: "0 0.1 200px", + "_min-main-size": "190px", + "_main-size": [null, "190px"], + }, + ], + // Notes: + // - We proceed as in previous testcase, but clamp the second flex item + // at its min main size. + // - After that point, we have a total flex-shrink of = 0.3, so we + // distribute 0.3 * -100px = -30px to the remaining unfrozen flex + // items. Since there's only one unfrozen item left, it gets all of it. + }, + + // ...now with min-size larger than our flex-basis: + // (This makes us freeze the second item right away, before we compute + // the initial free space.) + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "55px"], // +30% of 200px-100px-250px + }, + { + flex: "0 0.1 200px", + "_min-main-size": "250px", + "_main-size": [null, "250px"], // immediately frozen + }, + ], + // (Same as previous example, except the min-main-size prevents the + // second item from shrinking at all) + }, + + // ...and now with a min-size and a small flex-basis, such that we initially + // have positive free space, which makes the "% of [original] free space" + // calculations a bit more subtle. We set the "original free space" after + // we've clamped the second item (the first time the free space is negative). + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "70px"], + }, + { + flex: "0 0.1 50px", + "_min-main-size": "200px", + "_main-size": [null, "200px"], + }, + ], + }, + + // Now with max-size making an item shrink more than its flex-shrink value + // calls for: + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "70px"], + }, + { + flex: "0 0.1 200px", + "_max-main-size": "150px", + "_main-size": [null, "150px"], + }, + ], + // Notes: + // - We proceed as in an earlier testcase, but clamp the second flex item + // at its max main size. + // - After that point, we have a total flex-shrink of = 0.3, so we + // distribute 0.3 * -100px = -30px to the remaining unfrozen flex + // items. Since there's only one unfrozen item left, it gets all of it. + }, + + // ...and now with a small enough max-size that it prevents the other flex + // item from taking its full desired portion of the (negative) original free + // space: + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "90px"], + }, + { + flex: "0 0.1 200px", + "_max-main-size": "110px", + "_main-size": [null, "110px"], + }, + ], + // Notes: + // - We proceed as in an earlier testcase, but clamp the second flex item + // at its max main size. + // - After that point, we have a total flex-shrink of 0.3, which would + // have us distribute 0.3 * -100px = -30px to the (one) remaining + // unfrozen flex item. But our remaining free space is only -10px at + // that point, so we distribute that instead. + }, + + // ...and now with a small enough max-size that it pushes the other flex item + // to actually grow a bit (with custom "flex-grow: 1" for this testcase): + { + items: [ + { + flex: "1 0.3 100px", + "_main-size": [null, "120px"], + }, + { + flex: "1 0.1 200px", + "_max-main-size": "80px", + "_main-size": [null, "80px"], + }, + ], + }, + + // In this case, the items' flexibilities don't initially sum to < 1, but they + // do after we freeze the third item for violating its min-size. + { + items: [ + { + flex: "0 0.3 100px", + "_main-size": [null, "76px"], + }, + { + flex: "0 0.1 150px", + "_main-size": [null, "138px"], + }, + { + flex: "0 0.8 10px", + "_min-main-size": "40px", + "_main-size": [null, "40px"], + }, + ], + // Notes: + // - We immediately freeze the 3rd item, since we're shrinking and its + // min size obviously prevents it from shrinking at all. This leaves + // 200px - 100px - 150px - 40px = -90px of "initial free space". + // + // - Our remaining flexible items have a total flex-shrink of 0.4, + // so we can distribute a total of 0.4 * -90px = -36px + // + // - We distribute that space using *scaled* flex factors: + // * 1st item's scaled flex factor: 0.3 * 100px = 30 + // * 2nd item's scaled flex factor: 0.1 * 150px = 15 + // ...which means... + // * 1st item's share of distributed free space: 30/(30+15) = 2/3 + // * 2nd item's share of distributed free space: 15/(30+15) = 1/3 + // + // SO: + // - 1st item gets 2/3 * -36px = -24px. 100px - 24px = 76px + // - 2nd item gets 1/3 * -36px = -12px. 150px - 12px = 138px + }, + + // In this case, the items' flexibilities sum to > 1, in part due to an item + // that *can't actually shrink* due to its 0 flex-basis (which gives it a + // "scaled flex factor" of 0). This prevents us from triggering the special + // behavior for flexibilities that sum to less than 1, and as a result, the + // first item ends up absorbing all of the free space. + { + items: [ + { + flex: "0 .5 300px", + "_main-size": [null, "200px"], + }, + { + flex: "0 5 0px", + "_main-size": [null, "0px"], + }, + ], + }, + + // This case is similar to the one above, but with a *barely* nonzero base + // size for the second item. This should produce a result similar to the case + // above. (In particular, we should first distribute a very small amount of + // negative free space to the second item, getting it to approximately zero, + // and distribute the bulk of the negative free space to the first item, + // getting it to approximately 200px.) + { + items: [ + { + flex: "0 .5 300px", + "_main-size": [null, "200px"], + }, + { + flex: "0 1 0.01px", + "_main-size": [null, "0px"], + }, + ], + }, + // This case is similar to the ones above, but now we've increased the + // flex-shrink value on the second-item so that it claims enough of the + // negative free space to go below its min-size (0px). So, it triggers a min + // violation & is frozen. For the loop *after* the min violation, the sum of + // the remaining flex items' flex-shrink values is less than 1, so we trigger + // the special <1 behavior and only distribute half of the remaining + // (negative) free space to the first item (instead of all of it). + { + items: [ + { + flex: "0 .5 300px", + "_main-size": [null, "250px"], + }, + { + flex: "0 5 0.01px", + "_main-size": [null, "0px"], + }, + ], + }, +]; diff --git a/layout/style/test/gen-css-properties.py b/layout/style/test/gen-css-properties.py new file mode 100644 index 0000000000..1d6fad226d --- /dev/null +++ b/layout/style/test/gen-css-properties.py @@ -0,0 +1,24 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import os +import sys +import subprocess + + +def main(output, css_properties, exe): + # moz.build passes in the exe name without any path, so to run it we need to + # prepend the './' + run_exe = exe if os.path.isabs(exe) else "./%s" % exe + + # Use universal_newlines so everything is '\n', which gets converted to + # '\r\n' when writing out the file in Windows. + data = subprocess.check_output([run_exe], universal_newlines=True) + with open(css_properties) as f: + data += f.read() + output.write(data) + + +if __name__ == "__main__": + main(sys.stdout, *sys.argv[1:]) diff --git a/layout/style/test/gtest/ImportScannerTest.cpp b/layout/style/test/gtest/ImportScannerTest.cpp new file mode 100644 index 0000000000..c0b43221dd --- /dev/null +++ b/layout/style/test/gtest/ImportScannerTest.cpp @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "mozilla/ImportScanner.h" +#include "mozilla/StaticPrefs_layout.h" + +using namespace mozilla; + +static nsTArray Scan(const char* aCssCode) { + nsTArray urls; + ImportScanner scanner; + scanner.Start(); + urls.AppendElements(scanner.Scan(NS_ConvertUTF8toUTF16(aCssCode))); + urls.AppendElements(scanner.Stop()); + return urls; +} + +TEST(ImportScanner, Simple) +{ + auto urls = Scan( + "/* Something something */ " + "@charset \"utf-8\";" + "@import url(bar);" + "@import uRL( baz );" + "@import \"bazz)\""); + + ASSERT_EQ(urls.Length(), 3u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"baz"_ns); + ASSERT_EQ(urls[2], u"bazz)"_ns); +} + +TEST(ImportScanner, UrlWithQuotes) +{ + auto urls = Scan( + "/* Something something */ " + "@import url(\"bar\");" + "@import\tuRL( \"baz\" );" + "@imPort\turL( 'bazz' );" + "something else {}" + "@import\turL( 'bazz' ); "); + + ASSERT_EQ(urls.Length(), 3u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"baz"_ns); + ASSERT_EQ(urls[2], u"bazz"_ns); +} + +TEST(ImportScanner, MediaIsIgnored) +{ + auto urls = Scan( + "@chArset \"utf-8\";" + "@import url(\"bar\") print;" + "/* Something something */ " + "@import\tuRL( \"baz\" ) (min-width: 100px);" + "@import\turL( bazz ) (max-width: 100px);"); + + ASSERT_EQ(urls.Length(), 3u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"baz"_ns); + ASSERT_EQ(urls[2], u"bazz"_ns); +} + +TEST(ImportScanner, Layers) +{ + auto urls = Scan( + "@layer foo, bar;\n" + "@import url(\"bar\") layer(foo);" + "@import url(\"baz\");" + "@import url(bazz);" + "@layer block {}" + // This one below is invalid now and shouldn't be scanned. + "@import\turL( 'bazzz' ); "); + + ASSERT_EQ(urls.Length(), 3u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"baz"_ns); + ASSERT_EQ(urls[2], u"bazz"_ns); +} + +TEST(ImportScanner, Supports) +{ + auto urls = Scan( + // Supported feature, should be included. + "@import url(bar) supports(display: block);" + // Unsupported feature, should not be included. + "@import url(baz) supports(foo: bar);" + // Supported condition with operator, should be included. + "@import url(bazz) supports((display: flex) and (display: block));" + // Unsupported condition with function, should be not included. + "@import url(bazzz) supports(selector(foo:bar(baz)));" + // Supported large condition with layer, supports, media list + "@import url(bazzzz) layer(A.B) supports(display: flex) (max-width: " + "100px)"); + + if (StaticPrefs::layout_css_import_supports_enabled()) { + // If the pref is enabled, expect the supports conditions to be evaluated + // and unsupported to not be emitted. + + ASSERT_EQ(urls.Length(), 3u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"bazz"_ns); + ASSERT_EQ(urls[2], u"bazzzz"_ns); + } else { + // If disabled, all imports should be included as the supports conditions + // should be ignored. + + ASSERT_EQ(urls.Length(), 5u); + ASSERT_EQ(urls[0], u"bar"_ns); + ASSERT_EQ(urls[1], u"baz"_ns); + ASSERT_EQ(urls[2], u"bazz"_ns); + ASSERT_EQ(urls[3], u"bazzz"_ns); + ASSERT_EQ(urls[4], u"bazzzz"_ns); + } +} diff --git a/layout/style/test/gtest/StyloParsingBench.cpp b/layout/style/test/gtest/StyloParsingBench.cpp new file mode 100644 index 0000000000..4c14ebed7c --- /dev/null +++ b/layout/style/test/gtest/StyloParsingBench.cpp @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "gtest/MozGTestBench.h" +#include "nsString.h" +#include "ExampleStylesheet.h" +#include "ServoBindings.h" +#include "mozilla/dom/DOMString.h" +#include "mozilla/Encoding.h" +#include "mozilla/Utf8.h" +#include "mozilla/NullPrincipal.h" +#include "mozilla/css/SheetParsingMode.h" +#include "ReferrerInfo.h" +#include "nsCSSValue.h" +#include "ReferrerInfo.h" + +using namespace mozilla; +using namespace mozilla::css; +using namespace mozilla::dom; +using namespace mozilla::net; + +// Bug 1436018 - Disable Stylo microbenchmark on Windows +#if !defined(_WIN32) && !defined(_WIN64) + +# define PARSING_REPETITIONS 20 +# define SETPROPERTY_REPETITIONS (1000 * 1000) +# define GETPROPERTY_REPETITIONS (1000 * 1000) + +static void ServoParsingBench(const StyleUseCounters* aCounters) { + auto css = AsBytes(MakeStringSpan(EXAMPLE_STYLESHEET)); + nsCString cssStr; + cssStr.Append(css); + ASSERT_EQ(Encoding::UTF8ValidUpTo(css), css.Length()); + + RefPtr uri = NullPrincipal::CreateURI(); + nsCOMPtr referrerInfo = new ReferrerInfo(nullptr); + RefPtr data = + new URLExtraData(uri.forget(), referrerInfo.forget(), + NullPrincipal::CreateWithoutOriginAttributes()); + for (int i = 0; i < PARSING_REPETITIONS; i++) { + RefPtr stylesheet = + Servo_StyleSheet_FromUTF8Bytes( + nullptr, nullptr, nullptr, &cssStr, eAuthorSheetFeatures, data, + eCompatibility_FullStandards, nullptr, aCounters, + StyleAllowImportRules::Yes, StyleSanitizationKind::None, nullptr) + .Consume(); + } +} + +static constexpr auto STYLE_RULE = StyleCssRuleType::Style; + +static void ServoSetPropertyByIdBench(const nsACString& css) { + RefPtr block = + Servo_DeclarationBlock_CreateEmpty().Consume(); + RefPtr uri = NullPrincipal::CreateURI(); + nsCOMPtr referrerInfo = new ReferrerInfo(nullptr); + RefPtr data = + new URLExtraData(uri.forget(), referrerInfo.forget(), + NullPrincipal::CreateWithoutOriginAttributes()); + ASSERT_TRUE(IsUtf8(css)); + + for (int i = 0; i < SETPROPERTY_REPETITIONS; i++) { + Servo_DeclarationBlock_SetPropertyById( + block, eCSSProperty_width, &css, + /* is_important = */ false, data, StyleParsingMode::DEFAULT, + eCompatibility_FullStandards, nullptr, STYLE_RULE, {}); + } +} + +static void ServoGetPropertyValueById() { + RefPtr block = + Servo_DeclarationBlock_CreateEmpty().Consume(); + + RefPtr uri = NullPrincipal::CreateURI(); + nsCOMPtr referrerInfo = new ReferrerInfo(nullptr); + RefPtr data = + new URLExtraData(uri.forget(), referrerInfo.forget(), + NullPrincipal::CreateWithoutOriginAttributes()); + constexpr auto css_ = "10px"_ns; + const nsACString& css = css_; + Servo_DeclarationBlock_SetPropertyById( + block, eCSSProperty_width, &css, + /* is_important = */ false, data, StyleParsingMode::DEFAULT, + eCompatibility_FullStandards, nullptr, STYLE_RULE, {}); + + for (int i = 0; i < GETPROPERTY_REPETITIONS; i++) { + nsAutoCString value; + Servo_DeclarationBlock_GetPropertyValueById(block, eCSSProperty_width, + &value); + ASSERT_TRUE(value.EqualsLiteral("10px")); + } +} + +MOZ_GTEST_BENCH(Stylo, Servo_StyleSheet_FromUTF8Bytes_Bench, + [] { ServoParsingBench(nullptr); }); + +MOZ_GTEST_BENCH(Stylo, Servo_StyleSheet_FromUTF8Bytes_Bench_UseCounters, [] { + UniquePtr counters(Servo_UseCounters_Create()); + ServoParsingBench(counters.get()); +}); + +MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_SetPropertyById_Bench, + [] { ServoSetPropertyByIdBench("10px"_ns); }); + +MOZ_GTEST_BENCH(Stylo, + Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench, + [] { ServoSetPropertyByIdBench(" 10px"_ns); }); + +MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_GetPropertyById_Bench, + ServoGetPropertyValueById); + +#endif diff --git a/layout/style/test/gtest/example.css b/layout/style/test/gtest/example.css new file mode 100644 index 0000000000..12a0fb9a4f --- /dev/null +++ b/layout/style/test/gtest/example.css @@ -0,0 +1,2925 @@ +/* Copied from devtools/client/debugger/debugger.css on 2017-04-03 */ + +.landing-page { + flex: 1; + display: flex; + width: 100vw; + height: 100vh; + flex-direction: row; + align-items: stretch; + /* Customs properties */ + --title-font-size: 24px; + --ui-element-font-size: 16px; + --primary-line-height: 30px; + --secondary-line-height: 25px; + --base-spacing: 20px; + --base-transition: all 0.25s ease; +} + +.landing-popup { + min-width: 0; +} + +.landing-page .panel { + display: flex; + flex: 1; + flex-direction: column; + justify-content: space-between; +} + +.landing-page .panel header { + display: flex; + align-items: baseline; + margin: calc(2 * var(--base-spacing)) 0 0; + padding-bottom: var(--base-spacing); +} + +.landing-page .panel header input[type=search] { + flex: 1; + background-color: var(--theme-tab-toolbar-background); + color: var(--theme-comment); + font-size: var(--ui-element-font-size); + border: 1px solid var(--theme-splitter-color); + padding: calc(var(--base-spacing) / 2); + margin: 0 var(--base-spacing); + transition: var(--base-transition); +} + +.landing-page .panel header input[type=button] { + background-color: var(--theme-tab-toolbar-background); + color: var(--theme-comment); + font-size: var(--ui-element-font-size); + border: 1px solid var(--theme-splitter-color); + padding: calc(var(--base-spacing) / 2); + margin: 0 var(--base-spacing); + transition: var(--base-transition); +} + +.landing-page .panel header h1 { + color: var(--theme-body-color); + font-size: var(--title-font-size); + margin: 0; + line-height: var(--primary-line-height); + font-weight: normal; + padding-left: calc(2 * var(--base-spacing)); +} + +.landing-page .panel h3 { + padding-left: calc(2 * var(--base-spacing)); +} + +.landing-page .panel header input::placeholder { + color: var(--theme-body-color-inactive); +} + +.landing-page .panel header input:focus { + border: 1px solid var(--theme-selection-background); +} + +.landing-page .panel .center-message { + font-size: var(--ui-element-font-size); + line-height: var(--secondary-line-height); + padding: calc(var(--base-spacing) / 2); +} + +.landing-page .center a { + color: var(--theme-highlight-bluegrey); + text-decoration: none; +} + +.landing-page .panel .footer-note { + padding: var(--base-spacing) 0; + text-align: center; + font-size: 14px; + color: var(--theme-comment); +} +.landing-page .tab-group { + flex: 1; + overflow-y: auto; +} + +.landing-page .tab-list { + list-style: none; + padding: 0; + margin: 0; +} + +.landing-page .tab { + border-bottom: 1px solid var(--theme-splitter-color); + padding: calc(var(--base-spacing) / 2) var(--base-spacing); + font-family: sans-serif; +} + +.landing-page .tab-sides { + display: flex; + justify-content: space-between; + margin: 0 calc(var(--base-spacing) * 2); +} + +.landing-page .tab-title { + line-height: var(--secondary-line-height); + font-size: var(--ui-element-font-size); + color: var(--theme-highlight-bluegrey); + word-break: break-all; +} + +.landing-page .tab-url { + color: var(--theme-comment); + word-break: break-all; +} + +.landing-page .tab-value { + color: var(--theme-comment); + line-height: var(--secondary-line-height); + font-size: var(--ui-element-font-size); +} + +.landing-page .tab:focus, +.landing-page .tab.active { + background: var(--theme-selection-background); + color: var(--theme-selection-color); + cursor: pointer; + transition: var(--base-transition); +} + +.landing-page .tab:focus .tab-title, +.landing-page .tab.active .tab-title { + color: inherit; +} + +.landing-page .tab:focus .tab-url, +.landing-page .tab.active .tab-url { + color: var(--theme-highlight-gray); +} +.landing-page .sidebar { + display: flex; + background-color: var(--theme-tab-toolbar-background); + width: 200px; + flex-direction: column; + border-right: 1px solid var(--theme-splitter-color); +} + +.landing-page .sidebar h1 { + color: var(--theme-body-color); + font-size: var(--title-font-size); + margin: 0; + line-height: var(--primary-line-height); + font-weight: normal; + padding: calc(2 * var(--base-spacing)) var(--base-spacing); +} + +.landing-page .sidebar ul { + list-style: none; + padding: 0; + line-height: var(--primary-line-height); + font-size: var(--ui-element-font-size); +} + +.landing-page .sidebar li { + padding: calc(var(--base-spacing) / 4) var(--base-spacing); +} + +.landing-page .sidebar li a { + color: var(--theme-body-color); +} + +.landing-page .sidebar li.selected { + background: var(--theme-highlight-bluegrey); + color: var(--theme-selection-color); + transition: var(--base-transition); +} + +.landing-page .sidebar li.selected a { + color: inherit; +} + +.landing-page .sidebar li:hover, +.landing-page .sidebar li:focus { + background: var(--theme-selection-background); + color: var(--theme-selection-color); + cursor: pointer; +} + +.landing-page .sidebar li:hover a, +.landing-page .sidebar li:focus a { + color: inherit; +} +:root.theme-light, +:root .theme-light { + --theme-search-overlays-semitransparent: rgba(221, 225, 228, 0.66); +} + +* { + box-sizing: border-box; +} + +html, +body { + height: 100%; + margin: 0; + padding: 0; + width: 100%; +} + +#mount { + display: flex; + height: 100%; +} + +::-webkit-scrollbar { + width: 8px; + height: 8px; + background: transparent; +} + +::-webkit-scrollbar-track { + border-radius: 8px; + background: transparent; +} + +::-webkit-scrollbar-thumb { + border-radius: 8px; + background: rgba(113, 113, 113, 0.5); +} + +:root.theme-dark .CodeMirror-scrollbar-filler { + background: transparent; +} +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; + background-color: #7e7; +} +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: -20px; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -30px; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper { + -webkit-user-select: none; + user-select: none; +} + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: contextual; + font-variant-ligatures: contextual; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget {} + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +:root { + /* --breakpoint-background: url("chrome://devtools/skin/images/breakpoint.svg#light"); */ + /* --breakpoint-hover-background: url("chrome://devtools/skin/images/breakpoint.svg#light-hover"); */ + --breakpoint-active-color: rgba(44,187,15,.2); + --breakpoint-active-color-hover: rgba(44,187,15,.5); + /* --breakpoint-conditional-background: url("chrome://devtools/skin/images/breakpoint.svg#light-conditional"); */ +} + +.theme-dark:root { + /* --breakpoint-background: url("chrome://devtools/skin/images/breakpoint.svg#dark"); */ + /* --breakpoint-hover-background: url("chrome://devtools/skin/images/breakpoint.svg#dark-hover"); */ + --breakpoint-active-color: rgba(0,255,175,.4); + --breakpoint-active-color-hover: rgba(0,255,175,.7); + /* --breakpoint-conditional-background: url("chrome://devtools/skin/images/breakpoint.svg#dark-conditional"); */ +} + +.CodeMirror .errors { + width: 16px; +} + +.CodeMirror .error { + display: inline-block; + margin-left: 5px; + width: 12px; + height: 12px; + background-repeat: no-repeat; + background-position: center; + background-size: contain; + /* background-image: url("chrome://devtools/skin/images/editor-error.png"); */ + opacity: 0.75; +} + +.CodeMirror .hit-counts { + width: 6px; +} + +.CodeMirror .hit-count { + display: inline-block; + height: 12px; + border: solid rgba(0,0,0,0.2); + border-width: 1px 1px 1px 0; + border-radius: 0 3px 3px 0; + padding: 0 3px; + font-size: 10px; + pointer-events: none; +} + +.CodeMirror-linenumber:before { + content: " "; + display: block; + width: calc(100% - 3px); + position: absolute; + top: 1px; + left: 0; + height: 12px; + z-index: -1; + background-size: calc(100% - 2px) 12px; + background-repeat: no-repeat; + background-position: right center; + padding-inline-end: 9px; +} + +.breakpoint .CodeMirror-linenumber { + color: var(--theme-body-background); +} + +.breakpoint .CodeMirror-linenumber:before { + background-image: var(--breakpoint-background) !important; +} + +.conditional .CodeMirror-linenumber:before { + background-image: var(--breakpoint-conditional-background) !important; +} + +.debug-line .CodeMirror-linenumber { + background-color: var(--breakpoint-active-color); +} + +.theme-dark .debug-line .CodeMirror-linenumber { + color: #c0c0c0; +} + +.debug-line .CodeMirror-line { + background-color: var(--breakpoint-active-color) !important; +} + +/* Don't display the highlight color since the debug line + is already highlighted */ +.debug-line .CodeMirror-activeline-background { + display: none; +} + +.CodeMirror { + cursor: text; + height: 100%; +} + +.CodeMirror-gutters { + cursor: default; +} + +/* This is to avoid the fake horizontal scrollbar div of codemirror to go 0 +height when floating scrollbars are active. Make sure that this value is equal +to the maximum of `min-height` specific to the `scrollbar[orient="horizontal"]` +selector in floating-scrollbar-light.css across all platforms. */ +.CodeMirror-hscrollbar { + min-height: 10px; +} + +/* This is to avoid the fake vertical scrollbar div of codemirror to go 0 +width when floating scrollbars are active. Make sure that this value is equal +to the maximum of `min-width` specific to the `scrollbar[orient="vertical"]` +selector in floating-scrollbar-light.css across all platforms. */ +.CodeMirror-vscrollbar { + min-width: 10px; +} + +.cm-trailingspace { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg=="); + opacity: 0.75; + background-position: left bottom; + background-repeat: repeat-x; +} + +.cm-highlight { + position: relative; +} + +.cm-highlight:before { + position: absolute; + border-top-style: solid; + border-bottom-style: solid; + border-top-color: var(--theme-comment-alt); + border-bottom-color: var(--theme-comment-alt); + border-top-width: 1px; + border-bottom-width: 1px; + top: -1px; + bottom: 0; + left: 0; + right: 0; + content: ""; + margin-bottom: -1px; +} + +.cm-highlight-full:before { + border: 1px solid var(--theme-comment-alt); +} + +.cm-highlight-start:before { + border-left-width: 1px; + border-left-style: solid; + border-left-color: var(--theme-comment-alt); + margin: 0 0 -1px -1px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} + +.cm-highlight-end:before { + border-right-width: 1px; + border-right-style: solid; + border-right-color: var(--theme-comment-alt); + margin: 0 -1px -1px 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} + +/* CodeMirror dialogs styling */ + +.CodeMirror-dialog { + padding: 4px 3px; +} + +.CodeMirror-dialog, +.CodeMirror-dialog input { + font: message-box; +} + +/* Fold addon */ + +.CodeMirror-foldmarker { + color: blue; + text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; + font-family: sans-serif; + line-height: .3; + cursor: pointer; +} + +.CodeMirror-foldgutter { + width: 16px; /* Same as breakpoints gutter above */ +} + +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + color: #555; + cursor: pointer; +} + +.CodeMirror-foldgutter-open:after { + font-size: 120%; + content: "\25BE"; +} + +.CodeMirror-foldgutter-folded:after { + font-size: 120%; + content: "\25B8"; +} + +.CodeMirror-hints { + position: absolute; + z-index: 10; + overflow: hidden; + list-style: none; + margin: 0; + padding: 2px; + border-radius: 3px; + font-size: 90%; + max-height: 20em; + overflow-y: auto; +} + +.CodeMirror-hint { + margin: 0; + padding: 0 4px; + border-radius: 2px; + max-width: 19em; + overflow: hidden; + white-space: pre; + cursor: pointer; +} + +.CodeMirror-Tern-completion { + padding-inline-start: 22px; + position: relative; + line-height: 18px; +} + +.CodeMirror-Tern-completion:before { + position: absolute; + left: 2px; + bottom: 2px; + border-radius: 50%; + font-size: 12px; + font-weight: bold; + height: 15px; + width: 15px; + line-height: 16px; + text-align: center; + color: #ffffff; + box-sizing: border-box; +} + +.CodeMirror-Tern-completion-unknown:before { + content: "?"; +} + +.CodeMirror-Tern-completion-object:before { + content: "O"; +} + +.CodeMirror-Tern-completion-fn:before { + content: "F"; +} + +.CodeMirror-Tern-completion-array:before { + content: "A"; +} + +.CodeMirror-Tern-completion-number:before { + content: "N"; +} + +.CodeMirror-Tern-completion-string:before { + content: "S"; +} + +.CodeMirror-Tern-completion-bool:before { + content: "B"; +} + +.CodeMirror-Tern-completion-guess { + color: #999; +} + +.CodeMirror-Tern-tooltip { + border-radius: 3px; + padding: 2px 5px; + white-space: pre-wrap; + max-width: 40em; + position: absolute; + z-index: 10; +} + +.CodeMirror-Tern-hint-doc { + max-width: 25em; +} + +.CodeMirror-Tern-farg-current { + text-decoration: underline; +} + +.CodeMirror-Tern-fhint-guess { + opacity: .7; +} +:root.theme-light, +:root .theme-light { + --search-overlays-semitransparent: rgba(221, 225, 228, 0.66); +} + +:root.theme-dark, +:root .theme-dark { + --search-overlays-semitransparent: rgba(42, 46, 56, 0.66); +} +.debugger { + display: flex; + flex: 1; + height: 100%; +} + +.editor-pane { + display: flex; + position: relative; + flex: 1; + background-color: var(--theme-tab-toolbar-background); + height: calc(100% - 1px); + overflow: hidden; +} + +.editor-container { + width: 100%; +} + +.subsettings:hover { + cursor: pointer; +} + +.search-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + z-index: 200; + background-color: var(--search-overlays-semitransparent); +} + +.search-container .close-button { + width: 16px; + margin-top: 25px; + margin-right: 20px; +} +menupopup { + position: fixed; + z-index: 10000; + background: white; + border: 1px solid #cccccc; + padding: 5px 0; + background: #f2f2f2; + border-radius: 5px; + color: #585858; + box-shadow: 0 0 4px 0 rgba(190, 190, 190, 0.8); + min-width: 130px; +} + +menuitem { + display: block; + padding: 0 20px; + line-height: 20px; + font-weight: 500; + font-size: 13px; + user-select: none; +} + +menuitem:hover { + background: #3780fb; + color: white; + cursor: pointer; +} + +menuitem[disabled=true] { + color: #cccccc; +} + +menuitem[disabled=true]:hover { + background-color: transparent; + cursor: default; +} + +menuseparator { + border-bottom: 1px solid #cacdd3; + width: 100%; + height: 5px; + display: block; + margin-bottom: 5px; +} + +#contextmenu-mask.show { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; +} +/* vim:set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +.split-box { + display: flex; + flex: 1; + min-width: 0; + height: 100%; + width: 100%; +} + +.split-box.vert { + flex-direction: row; +} + +.split-box.horz { + flex-direction: column; +} + +.split-box > .uncontrolled { + display: flex; + flex: 1; + min-width: 0; + overflow: auto; +} + +.split-box > .controlled { + display: flex; + overflow: auto; +} + +.split-box > .splitter { + background-image: none; + border: 0; + border-style: solid; + border-color: transparent; + background-color: var(--theme-splitter-color); + background-clip: content-box; + position: relative; + + box-sizing: border-box; + + /* Positive z-index positions the splitter on top of its siblings and makes + it clickable on both sides. */ + z-index: 1; +} + +.split-box.vert > .splitter { + min-width: calc(var(--devtools-splitter-inline-start-width) + + var(--devtools-splitter-inline-end-width) + 1px); + + border-left-width: var(--devtools-splitter-inline-start-width); + border-right-width: var(--devtools-splitter-inline-end-width); + + margin-left: calc(-1 * var(--devtools-splitter-inline-start-width) - 1px); + margin-right: calc(-1 * var(--devtools-splitter-inline-end-width)); + + cursor: ew-resize; +} + +.split-box.horz > .splitter { + min-height: calc(var(--devtools-splitter-top-width) + + var(--devtools-splitter-bottom-width) + 1px); + + border-top-width: var(--devtools-splitter-top-width); + border-bottom-width: var(--devtools-splitter-bottom-width); + + margin-top: calc(-1 * var(--devtools-splitter-top-width) - 1px); + margin-bottom: calc(-1 * var(--devtools-splitter-bottom-width)); + + cursor: ns-resize; +} + +.split-box.disabled { + pointer-events: none; +} + +/** + * Make sure splitter panels are not processing any mouse + * events. This is good for performance during splitter + * bar dragging. + */ +.split-box.dragging > .controlled, +.split-box.dragging > .uncontrolled { + pointer-events: none; +} +/* vim:set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +.theme-dark, +.theme-light { + --number-color: var(--theme-highlight-green); + --string-color: var(--theme-highlight-orange); + --null-color: var(--theme-comment); + --object-color: var(--theme-body-color); + --caption-color: var(--theme-highlight-blue); + --location-color: var(--theme-content-color1); + --source-link-color: var(--theme-highlight-blue); + --node-color: var(--theme-highlight-bluegrey); + --reference-color: var(--theme-highlight-purple); +} + +.theme-firebug { + --number-color: #000088; + --string-color: #FF0000; + --null-color: #787878; + --object-color: DarkGreen; + --caption-color: #444444; + --location-color: #555555; + --source-link-color: blue; + --node-color: rgb(0, 0, 136); + --reference-color: rgb(102, 102, 255); +} + +/******************************************************************************/ + +.objectLink:hover { + cursor: pointer; + text-decoration: underline; +} + +.inline { + display: inline; + white-space: normal; +} + +.objectBox-object { + font-weight: bold; + color: var(--object-color); + white-space: pre-wrap; +} + +.objectBox-string, +.objectBox-text, +.objectLink-textNode, +.objectBox-table { + white-space: pre-wrap; +} + +.objectBox-number, +.objectLink-styleRule, +.objectLink-element, +.objectLink-textNode, +.objectBox-array > .length { + color: var(--number-color); +} + +.objectBox-string { + color: var(--string-color); +} + +.objectLink-function, +.objectBox-stackTrace, +.objectLink-profile { + color: var(--object-color); +} + +.objectLink-Location { + font-style: italic; + color: var(--location-color); +} + +.objectBox-null, +.objectBox-undefined, +.objectBox-hint, +.logRowHint { + font-style: italic; + color: var(--null-color); +} + +.objectLink-sourceLink { + position: absolute; + right: 4px; + top: 2px; + padding-left: 8px; + font-weight: bold; + color: var(--source-link-color); +} + +/******************************************************************************/ + +.objectLink-event, +.objectLink-eventLog, +.objectLink-regexp, +.objectLink-object, +.objectLink-Date { + font-weight: bold; + color: var(--object-color); + white-space: pre-wrap; +} + +/******************************************************************************/ + +.objectLink-object .nodeName, +.objectLink-NamedNodeMap .nodeName, +.objectLink-NamedNodeMap .objectEqual, +.objectLink-NamedNodeMap .arrayLeftBracket, +.objectLink-NamedNodeMap .arrayRightBracket, +.objectLink-Attr .attrEqual, +.objectLink-Attr .attrTitle { + color: var(--node-color); +} + +.objectLink-object .nodeName { + font-weight: normal; +} + +/******************************************************************************/ + +.objectLeftBrace, +.objectRightBrace, +.arrayLeftBracket, +.arrayRightBracket { + cursor: pointer; + font-weight: bold; +} + +.objectLeftBrace, +.arrayLeftBracket { + margin-right: 4px; +} + +.objectRightBrace, +.arrayRightBracket { + margin-left: 4px; +} + +/******************************************************************************/ +/* Cycle reference*/ + +.objectLink-Reference { + font-weight: bold; + color: var(--reference-color); +} + +.objectBox-array > .objectTitle { + font-weight: bold; + color: var(--object-color); +} + +.caption { + font-weight: bold; + color: var(--caption-color); +} + +/******************************************************************************/ +/* Themes */ + +.theme-dark .objectBox-null, +.theme-dark .objectBox-undefined, +.theme-light .objectBox-null, +.theme-light .objectBox-undefined { + font-style: normal; +} + +.theme-dark .objectBox-object, +.theme-light .objectBox-object { + font-weight: normal; + white-space: pre-wrap; +} + +.theme-dark .caption, +.theme-light .caption { + font-weight: normal; +} + +.search-container { + position: absolute; + top: 30px; + left: 0; + width: calc(100% - 1px); + height: calc(100% - 31px); + display: flex; + z-index: 200; + background-color: var(--theme-body-background); +} + +.searchinput-container { + display: flex; + border-bottom: 1px solid var(--theme-splitter-color); +} + +.theme-dark .result-list li .subtitle { + color: var(--theme-comment-alt); +} + +.arrow, +.folder, +.domain, +.file, +.worker, +.refresh, +.add-button { + fill: var(--theme-splitter-color); +} + +.worker, +.folder { + position: relative; + top: 2px; +} + +.domain, +.file, +.worker, +.refresh, +.add-button { + position: relative; + top: 1px; +} + +.domain svg, +.folder svg, +.worker svg, +.refresh svg, +.add-button svg { + width: 15px; +} + +.file svg { + width: 13px; +} + +.file svg, +.domain svg, +.folder svg, +.refresh svg, +.worker svg { + margin-inline-end: 5px; +} + +.arrow svg { + fill: var(--theme-splitter-color); + margin-top: 3px; + transition: transform 0.25s ease; + width: 10px; +} + +html:not([dir="rtl"]) .arrow svg { + margin-right: 5px; + transform: rotate(-90deg); +} + +html[dir="rtl"] .arrow svg { + margin-left: 5px; + transform: rotate(90deg); +} + +/* TODO (Amit): html is just for specificity. keep it like this? */ +html .arrow.expanded svg { + transform: rotate(0deg); +} + +.arrow.hidden { + visibility: hidden; +} +.close-btn path { + fill: var(--theme-comment-alt); +} + +.close-btn .close { + cursor: pointer; + width: 14px; + height: 14px; + padding: 2px; + text-align: center; + margin-top: 2px; + line-height: 7px; + transition: all 0.25s easeinout; +} + +.close-btn .close svg { + width: 8px; +} + +.close-btn:hover { + display: block; +} + +.close-btn:hover .close { + background: var(--theme-selection-background); + border-radius: 2px; +} + +.close-btn:hover .close path { + fill: white; +} + +.close-btn-big { + padding: 11px; + margin-right: 7px; + width: 27px; + height: 40px; +} + +.close-btn-big .close { + cursor: pointer; + display: inline-block; + padding: 2px; + text-align: center; + transition: all 0.25s easeinout; + line-height: 100%; + width: 16px; + height: 16px; +} + +.close-btn-big .close svg { + width: 9px; + height: 9px; +} + +.close-btn-big .close:hover { + border-radius: 2px; +} + +.search-field { + width: calc(100% - 1px); + height: 27px; + background-color: var(--theme-toolbar-background); + border-bottom: 1px solid var(--theme-splitter-color); + padding-right: 10px; + display: flex; + flex-shrink: 0; +} + +.search-field.big { + height: 40px; + font-size: 14px; +} + +.search-field.big input { + font-size: 14px; +} + +.search-field i { + display: block; + padding: 0; + width: 16px; +} + +.search-field i svg { + width: 16px; +} + +.search-field.big input { + line-height: 40px; +} + +.search-field input { + border: none; + line-height: 30px; + background-color: var(--theme-toolbar-background); + color: var(--theme-body-color-inactive); + width: calc(100% - 38px); + flex: 1; +} + +.theme-dark .search-field input { + color: var(--theme-body-color-inactive); +} + +.search-field i.magnifying-glass, +.search-field i.sad-face { + padding: 6px; + width: 24px; +} + +.search-field.big i.magnifying-glass, +.search-field.big i.sad-face { + padding: 14px; + width: 40px; +} + +.search-field .magnifying-glass path, +.search-field .magnifying-glass ellipse { + stroke: var(--theme-splitter-color); +} + +.search-field ::-webkit-input-placeholder { + color: var(--theme-body-color-inactive); +} + +.search-field input::placeholder { + color: var(--theme-body-color-inactive); +} + +.search-field input:focus { + outline-width: 0; +} + +.search-field input.empty { + color: var(--theme-highlight-orange); +} + +.search-field.big .summary { + line-height: 40px; +} + +.search-field .summary { + line-height: 27px; + padding-right: 10px; + color: var(--theme-body-color-inactive); +} + +.result-list { + list-style: none; + width: 100%; + background-color: var(--theme-toolbar-background); + margin: 0px; + padding: 0px; + overflow: auto; +} + +.result-list.big { + max-height: calc(100% - 32px); +} + +.result-list * { + user-select: none; +} + +.result-list li { + color: var(--theme-body-color); + background-color: var(--theme-tab-toolbar-background); + padding: 4px 13px; + display: flex; + justify-content: space-between; +} + +.result-list li:first-child { + border-top: none; +} + +.result-list.big li { + padding: 10px; + flex-direction: column; + border-bottom: 1px solid var(--theme-splitter-color); +} + +.result-list li:hover { + background: var(--theme-tab-toolbar-background); + cursor: pointer; +} + +.result-list li.selected { + border: 1px solid var(--theme-selection-background); +} + +.result-list.big li.selected { + padding-left: 9px; + padding-top: 9px; +} + +.search-bar .result-list li.selected { + background-color: var(--theme-selection-background); + color: white; +} + +.result-list li .title { + line-height: 1.5em; + word-break: break-all; +} + +.result-list li.selected .title { + color: white; +} + +.result-list.big li.selected .title { + color: var(--theme-body-color); +} + +.result-list.big li .subtitle { + word-break: break-all; + color: var(--theme-body-color-inactive); +} + +.result-list.big li .subtitle { + line-height: 1.5em; +} + +.search-bar .result-list li.selected .subtitle { + color: white; +} + +.search-bar .result-list { + border-bottom: 1px solid var(--theme-splitter-color); +} + +.theme-dark .result-list { + background-color: var(--theme-body-background); +} + +.autocomplete { + flex: 1; + width: 100%; +} + +.autocomplete .no-result-msg { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + color: var(--theme-graphs-full-red); + font-size: 24px; + padding: 4px; + word-break: break-all; +} + +.autocomplete .no-result-msg .sad-face { + width: 24px; + margin: 0 4px; + line-height: 0; + flex-shrink: 0; +} + +.autocomplete .no-result-msg .sad-face svg { + fill: var(--theme-graphs-full-red); +} +.tree { + -webkit-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + + white-space: nowrap; + overflow: auto; + min-width: 100%; +} + +.tree button { + display: block; +} + +.tree .node { + padding: 2px 5px; + position: relative; + cursor: pointer; +} + +.tree .node.focused { + color: white; + background-color: var(--theme-selection-background); +} + +html:not([dir="rtl"]) .tree .node > div { + margin-left: 10px; +} + +html[dir="rtl"] .tree .node > div { + margin-right: 10px; +} + +.tree .node.focused svg { + fill: white; +} + +.tree-node button { + position: fixed; +} +.sources-panel { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; +} + +.sources-panel * { + user-select: none; +} + +.sources-header { + height: 30px; + border-bottom: 1px solid var(--theme-splitter-color); + padding-top: 0px; + padding-bottom: 0px; + line-height: 30px; + font-size: 1.2em; + display: flex; + align-items: baseline; + user-select: none; + justify-content: flex-end; +} + +.theme-dark .sources-header { + background-color: var(--theme-tab-toolbar-background); +} + +.sources-header { + padding-inline-start: 10px; +} + +.sources-header-info { + font-size: 12px; + color: var(--theme-comment-alt); + font-weight: lighter; + white-space: nowrap; + padding-inline-end: 10px; + cursor: pointer; +} + +.sources-list { + flex: 1; + display: flex; + overflow: hidden; +} + +.theme-dark .sources-list .tree .node:not(.focused) svg { + fill: var(--theme-comment); +} + +.theme-dark .source-list .tree .node.focused { + background-color: var(--theme-tab-toolbar-background); +} +.toggle-button-start, +.toggle-button-end { + transform: translate(0, 2px); + transition: transform 0.25s ease-in-out; + cursor: pointer; + padding: 4px 2px; +} + +.toggle-button-start svg, +.toggle-button-end svg { + width: 16px; + fill: var(--theme-comment); +} + +.theme-dark .toggle-button-start svg, +.theme-dark .toggle-button-end svg { + fill: var(--theme-comment-alt); +} + +.toggle-button-end { + margin-left: auto; + margin-right: 5px; +} + +.toggle-button-start { + margin-left: 5px; +} + +html:not([dir="rtl"]) .toggle-button-end svg, +html[dir="rtl"] .toggle-button-start svg { + transform: rotate(180deg); +} + +html .toggle-button-end.vertical svg { + transform: rotate(-90deg); +} + +.toggle-button-end.vertical { + margin-bottom: 2px; +} + +.toggle-button-start.collapsed, +.toggle-button-end.collapsed { + transform: rotate(180deg); +} + +.source-footer { + background: var(--theme-toolbar-background); + border-top: 1px solid var(--theme-splitter-color); + position: absolute; + display: flex; + bottom: 0; + left: 0; + right: 1px; + opacity: 1; + z-index: 100; + user-select: none; + height: 27px; + box-sizing: border-box; +} + +.source-footer .commands { + display: flex; +} + +.source-footer .commands * { + user-select: none; +} + +.source-footer > .commands > .action { + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + transition: opacity 200ms; + border: none; + background: transparent; + padding: 8px 0.7em; +} + +.source-footer > .commands > .action i { + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; +} + +:root.theme-dark .source-footer > .commands > .action { + fill: var(--theme-body-color); +} + +:root.theme-dark .source-footer > .commands > .action:hover { + fill: var(--theme-selection-color); +} + +.source-footer > .commands > .action svg { + height: 16px; + width: 16px; +} + +.source-footer .commands .coverage { + color: var(--theme-body-color); +} + +.coverage-on .source-footer .commands .coverage { + color: var(--theme-highlight-blue); + border: 1px solid var(--theme-body-color-inactive); + border-radius: 2px; +} + +.search-bar { + display: flex; + flex-direction: column; + max-height: 50%; +} + +.search-bar .search-field { + padding-left: 7px; +} + +.search-bar .close-btn { + padding: 6px; +} + +.search-bottom-bar * { + user-select: none; +} + +.search-bottom-bar { + display: flex; + flex-shrink: 0; + justify-content: space-between; + width: calc(100% - 1px); + height: 27px; + background-color: var(--theme-toolbar-background); + border-bottom: 1px solid var(--theme-splitter-color); + padding: 0 13px; +} + +.search-bottom-bar button:focus { + outline: none; +} + +.search-bottom-bar .search-modifiers { + display: flex; + align-items: center; +} + +.search-bottom-bar .search-modifiers button { + padding: 0 3px; + margin: 0 3px; + border: none; + background: none; + width: 20px; + height: 20px; + border-radius: 3px; +} + +.search-bottom-bar .search-modifiers button i { + display: flex; + justify-content: center; + align-items: center; + padding: 0; + width: 16px; +} + +.search-bottom-bar .search-modifiers button svg { + fill: var(--theme-comment-alt); + height: 16px; + width: 16px; +} + +.search-bottom-bar .search-modifiers button svg:hover { + cursor: pointer; +} + +.search-bottom-bar .search-modifiers button:active { + outline: none; +} + +.search-bottom-bar .search-modifiers button.active svg { + fill: var(--theme-selection-background); +} + +.theme-dark .search-bottom-bar .search-modifiers button.active svg { + fill: white; +} + +.search-bottom-bar .search-modifiers button.disabled svg { + fill: var(--theme-comment-alt); +} + +.search-bottom-bar .search-type-toggles { + display: flex; + align-items: center; +} + +.search-bottom-bar .search-type-toggles .search-toggle-title { + color: var(--theme-body-color-inactive); + font-size: 11px; + font-weight: normal; + margin: 0; +} + +.search-bottom-bar .search-type-toggles .search-type-btn { + margin: 0 6px; + border: none; + background: transparent; + color: var(--theme-comment-alt); +} + +.search-bottom-bar .search-type-toggles .search-type-btn:hover { + cursor: pointer; +} + +.search-bottom-bar .search-type-toggles .search-type-btn:active { + outline: none; +} + +.search-bottom-bar .search-type-toggles .search-type-btn.active { + color: var(--theme-selection-background); +} + +.theme-dark .search-bottom-bar .search-type-toggles .search-type-btn.active { + color: white; +} + +.search-bar .result-list { + max-height: 230px; +} +.popover { + position: fixed; + z-index: 4; +} + +.popover-gap { + height: 10px; + padding-top: 10px; +} + +.popover::before, +.popover::after { + content: ''; + height: 0; + width: 0; + position: absolute; + border: 10px solid transparent; + left: calc(20% - 10px); /* corresponds to calculation in Popover.js */ +} + +.popover::before { + border-bottom-color: var(--theme-comment); + top: -10px; +} + +.popover::after { + border-bottom-color: var(--theme-body-background); + top: -8px; +} +.preview { + background: var(--theme-body-background); + min-width: 200px; + min-height: 80px; + border: 1px solid var(--theme-comment); + padding: 10px; + height: auto; + min-height: inherit; + max-height: 130px; + overflow: auto; + max-width: 400px; +} + +.preview .header { + width: 100%; + line-height: 20px; + border-bottom: 1px solid #cccccc; + display: flex; + flex-direction: column; +} + +.preview .header .link { + align-self: flex-end; + color: var(--theme-highlight-blue); + text-decoration: underline; +} +.preview .header .link:hover { + cursor: pointer; +} + +.selected-token { + background-color: var(--theme-search-overlays-semitransparent); + color: var(--theme-selection-color); +} + +.selected-token:hover { + cursor: pointer; +} + +.preview .function-signature { + padding-top: 10px; +} + +.function-signature { + line-height: 20px; + align-self: center; +} + +.function-signature .function-name { + color: var(--theme-highlight-blue); +} + +.function-signature .param { + color: var(--string-color); +} + +.function-signature .paren { + color: var(--object-color); +} + +.function-signature .comma { + color: var(--object-color); +} + +.theme-dark .preview { + border-color: var(--theme-body-color); +} + +.theme-dark .preview .arrow svg { + fill: var(--theme-comment); +} +.conditional-breakpoint-panel { + cursor: initial; + margin: 1em 0; + position: relative; + display: flex; + align-items: center; + background: var(--theme-toolbar-background); + border-top: 1px solid var(--theme-splitter-color); + border-bottom: 1px solid var(--theme-splitter-color); +} + +.conditional-breakpoint-panel .prompt { + font-size: 1.8em; + color: var(--theme-comment-alt); + padding-left: 3px; +} + +.conditional-breakpoint-panel input { + margin: 5px 10px; + width: calc(100% - 4em); + border: none; + background: var(--theme-toolbar-background); + font-size: 14px; + color: var(--theme-comment); + line-height: 30px; +} + +.conditional-breakpoint-panel input:focus { + outline-width: 0; +} +/* vim:set ts=2 sw=2 sts=2 et: */ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * There's a known codemirror flex issue with chrome that this addresses. + * BUG https://github.com/devtools-html/debugger.html/issues/63 + */ +.editor-wrapper { + position: absolute; + height: calc(100% - 31px); + width: 100%; + top: 30px; + left: 0px; +} + +html[dir="rtl"] .editor-mount { + direction: ltr; +} + +.editor-wrapper .breakpoints { + position: absolute; + top: 0; + left: 0; +} + +.function-search { + max-height: 300px; + overflow: hidden; +} + +.function-search .results { + height: auto; +} + +.editor.hit-marker { + height: 14px; +} + +.coverage-on .CodeMirror-code :not(.hit-marker) .CodeMirror-line, +.coverage-on .CodeMirror-code :not(.hit-marker) .CodeMirror-gutter-wrapper { + opacity: 0.5; +} + +.editor.new-breakpoint svg { + fill: var(--theme-selection-background); + width: 60px; + height: 14px; + position: absolute; + top: 0px; + right: -4px; +} + +.new-breakpoint.has-condition svg { + fill: var(--theme-graphs-yellow); +} + +.editor.new-breakpoint.breakpoint-disabled svg { + opacity: 0.3; +} + +.CodeMirror { + width: 100%; + height: 100%; +} + +.editor-wrapper .editor-mount { + width: 100%; + height: calc(100% - 32px); + background-color: var(--theme-body-background); +} + +.search-bar ~ .editor-mount { + height: calc(100% - 72px); +} + +.CodeMirror-linenumber { + font-size: 11px; + line-height: 14px; +} + +/* set the linenumber white when there is a breakpoint */ +.new-breakpoint .CodeMirror-gutter-wrapper .CodeMirror-linenumber { + color: white; +} + +/* move the breakpoint below the linenumber */ +.new-breakpoint .CodeMirror-gutter-elt:last-child { + z-index: 0; +} + +.editor-wrapper .CodeMirror-line { + font-size: 11px; + line-height: 14px; +} + +.theme-dark .editor-wrapper .CodeMirror-line .cm-comment { + color: var(--theme-content-color3); +} + +.debug-line .CodeMirror-line { + background-color: var(--breakpoint-active-color) !important; +} + +/* Don't display the highlight color since the debug line + is already highlighted */ +.debug-line .CodeMirror-activeline-background { + display: none; +} + +.highlight-line .CodeMirror-line { + animation: fade-highlight-out 1.5s normal forwards; +} + +@keyframes fade-highlight-out { + 0% { background-color: var(--theme-highlight-gray); } + 100% { background-color: transparent; } +} + +.welcomebox { + width: calc(100% - 1px); + + /* Offsetting it by 30px for the sources-header area */ + height: calc(100% - 30px); + position: absolute; + top: 30px; + left: 0; + padding: 50px 0; + text-align: center; + font-size: 1.25em; + color: var(--theme-comment-alt); + background-color: var(--theme-tab-toolbar-background); + font-weight: lighter; + z-index: 100; + user-select: none; +} +.input-expression { + width: 100%; + margin: 0px; + border: 1px; + cursor: pointer; + background-color: var(--theme-body-background); + font-size: 12px; + padding: 0px 20px; + color: var(--theme-highlight-blue); +} + +.input-expression::-webkit-input-placeholder { + text-align: center; + font-style: italic; + color: var(--theme-comment-alt); +} + +.input-expression::placeholder { + text-align: center; + font-style: italic; + color: var(--theme-comment-alt); + opacity: 1; +} + +.input-expression:focus { + outline: none; + cursor: text; +} + +.expression-input-container { + padding: 0.5em; + display: flex; +} + +.expression-container { + border: 1px; + padding: 8px 5px 0px 0px; + width: 100%; + color: var(--theme-body-color); + background-color: var(--theme-body-background); + display: flex; + position: relative; +} + +.expression-container > .tree { + width: 100%; + overflow: hidden; +} + +:root.theme-light .expression-container:hover { + background-color: var(--theme-tab-toolbar-background); +} + +:root.theme-dark .expression-container:hover { + background-color: var(--search-overlays-semitransparent); +} + +.expression-container .close-btn { + position: absolute; + inset-inline-end: 6px; + top: 6px; +} + +.expression-container .close { + display: none; +} + +.expression-container:hover .close { + display: block; +} + +.expression-input { + cursor: pointer; + max-width: 50%; +} + +.expression-separator { + padding: 0px 5px; +} + +.expression-value { + overflow-x: scroll; + color: var(--theme-content-color2); + max-width: 50% !important; +} + +.expression-error { + color: var(--theme-highlight-red); +} + +.why-paused { + background-color: var(--breakpoint-active-color); + border: 1.7px solid var(--breakpoint-active-color); + color: var(--theme-highlight-blue); + padding: 10px 10px 10px 20px; + white-space: normal; + opacity: 0.9; + font-size: 12px; + font-weight: bold; + flex: 0 1 auto; +} + +.theme-dark .secondary-panes .why-paused { + color: white; +} +.breakpoints-list * { + user-select: none; +} + +.breakpoints-list .breakpoint { + font-size: 12px; + color: var(--theme-content-color1); + padding: 0.5em 1px; + line-height: 1em; + position: relative; + transition: all 0.25s ease; +} + +html[dir="rtl"] .breakpoints-list .breakpoint { + border-right: 4px solid transparent; +} + +html:not([dir="rtl"]) .breakpoints-list .breakpoint { + border-left: 4px solid transparent; +} + +.breakpoints-list .breakpoint:last-of-type { + padding-bottom: 0.45em; +} + +html:not([dir="rtl"]) .breakpoints-list .breakpoint.is-conditional { + border-left-color: var(--theme-graphs-yellow); +} + +html[dir="rtl"] .breakpoints-list .breakpoint.is-conditional { + border-right-color: var(--theme-graphs-yellow); +} + +html .breakpoints-list .breakpoint.paused { + background-color: var(--theme-toolbar-background-alt); + border-color: var(--breakpoint-active-color); +} + +.breakpoints-list .breakpoint.disabled .breakpoint-label { + color: var(--theme-content-color3); + transition: color 0.5s linear; +} + +.breakpoints-list .breakpoint:hover { + cursor: pointer; + background-color: var(--search-overlays-semitransparent); +} + +.breakpoints-list .breakpoint.paused:hover { + border-color: var(--breakpoint-active-color-hover); +} + +.breakpoints-list .breakpoint-checkbox { + margin-inline-start: 0; +} + +.breakpoints-list .breakpoint-label { + display: inline-block; + padding-inline-start: 2px; + padding-bottom: 4px; +} + +.breakpoints-list .pause-indicator { + flex: 0 1 content; + order: 3; +} + +:root.theme-light .breakpoint-snippet, +:root.theme-firebug .breakpoint-snippet { + color: var(--theme-comment); +} + +:root.theme-dark .breakpoint-snippet { + color: var(--theme-body-color); + opacity: 0.6; +} + +.breakpoint-snippet { + overflow: hidden; + text-overflow: ellipsis; + padding-inline-start: 18px; + padding-inline-end: 18px; +} + +.breakpoint .close-btn { + position: absolute; + inset-inline-end: 6px; + top: 12px; +} + +.breakpoint .close { + display: none; +} + +.breakpoint:hover .close { + display: block; +} + +.object-node.default-property { + opacity: 0.6; +} + +.object-label { + color: var(--theme-highlight-blue); +} + +.objectBox-object, +.objectBox-string, +.objectBox-text, +.objectBox-table, +.objectLink-textNode, +.objectLink-event, +.objectLink-eventLog, +.objectLink-regexp, +.objectLink-object, +.objectLink-Date, +.theme-dark .objectBox-object, +.theme-light .objectBox-object { + white-space: nowrap; +} + +.scopes-list .tree-node { + overflow: hidden; +} +.frames ul { + list-style: none; + margin: 0; + padding: 0; +} + +.frames ul li { + cursor: pointer; + padding: 7px 10px 7px 21px; + overflow: hidden; + display: flex; + justify-content: space-between; +} + +/* Style the focused call frame like so: +.frames ul li:focus { + border: 3px solid red; +} +*/ + +.frames ul li * { + user-select: none; +} + +.frames ul li:nth-of-type(2n) { + background-color: var(--theme-tab-toolbar-background); +} + +.frames .location { + font-weight: lighter; +} + +:root.theme-light .frames .location, +:root.theme-firebug .frames .location { + color: var(--theme-comment); +} + +:root.theme-dark .frames .location { + color: var(--theme-body-color); + opacity: 0.6; +} + +.frames .title { + text-overflow: ellipsis; + overflow: hidden; + margin-right: 1em; +} + +.frames ul li:hover, +.frames ul li:focus { + background-color: var(--theme-toolbar-background-alt); + outline: none; +} + +.frames ul li.selected { + background-color: var(--theme-selection-background); + color: white; +} + +:root.theme-light .frames ul li.selected .location, +:root.theme-firebug .frames ul li.selected .location, +:root.theme-dark .frames ul li.selected .location { + color: white; +} + +:root.theme-dark .frames ul li:hover .location, +:root.theme-dark .frames ul li.selected .location { + opacity: 1; +} + +.show-more { + cursor: pointer; + text-align: center; + padding: 8px 0px; + border-top: 1px solid var(--theme-splitter-color); + background-color: var(--theme-tab-toolbar-background); +} + +.show-more:hover { + background-color: var(--search-overlays-semitransparent); +} +.event-listeners { + list-style: none; + margin: 0; + padding: 0; +} + +.event-listeners .listener { + cursor: pointer; + padding: 7px 10px 7px 21px; + clear: both; + overflow: hidden; +} + +.event-listeners .listener * { + user-select: none; +} + +.event-listeners .listener:nth-of-type(2n) { + background-color: var(--theme-tab-toolbar-background); +} + +.event-listeners .listener .type { + color: var(--theme-highlight-bluegrey); + padding-right: 5px; +} + +.event-listeners .listener .selector { + color: var(--theme-content-color2); +} + +.event-listeners .listener-checkbox { + margin-left: 0; +} + +.event-listeners .listener .close-btn { + float: right; +} + +.event-listeners .listener .close { + display: none; +} + +.event-listeners .listener:hover .close { + display: block; +} +.accordion { + background-color: var(--theme-body-background); + width: 100%; +} + +.accordion ._header { + background-color: var(--theme-toolbar-background); + border-bottom: 1px solid var(--theme-splitter-color); + cursor: pointer; + font-size: 12px; + padding: 5px; + transition: all 0.25s ease; + width: 100%; + + -webkit-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.accordion ._header { + display: flex; +} + +.accordion ._header:hover { + background-color: var(--search-overlays-semitransparent); +} + +.accordion ._header button svg, +.accordion ._header:hover button svg { + fill: currentColor; + height: 16px; +} + +.accordion ._content { + border-bottom: 1px solid var(--theme-splitter-color); + font-size: 12px; +} + +.accordion ._header .header-buttons { + display: flex; + margin-left: auto; + padding-right: 5px; +} + +.accordion .header-buttons .add-button { + font-size: 180%; + text-align: center; + line-height: 16px; +} + +.accordion .header-buttons button { + color: var(--theme-body-color); + border: none; + background: none; + outline: 0; + padding: 0; + width: 16px; + height: 16px; +} + +.accordion .header-buttons button::-moz-focus-inner { + border: none; +} +.command-bar { + flex: 0 0 30px; + border-bottom: 1px solid var(--theme-splitter-color); + display: flex; + height: 30px; + overflow: hidden; + position: sticky; + top: 0; + z-index: 1; + background-color: var(--theme-body-background); +} + +.theme-dark .command-bar { + background-color: var(--theme-tab-toolbar-background); +} + +.command-bar > button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: transparent; + border: none; + cursor: pointer; + display: inline-block; + text-align: center; + transition: all 0.25s ease; + padding: 8px 5px; + position: relative; + fill: currentColor; +} + +:root.theme-dark .command-bar > button { + color: var(--theme-body-color); +} + +.command-bar > button { + margin-inline-end: 0.7em; +} + +html .command-bar > button:disabled { + opacity: 0.3; + cursor: default; +} + +.command-bar > button > i { + height: 100%; + width: 100%; + display: block; +} + +.command-bar > button > i > svg { + width: 16px; + height: 16px; +} + +.command-bar button.pause-exceptions { + margin-inline-start: 0.5em; +} + +.command-bar .subSettings { + float: right; +} + +.command-bar button.pause-exceptions.uncaught { + color: var(--theme-highlight-purple); +} + +.command-bar button.pause-exceptions.all { + color: var(--theme-highlight-blue); +} +.secondary-panes { + display: flex; + flex-direction: column; + flex: 1; + white-space: nowrap; +} + +.secondary-panes * { + user-select: none; +} + +.secondary-panes .accordion { + overflow-y: auto; + overflow-x: hidden; + flex: 1 0 auto; +} + +.pane { + color: var(--theme-body-color); +} + +.pane .pane-info { + font-style: italic; + text-align: center; + padding: 0.5em; + user-select: none; +} + +.theme-dark .secondary-panes .accordion .arrow svg { + fill: var(--theme-comment); +} +.welcomebox { + width: calc(100% - 1px); + + /* Offsetting it by 30px for the sources-header area */ + height: calc(100% - 30px); + position: absolute; + top: 30px; + left: 0; + padding: 50px 0 0 0; + text-align: center; + font-size: 1.25em; + color: var(--theme-comment-alt); + background-color: var(--theme-tab-toolbar-background); + font-weight: lighter; + z-index: 100; +} + +html .welcomebox .toggle-button-end { + bottom: 11px; + position: absolute; + top: auto; +} +.dropdown { + --width: 150px; + background: var(--theme-body-background); + border: 1px solid var(--theme-splitter-color); + box-shadow: 0 4px 4px 0 var(--search-overlays-semitransparent); + max-height: 300px; + position: absolute; + right: 8px; + top: 35px; + width: var(--width); + z-index: 1000; +} + +html[dir="rtl"] .dropdown { + right: calc((var(--width) - 11px) * (-1)); +} + +.dropdown-block { + padding: 0px 2px; + position: relative; + align-self: center; +} + +.dropdown-button { + cursor: pointer; + color: var(--theme-comment); + background: none; + border: none; + padding: 0; + font-weight: 100; + margin-top: 6px; + font-size: 14px; +} + +.dropdown li { + transition: all 0.25s ease; + padding: 2px 10px 10px 5px; + overflow: hidden; + height: 30px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dropdown li:hover { + background-color: var(--search-overlays-semitransparent); + cursor: pointer; +} + +.dropdown ul { + list-style: none; + line-height: 2em; + font-size: 1em; + margin: 0; + padding: 0; +} + +.dropdown-mask { + position: fixed; + width: 100%; + height: 100%; + background: transparent; + z-index: 999; + left: 0; + top: 0; +} +.source-header { + border-bottom: 1px solid var(--theme-splitter-color); + width: 100%; + height: 30px; + display: flex; + align-items: flex-end; +} + +.source-header * { + user-select: none; +} + +.source-header .new-tab-btn { + padding: 0px 4px; + margin-top: 8px; + cursor: pointer; + fill: var(--theme-comment); + transition: 0.1s ease; + align-self: center; +} + +.source-header .new-tab-btn svg { + width: 12px; +} + +.source-tabs { + max-width: calc(100% - 80px); + align-self: flex-start; +} + +.source-tab { + border: 1px solid transparent; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + height: 30px; + display: inline-flex; + align-items: center; + position: relative; + transition: all 0.25s ease; + min-width: 40px; + overflow: hidden; + padding: 6px; + margin-inline-start: 3px; + margin-top: 2px; +} + +.source-tab:hover { + background-color: var(--theme-toolbar-background-alt); + border-color: var(--theme-splitter-color); + cursor: pointer; +} + +.source-tab.active { + color: var(--theme-body-color); + background-color: var(--theme-body-background); + border-color: var(--theme-splitter-color); + border-bottom-color: transparent; +} + +.source-tab.active path, +.source-tab:hover path { + fill: var(--theme-body-color); +} + +.source-tab .prettyPrint { + line-height: 0; +} + +.source-tab .prettyPrint svg { + height: 12px; + width: 12px; +} + +.source-tab .prettyPrint path { + fill: var(--theme-textbox-box-shadow); +} + +.source-tab .filename { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.source-tab.pretty .filename { + padding-inline-start: 8px; +} + +.source-tab .close-btn { + visibility: hidden; + line-height: 0; + margin-inline-start: 6px; +} + +.source-tab.active .close-btn { + visibility: visible; +} + +.source-tab:hover .close-btn { + visibility: visible; +} + +.source-tab .close-btn .close { + padding: 0; + margin-top: 0; + display: inline-flex; + justify-content: center; +} diff --git a/layout/style/test/gtest/generate_example_stylesheet.py b/layout/style/test/gtest/generate_example_stylesheet.py new file mode 100644 index 0000000000..5c69f5c702 --- /dev/null +++ b/layout/style/test/gtest/generate_example_stylesheet.py @@ -0,0 +1,16 @@ +def main(output, stylesheet): + css = open(stylesheet, "r").read() + css = ( + css.replace("\\", "\\\\") + .replace("\r", "\\r") + .replace("\n", "\\n") + .replace('"', '\\"') + ) + + # Work around "error C2026: string too big" + # https://msdn.microsoft.com/en-us/library/dddywwsc.aspx + chunk_size = 10000 + chunks = ('"%s"' % css[i : i + chunk_size] for i in range(0, len(css), chunk_size)) + + header = "#define EXAMPLE_STYLESHEET " + " ".join(chunks) + output.write(header) diff --git a/layout/style/test/gtest/moz.build b/layout/style/test/gtest/moz.build new file mode 100644 index 0000000000..aa3adbc9ab --- /dev/null +++ b/layout/style/test/gtest/moz.build @@ -0,0 +1,24 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +Library("style-gtest") + +UNIFIED_SOURCES = [ + "ImportScannerTest.cpp", + "StyloParsingBench.cpp", +] + +LOCAL_INCLUDES += [ + "/layout/style", +] + +GeneratedFile( + "ExampleStylesheet.h", + script="generate_example_stylesheet.py", + inputs=["example.css"], +) + +FINAL_LIBRARY = "xul-gtest" diff --git a/layout/style/test/mapped.css b/layout/style/test/mapped.css new file mode 100644 index 0000000000..7aebaecc82 --- /dev/null +++ b/layout/style/test/mapped.css @@ -0,0 +1,3 @@ +div { + color: #f06; +} diff --git a/layout/style/test/mapped.css^headers^ b/layout/style/test/mapped.css^headers^ new file mode 100644 index 0000000000..3b74491556 --- /dev/null +++ b/layout/style/test/mapped.css^headers^ @@ -0,0 +1 @@ +X-SourceMap: mapped.css.map diff --git a/layout/style/test/mapped2.css b/layout/style/test/mapped2.css new file mode 100644 index 0000000000..fc42a5abef --- /dev/null +++ b/layout/style/test/mapped2.css @@ -0,0 +1,4 @@ +span { + color: #f06; +} +//# sourceMappingURL: overridden-by-headers diff --git a/layout/style/test/mapped2.css^headers^ b/layout/style/test/mapped2.css^headers^ new file mode 100644 index 0000000000..1656e66589 --- /dev/null +++ b/layout/style/test/mapped2.css^headers^ @@ -0,0 +1,2 @@ +SourceMap: mapped2.css.map +X-SourceMap: ignored.css.map diff --git a/layout/style/test/media_queries_iframe.html b/layout/style/test/media_queries_iframe.html new file mode 100644 index 0000000000..141ecdcd94 --- /dev/null +++ b/layout/style/test/media_queries_iframe.html @@ -0,0 +1,15 @@ + + + + Media Queries Test inner frame + + + + + + + + diff --git a/layout/style/test/media_queries_iframe2.html b/layout/style/test/media_queries_iframe2.html new file mode 100644 index 0000000000..8768cd53c6 --- /dev/null +++ b/layout/style/test/media_queries_iframe2.html @@ -0,0 +1,37 @@ + + + + Media Queries Test inner frame + + + + + + + + + + + + diff --git a/layout/style/test/mochitest.toml b/layout/style/test/mochitest.toml new file mode 100644 index 0000000000..9df86ea539 --- /dev/null +++ b/layout/style/test/mochitest.toml @@ -0,0 +1,783 @@ +[DEFAULT] +prefs = [ + "dom.animations-api.compositing.enabled=true", + "dom.animations-api.timelines.enabled=true", + "gfx.omta.background-color=true", + "gfx.font_loader.delay=0", + "layout.css.container-queries.enabled=true", + "layout.css.individual-transform.enabled=true", + "layout.css.motion-path-ray.enabled=true", + "layout.css.motion-path-basic-shapes.enabled=true", + "layout.css.motion-path-coord-box.enabled=true", + "layout.css.motion-path-offset-position.enabled=true", + "layout.css.motion-path-url.enabled=true", + "layout.css.backdrop-filter.enabled=true", + "layout.css.fit-content-function.enabled=true", + "layout.css.scroll-driven-animations.enabled=true", + "layout.css.animation-composition.enabled=true", + "layout.css.basic-shape-rect.enabled=true", + "layout.css.basic-shape-xywh.enabled=true", + "layout.css.transform-box-content-stroke.enabled=true", +] +support-files = [ + "animation_utils.js", + "bug1729861.js", + "ccd-quirks.html", + "ccd.sjs", + "ccd-standards.html", + "chrome/bug418986-2.js", + "chrome/match.png", + "chrome/mismatch.png", + "descriptor_database.js", + "!/dom/events/test/event_leak_utils.js", + "empty.html", + "file_computed_style_bfcache_display_none.html", + "file_computed_style_bfcache_display_none2.html", + "media_queries_iframe.html", + "media_queries_iframe2.html", + "neverending_font_load.sjs", + "neverending_stylesheet_load.sjs", + "post-redirect-1.css", + "post-redirect-2.css", + "post-redirect-3.css", + "property_database.js", + "redirect.sjs", + "style_attribute_tests.js", + "support/blue-100x100.png", + "support/1x1-transparent.png", + "unstyled.css", + "unstyled-frame.css", + "unstyled-frame.xml", + "unstyled.xml", + "viewport_units_iframe.html", + "visited_image_loading_frame_empty.html", + "visited_image_loading_frame.html", + "visited_image_loading.sjs", + "visited-lying-inner.html", + "visited-pref-iframe.html", +] + +["test_acid3_test46.html"] + +["test_addSheet.html"] +support-files = ["additional_sheets_helper.html"] + +["test_additional_sheets.html"] +support-files = ["additional_sheets_helper.html"] + +["test_align_justify_computed_values.html"] + +["test_all_shorthand.html"] + +["test_animations.html"] + +["test_animations_async_tests.html"] +support-files = [ + "Ahem.ttf", + "file_animations_async_tests.html", +] + +["test_animations_dynamic_changes.html"] + +["test_animations_effect_timing_duration.html"] + +["test_animations_effect_timing_enddelay.html"] + +["test_animations_effect_timing_iterations.html"] + +["test_animations_event_handler_attribute.html"] + +["test_animations_event_order.html"] + +["test_animations_iterationstart.html"] + +["test_animations_omta.html"] + +["test_animations_omta_scroll.html"] +support-files = ["file_animations_omta_scroll.html"] + +["test_animations_omta_scroll_rtl.html"] +support-files = ["file_animations_omta_scroll_rtl.html"] + +["test_animations_omta_start.html"] + +["test_animations_pausing.html"] + +["test_animations_playbackrate.html"] + +["test_animations_reverse.html"] + +["test_animations_styles_on_event.html"] + +["test_animations_variable_changes.html"] + +["test_animations_with_disabled_properties.html"] +support-files = ["file_animations_with_disabled_properties.html"] + +["test_any_dynamic.html"] + +["test_area_url_cursor.html"] + +["test_asyncopen.html"] + +["test_at_rule_parse_serialize.html"] + +["test_attribute_selector_eof_behavior.html"] + +["test_backdrop_filter_enabled_state.html"] + +["test_background_blend_mode.html"] + +["test_border_device_pixel_rounding_initial_style.html"] + +["test_box_size_keywords.html"] + +["test_bug73586.html"] + +["test_bug74880.html"] + +["test_bug98997.html"] + +["test_bug160403.html"] + +["test_bug200089.html"] + +["test_bug221428.html"] + +["test_bug229915.html"] + +["test_bug302186.html"] + +["test_bug319381.html"] + +["test_bug357614.html"] + +["test_bug363146.html"] + +["test_bug372770.html"] + +["test_bug373293.html"] + +["test_bug377947.html"] + +["test_bug379440.html"] + +["test_bug379741.html"] + +["test_bug382027.html"] + +["test_bug383075.html"] + +["test_bug387615.html"] + +["test_bug389464.html"] + +["test_bug391034.html"] + +["test_bug391221.html"] + +["test_bug397427.html"] +fail-if = ["xorigin"] +skip-if = [ + "http3", + "http2", +] + +["test_bug399349.html"] + +["test_bug401046.html"] +skip-if = ["true"] # Bug 701060 + +["test_bug405818.html"] + +["test_bug412901.html"] + +["test_bug413958.html"] + +["test_bug418986-2.html"] + +["test_bug437915.html"] + +["test_bug450191.html"] + +["test_bug470769.html"] + +["test_bug499655.html"] + +["test_bug499655.xhtml"] + +["test_bug517224.html"] +support-files = ["bug517224.sjs"] + +["test_bug524175.html"] + +["test_bug525952.html"] + +["test_bug534804.html"] + +["test_bug573255.html"] + +["test_bug580685.html"] + +["test_bug621351.html"] + +["test_bug635286.html"] + +["test_bug645998.html"] +support-files = [ + "file_bug645998-1.css", + "file_bug645998-2.css", +] + +["test_bug652486.html"] + +["test_bug657143.html"] + +["test_bug667520.html"] + +["test_bug716226.html"] + +["test_bug732153.html"] + +["test_bug732209.html"] +support-files = ["bug732209-css.sjs"] +skip-if = [ + "http3", + "http2", +] + +["test_bug765590.html"] + +["test_bug771043.html"] + +["test_bug795520.html"] + +["test_bug798843_pref.html"] + +["test_bug829816.html"] +support-files = ["file_bug829816.css"] + +["test_bug874919.html"] + +["test_bug887741_at-rules_in_declaration_lists.html"] + +["test_bug892929.html"] + +["test_bug1055933.html"] +support-files = ["file_bug1055933_circle-xxl.png"] + +["test_bug1089417.html"] +support-files = ["file_bug1089417_iframe.html"] + +["test_bug1112014.html"] + +["test_bug1203766.html"] + +["test_bug1232829.html"] + +["test_bug1292447.html"] + +["test_bug1330375.html"] + +["test_bug1371488.html"] + +["test_bug1375944.html"] +support-files = [ + "file_bug1375944.html", + "Ahem.ttf", +] + +["test_bug1382568.html"] +support-files = ["bug1382568-iframe.html"] + +["test_bug1394302.html"] + +["test_bug1443344-1.html"] +scheme = "https" +support-files = ["file_bug1443344.css"] + +["test_bug1443344-2.html"] +scheme = "https" +support-files = ["file_bug1443344.css"] + +["test_bug1451199-1.html"] + +["test_bug1451199-2.html"] + +["test_bug1490890.html"] + +["test_bug1505254.html"] + +["test_bug1729861.html"] + +["test_cascade.html"] + +["test_ch_ex_no_infloops.html"] + +["test_change_hint_optimizations.html"] + +["test_clip-path_polygon.html"] + +["test_color_rounding.html"] + +["test_compute_data_with_start_struct.html"] +skip-if = ["os == 'android'"] + +["test_computed_style.html"] + +["test_computed_style_bfcache_display_none.html"] + +["test_computed_style_difference.html"] + +["test_computed_style_grid_with_pseudo.html"] + +["test_computed_style_in_created_document.html"] + +["test_computed_style_min_size_auto.html"] + +["test_computed_style_no_flush.html"] + +["test_computed_style_no_pseudo.html"] + +["test_computed_style_prefs.html"] + +["test_condition_text.html"] + +["test_constructable_stylesheets_chrome_only_rules_in_content.html"] + +["test_counter_descriptor_storage.html"] + +["test_counter_style.html"] + +["test_crash_with_content_policy.html"] +support-files = ["file_bug1381233.html"] + +["test_css_cross_domain.html"] +skip-if = [ + "http3", + "http2", + "socketprocess_networking", +] + +["test_css_cross_domain_no_orb.html"] +skip-if = [ + "http3", + "http2", +] + +["test_css_eof_handling.html"] + +["test_css_escape_api.html"] + +["test_css_function_mismatched_parenthesis.html"] + +["test_css_loader_crossorigin_data_url.html"] + +["test_css_parse_error_smoketest.html"] + +["test_css_supports.html"] + +["test_css_supports_variables.html"] + +["test_cue_restrictions.html"] + +["test_custom_content_inheritance.html"] + +["test_default_bidi_css.html"] + +["test_default_computed_style.html"] + +["test_descriptor_storage.html"] + +["test_descriptor_syntax_errors.html"] + +["test_display_mode.html"] +skip-if = [ + "http3", + "http2", +] + +["test_dont_use_document_colors.html"] + +["test_dont_use_document_fonts.html"] + +["test_dynamic_change_causing_reflow.html"] + +["test_exposed_prop_accessors.html"] + +["test_extra_inherit_initial.html"] + +["test_first_letter_restrictions.html"] + +["test_first_line_restrictions.html"] + +["test_flexbox_child_display_values.xhtml"] + +["test_flexbox_flex_grow_and_shrink.html"] + +["test_flexbox_flex_shorthand.html"] + +["test_flexbox_focus_order.html"] + +["test_flexbox_layout.html"] +support-files = ["flexbox_layout_testcases.js"] + +["test_flexbox_order.html"] + +["test_flexbox_order_abspos.html"] + +["test_flexbox_order_table.html"] + +["test_flexbox_reflow_counts.html"] +skip-if = ["verify"] + +["test_flushing_frame.html"] + +["test_font_face_cascade.html"] + +["test_font_face_parser.html"] + +["test_font_family_parsing.html"] + +["test_font_family_serialization.html"] + +["test_font_loading_api.html"] +support-files = [ + "BitPattern.woff", + "file_font_loading_api_vframe.html", +] +# This test checks font loading state. When loaded second time, fonts may be +# loaded synchronously, causing this test to fail in test-verify task. +skip-if = [ + "verify", # Bug 1455824 + "os == 'android'", # Bug 1455824 + "http3", + "http2", +] + +["test_garbage_at_end_of_declarations.html"] + +["test_grid_computed_values.html"] + +["test_grid_container_shorthands.html"] + +["test_grid_item_shorthands.html"] + +["test_grid_shorthand_serialization.html"] + +["test_group_insertRule.html"] + +["test_hover_on_part.html"] + +["test_hover_quirk.html"] + +["test_html_attribute_computed_values.html"] + +["test_ident_escaping.html"] + +["test_img_src_causing_reflow.html"] + +["test_import_preload.html"] +support-files = ["slow_load.sjs"] +# Test is slightly racy and on Android it fails frequently enough to be +# annoying. +skip-if = ["os == 'android'"] + +["test_inherit_computation.html"] + +["test_inherit_storage.html"] + +["test_initial_computation.html"] + +["test_initial_storage.html"] + +["test_invalidation_basic.html"] + +["test_keyframes_rules.html"] + +["test_keyframes_vendor_prefix.html"] + +["test_load_events_on_stylesheets.html"] +support-files = [ + "slow_broken_sheet.sjs", + "slow_ok_sheet.sjs", +] + +["test_logical_properties.html"] + +["test_marker_restrictions.html"] + +["test_mask_image_CORS.html"] + +["test_media_queries.html"] +# times out on verify, see bug 1461033. +skip-if = ["verify"] +support-files = ["chrome/chrome-only-media-queries.js"] + +["test_media_queries_dynamic.html"] +skip-if = ["xorigin"] # Crashes, Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110, [Child][MessageChannel] Error: (msgtype=0xFFF7,name=) Channel error: cannot send/recv + +["test_media_query_list.html"] + +["test_media_query_serialization.html"] + +["test_moz_device_pixel_ratio.html"] + +["test_moz_prefixed_cursor.html"] + +["test_mq_any_hover_and_any_pointer.html"] + +["test_mq_changes_in_iframe.html"] +support-files = ["mq_changes_child.html"] +skip-if = [ + "headless", + "os == 'win'", +] + +["test_mq_hover_and_pointer.html"] + +["test_mq_prefers_contrast_dynamic.html"] +skip-if = [ + "headless", + "os == 'win'", +] + +["test_mq_prefers_reduced_motion_dynamic.html"] +skip-if = [ + "headless", + "os == 'win'", +] + +["test_mql_event_listener_leaks.html"] + +["test_namespace_rule.html"] + +["test_non_content_accessible_env_vars.html"] + +["test_non_content_accessible_properties.html"] + +["test_non_content_accessible_pseudos.html"] + +["test_non_content_accessible_values.html"] + +["test_non_matching_sheet_media.html"] + +["test_of_type_selectors.xhtml"] + +["test_overscroll_behavior_pref.html"] + +["test_page_parser.html"] + +["test_parse_eof.html"] + +["test_parse_ident.html"] + +["test_parse_rule.html"] + +["test_parse_url.html"] + +["test_parser_diagnostics_unprintables.html"] + +["test_pixel_lengths.html"] + +["test_placeholder_restrictions.html"] + +["test_pointer-events.html"] + +["test_position_float_display.html"] + +["test_position_sticky.html"] + +["test_prefers_contrast_color_pairs.html"] + +["test_priority_preservation.html"] + +["test_property_database.html"] + +["test_property_syntax_errors.html"] + +["test_pseudo_display_fixup.html"] + +["test_pseudoelement_parsing.html"] + +["test_pseudoelement_state.html"] +skip-if = ["verify && debug && os == 'linux'"] + +["test_query_container_for.html"] + +["test_redundant_font_download.html"] +support-files = ["redundant_font_download.sjs"] + +["test_reframe_cb.html"] + +["test_reframe_image_loading.html"] + +["test_reframe_input.html"] + +["test_reframe_pseudo_element.html"] + +["test_rem_unit.html"] + +["test_restyle_table_wrapper.html"] + +["test_restyles_in_smil_animation.html"] + +["test_revert.html"] + +["test_root_node_display.html"] + +["test_rule_insertion.html"] + +["test_rules_out_of_sheets.html"] + +["test_selectors.html"] + +["test_setPropertyWithNull.html"] +skip-if = ["xorigin && debug"] + +["test_shape_outside_CORS.html"] + +["test_shared_sheet_caching.html"] +support-files = [ + "file_shared_sheet_caching.css", + "file_shared_sheet_caching.html", +] +fail-if = ["xorigin"] + +["test_sheet_privilege.html"] + +["test_shorthand_property_getters.html"] + +["test_specified_value_serialization.html"] +support-files = ["file_specified_value_serialization_individual_transforms.html"] + +["test_style_attr_listener.html"] + +["test_style_attribute_quirks.html"] + +["test_style_attribute_standards.html"] + +["test_style_struct_copy_constructors.html"] + +["test_stylesheet_additions.html"] + +["test_stylesheet_clone_font_face.html"] + +["test_supports_rules.html"] + +["test_system_font_serialization.html"] + +["test_text_decoration_shorthands.html"] + +["test_transitions.html"] + +["test_transitions_and_reframes.html"] + +["test_transitions_and_restyles.html"] + +["test_transitions_and_zoom.html"] + +["test_transitions_at_start.html"] + +["test_transitions_bug537151.html"] + +["test_transitions_cancel_near_end.html"] + +["test_transitions_computed_value_combinations.html"] + +["test_transitions_computed_values.html"] + +["test_transitions_dynamic_changes.html"] + +["test_transitions_events.html"] + +["test_transitions_per_property.html"] + +["test_transitions_replacement_on_busy_frame.html"] + +["test_transitions_replacement_with_setKeyframes.html"] + +["test_transitions_step_functions.html"] + +["test_unclosed_parentheses.html"] + +["test_unicode_range_loading.html"] +support-files = [ + "../../reftests/fonts/markA.woff", + "../../reftests/fonts/markB.woff", + "../../reftests/fonts/markC.woff", + "../../reftests/fonts/markD.woff", +] + +["test_units_angle.html"] + +["test_units_frequency.html"] + +["test_units_length.html"] + +["test_units_time.html"] + +["test_use_counters.html"] +skip-if = ["!nightly_build"] + +["test_user_sheet_shadow_dom.html"] + +["test_value_cloning.html"] +# This test requires too much memory on TSan (bug 1612707) +# See bug 775227 for android +skip-if = [ + "os == 'android'", + "tsan", +] + +["test_value_computation.html"] +# This test requires too much memory on TSan (bug 1612707) +skip-if = ["tsan"] + +["test_value_storage.html"] + +["test_variable_serialization_computed.html"] + +["test_variable_serialization_specified.html"] + +["test_variables.html"] +support-files = ["support/external-variable-url.css"] +skip-if = [ + "http3", + "http2", +] + +["test_variables_loop.html"] + +["test_variables_order.html"] +support-files = ["support/external-variable-url.css"] + +["test_video_object_fit.html"] + +["test_viewport_scrollbar_causing_reflow.html"] +skip-if = ["verify && (os == 'win' || os == 'mac')"] + +["test_viewport_units.html"] + +["test_visited_image_loading.html"] +skip-if = ["os == 'android'"] # TIMED_OUT for android + +["test_visited_image_loading_empty.html"] +skip-if = ["os == 'android'"] # TIMED_OUT for android + +["test_visited_lying.html"] +skip-if = ["os == 'android'"] # TIMED_OUT for android +fail-if = ["xorigin"] + +["test_visited_pref.html"] +skip-if = ["os == 'android'"] # TIMED_OUT for android +fail-if = ["xorigin"] + +["test_visited_reftests.html"] +skip-if = ["os == 'android'"] # TIMED_OUT for android + +["test_webkit_device_pixel_ratio.html"] +skip-if = ["xorigin"] # process crash: Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110 + +["test_webkit_flex_display.html"] +skip-if = ["xorigin"] # Crashes, Assertion failure: mInFlightProcessId == 0, at /builds/worker/checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:110 diff --git a/layout/style/test/moz.build b/layout/style/test/moz.build new file mode 100644 index 0000000000..ee826be9ed --- /dev/null +++ b/layout/style/test/moz.build @@ -0,0 +1,152 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# ** Note: The comment below along with the CPP_UNIT_TESTS and LIBS variables +# ** were commented out in the original Makefile.in, and should be restored +# ** some day, perhaps as a gtest. +# +# ParseCSS.cpp used to be built as a test program, but it was not +# being used for anything, and recent changes to the CSS loader have +# made it fail to link. Further changes are planned which should make +# it buildable again. + +DIRS += ["gtest"] + +HostSimplePrograms( + [ + "host_ListCSSProperties", + ] +) + +MOCHITEST_MANIFESTS += [ + "mochitest.toml", +] +BROWSER_CHROME_MANIFESTS += ["browser.toml"] +MOCHITEST_CHROME_MANIFESTS += ["chrome/chrome.toml"] + +TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test.chrome += [ + "chrome/display_mode_reflow_iframe.html", + "chrome/moz_document_helper.html", + "media_queries_iframe.html", +] + +TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test["css-visited"] += [ + "/layout/reftests/css-visited/border-1-ref.html", + "/layout/reftests/css-visited/border-1.html", + "/layout/reftests/css-visited/border-2-ref.html", + "/layout/reftests/css-visited/border-2a.html", + "/layout/reftests/css-visited/border-2b.html", + "/layout/reftests/css-visited/border-collapse-1-ref.html", + "/layout/reftests/css-visited/border-collapse-1.html", + "/layout/reftests/css-visited/caret-color-on-visited-1-ref.html", + "/layout/reftests/css-visited/caret-color-on-visited-1.html", + "/layout/reftests/css-visited/color-choice-1-ref.html", + "/layout/reftests/css-visited/color-choice-1.html", + "/layout/reftests/css-visited/color-on-bullets-1-ref.html", + "/layout/reftests/css-visited/color-on-bullets-1.html", + "/layout/reftests/css-visited/color-on-link-1-ref.html", + "/layout/reftests/css-visited/color-on-link-1.html", + "/layout/reftests/css-visited/color-on-link-before-1.html", + "/layout/reftests/css-visited/color-on-text-decoration-1-ref.html", + "/layout/reftests/css-visited/color-on-text-decoration-1.html", + "/layout/reftests/css-visited/color-on-visited-1-ref.html", + "/layout/reftests/css-visited/color-on-visited-1.html", + "/layout/reftests/css-visited/color-on-visited-before-1.html", + "/layout/reftests/css-visited/color-on-visited-text-1-ref.html", + "/layout/reftests/css-visited/color-on-visited-text-1.html", + "/layout/reftests/css-visited/column-rule-1-notref.html", + "/layout/reftests/css-visited/column-rule-1-ref.html", + "/layout/reftests/css-visited/column-rule-1.html", + "/layout/reftests/css-visited/content-before-1-ref.html", + "/layout/reftests/css-visited/content-color-on-link-before-1-ref.html", + "/layout/reftests/css-visited/content-color-on-link-before-1.html", + "/layout/reftests/css-visited/content-color-on-visited-before-1-ref.html", + "/layout/reftests/css-visited/content-color-on-visited-before-1.html", + "/layout/reftests/css-visited/content-on-link-before-1.html", + "/layout/reftests/css-visited/content-on-visited-before-1.html", + "/layout/reftests/css-visited/first-line-1-ref.html", + "/layout/reftests/css-visited/first-line-1.html", + "/layout/reftests/css-visited/inherit-keyword-1-ref.html", + "/layout/reftests/css-visited/inherit-keyword-1.xhtml", + "/layout/reftests/css-visited/link-root-1-ref.xhtml", + "/layout/reftests/css-visited/link-root-1.xhtml", + "/layout/reftests/css-visited/logical-box-border-color-visited-link-001.html", + "/layout/reftests/css-visited/logical-box-border-color-visited-link-002.html", + "/layout/reftests/css-visited/logical-box-border-color-visited-link-003.html", + "/layout/reftests/css-visited/logical-box-border-color-visited-link-ref.html", + "/layout/reftests/css-visited/mathml-links-ref.html", + "/layout/reftests/css-visited/mathml-links.html", + "/layout/reftests/css-visited/outline-1-ref.html", + "/layout/reftests/css-visited/outline-1.html", + "/layout/reftests/css-visited/placeholder-1-ref.html", + "/layout/reftests/css-visited/placeholder-1.html", + "/layout/reftests/css-visited/selector-adj-sibling-1-ref.html", + "/layout/reftests/css-visited/selector-adj-sibling-1.html", + "/layout/reftests/css-visited/selector-adj-sibling-2-ref.html", + "/layout/reftests/css-visited/selector-adj-sibling-2.html", + "/layout/reftests/css-visited/selector-adj-sibling-3-ref.xhtml", + "/layout/reftests/css-visited/selector-adj-sibling-3.xhtml", + "/layout/reftests/css-visited/selector-any-sibling-1-ref.html", + "/layout/reftests/css-visited/selector-any-sibling-1.html", + "/layout/reftests/css-visited/selector-any-sibling-2-ref.html", + "/layout/reftests/css-visited/selector-any-sibling-2.html", + "/layout/reftests/css-visited/selector-child-1-ref.html", + "/layout/reftests/css-visited/selector-child-1.html", + "/layout/reftests/css-visited/selector-child-2-ref.xhtml", + "/layout/reftests/css-visited/selector-child-2.xhtml", + "/layout/reftests/css-visited/selector-descendant-1-ref.html", + "/layout/reftests/css-visited/selector-descendant-1.html", + "/layout/reftests/css-visited/selector-descendant-2-ref.xhtml", + "/layout/reftests/css-visited/selector-descendant-2.xhtml", + "/layout/reftests/css-visited/subject-of-selector-1-ref.html", + "/layout/reftests/css-visited/subject-of-selector-adj-sibling-1.html", + "/layout/reftests/css-visited/subject-of-selector-any-sibling-1.html", + "/layout/reftests/css-visited/subject-of-selector-child-1.html", + "/layout/reftests/css-visited/subject-of-selector-descendant-1.html", + "/layout/reftests/css-visited/subject-of-selector-descendant-2-ref.xhtml", + "/layout/reftests/css-visited/subject-of-selector-descendant-2.xhtml", + "/layout/reftests/css-visited/svg-paint-currentcolor-visited-ref.svg", + "/layout/reftests/css-visited/svg-paint-currentcolor-visited.svg", + "/layout/reftests/css-visited/transition-on-visited-ref.html", + "/layout/reftests/css-visited/transition-on-visited.html", + "/layout/reftests/css-visited/variables-visited-ref.html", + "/layout/reftests/css-visited/variables-visited.html", + "/layout/reftests/css-visited/visited-inherit-1-ref.html", + "/layout/reftests/css-visited/visited-inherit-1.html", + "/layout/reftests/css-visited/visited-page.html", + "/layout/reftests/css-visited/white-to-transparent-1-ref.html", + "/layout/reftests/css-visited/white-to-transparent-1.html", + "/layout/reftests/css-visited/width-1-ref.html", + "/layout/reftests/css-visited/width-on-link-1.html", + "/layout/reftests/css-visited/width-on-visited-1.html", + "/layout/reftests/fonts/Ahem.ttf", + "/layout/reftests/svg/as-image/svg-image-visited-1-ref.html", + "/layout/reftests/svg/as-image/svg-image-visited-1a-helper.svg", + "/layout/reftests/svg/as-image/svg-image-visited-1a.html", + "/layout/reftests/svg/as-image/svg-image-visited-1b-helper.svg", + "/layout/reftests/svg/as-image/svg-image-visited-1b.html", + "/layout/reftests/svg/as-image/svg-image-visited-1c-helper.svg", + "/layout/reftests/svg/as-image/svg-image-visited-1c.html", + "/layout/reftests/svg/as-image/svg-image-visited-1d-helper.svg", + "/layout/reftests/svg/as-image/svg-image-visited-1d.html", + "/layout/reftests/svg/pseudo-classes-02-ref.svg", + "/layout/reftests/svg/pseudo-classes-02.svg", +] + +DEFINES["MOZILLA_INTERNAL_API"] = True + +if CONFIG["COMPILE_ENVIRONMENT"]: + GeneratedFile( + "css_properties.js", + script="gen-css-properties.py", + inputs=[ + "css_properties_like_longhand.js", + "!host_ListCSSProperties%s" % CONFIG["HOST_BIN_SUFFIX"], + ], + ) + TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test += [ + "!css_properties.js" + ] diff --git a/layout/style/test/mq_changes_child.html b/layout/style/test/mq_changes_child.html new file mode 100644 index 0000000000..f594e9f00d --- /dev/null +++ b/layout/style/test/mq_changes_child.html @@ -0,0 +1,8 @@ + diff --git a/layout/style/test/neverending_font_load.sjs b/layout/style/test/neverending_font_load.sjs new file mode 100644 index 0000000000..b02fc377a8 --- /dev/null +++ b/layout/style/test/neverending_font_load.sjs @@ -0,0 +1,5 @@ +function handleRequest(request, response) { + response.processAsync(); + response.setHeader("Content-Type", "application/octet-stream", false); + response.write(""); +} diff --git a/layout/style/test/neverending_stylesheet_load.sjs b/layout/style/test/neverending_stylesheet_load.sjs new file mode 100644 index 0000000000..048263fe54 --- /dev/null +++ b/layout/style/test/neverending_stylesheet_load.sjs @@ -0,0 +1,5 @@ +function handleRequest(request, response) { + response.processAsync(); + response.setHeader("Content-Type", "text/css", false); + response.write(""); +} diff --git a/layout/style/test/post-redirect-1.css b/layout/style/test/post-redirect-1.css new file mode 100644 index 0000000000..3620c9f377 --- /dev/null +++ b/layout/style/test/post-redirect-1.css @@ -0,0 +1 @@ +#one { color: green; background: url("?1"); } diff --git a/layout/style/test/post-redirect-2.css b/layout/style/test/post-redirect-2.css new file mode 100644 index 0000000000..3bdf3279d3 --- /dev/null +++ b/layout/style/test/post-redirect-2.css @@ -0,0 +1 @@ +#two { color: green; background: url("?1"); } diff --git a/layout/style/test/post-redirect-3.css b/layout/style/test/post-redirect-3.css new file mode 100644 index 0000000000..dd98be8e66 --- /dev/null +++ b/layout/style/test/post-redirect-3.css @@ -0,0 +1 @@ +#three { color: green; background: url("?1"); } diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js new file mode 100644 index 0000000000..422f2ffe5c --- /dev/null +++ b/layout/style/test/property_database.js @@ -0,0 +1,14128 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* eslint-disable dot-notation */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Utility function. Returns true if the given boolean pref... +// (a) exists and (b) is set to true. +// Otherwise, returns false. +// +// This function also reports a test failure if the pref isn't set at all. This +// ensures that we remove pref-checks from mochitests (instead of accidentally +// disabling the tests that are controlled by that check) when we remove a +// mature feature's pref from the rest of the codebase. +function IsCSSPropertyPrefEnabled(prefName) { + try { + if (SpecialPowers.getBoolPref(prefName)) { + return true; + } + } catch (ex) { + ok( + false, + "Failed to look up property-controlling pref '" + + prefName + + "' (" + + ex + + ")" + ); + } + + return false; +} + +// True longhand properties. +const CSS_TYPE_LONGHAND = 0; + +// True shorthand properties. +const CSS_TYPE_TRUE_SHORTHAND = 1; + +// Properties that we handle as shorthands but were longhands either in +// the current spec or earlier versions of the spec. +const CSS_TYPE_SHORTHAND_AND_LONGHAND = 2; + +// Legacy shorthand properties, that behave mostly like an alias +// (CSS_TYPE_SHORTHAND_AND_LONGHAND) but not quite because their syntax may not +// match, plus they shouldn't serialize in cssText. +const CSS_TYPE_LEGACY_SHORTHAND = 3; + +// Each property has the following fields: +// domProp: The name of the relevant member of nsIDOM[NS]CSS2Properties +// inherited: Whether the property is inherited by default (stated as +// yes or no in the property header in all CSS specs) +// type: see above +// alias_for: optional, indicates that the property is an alias for +// some other property that is the preferred serialization. (Type +// must not be CSS_TYPE_LONGHAND.) +// logical: optional, indicates that the property is a logical directional +// property. (Type must be CSS_TYPE_LONGHAND.) +// axis: optional, indicates that the property is an axis-related logical +// directional property. (Type must be CSS_TYPE_LONGHAND and 'logical' +// must be true.) +// initial_values: Values whose computed value should be the same as the +// computed value for the property's initial value. +// other_values: Values whose computed value should be different from the +// computed value for the property's initial value. +// XXX Should have a third field for values whose computed value may or +// may not be the same as for the property's initial value. +// invalid_values: Things that are not values for the property and +// should be rejected, but which are balanced and should not absorb +// what follows +// quirks_values: Values that should be accepted in quirks mode only, +// mapped to the values they are equivalent to. +// unbalanced_values: Things that are not values for the property and +// should be rejected, and which also contain unbalanced constructs +// that should absorb what follows +// +// Note: By default, an alias is assumed to accept/reject the same values as +// the property that it aliases, and to have the same prerequisites. So, if +// "alias_for" is set, the "*_values" and "prerequisites" fields can simply +// be omitted, and they'll be populated automatically to match the aliased +// property's fields. + +// Helper functions used to construct gCSSProperties. + +function initial_font_family_is_sans_serif() { + // The initial value of 'font-family' might be 'serif' or + // 'sans-serif'. + const meta = document.createElement("meta"); + meta.setAttribute("style", "font: initial;"); + document.documentElement.appendChild(meta); + const family = getComputedStyle(meta).fontFamily; + meta.remove(); + return family == "sans-serif"; +} + +var gInitialFontFamilyIsSansSerif = initial_font_family_is_sans_serif(); + +// shared by background-image and border-image-source +var validNonUrlImageValues = [ + "-moz-element(#a)", + "-moz-element( #a )", + "-moz-element(#a-1)", + "-moz-element(#a\\:1)", + /* gradient torture test */ + "linear-gradient(red, blue)", + "linear-gradient(red, yellow, blue)", + "linear-gradient(red 1px, yellow 20%, blue 24em, green)", + "linear-gradient(red, yellow, green, blue 50%)", + "linear-gradient(red -50%, yellow -25%, green, blue)", + "linear-gradient(red -99px, yellow, green, blue 120%)", + "linear-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "linear-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + "linear-gradient(red, green calc(50% + 20px), blue)", + "linear-gradient(180deg, red, blue)", + + "linear-gradient(to top, red, blue)", + "linear-gradient(to bottom, red, blue)", + "linear-gradient(to left, red, blue)", + "linear-gradient(to right, red, blue)", + "linear-gradient(to top left, red, blue)", + "linear-gradient(to top right, red, blue)", + "linear-gradient(to bottom left, red, blue)", + "linear-gradient(to bottom right, red, blue)", + "linear-gradient(to left top, red, blue)", + "linear-gradient(to left bottom, red, blue)", + "linear-gradient(to right top, red, blue)", + "linear-gradient(to right bottom, red, blue)", + + "linear-gradient(-33deg, red, blue)", + "linear-gradient(30grad, red, blue)", + "linear-gradient(10deg, red, blue)", + "linear-gradient(1turn, red, blue)", + "linear-gradient(.414rad, red, blue)", + + "linear-gradient(.414rad, red, 50%, blue)", + "linear-gradient(.414rad, red, 0%, blue)", + "linear-gradient(.414rad, red, 100%, blue)", + + "linear-gradient(.414rad, red 50%, 50%, blue 50%)", + "linear-gradient(.414rad, red 50%, 20%, blue 50%)", + "linear-gradient(.414rad, red 50%, 30%, blue 10%)", + "linear-gradient(to right bottom, red, 20%, green 50%, 65%, blue)", + "linear-gradient(to right bottom, red, 20%, green 10%, blue)", + "linear-gradient(to right bottom, red, 50%, green 50%, 50%, blue)", + "linear-gradient(to right bottom, red, 0%, green 50%, 100%, blue)", + + "linear-gradient(red 0% 100%)", + "linear-gradient(red 0% 50%, blue 50%)", + "linear-gradient(red 0% 50%, blue 50% 100%)", + "linear-gradient(red 0% 50%, 0%, blue 50%)", + "linear-gradient(red 0% 50%, 0%, blue 50% 100%)", + + /* Unitless 0 is valid as an */ + "linear-gradient(0, red, blue)", + + "radial-gradient(red, blue)", + "radial-gradient(red, yellow, blue)", + "radial-gradient(red 1px, yellow 20%, blue 24em, green)", + "radial-gradient(red, yellow, green, blue 50%)", + "radial-gradient(red -50%, yellow -25%, green, blue)", + "radial-gradient(red -99px, yellow, green, blue 120%)", + "radial-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + + "radial-gradient(0 0, red, blue)", + "radial-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "radial-gradient(at top left, red, blue)", + "radial-gradient(at 20% bottom, red, blue)", + "radial-gradient(at center 20%, red, blue)", + "radial-gradient(at left 35px, red, blue)", + "radial-gradient(at 10% 10em, red, blue)", + "radial-gradient(at 44px top, red, blue)", + "radial-gradient(at 0 0, red, blue)", + + "radial-gradient(farthest-corner, red, blue)", + "radial-gradient(circle, red, blue)", + "radial-gradient(ellipse closest-corner, red, blue)", + "radial-gradient(closest-corner ellipse, red, blue)", + "radial-gradient(farthest-side circle, red, blue)", + + "radial-gradient(at 43px, red, blue)", + "radial-gradient(at 43px 43px, red, blue)", + "radial-gradient(at 50% 50%, red, blue)", + "radial-gradient(at 43px 50%, red, blue)", + "radial-gradient(at 50% 43px, red, blue)", + "radial-gradient(circle 43px, red, blue)", + "radial-gradient(43px circle, red, blue)", + "radial-gradient(ellipse 43px 43px, red, blue)", + "radial-gradient(ellipse 50% 50%, red, blue)", + "radial-gradient(ellipse 43px 50%, red, blue)", + "radial-gradient(ellipse 50% 43px, red, blue)", + "radial-gradient(50% 43px ellipse, red, blue)", + + "radial-gradient(farthest-corner at top left, red, blue)", + "radial-gradient(ellipse closest-corner at 45px, red, blue)", + "radial-gradient(circle farthest-side at 45px, red, blue)", + "radial-gradient(closest-side ellipse at 50%, red, blue)", + "radial-gradient(farthest-corner circle at 4em, red, blue)", + + "radial-gradient(30% 40% at top left, red, blue)", + "radial-gradient(50px 60px at 15% 20%, red, blue)", + "radial-gradient(7em 8em at 45px, red, blue)", + + "radial-gradient(circle at 15% 20%, red, blue)", + + "radial-gradient(red 0% 100%)", + "radial-gradient(red 0% 50%, blue 50%)", + "radial-gradient(red 0% 50%, blue 50% 100%)", + "radial-gradient(red 0% 50%, 0%, blue 50%)", + "radial-gradient(red 0% 50%, 0%, blue 50% 100%)", + + "repeating-radial-gradient(red, blue)", + "repeating-radial-gradient(red, yellow, blue)", + "repeating-radial-gradient(red 1px, yellow 20%, blue 24em, green)", + "repeating-radial-gradient(red, yellow, green, blue 50%)", + "repeating-radial-gradient(red -50%, yellow -25%, green, blue)", + "repeating-radial-gradient(red -99px, yellow, green, blue 120%)", + "repeating-radial-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "repeating-radial-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "repeating-radial-gradient(at top left, red, blue)", + "repeating-radial-gradient(at 0 0, red, blue)", + "repeating-radial-gradient(at 20% bottom, red, blue)", + "repeating-radial-gradient(at center 20%, red, blue)", + "repeating-radial-gradient(at left 35px, red, blue)", + "repeating-radial-gradient(at 10% 10em, red, blue)", + "repeating-radial-gradient(at 44px top, red, blue)", + + "repeating-radial-gradient(farthest-corner at top left, red, blue)", + "repeating-radial-gradient(closest-corner ellipse at 45px, red, blue)", + "repeating-radial-gradient(farthest-side circle at 45px, red, blue)", + "repeating-radial-gradient(ellipse closest-side at 50%, red, blue)", + "repeating-radial-gradient(circle farthest-corner at 4em, red, blue)", + + "repeating-radial-gradient(30% 40% at top left, red, blue)", + "repeating-radial-gradient(50px 60px at 15% 20%, red, blue)", + "repeating-radial-gradient(7em 8em at 45px, red, blue)", + + // When that happens this should be moved to the `invalid` list. + "repeating-radial-gradient(circle closest-side at left 0px bottom 7in, hsl(2,2%,5%), rgb(1,6,0))", + + "radial-gradient(at calc(25%) top, red, blue)", + "radial-gradient(at left calc(25%), red, blue)", + "radial-gradient(at calc(25px) top, red, blue)", + "radial-gradient(at left calc(25px), red, blue)", + "radial-gradient(at calc(-25%) top, red, blue)", + "radial-gradient(at left calc(-25%), red, blue)", + "radial-gradient(at calc(-25px) top, red, blue)", + "radial-gradient(at left calc(-25px), red, blue)", + "radial-gradient(at calc(100px + -25%) top, red, blue)", + "radial-gradient(at left calc(100px + -25%), red, blue)", + "radial-gradient(at calc(100px + -25px) top, red, blue)", + "radial-gradient(at left calc(100px + -25px), red, blue)", + + "image-set(linear-gradient(green, green) 1x, url(foobar.png) 2x)", + "image-set(linear-gradient(red, red), url(foobar.png) 2x)", + "image-set(url(foobar.png) 2x)", + "image-set(url(foobar.png) 1x, url(bar.png) 2x, url(baz.png) 3x)", + "image-set('foobar.png', 'bar.png' 2x, url(baz.png) 3x)", + "image-set(url(foobar.png) type('image/png'))", + "image-set(url(foobar.png) 1x type('image/png'))", + "image-set(url(foobar.png) type('image/png') 1x)", + + ...(IsCSSPropertyPrefEnabled("layout.css.cross-fade.enabled") + ? [ + "cross-fade(red, blue)", + "cross-fade(red)", + "cross-fade(red 50%)", + // see: . This + // may become invalid depending on how discussion on that issue + // goes. + "cross-fade(red -50%, blue 150%)", + "cross-fade(red -50%, url(www.example.com))", + + "cross-fade(url(http://placekitten.com/200/300), 55% linear-gradient(red, blue))", + "cross-fade(cross-fade(red, white), cross-fade(blue))", + "cross-fade(gold 77%, 60% blue)", + + "cross-fade(url(http://placekitten.com/200/300), url(http://placekitten.com/200/300))", + "cross-fade(#F0F8FF, rgb(0, 0, 0), rgba(0, 255, 0, 1) 25%)", + ] + : []), + + // Conic gradient + "conic-gradient(red, blue)", + "conic-gradient(red,blue,yellow)", + "conic-gradient( red , blue, yellow)", + "conic-gradient(red 0, blue 50deg)", + "conic-gradient(red 10%, blue 50%)", + "conic-gradient(red -50deg, blue 50deg)", + "conic-gradient(red 50deg, blue 0.3turn, yellow 200grad, orange 60% 5rad)", + + "conic-gradient(red 0 100%)", + "conic-gradient(red 0 50%, blue 50%)", + "conic-gradient(red 0 50deg, blue 50% 100%)", + "conic-gradient(red 0 50%, 0deg, blue 50%)", + "conic-gradient(red 0deg 50%, 0%, blue 50% 100%)", + + "conic-gradient(from 0, red, blue)", + "conic-gradient(from 40deg, red, blue)", + "conic-gradient(from 0.4turn, red, blue)", + "conic-gradient(from 200grad, red, blue)", + "conic-gradient(from 5rad, red, blue)", + + "conic-gradient(at top, red, blue)", + "conic-gradient(at top left, red, blue)", + "conic-gradient(at left top, red, blue)", + "conic-gradient(at center center, red, blue)", + "conic-gradient(at 20% bottom, red, blue)", + "conic-gradient(at center 20%, red, blue)", + "conic-gradient(at left 35px, red, blue)", + "conic-gradient(at 10% 10em, red, blue)", + "conic-gradient(at 44px top, red, blue)", + "conic-gradient(at 0 0, red, blue)", + "conic-gradient(at 10px, red, blue)", + + "conic-gradient(at calc(25%) top, red, blue)", + "conic-gradient(at left calc(25%), red, blue)", + "conic-gradient(at calc(25px) top, red, blue)", + "conic-gradient(at left calc(25px), red, blue)", + "conic-gradient(at calc(-25%) top, red, blue)", + "conic-gradient(at left calc(-25%), red, blue)", + "conic-gradient(at calc(-25px) top, red, blue)", + "conic-gradient(at left calc(-25px), red, blue)", + "conic-gradient(at calc(100px + -25%) top, red, blue)", + "conic-gradient(at left calc(100px + -25%), red, blue)", + "conic-gradient(at calc(100px + -25px) top, red, blue)", + "conic-gradient(at left calc(100px + -25px), red, blue)", + + "conic-gradient(from 0 at 0 0, red, blue)", + "conic-gradient(from 40deg at 50%, red, blue)", + "conic-gradient(from 0.4turn at left 30%, red, blue)", + "conic-gradient(from 200grad at calc(100px + -25%) top, red, blue)", + "conic-gradient(from 5rad at 10px, red, blue)", + + "repeating-conic-gradient(red, blue)", + "repeating-conic-gradient(red, yellow, blue)", + "repeating-conic-gradient(red 1deg, yellow 20%, blue 5rad, green)", + "repeating-conic-gradient(red, yellow, green, blue 50%)", + "repeating-conic-gradient(red -50%, yellow -25%, green, blue)", + "repeating-conic-gradient(red -99deg, yellow, green, blue 120%)", + "repeating-conic-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "repeating-conic-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "repeating-conic-gradient(from 0, red, blue)", + "repeating-conic-gradient(from 40deg, red, blue)", + "repeating-conic-gradient(from 0.4turn, red, blue)", + "repeating-conic-gradient(from 200grad, red, blue)", + "repeating-conic-gradient(from 5rad, red, blue)", + + "repeating-conic-gradient(at top left, red, blue)", + "repeating-conic-gradient(at 0 0, red, blue)", + "repeating-conic-gradient(at 20% bottom, red, blue)", + "repeating-conic-gradient(at center 20%, red, blue)", + "repeating-conic-gradient(at left 35px, red, blue)", + "repeating-conic-gradient(at 10% 10em, red, blue)", + "repeating-conic-gradient(at 44px top, red, blue)", + + "repeating-conic-gradient(from 0 at 0 0, red, blue)", + "repeating-conic-gradient(from 40deg at 50%, red, blue)", + "repeating-conic-gradient(from 0.4turn at left 30%, red, blue)", + "repeating-conic-gradient(from 200grad at calc(100px + -25%) top, red, blue)", + "repeating-conic-gradient(from 5rad at 10px, red, blue)", + + // 2008 GRADIENTS: -webkit-gradient() + // ---------------------------------- + // linear w/ no color stops (valid) and a variety of position values: + "-webkit-gradient(linear, 1 2, 3 4)", + "-webkit-gradient(linear,1 2,3 4)", // (no extra space) + "-webkit-gradient(linear , 1 2 , 3 4 )", // (lots of extra space) + "-webkit-gradient(linear, 1 10% , 0% 4)", // percentages + "-webkit-gradient(linear, +1.0 -2%, +5.3% -0)", // (+/- & decimals are valid) + "-webkit-gradient(linear, left top, right bottom)", // keywords + "-webkit-gradient(linear, right center, center top)", + "-webkit-gradient(linear, center center, center center)", + "-webkit-gradient(linear, center 5%, 30 top)", // keywords mixed w/ nums + + // linear w/ just 1 color stop: + "-webkit-gradient(linear, 1 2, 3 4, from(lime))", + "-webkit-gradient(linear, 1 2, 3 4, to(lime))", + // * testing the various allowable stop values ( & ): + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(-0, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(-30, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(+9999, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(-.1, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0%, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(100%, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(9999%, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(-.5%, lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(+0%, lime))", + // * testing the various color values: + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, transparent))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, rgb(1,2,3)))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, #00ff00))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, #00f))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, hsla(240, 30%, 50%, 0.8)))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, rgba(255, 230, 10, 0.5)))", + + // linear w/ multiple color stops: + // * using from()/to() -- note that out-of-order is OK: + "-webkit-gradient(linear, 1 2, 3 4, from(lime), from(blue))", + "-webkit-gradient(linear, 1 2, 3 4, to(lime), to(blue))", + "-webkit-gradient(linear, 1 2, 3 4, from(lime), to(blue))", + "-webkit-gradient(linear, 1 2, 3 4, to(lime), from(blue))", + "-webkit-gradient(linear, 1 2, 3 4, from(lime), to(blue), from(purple))", + // * using color-stop(): + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, lime), color-stop(30%, blue))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0, lime), color-stop(30%, blue), color-stop(100%, purple))", + // * using color-stop() intermixed with from()/to() functions: + "-webkit-gradient(linear, 1 2, 3 4, from(lime), color-stop(30%, blue))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(30%, blue), to(lime))", + // * overshooting endpoints (0 & 1.0) + "-webkit-gradient(linear, 1 2, 3 4, color-stop(-30%, lime), color-stop(.4, blue), color-stop(1.5, purple))", + // * repeating a stop position (valid) + "-webkit-gradient(linear, 1 2, 3 4, color-stop(30%, lime), color-stop(30%, blue))", + // * stops out of order (valid) + "-webkit-gradient(linear, 1 2, 3 4, color-stop(70%, lime), color-stop(20%, blue), color-stop(40%, purple))", + + // radial w/ no color stops (valid) and a several different radius values: + "-webkit-gradient(radial, 1 2, 8, 3 4, 9)", + "-webkit-gradient(radial, 0 0, 10, 0 0, 5)", + + // radial w/ color stops + // (mostly leaning on more-robust 'linear' tests above; just testing a few + // examples w/ radial as a sanity-check): + "-webkit-gradient(radial, 1 2, 8, 3 4, 9, from(lime))", + "-webkit-gradient(radial, 1 2, 8, 3 4, 9, to(blue))", + "-webkit-gradient(radial, 1 2, 8, 3 4, 9, color-stop(0.5, #00f), color-stop(0.8, rgba(100, 200, 0, 0.5)))", + + // 2011 GRADIENTS: -webkit-linear-gradient(), -webkit-radial -gradient() + // --------------------------------------------------------------------- + // Basic linear-gradient syntax (valid when prefixed or unprefixed): + "-webkit-linear-gradient(red, green, blue)", + + // Angled linear-gradients (valid when prefixed or unprefixed): + "-webkit-linear-gradient(135deg, red, blue)", + "-webkit-linear-gradient( 135deg , red , blue )", + "-webkit-linear-gradient(280deg, red 60%, blue)", + + // Linear-gradient with unitless-0 (normally invalid for + // but accepted here for better webkit emulation): + "-webkit-linear-gradient(0, red, blue)", + + // Linear-gradient with calc expression (bug 1363349) + "-webkit-gradient(linear, calc(5 + 5) top, calc(10 + 10) top, from(blue), to(lime))", + "-webkit-gradient(linear, calc(5 - 5) top, calc(10 + 10) top, from(blue), to(lime))", + "-webkit-gradient(linear, calc(5 * 5) top, calc(10 + 10) top, from(blue), to(lime))", + "-webkit-gradient(linear, calc(5 / 5) top, calc(10 + 10) top, from(blue), to(lime))", + "-webkit-gradient(linear, left calc(25% - 10%), right calc(75% + 10%), from(blue), to(lime))", + "-webkit-gradient(linear, calc(1) 2, 3 4)", + + // Radial-gradient with calc expression (bug 1363349) + "-webkit-gradient(radial, 1 2, 0, 3 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(1 + 2), 3 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(1 - 2), 3 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(1 * 2), 3 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(1 / 2), 3 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, calc(0 + 1) calc(1 + 1), calc(1 + 2), calc(1 + 2) 4, calc(1 + 5), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(8), 3 4, 9)", + + // Basic radial-gradient syntax (valid when prefixed or unprefixed): + "-webkit-radial-gradient(circle, white, black)", + "-webkit-radial-gradient(circle, white, black)", + "-webkit-radial-gradient(ellipse closest-side, white, black)", + "-webkit-radial-gradient(circle farthest-corner, white, black)", + + // Contain/cover keywords (valid only for -moz/-webkit prefixed): + "-webkit-radial-gradient(cover, red, blue)", + "-webkit-radial-gradient(cover circle, red, blue)", + "-webkit-radial-gradient(contain, red, blue)", + "-webkit-radial-gradient(contain ellipse, red, blue)", + + // Initial side/corner/point (valid only for -moz/-webkit prefixed): + "-webkit-linear-gradient(top, red, blue)", + "-webkit-linear-gradient(left, red, blue)", + "-webkit-linear-gradient(bottom, red, blue)", + "-webkit-linear-gradient(right top, red, blue)", + "-webkit-linear-gradient(top right, red, blue)", + "-webkit-radial-gradient(right, red, blue)", + "-webkit-radial-gradient(left bottom, red, blue)", + "-webkit-radial-gradient(bottom left, red, blue)", + "-webkit-radial-gradient(center, red, blue)", + "-webkit-radial-gradient(center right, red, blue)", + "-webkit-radial-gradient(center center, red, blue)", + "-webkit-radial-gradient(center top, red, blue)", + "-webkit-radial-gradient(left 50%, red, blue)", + "-webkit-radial-gradient(20px top, red, blue)", + "-webkit-radial-gradient(20em 30%, red, blue)", + + // Point + keyword-sized shape (valid only for -moz/-webkit prefixed): + "-webkit-radial-gradient(center, circle closest-corner, red, blue)", + "-webkit-radial-gradient(10px 20px, cover circle, red, blue)", + "-webkit-radial-gradient(5em 50%, ellipse contain, red, blue)", + + // Repeating examples: + "-webkit-repeating-linear-gradient(red 10%, blue 30%)", + "-webkit-repeating-linear-gradient(30deg, pink 20px, orange 70px)", + "-webkit-repeating-linear-gradient(left, red, blue)", + "-webkit-repeating-linear-gradient(left, red 10%, blue 30%)", + "-webkit-repeating-radial-gradient(circle, red, blue 10%, red 20%)", + "-webkit-repeating-radial-gradient(circle farthest-corner, gray 10px, yellow 20px)", + "-webkit-repeating-radial-gradient(top left, circle, red, blue 4%, red 8%)", +]; +var invalidNonUrlImageValues = [ + "-moz-element(#a:1)", + "-moz-element(a#a)", + "-moz-element(#a a)", + "-moz-element(#a+a)", + "-moz-element(#a())", + /* no quirks mode colors */ + "linear-gradient(red, ff00ff)", + /* no quirks mode colors */ + "radial-gradient(at 10% bottom, ffffff, black) scroll no-repeat", + /* no quirks mode lengths */ + "linear-gradient(red -99, yellow, green, blue 120%)", + /* Unitless nonzero numbers are valid as an */ + "linear-gradient(30, red, blue)", + /* There must be a comma between gradient-line (e.g. ) and colors */ + "linear-gradient(30deg red, blue)", + "linear-gradient(to top left red, blue)", + "linear-gradient(to right red, blue)", + /* Invalid color or calc() function */ + "linear-gradient(red, rgb(0, rubbish, 0) 50%, red)", + "linear-gradient(red, red calc(50% + rubbish), red)", + "linear-gradient(to top calc(50% + rubbish), red, blue)", + + "radial-gradient(circle 175px 20px, black, white)", + "radial-gradient(175px 20px circle, black, white)", + "radial-gradient(ellipse 175px, black, white)", + "radial-gradient(175px ellipse, black, white)", + "radial-gradient(50%, red, blue)", + "radial-gradient(circle 50%, red, blue)", + "radial-gradient(50% circle, red, blue)", + + /* Invalid units */ + "conic-gradient(red, blue 50px, yellow 30px)", + "repeating-conic-gradient(red 1deg, yellow 20%, blue 24em, green)", + "conic-gradient(from 0%, black, white)", + "conic-gradient(from 60%, black, white)", + "conic-gradient(from 40px, black, white)", + "conic-gradient(from 50, black, white)", + "conic-gradient(at 50deg, black, white)", + "conic-gradient(from 40deg at 50deg, black, white)", + "conic-gradient(from 40deg at 50deg 60deg, black, white)", + /* Invalid keywords (or ordering) */ + "conic-gradient(at 40% from 50deg, black, white)", + "conic-gradient(to 50deg, black, white)", + + /* Used to be valid only when prefixed */ + "linear-gradient(top left, red, blue)", + "linear-gradient(0 0, red, blue)", + "linear-gradient(20% bottom, red, blue)", + "linear-gradient(center 20%, red, blue)", + "linear-gradient(left 35px, red, blue)", + "linear-gradient(10% 10em, red, blue)", + "linear-gradient(44px top, red, blue)", + + "linear-gradient(top left 45deg, red, blue)", + "linear-gradient(20% bottom -300deg, red, blue)", + "linear-gradient(center 20% 1.95929rad, red, blue)", + "linear-gradient(left 35px 30grad, red, blue)", + "linear-gradient(left 35px 0.1turn, red, blue)", + "linear-gradient(10% 10em 99999deg, red, blue)", + "linear-gradient(44px top -33deg, red, blue)", + + "linear-gradient(30grad left 35px, red, blue)", + "linear-gradient(10deg 20px, red, blue)", + "linear-gradient(1turn 20px, red, blue)", + "linear-gradient(.414rad bottom, red, blue)", + + "linear-gradient(to top, 0%, blue)", + "linear-gradient(to top, red, 100%)", + "linear-gradient(to top, red, 45%, 56%, blue)", + "linear-gradient(to top, red,, blue)", + "linear-gradient(to top, red, green 35%, 15%, 54%, blue)", + + "linear-gradient(unset, 10px 10px, from(blue))", + "linear-gradient(unset, 10px 10px, blue 0)", + "repeating-linear-gradient(unset, 10px 10px, blue 0)", + + "radial-gradient(top left 45deg, red, blue)", + "radial-gradient(20% bottom -300deg, red, blue)", + "radial-gradient(center 20% 1.95929rad, red, blue)", + "radial-gradient(left 35px 30grad, red, blue)", + "radial-gradient(10% 10em 99999deg, red, blue)", + "radial-gradient(44px top -33deg, red, blue)", + + "radial-gradient(-33deg, red, blue)", + "radial-gradient(30grad left 35px, red, blue)", + "radial-gradient(10deg 20px, red, blue)", + "radial-gradient(.414rad bottom, red, blue)", + + "radial-gradient(cover, red, blue)", + "radial-gradient(ellipse contain, red, blue)", + "radial-gradient(cover circle, red, blue)", + + "radial-gradient(top left, cover, red, blue)", + "radial-gradient(15% 20%, circle, red, blue)", + "radial-gradient(45px, ellipse closest-corner, red, blue)", + "radial-gradient(45px, farthest-side circle, red, blue)", + + "radial-gradient(99deg, cover, red, blue)", + "radial-gradient(-1.2345rad, circle, red, blue)", + "radial-gradient(399grad, ellipse closest-corner, red, blue)", + "radial-gradient(399grad, farthest-side circle, red, blue)", + + "radial-gradient(top left 99deg, cover, red, blue)", + "radial-gradient(15% 20% -1.2345rad, circle, red, blue)", + "radial-gradient(45px 399grad, ellipse closest-corner, red, blue)", + "radial-gradient(45px 399grad, farthest-side circle, red, blue)", + "radial-gradient(circle red, blue)", + + /* don't allow more than two positions with multi-position syntax */ + "linear-gradient(red 0% 50% 100%)", + "linear-gradient(red 0% 50% 75%, blue 75%)", + "linear-gradient(to bottom, red 0% 50% 100%)", + "linear-gradient(to bottom, red 0% 50% 75%, blue 75%)", + "radial-gradient(red 0% 50% 100%)", + "radial-gradient(red 0% 50% 75%, blue 75%)", + "radial-gradient(center, red 0% 50% 100%)", + "radial-gradient(center, red 0% 50% 75%, blue 75%)", + "conic-gradient(red 0% 50% 100%)", + "conic-gradient(red 0% 50% 75%, blue 75%)", + "conic-gradient(center, red 0% 50% 100%)", + "conic-gradient(center, red 0% 50% 75%, blue 75%)", + + // missing color in color stop + "conic-gradient(red 50deg, blue 0.3turn, yellow 200grad, orange 60%, 5rad)", + + "-moz-linear-gradient(unset, 10px 10px, from(blue))", + "-moz-linear-gradient(unset, 10px 10px, blue 0)", + "-moz-repeating-linear-gradient(unset, 10px 10px, blue 0)", + + // 2008 GRADIENTS: -webkit-gradient() + // https://www.webkit.org/blog/175/introducing-css-gradients/ + // ---------------------------------- + // Mostly-empty expressions (missing most required pieces): + "-webkit-gradient()", + "-webkit-gradient( )", + "-webkit-gradient(,)", + "-webkit-gradient(bogus)", + "-webkit-gradient(linear)", + "-webkit-gradient(linear,)", + "-webkit-gradient(,linear)", + "-webkit-gradient(radial)", + "-webkit-gradient(radial,)", + + // linear w/ partial/missing expression(s) + "-webkit-gradient(linear, 1)", // Incomplete + "-webkit-gradient(linear, left)", // Incomplete + "-webkit-gradient(linear, center)", // Incomplete + "-webkit-gradient(linear, top)", // Incomplete + "-webkit-gradient(linear, 5%)", // Incomplete + "-webkit-gradient(linear, 1 2)", // Missing 2nd + "-webkit-gradient(linear, 1, 3)", // 2 incomplete s + "-webkit-gradient(linear, 1, 3 4)", // Incomplete 1st + "-webkit-gradient(linear, 1 2, 3)", // Incomplete 2nd + "-webkit-gradient(linear, 1 2, 3, 4)", // Comma inside + "-webkit-gradient(linear, 1, 2, 3 4)", // Comma inside + "-webkit-gradient(linear, 1, 2, 3, 4)", // Comma inside + + // linear w/ invalid units in expression + "-webkit-gradient(linear, 1px 2, 3 4)", + "-webkit-gradient(linear, 1 2, 3 4px)", + "-webkit-gradient(linear, 1px 2px, 3px 4px)", + "-webkit-gradient(linear, 1 2em, 3 4)", + + // linear w/ (only valid for radial) + "-webkit-gradient(linear, 1 2, 8, 3 4, 9)", + + // linear w/ out-of-order position keywords in expression + // (horizontal keyword is supposed to come first, for "x" coord) + "-webkit-gradient(linear, 0 0, top right)", + "-webkit-gradient(linear, bottom center, 0 0)", + "-webkit-gradient(linear, top bottom, 0 0)", + "-webkit-gradient(linear, bottom top, 0 0)", + "-webkit-gradient(linear, bottom top, 0 0)", + + // linear w/ trailing comma (which implies missing color-stops): + "-webkit-gradient(linear, 1 2, 3 4,)", + + // linear w/ invalid color values: + "-webkit-gradient(linear, 1 2, 3 4, from(invalidcolorname))", + "-webkit-gradient(linear, 1 2, 3 4, from(inherit))", + "-webkit-gradient(linear, 1 2, 3 4, from(initial))", + "-webkit-gradient(linear, 1 2, 3 4, from(currentColor))", + "-webkit-gradient(linear, 1 2, 3 4, from(00ff00))", + "-webkit-gradient(linear, 1 2, 3 4, from(##00ff00))", + "-webkit-gradient(linear, 1 2, 3 4, from(#00fff))", // wrong num hex digits + "-webkit-gradient(linear, 1 2, 3 4, from(xyz(0,0,0)))", // bogus color func + // Mixing and is invalid. + "-webkit-gradient(linear, 1 2, 3 4, from(rgb(100, 100%, 30)))", + + // linear w/ color stops that have comma issues + "-webkit-gradient(linear, 1 2, 3 4 from(lime))", + "-webkit-gradient(linear, 1 2, 3 4, from(lime,))", + "-webkit-gradient(linear, 1 2, 3 4, from(lime),)", + "-webkit-gradient(linear, 1 2, 3 4, from(lime) to(blue))", + "-webkit-gradient(linear, 1 2, 3 4, from(lime),, to(blue))", + "-webkit-gradient(linear, 1 2, 3 4, from(rbg(0, 0, 0,)))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0 lime))", + "-webkit-gradient(linear, 1 2, 3 4, color-stop(0,, lime))", + + // radial w/ broken /radius expression(s) + "-webkit-gradient(radial, 1)", // Incomplete + "-webkit-gradient(radial, 1 2)", // Missing radius + 2nd + "-webkit-gradient(radial, 1 2, 8)", // Missing 2nd + "-webkit-gradient(radial, 1 2, 8, 3)", // Incomplete 2nd + "-webkit-gradient(radial, 1 2, 8, 3 4)", // Missing 2nd radius + "-webkit-gradient(radial, 1 2, 3 4, 9)", // Missing 1st radius + "-webkit-gradient(radial, 1 2, -1.5, center center, +99999.9999)", // Negative radius + + // radial w/ incorrect units on radius (invalid; expecting ) + "-webkit-gradient(radial, 1 2, 8%, 3 4, 9)", + "-webkit-gradient(radial, 1 2, 8px, 3 4, 9)", + "-webkit-gradient(radial, 1 2, 8em, 3 4, 9)", + "-webkit-gradient(radial, 1 2, top, 3 4, 9)", + + // radial w/ trailing comma (which implies missing color-stops): + "-webkit-gradient(linear, 1 2, 8, 3 4, 9,)", + + // radial w/ invalid color value (mostly leaning on 'linear' test above): + "-webkit-gradient(radial, 1 2, 8, 3 4, 9, from(invalidcolorname))", + + // 2011 GRADIENTS: -webkit-linear-gradient(), -webkit-radial -gradient() + // --------------------------------------------------------------------- + // Syntax that's invalid for all types of gradients: + // * empty gradient expressions: + "-webkit-linear-gradient()", + "-webkit-radial-gradient()", + "-webkit-repeating-linear-gradient()", + "-webkit-repeating-radial-gradient()", + + // * missing comma between and color list: + "-webkit-linear-gradient(0 red, blue)", + "-webkit-linear-gradient(30deg red, blue)", + "-webkit-linear-gradient(top right red, blue)", + "-webkit-linear-gradient(bottom red, blue)", + + // Linear-gradient with calc expression containing mixed units + // (bug 1363349) + "-webkit-gradient(linear, calc(5 + 5%) top, calc(10 + 10) top, from(blue), to(lime))", + "-webkit-gradient(linear, left calc(25 - 10%), right calc(75% + 10%), from(blue), to(lime))", + + // Radial-gradient with calc expression containing mixed units, or a + // percentage in the radius (bug 1363349) + "-webkit-gradient(radial, 1 2, 0, 3 4, calc(1% + 5%), from(blue), to(lime))", + "-webkit-gradient(radial, 1 2, calc(1 + 2), 3 4, calc(1 + 5%), from(blue), to(lime))", + "-webkit-gradient(radial, calc(0 + 1) calc(1 + 1), calc(1% + 2%), calc(1 + 2) 4, calc(1 + 5), from(blue), to(lime))", + + // Linear syntax that's invalid for both -webkit & unprefixed, but valid + // for -moz: + // * initial which includes a length: + "-webkit-linear-gradient(10px, red, blue)", + "-webkit-linear-gradient(10px top, red, blue)", + // * initial which includes a side *and* an angle: + "-webkit-linear-gradient(bottom 30deg, red, blue)", + "-webkit-linear-gradient(30deg bottom, red, blue)", + "-webkit-linear-gradient(10px top 50deg, red, blue)", + "-webkit-linear-gradient(50deg 10px top, red, blue)", + // * initial which includes explicit "center": + "-webkit-linear-gradient(center, red, blue)", + "-webkit-linear-gradient(left center, red, blue)", + "-webkit-linear-gradient(top center, red, blue)", + "-webkit-linear-gradient(center top, red, blue)", + + // Linear syntax that's invalid for -webkit, but valid for -moz & unprefixed: + // * "to" syntax: + "-webkit-linear-gradient(to top, red, blue)", + + // * followed by angle: + "-webkit-radial-gradient(circle 10deg, red, blue)", + + // Radial syntax that's invalid for both -webkit & -moz, but valid for + // unprefixed: + // * " at " syntax: + "-webkit-radial-gradient(circle at left bottom, red, blue)", + // * explicitly-sized shape: + "-webkit-radial-gradient(circle 10px, red, blue)", + "-webkit-radial-gradient(ellipse 40px 20px, red, blue)", + + // Radial syntax that's invalid for both -webkit & unprefixed, but valid + // for -moz: + // * initial angle + "-webkit-radial-gradient(30deg, red, blue)", + // * initial angle/position combo + "-webkit-radial-gradient(top 30deg, red, blue)", + "-webkit-radial-gradient(left top 30deg, red, blue)", + "-webkit-radial-gradient(10px 20px 30deg, red, blue)", + + // Conic gradients should not support prefixed syntax + "-webkit-gradient(conic, 1 2, 3 4, color-stop(0, lime))", + "-webkit-conic-gradient(red, blue)", + "-moz-conic-gradient(red, blue)", + "-webkit-repeating-conic-gradient(red, blue)", + "-moz-repeating-conic-gradient(red, blue)", + + "image-set(url(foobar.png) 1x, none)", + "image-set(garbage)", + "image-set(image-set('foobar.png', 'bar.png' 2x) 1x, url(baz.png) 3x)", // Nested image-sets should fail to parse + "image-set(image-set(garbage))", + "image-set()", + "image-set(type('image/png') url(foobar.png) 1x)", + "image-set(url(foobar.png) type('image/png') 1x type('image/png'))", + "image-set(url(foobar.png) type('image/png') type('image/png'))", + "image-set(url(foobar.png) type(image/png))", + "image-set(url(foobar.png) epyt('image/png'))", + + ...(IsCSSPropertyPrefEnabled("layout.css.cross-fade.enabled") + ? [ + "cross-fade(red blue)", + "cross-fade()", + "cross-fade(50%, blue 50%)", + // Old syntax + "cross-fade(red, white, 50%)", + // see: . This + // may become invalid depending on how discussion on that issue + // goes. + "cross-fade(red, 150%, blue)", + "cross-fade(red auto, blue 10%)", + + // nested invalidity should propagate. + "cross-fade(url(http://placekitten.com/200/300), 55% linear-gradient(center, red, blue))", + "cross-fade(cross-fade(red, white, 50%), cross-fade(blue))", + + "cross-fade(url(http://placekitten.com/200/300) url(http://placekitten.com/200/300))", + "cross-fade(#F0F8FF, rgb(0, 0, 0), rgba(0, 255, 0, 1), 25%)", + ] + : []), +]; +var unbalancedGradientAndElementValues = ["-moz-element(#a()"]; + +var basicShapeSVGBoxValues = [ + "fill-box", + "stroke-box", + "view-box", + + "polygon(evenodd, 20pt 20cm) fill-box", + "polygon(evenodd, 20ex 20pc) stroke-box", + "polygon(evenodd, 20rem 20in) view-box", +]; + +var basicShapeOtherValues = [ + "polygon(20px 20px)", + "polygon(20px 20%)", + "polygon(20% 20%)", + "polygon(20rem 20em)", + "polygon(20cm 20mm)", + "polygon(20px 20px, 30px 30px)", + "polygon(20px 20px, 30% 30%, 30px 30px)", + + "content-box", + "padding-box", + "border-box", + + "polygon(0 0) content-box", + "border-box polygon(0 0)", + "padding-box polygon( 0 20px , 30px 20% ) ", + + "circle()", + "circle(at center)", + "circle(at top 0px left 20px)", + "circle(at bottom right)", + "circle(20%)", + "circle(300px)", + "circle(calc(20px + 30px))", + "circle(farthest-side)", + "circle(closest-side)", + "circle(closest-side at center)", + "circle(farthest-side at top)", + "circle(20px at top right)", + "circle(40% at 50% 100%)", + "circle(calc(20% + 20%) at right bottom)", + "circle() padding-box", + + "ellipse()", + "ellipse(at center)", + "ellipse(at top 0px left 20px)", + "ellipse(at bottom right)", + "ellipse(20% 20%)", + "ellipse(300px 50%)", + "ellipse(calc(20px + 30px) 10%)", + "ellipse(farthest-side closest-side)", + "ellipse(closest-side farthest-side)", + "ellipse(farthest-side farthest-side)", + "ellipse(closest-side closest-side)", + "ellipse(closest-side closest-side at center)", + "ellipse(20% farthest-side at top)", + "ellipse(20px 50% at top right)", + "ellipse(closest-side 40% at 50% 100%)", + "ellipse(calc(20% + 20%) calc(20px + 20cm) at right bottom)", + + "inset(1px)", + "inset(20% -20px)", + "inset(20em 4rem calc(20% + 20px))", + "inset(20vh 20vw 20pt 3%)", + "inset(5px round 3px)", + "inset(1px 2px round 3px / 3px)", + "inset(1px 2px 3px round 3px 2em / 20%)", + "inset(1px 2px 3px 4px round 3px 2vw 20% / 20px 3em 2vh 20%)", +]; + +var basicShapeOtherValuesWithFillRule = [ + "polygon(nonzero, 20px 20px, 30% 30%, 30px 30px)", + "polygon(evenodd, 20px 20px, 30% 30%, 30px 30px)", + "polygon(evenodd, 20% 20em) content-box", + "polygon(evenodd, 20vh 20em) padding-box", + "polygon(evenodd, 20vh calc(20% + 20em)) border-box", + "polygon(evenodd, 20vh 20vw) margin-box", +]; + +var basicShapeInvalidValues = [ + "url(#test) url(#tes2)", + "polygon (0 0)", + "polygon(20px, 40px)", + "border-box content-box", + "polygon(0 0) polygon(0 0)", + "polygon(nonzero 0 0)", + "polygon(evenodd 20px 20px)", + "polygon(20px 20px, evenodd)", + "polygon(20px 20px, nonzero)", + "polygon(0 0) conten-box content-box", + "content-box polygon(0 0) conten-box", + "padding-box polygon(0 0) conten-box", + "polygon(0 0) polygon(0 0) content-box", + "polygon(0 0) content-box polygon(0 0)", + "polygon(0 0), content-box", + "polygon(0 0), polygon(0 0)", + "content-box polygon(0 0) polygon(0 0)", + "content-box polygon(0 0) none", + "none content-box polygon(0 0)", + "inherit content-box polygon(0 0)", + "initial polygon(0 0)", + "polygon(0 0) farthest-side", + "farthest-corner polygon(0 0)", + "polygon(0 0) farthest-corner", + "polygon(0 0) conten-box", + "polygon(0 0) polygon(0 0) farthest-corner", + "polygon(0 0) polygon(0 0) polygon(0 0)", + "border-box polygon(0, 0)", + "border-box padding-box", + "margin-box farthest-side", + "nonsense() border-box", + "border-box nonsense()", + + "circle(at)", + "circle(at 20% 20% 30%)", + "circle(20px 2px at center)", + "circle(2at center)", + "circle(closest-corner)", + "circle(at center top closest-side)", + "circle(-20px)", + "circle(farthest-side closest-side)", + "circle(20% 20%)", + "circle(at farthest-side)", + "circle(calc(20px + rubbish))", + "circle(at top left 20px)", + + "ellipse(at)", + "ellipse(at 20% 20% 30%)", + "ellipse(20px at center)", + "ellipse(-20px 20px)", + "ellipse(closest-corner farthest-corner)", + "ellipse(20px -20px)", + "ellipse(-20px -20px)", + "ellipse(farthest-side)", + "ellipse(20%)", + "ellipse(at farthest-side farthest-side)", + "ellipse(at top left calc(20px + rubbish))", + "ellipse(at top left 20px)", + + "polygon(at)", + "polygon(at 20% 20% 30%)", + "polygon(20px at center)", + "polygon(2px 2at center)", + "polygon(closest-corner farthest-corner)", + "polygon(at center top closest-side closest-side)", + "polygon(40% at 50% 100%)", + "polygon(40% farthest-side 20px at 50% 100%)", + + "inset()", + "inset(round)", + "inset(round 3px)", + "inset(1px round 1px 2px 3px 4px 5px)", + "inset(1px 2px 3px 4px 5px)", + "inset(1px, round 3px)", + "inset(1px, 2px)", + "inset(1px 2px, 3px)", + "inset(1px at 3px)", + "inset(1px round 1px // 2px)", + "inset(1px round)", + "inset(1px calc(2px + rubbish))", + "inset(1px round 2px calc(3px + rubbish))", +]; + +var basicShapeUnbalancedValues = [ + "polygon(30% 30%", + "polygon(nonzero, 20% 20px", + "polygon(evenodd, 20px 20px", + + "circle(", + "circle(40% at 50% 100%", + "ellipse(", + "ellipse(40% at 50% 100%", + + "inset(1px", + "inset(1px 2px", + "inset(1px 2px 3px", + "inset(1px 2px 3px 4px", + "inset(1px 2px 3px 4px round 5px", + "inset(1px 2px 3px 4px round 5px / 6px", +]; + +var basicShapeXywhRectValues = []; +if (IsCSSPropertyPrefEnabled("layout.css.basic-shape-xywh.enabled")) { + basicShapeXywhRectValues.push( + "xywh(1px 2% 3px 4em)", + "xywh(1px 2% 3px 4em round 0px)", + "xywh(1px 2% 3px 4em round 0px 1%)", + "xywh(1px 2% 3px 4em round 0px 1% 2px)", + "xywh(1px 2% 3px 4em round 0px 1% 2px 3em)" + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.basic-shape-rect.enabled")) { + basicShapeXywhRectValues.push( + "rect(auto auto auto auto)", + "rect(1px 2% auto 4em)", + "rect(1px 2% auto 4em round 0px)", + "rect(1px 2% auto 4em round 0px 1%)", + "rect(1px 2% auto 4em round 0px 1% 2px)", + "rect(1px 2% auto 4em round 0px 1% 2px 3em)" + ); +} + +if (/* mozGradientsEnabled */ true) { + // Maybe one day :( + // Extend gradient lists with valid/invalid moz-prefixed expressions: + validNonUrlImageValues.push( + "-moz-linear-gradient(red, blue)", + "-moz-linear-gradient(red, yellow, blue)", + "-moz-linear-gradient(red 1px, yellow 20%, blue 24em, green)", + "-moz-linear-gradient(red, yellow, green, blue 50%)", + "-moz-linear-gradient(red -50%, yellow -25%, green, blue)", + "-moz-linear-gradient(red -99px, yellow, green, blue 120%)", + "-moz-linear-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "-moz-linear-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "-moz-linear-gradient(top, red, blue)", + + "-moz-linear-gradient(to top, red, blue)", + "-moz-linear-gradient(to bottom, red, blue)", + "-moz-linear-gradient(to left, red, blue)", + "-moz-linear-gradient(to right, red, blue)", + "-moz-linear-gradient(to top left, red, blue)", + "-moz-linear-gradient(to top right, red, blue)", + "-moz-linear-gradient(to bottom left, red, blue)", + "-moz-linear-gradient(to bottom right, red, blue)", + "-moz-linear-gradient(to left top, red, blue)", + "-moz-linear-gradient(to left bottom, red, blue)", + "-moz-linear-gradient(to right top, red, blue)", + "-moz-linear-gradient(to right bottom, red, blue)", + + "-moz-linear-gradient(top left, red, blue)", + "-moz-linear-gradient(left, red, blue)", + "-moz-linear-gradient(bottom, red, blue)", + + "-moz-linear-gradient(0, red, blue)", + + "-moz-linear-gradient(-33deg, red, blue)", + + "-moz-linear-gradient(blue calc(0px) ,green calc(25%) ,red calc(40px) ,blue calc(60px) , yellow calc(100px))", + "-moz-linear-gradient(-33deg, blue calc(-25%) ,red 40px)", + "-moz-linear-gradient(10deg, blue calc(100px + -25%),red calc(40px))", + "-moz-linear-gradient(10deg, blue calc(-25px),red calc(100%))", + "-moz-linear-gradient(.414rad, blue calc(100px + -25px) ,green calc(100px + -25px) ,red calc(100px + -25%) ,blue calc(-25px) , yellow calc(-25px))", + "-moz-linear-gradient(1turn, blue calc(-25%) ,green calc(25px) ,red calc(25%),blue calc(0px),white 50px, yellow calc(-25px))", + + "-moz-radial-gradient(red, blue)", + "-moz-radial-gradient(red, yellow, blue)", + "-moz-radial-gradient(red 1px, yellow 20%, blue 24em, green)", + "-moz-radial-gradient(red, yellow, green, blue 50%)", + "-moz-radial-gradient(red -50%, yellow -25%, green, blue)", + "-moz-radial-gradient(red -99px, yellow, green, blue 120%)", + "-moz-radial-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + + "-moz-radial-gradient(top left, red, blue)", + "-moz-radial-gradient(20% bottom, red, blue)", + "-moz-radial-gradient(center 20%, red, blue)", + "-moz-radial-gradient(left 35px, red, blue)", + "-moz-radial-gradient(10% 10em, red, blue)", + "-moz-radial-gradient(44px top, red, blue)", + + "-moz-radial-gradient(0 0, red, blue)", + "-moz-radial-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "-moz-radial-gradient(cover, red, blue)", + "-moz-radial-gradient(cover circle, red, blue)", + "-moz-radial-gradient(contain, red, blue)", + "-moz-radial-gradient(contain ellipse, red, blue)", + "-moz-radial-gradient(circle, red, blue)", + "-moz-radial-gradient(ellipse closest-corner, red, blue)", + "-moz-radial-gradient(farthest-side circle, red, blue)", + + "-moz-radial-gradient(top left, cover, red, blue)", + "-moz-radial-gradient(15% 20%, circle, red, blue)", + "-moz-radial-gradient(45px, ellipse closest-corner, red, blue)", + "-moz-radial-gradient(45px, farthest-side circle, red, blue)", + + "-moz-repeating-linear-gradient(red, blue)", + "-moz-repeating-linear-gradient(red, yellow, blue)", + "-moz-repeating-linear-gradient(red 1px, yellow 20%, blue 24em, green)", + "-moz-repeating-linear-gradient(red, yellow, green, blue 50%)", + "-moz-repeating-linear-gradient(red -50%, yellow -25%, green, blue)", + "-moz-repeating-linear-gradient(red -99px, yellow, green, blue 120%)", + "-moz-repeating-linear-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "-moz-repeating-linear-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "-moz-repeating-linear-gradient(to top, red, blue)", + "-moz-repeating-linear-gradient(to bottom, red, blue)", + "-moz-repeating-linear-gradient(to left, red, blue)", + "-moz-repeating-linear-gradient(to right, red, blue)", + "-moz-repeating-linear-gradient(to top left, red, blue)", + "-moz-repeating-linear-gradient(to top right, red, blue)", + "-moz-repeating-linear-gradient(to bottom left, red, blue)", + "-moz-repeating-linear-gradient(to bottom right, red, blue)", + "-moz-repeating-linear-gradient(to left top, red, blue)", + "-moz-repeating-linear-gradient(to left bottom, red, blue)", + "-moz-repeating-linear-gradient(to right top, red, blue)", + "-moz-repeating-linear-gradient(to right bottom, red, blue)", + + "-moz-repeating-linear-gradient(top left, red, blue)", + + "-moz-repeating-radial-gradient(red, blue)", + "-moz-repeating-radial-gradient(red, yellow, blue)", + "-moz-repeating-radial-gradient(red 1px, yellow 20%, blue 24em, green)", + "-moz-repeating-radial-gradient(red, yellow, green, blue 50%)", + "-moz-repeating-radial-gradient(red -50%, yellow -25%, green, blue)", + "-moz-repeating-radial-gradient(red -99px, yellow, green, blue 120%)", + "-moz-repeating-radial-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))", + "-moz-repeating-radial-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)", + + "-moz-repeating-radial-gradient(farthest-corner, red, blue)", + "-moz-repeating-radial-gradient(circle, red, blue)", + "-moz-repeating-radial-gradient(ellipse closest-corner, red, blue)", + + "-moz-radial-gradient(calc(25%) top, red, blue)", + "-moz-radial-gradient(left calc(25%), red, blue)", + "-moz-radial-gradient(calc(25px) top, red, blue)", + "-moz-radial-gradient(left calc(25px), red, blue)", + "-moz-radial-gradient(calc(-25%) top, red, blue)", + "-moz-radial-gradient(left calc(-25%), red, blue)", + "-moz-radial-gradient(calc(-25px) top, red, blue)", + "-moz-radial-gradient(left calc(-25px), red, blue)", + "-moz-radial-gradient(calc(100px + -25%) top, red, blue)", + "-moz-radial-gradient(left calc(100px + -25%), red, blue)", + "-moz-radial-gradient(calc(100px + -25px) top, red, blue)", + "-moz-radial-gradient(left calc(100px + -25px), red, blue)" + ); + + invalidNonUrlImageValues.push( + // The entries in this block used to be valid with the older more-complex + // -moz prefixed gradient syntax, but we've since simplified the syntax for + // consistency with -webkit prefixed gradients, in a way that makes these + // invalid now. + "-moz-linear-gradient(center 0%, red, blue)", + "-moz-linear-gradient(50% top, red, blue)", + "-moz-linear-gradient(50% 0%, red, blue)", + "-moz-linear-gradient(0 0, red, blue)", + "-moz-linear-gradient(20% bottom, red, blue)", + "-moz-linear-gradient(center 20%, red, blue)", + "-moz-linear-gradient(left 35px, red, blue)", + "-moz-linear-gradient(10% 10em, red, blue)", + "-moz-linear-gradient(44px top, red, blue)", + "-moz-linear-gradient(0px, red, blue)", + "-moz-linear-gradient(top left 45deg, red, blue)", + "-moz-linear-gradient(20% bottom -300deg, red, blue)", + "-moz-linear-gradient(center 20% 1.95929rad, red, blue)", + "-moz-linear-gradient(left 35px 30grad, red, blue)", + "-moz-linear-gradient(left 35px 0.1turn, red, blue)", + "-moz-linear-gradient(10% 10em 99999deg, red, blue)", + "-moz-linear-gradient(44px top -33deg, red, blue)", + "-moz-linear-gradient(30grad left 35px, red, blue)", + "-moz-linear-gradient(10deg 20px, red, blue)", + "-moz-linear-gradient(1turn 20px, red, blue)", + "-moz-linear-gradient(.414rad bottom, red, blue)", + "-moz-radial-gradient(top left 45deg, red, blue)", + "-moz-radial-gradient(20% bottom -300deg, red, blue)", + "-moz-radial-gradient(center 20% 1.95929rad, red, blue)", + "-moz-radial-gradient(left 35px 30grad, red, blue)", + "-moz-radial-gradient(10% 10em 99999deg, red, blue)", + "-moz-radial-gradient(44px top -33deg, red, blue)", + "-moz-radial-gradient(-33deg, red, blue)", + "-moz-radial-gradient(30grad left 35px, red, blue)", + "-moz-radial-gradient(10deg 20px, red, blue)", + "-moz-radial-gradient(.414rad bottom, red, blue)", + "-moz-radial-gradient(99deg, cover, red, blue)", + "-moz-radial-gradient(-1.2345rad, circle, red, blue)", + "-moz-radial-gradient(399grad, ellipse closest-corner, red, blue)", + "-moz-radial-gradient(399grad, farthest-side circle, red, blue)", + "-moz-radial-gradient(top left 99deg, cover, red, blue)", + "-moz-radial-gradient(15% 20% -1.2345rad, circle, red, blue)", + "-moz-radial-gradient(45px 399grad, ellipse closest-corner, red, blue)", + "-moz-radial-gradient(45px 399grad, farthest-side circle, red, blue)", + "-moz-repeating-linear-gradient(0 0, red, blue)", + "-moz-repeating-linear-gradient(20% bottom, red, blue)", + "-moz-repeating-linear-gradient(center 20%, red, blue)", + "-moz-repeating-linear-gradient(left 35px, red, blue)", + "-moz-repeating-linear-gradient(10% 10em, red, blue)", + "-moz-repeating-linear-gradient(44px top, red, blue)", + "-moz-repeating-linear-gradient(top left 45deg, red, blue)", + "-moz-repeating-linear-gradient(20% bottom -300deg, red, blue)", + "-moz-repeating-linear-gradient(center 20% 1.95929rad, red, blue)", + "-moz-repeating-linear-gradient(left 35px 30grad, red, blue)", + "-moz-repeating-linear-gradient(10% 10em 99999deg, red, blue)", + "-moz-repeating-linear-gradient(44px top -33deg, red, blue)", + "-moz-repeating-linear-gradient(30grad left 35px, red, blue)", + "-moz-repeating-linear-gradient(10deg 20px, red, blue)", + "-moz-repeating-linear-gradient(.414rad bottom, red, blue)", + + /* Negative radii */ + "-moz-radial-gradient(40%, -100px -10%, red, blue)", + + /* no quirks mode colors */ + "-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat", + /* no quirks mode lengths */ + "-moz-linear-gradient(10 10px -45deg, red, blue) repeat", + "-moz-linear-gradient(10px 10 -45deg, red, blue) repeat", + /* Unitless 0 is invalid as an */ + "-moz-linear-gradient(top left 0, red, blue)", + "-moz-linear-gradient(5px 5px 0, red, blue)", + /* There must be a comma between gradient-line (e.g. ) and colors */ + "-moz-linear-gradient(30deg red, blue)", + "-moz-linear-gradient(5px 5px 30deg red, blue)", + "-moz-linear-gradient(5px 5px red, blue)", + "-moz-linear-gradient(top left 30deg red, blue)", + + /* Old syntax */ + "-moz-linear-gradient(10px 10px, 20px, 30px 30px, 40px, from(blue), to(red))", + "-moz-radial-gradient(20px 20px, 10px 10px, from(green), to(#ff00ff))", + "-moz-radial-gradient(10px 10px, 20%, 40px 40px, 10px, from(green), to(#ff00ff))", + "-moz-linear-gradient(10px, 20px, 30px, 40px, color-stop(0.5, #00ccff))", + "-moz-linear-gradient(20px 20px, from(blue), to(red))", + "-moz-linear-gradient(40px 40px, 10px 10px, from(blue) to(red) color-stop(10%, fuchsia))", + "-moz-linear-gradient(20px 20px 30px, 10px 10px, from(red), to(#ff0000))", + "-moz-radial-gradient(left top, center, 20px 20px, 10px, from(blue), to(red))", + "-moz-linear-gradient(left left, top top, from(blue))", + "-moz-linear-gradient(inherit, 10px 10px, from(blue))", + /* New syntax */ + "-moz-linear-gradient(10px 10px, 20px, 30px 30px, 40px, blue 0, red 100%)", + "-moz-radial-gradient(20px 20px, 10px 10px, from(green), to(#ff00ff))", + "-moz-radial-gradient(10px 10px, 20%, 40px 40px, 10px, from(green), to(#ff00ff))", + "-moz-linear-gradient(10px, 20px, 30px, 40px, #00ccff 50%)", + "-moz-linear-gradient(40px 40px, 10px 10px, blue 0 fuchsia 10% red 100%)", + "-moz-linear-gradient(20px 20px 30px, 10px 10px, red 0, #ff0000 100%)", + "-moz-radial-gradient(left top, center, 20px 20px, 10px, from(blue), to(red))", + "-moz-linear-gradient(left left, top top, blue 0)", + "-moz-linear-gradient(inherit, 10px 10px, blue 0)", + "-moz-linear-gradient(left left blue red)", + "-moz-linear-gradient(left left blue, red)", + "-moz-linear-gradient()", + "-moz-linear-gradient(cover, red, blue)", + "-moz-linear-gradient(auto, red, blue)", + "-moz-linear-gradient(22 top, red, blue)", + "-moz-linear-gradient(10% red blue)", + "-moz-linear-gradient(10%, red blue)", + "-moz-linear-gradient(10%,, red, blue)", + "-moz-linear-gradient(45px, center, red, blue)", + "-moz-linear-gradient(45px, center red, blue)", + "-moz-radial-gradient(contain, ellipse, red, blue)", + "-moz-radial-gradient(10deg contain, red, blue)", + "-moz-radial-gradient(10deg, contain,, red, blue)", + "-moz-radial-gradient(contain contain, red, blue)", + "-moz-radial-gradient(ellipse circle, red, blue)", + "-moz-radial-gradient(to top left, red, blue)", + "-moz-radial-gradient(center, 10%, red, blue)", + "-moz-radial-gradient(5rad, 20px, red, blue)", + + "-moz-radial-gradient(at top left to cover, red, blue)", + "-moz-radial-gradient(at 15% 20% circle, red, blue)", + + "-moz-radial-gradient(to cover, red, blue)", + "-moz-radial-gradient(to contain, red, blue)", + "-moz-radial-gradient(to closest-side circle, red, blue)", + "-moz-radial-gradient(to farthest-corner ellipse, red, blue)", + + "-moz-radial-gradient(ellipse at 45px closest-corner, red, blue)", + "-moz-radial-gradient(circle at 45px farthest-side, red, blue)", + "-moz-radial-gradient(ellipse 45px, closest-side, red, blue)", + "-moz-radial-gradient(circle 45px, farthest-corner, red, blue)", + "-moz-radial-gradient(ellipse, ellipse closest-side, red, blue)", + "-moz-radial-gradient(circle, circle farthest-corner, red, blue)", + + "-moz-radial-gradient(99deg to farthest-corner, red, blue)", + "-moz-radial-gradient(-1.2345rad circle, red, blue)", + "-moz-radial-gradient(ellipse 399grad to closest-corner, red, blue)", + "-moz-radial-gradient(circle 399grad to farthest-side, red, blue)", + + "-moz-radial-gradient(at top left 99deg, to farthest-corner, red, blue)", + "-moz-radial-gradient(circle at 15% 20% -1.2345rad, red, blue)", + "-moz-radial-gradient(to top left at 30% 40%, red, blue)", + "-moz-radial-gradient(ellipse at 45px 399grad, to closest-corner, red, blue)", + "-moz-radial-gradient(at 45px 399grad to farthest-side circle, red, blue)", + + "-moz-radial-gradient(to 50%, red, blue)", + "-moz-radial-gradient(circle to 50%, red, blue)", + "-moz-radial-gradient(circle to 43px 43px, red, blue)", + "-moz-radial-gradient(circle to 50% 50%, red, blue)", + "-moz-radial-gradient(circle to 43px 50%, red, blue)", + "-moz-radial-gradient(circle to 50% 43px, red, blue)", + "-moz-radial-gradient(ellipse to 43px, red, blue)", + "-moz-radial-gradient(ellipse to 50%, red, blue)", + + "-moz-linear-gradient(to 0 0, red, blue)", + "-moz-linear-gradient(to 20% bottom, red, blue)", + "-moz-linear-gradient(to center 20%, red, blue)", + "-moz-linear-gradient(to left 35px, red, blue)", + "-moz-linear-gradient(to 10% 10em, red, blue)", + "-moz-linear-gradient(to 44px top, red, blue)", + "-moz-linear-gradient(to top left 45deg, red, blue)", + "-moz-linear-gradient(to 20% bottom -300deg, red, blue)", + "-moz-linear-gradient(to center 20% 1.95929rad, red, blue)", + "-moz-linear-gradient(to left 35px 30grad, red, blue)", + "-moz-linear-gradient(to 10% 10em 99999deg, red, blue)", + "-moz-linear-gradient(to 44px top -33deg, red, blue)", + "-moz-linear-gradient(to -33deg, red, blue)", + "-moz-linear-gradient(to 30grad left 35px, red, blue)", + "-moz-linear-gradient(to 10deg 20px, red, blue)", + "-moz-linear-gradient(to .414rad bottom, red, blue)", + + "-moz-linear-gradient(to top top, red, blue)", + "-moz-linear-gradient(to bottom bottom, red, blue)", + "-moz-linear-gradient(to left left, red, blue)", + "-moz-linear-gradient(to right right, red, blue)", + + "-moz-repeating-linear-gradient(10px 10px, 20px, 30px 30px, 40px, blue 0, red 100%)", + "-moz-repeating-radial-gradient(20px 20px, 10px 10px, from(green), to(#ff00ff))", + "-moz-repeating-radial-gradient(10px 10px, 20%, 40px 40px, 10px, from(green), to(#ff00ff))", + "-moz-repeating-linear-gradient(10px, 20px, 30px, 40px, #00ccff 50%)", + "-moz-repeating-linear-gradient(40px 40px, 10px 10px, blue 0 fuchsia 10% red 100%)", + "-moz-repeating-linear-gradient(20px 20px 30px, 10px 10px, red 0, #ff0000 100%)", + "-moz-repeating-radial-gradient(left top, center, 20px 20px, 10px, from(blue), to(red))", + "-moz-repeating-linear-gradient(left left, top top, blue 0)", + "-moz-repeating-linear-gradient(inherit, 10px 10px, blue 0)", + "-moz-repeating-linear-gradient(left left blue red)", + "-moz-repeating-linear-gradient()", + + "-moz-repeating-linear-gradient(to 0 0, red, blue)", + "-moz-repeating-linear-gradient(to 20% bottom, red, blue)", + "-moz-repeating-linear-gradient(to center 20%, red, blue)", + "-moz-repeating-linear-gradient(to left 35px, red, blue)", + "-moz-repeating-linear-gradient(to 10% 10em, red, blue)", + "-moz-repeating-linear-gradient(to 44px top, red, blue)", + "-moz-repeating-linear-gradient(to top left 45deg, red, blue)", + "-moz-repeating-linear-gradient(to 20% bottom -300deg, red, blue)", + "-moz-repeating-linear-gradient(to center 20% 1.95929rad, red, blue)", + "-moz-repeating-linear-gradient(to left 35px 30grad, red, blue)", + "-moz-repeating-linear-gradient(to 10% 10em 99999deg, red, blue)", + "-moz-repeating-linear-gradient(to 44px top -33deg, red, blue)", + "-moz-repeating-linear-gradient(to -33deg, red, blue)", + "-moz-repeating-linear-gradient(to 30grad left 35px, red, blue)", + "-moz-repeating-linear-gradient(to 10deg 20px, red, blue)", + "-moz-repeating-linear-gradient(to .414rad bottom, red, blue)", + + "-moz-repeating-linear-gradient(to top top, red, blue)", + "-moz-repeating-linear-gradient(to bottom bottom, red, blue)", + "-moz-repeating-linear-gradient(to left left, red, blue)", + "-moz-repeating-linear-gradient(to right right, red, blue)", + + "-moz-repeating-radial-gradient(to top left at 30% 40%, red, blue)", + "-moz-repeating-radial-gradient(ellipse at 45px closest-corner, red, blue)", + "-moz-repeating-radial-gradient(circle at 45px farthest-side, red, blue)", + + /* Valid only when unprefixed */ + "-moz-radial-gradient(at top left, red, blue)", + "-moz-radial-gradient(at 20% bottom, red, blue)", + "-moz-radial-gradient(at center 20%, red, blue)", + "-moz-radial-gradient(at left 35px, red, blue)", + "-moz-radial-gradient(at 10% 10em, red, blue)", + "-moz-radial-gradient(at 44px top, red, blue)", + "-moz-radial-gradient(at 0 0, red, blue)", + + "-moz-radial-gradient(circle 43px, red, blue)", + "-moz-radial-gradient(ellipse 43px 43px, red, blue)", + "-moz-radial-gradient(ellipse 50% 50%, red, blue)", + "-moz-radial-gradient(ellipse 43px 50%, red, blue)", + "-moz-radial-gradient(ellipse 50% 43px, red, blue)", + + "-moz-radial-gradient(farthest-corner at top left, red, blue)", + "-moz-radial-gradient(ellipse closest-corner at 45px, red, blue)", + "-moz-radial-gradient(circle farthest-side at 45px, red, blue)", + "-moz-radial-gradient(closest-side ellipse at 50%, red, blue)", + "-moz-radial-gradient(farthest-corner circle at 4em, red, blue)", + + "-moz-radial-gradient(30% 40% at top left, red, blue)", + "-moz-radial-gradient(50px 60px at 15% 20%, red, blue)", + "-moz-radial-gradient(7em 8em at 45px, red, blue)" + ); +} + +const pathValues = { + other_values: [ + "path('M 10 10 20 20 H 90 V 90 Z')", + "path('M10 10 20,20H90V90Z')", + "path('M 10 10 C 20 20, 40 20, 50 10')", + "path('M 10 80 C 40 10, 65 10, 95 80 S 1.5e2 150, 180 80')", + "path('M 10 80 Q 95 10 180 80')", + "path('M 10 80 Q 52.5 10, 95 80 T 180 80')", + "path('M 80 80 A 45 45, 0, 0, 0, 1.25e2 1.25e2 L 125 80 Z')", + "path('M100-200h20z')", + "path('M10,10L20.6.5z')", + ], + invalid_values: [ + "path()", + "path(a)", + "path('M 10 Z')", + "path('M 10-10 20')", + "path('M 10 10 C 20 20 40 20')", + ], +}; + +var gCSSProperties = { + animation: { + domProp: "animation", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + subproperties: [ + "animation-name", + "animation-duration", + "animation-timing-function", + "animation-delay", + "animation-direction", + "animation-fill-mode", + "animation-iteration-count", + "animation-play-state", + ], + initial_values: [ + "none none 0s 0s ease normal running 1.0", + "none", + "0s", + "ease", + "normal", + "running", + "1.0", + ], + other_values: [ + "none none 0s 0s cubic-bezier(0.25, 0.1, 0.25, 1.0) normal running 1.0", + "bounce 1s linear 2s", + "bounce 1s 2s linear", + "bounce linear 1s 2s", + "linear bounce 1s 2s", + "linear 1s bounce 2s", + "linear 1s 2s bounce", + "1s bounce linear 2s", + "1s bounce 2s linear", + "1s 2s bounce linear", + "1s linear bounce 2s", + "1s linear 2s bounce", + "1s 2s linear bounce", + "bounce linear 1s", + "bounce 1s linear", + "linear bounce 1s", + "linear 1s bounce", + "1s bounce linear", + "1s linear bounce", + "1s 2s bounce", + "1s bounce 2s", + "bounce 1s 2s", + "1s 2s linear", + "1s linear 2s", + "linear 1s 2s", + "bounce 1s", + "1s bounce", + "linear 1s", + "1s linear", + "1s 2s", + "2s 1s", + "bounce", + "linear", + "1s", + "height", + "2s", + "ease-in-out", + "2s ease-in", + "opacity linear", + "ease-out 2s", + "2s color, 1s bounce, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", + "1s \\32bounce linear 2s", + "1s -bounce linear 2s", + "1s -\\32bounce linear 2s", + "1s \\32 0bounce linear 2s", + "1s -\\32 0bounce linear 2s", + "1s \\2bounce linear 2s", + "1s -\\2bounce linear 2s", + "2s, 1s bounce", + "1s bounce, 2s", + "2s all, 1s bounce", + "1s bounce, 2s all", + "1s bounce, 2s none", + "2s none, 1s bounce", + "2s bounce, 1s all", + "2s all, 1s bounce", + ], + invalid_values: [ + "2s inherit", + "inherit 2s", + "2s bounce, 1s inherit", + "2s inherit, 1s bounce", + "2s initial", + "2s all,, 1s bounce", + "2s all, , 1s bounce", + "bounce 1s cubic-bezier(0, rubbish) 2s", + "bounce 1s steps(rubbish) 2s", + "2s unset", + ], + }, + "animation-delay": { + domProp: "animationDelay", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["0s", "0ms"], + other_values: [ + "1s", + "250ms", + "-100ms", + "-1s", + "1s, 250ms, 2.3s", + "calc(1s + 2ms)", + ], + invalid_values: ["0", "0px"], + }, + "animation-direction": { + domProp: "animationDirection", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["normal"], + other_values: [ + "alternate", + "normal, alternate", + "alternate, normal", + "normal, normal", + "normal, normal, normal", + "reverse", + "alternate-reverse", + "normal, reverse, alternate-reverse, alternate", + ], + invalid_values: [ + "normal normal", + "inherit, normal", + "reverse-alternate", + "normal, unset", + "unset, normal", + ], + }, + "animation-duration": { + domProp: "animationDuration", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0s", "0ms"], + applies_to_marker: true, + other_values: ["1s", "250ms", "1s, 250ms, 2.3s", "calc(1s + 2ms)"], + invalid_values: ["0", "0px", "-1ms", "-2s"], + }, + "animation-fill-mode": { + domProp: "animationFillMode", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["none"], + other_values: [ + "forwards", + "backwards", + "both", + "none, none", + "forwards, backwards", + "forwards, none", + "none, both", + ], + invalid_values: ["all"], + }, + "animation-iteration-count": { + domProp: "animationIterationCount", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["1"], + other_values: [ + "infinite", + "0", + "0.5", + "7.75", + "-0.0", + "1, 2, 3", + "infinite, 2", + "1, infinite", + "calc(1 + 2.0)", + ], + // negatives forbidden per + // http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html + invalid_values: ["none", "-1", "-0.5", "-1, infinite", "infinite, -3"], + }, + "animation-name": { + domProp: "animationName", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["none"], + other_values: [ + "all", + "ball", + "mall", + "color", + "bounce, bubble, opacity", + "foobar", + "auto", + "\\32bounce", + "-bounce", + "-\\32bounce", + "\\32 0bounce", + "-\\32 0bounce", + "\\2bounce", + "-\\2bounce", + ], + invalid_values: [ + "bounce, initial", + "initial, bounce", + "bounce, inherit", + "inherit, bounce", + "bounce, unset", + "unset, bounce", + ], + }, + "animation-play-state": { + domProp: "animationPlayState", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["running"], + other_values: [ + "paused", + "running, running", + "paused, running", + "paused, paused", + "running, paused", + "paused, running, running, running, paused, running", + ], + invalid_values: ["0"], + }, + "animation-timing-function": { + domProp: "animationTimingFunction", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["ease"], + other_values: [ + "cubic-bezier(0.25, 0.1, 0.25, 1.0)", + "linear", + "ease-in", + "ease-out", + "ease-in-out", + "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", + "cubic-bezier(0.5, 0.5, 0.5, 0.5)", + "cubic-bezier(0.25, 1.5, 0.75, -0.5)", + "step-start", + "step-end", + "steps(1)", + "steps(2, start)", + "steps(386)", + "steps(3, end)", + "steps(calc(2 + 1))", + "steps(1, jump-start)", + "steps(1, jump-end)", + "steps(2, jump-none)", + "steps(1, jump-both)", + ], + invalid_values: [ + "none", + "auto", + "cubic-bezier(0.25, 0.1, 0.25)", + "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", + "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", + "cubic-bezier(1.5, 0.5, 0.5, 0.5)", + "cubic-bezier(0.5, 0.5, -0.5, 0.5)", + "cubic-bezier(0.5, 0.5, 1.5, 0.5)", + "steps(2, step-end)", + "steps(0)", + "steps(-2)", + "steps(0, step-end, 1)", + "steps(0, jump-start)", + "steps(0, jump-end)", + "steps(1, jump-none)", + "steps(0, jump-both)", + ], + }, + appearance: { + domProp: "appearance", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["auto", "radio", "menulist"], + invalid_values: [], + }, + "-moz-appearance": { + domProp: "MozAppearance", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "appearance", + subproperties: ["appearance"], + }, + "-webkit-appearance": { + domProp: "webkitAppearance", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "appearance", + subproperties: ["appearance"], + }, + "aspect-ratio": { + domProp: "aspectRatio", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "1", + "1.0", + "1 / 2", + "1/2", + "16.2 / 9.5", + "1/0", + "0/1", + "0 / 0", + "auto 1", + "0 auto", + ], + invalid_values: ["none", "1 test", "1 / auto", "auto / 1"], + }, + "border-inline": { + domProp: "borderInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-inline-start-color", + "border-inline-start-style", + "border-inline-start-width", + "border-inline-end-color", + "border-inline-end-style", + "border-inline-end-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-inline-end": { + domProp: "borderInlineEnd", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-inline-end-color", + "border-inline-end-style", + "border-inline-end-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 green none"], + }, + "border-inline-color": { + domProp: "borderInlineColor", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-inline-start-color", "border-inline-end-color"], + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5) blue", "blue transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-inline-end-color": { + domProp: "borderInlineEndColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-inline-style": { + domProp: "borderInlineStyle", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-inline-start-style", "border-inline-end-style"], + initial_values: ["none"], + other_values: [ + "solid", + "dashed solid", + "solid dotted", + "double double", + "inset outset", + "inset double", + "none groove", + "ridge none", + ], + invalid_values: [], + }, + "border-inline-end-style": { + domProp: "borderInlineEndStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-inline-width": { + domProp: "borderInlineWidth", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-inline-start-width", "border-inline-end-width"], + prerequisites: { "border-style": "solid" }, + initial_values: ["medium", "3px", "medium medium"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(2px) thin", + "calc(-2px)", + "calc(-2px) thick", + "calc(0em)", + "medium calc(0em)", + "calc(0px)", + "1px calc(0px)", + "calc(5em)", + "1em calc(5em)", + ], + invalid_values: ["5%", "5", "5 thin", "thin 5%", "blue", "solid"], + }, + "border-inline-end-width": { + domProp: "borderInlineEndWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { "border-inline-end-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%", "5"], + }, + "border-image": { + domProp: "borderImage", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-image-source", + "border-image-slice", + "border-image-width", + "border-image-outset", + "border-image-repeat", + ], + initial_values: ["none"], + other_values: [ + "url('border.png') 27 27 27 27", + "url('border.png') 27", + "stretch url('border.png')", + "url('border.png') 27 fill", + "url('border.png') 27 27 27 27 repeat", + "repeat url('border.png') 27 27 27 27", + "url('border.png') repeat 27 27 27 27", + "url('border.png') fill 27 27 27 27 repeat", + "url('border.png') fill 27 27 27 27 repeat space", + "url('border.png') 27 27 27 27 / 1em", + "27 27 27 27 / 1em url('border.png') ", + "url('border.png') 27 27 27 27 / 10 10 10 / 10 10 repeat", + "repeat 27 27 27 27 / 10 10 10 / 10 10 url('border.png')", + "url('border.png') 27 27 27 27 / / 10 10 1em", + "fill 27 27 27 27 / / 10 10 1em url('border.png')", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em repeat", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em stretch round", + ], + invalid_values: [ + "url('border.png') 27 27 27 27 27", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em 1em", + "url('border.png') 27 27 27 27 /", + "url('border.png') fill", + "url('border.png') fill repeat", + "fill repeat", + "url('border.png') fill / 1em", + "url('border.png') / repeat", + "url('border.png') 1 /", + "url('border.png') 1 / /", + "1 / url('border.png')", + "url('border.png') / 1", + "url('border.png') / / 1", + ], + }, + "border-image-source": { + domProp: "borderImageSource", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["none"], + other_values: ["url('border.png')"].concat(validNonUrlImageValues), + invalid_values: ["url('border.png') url('border.png')"].concat( + invalidNonUrlImageValues + ), + unbalanced_values: [].concat(unbalancedGradientAndElementValues), + }, + "border-image-slice": { + domProp: "borderImageSlice", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["100%", "100% 100% 100% 100%"], + other_values: [ + "0%", + "10", + "10 100% 0 2", + "0 0 0 0", + "fill 10 10", + "10 10 fill", + ], + invalid_values: [ + "-10%", + "-10", + "10 10 10 10 10", + "10 10 10 10 -10", + "10px", + "-10px", + "fill", + "fill fill 10px", + "10px fill fill", + ], + }, + "border-image-width": { + domProp: "borderImageWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["1", "1 1 1 1"], + other_values: [ + "0", + "0%", + "0px", + "auto auto auto auto", + "10 10% auto 15px", + "10px 10px 10px 10px", + "10", + "10 10", + "10 10 10", + "calc(10px)", + "calc(10px + 5%)", + ], + invalid_values: [ + "-10", + "-10px", + "-10%", + "10 10 10 10 10", + "10 10 10 10 auto", + "auto auto auto auto auto", + "10px calc(nonsense)", + "1px red", + ], + unbalanced_values: ["10px calc("], + }, + "border-image-outset": { + domProp: "borderImageOutset", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["0", "0 0 0 0"], + other_values: [ + "10px", + "10", + "10 10", + "10 10 10", + "10 10 10 10", + "10px 10 10 10px", + ], + invalid_values: [ + "-10", + "-10px", + "-10%", + "10%", + "10 10 10 10 10", + "10px calc(nonsense)", + "1px red", + ], + unbalanced_values: ["10px calc("], + }, + "border-image-repeat": { + domProp: "borderImageRepeat", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["stretch", "stretch stretch"], + other_values: [ + "round", + "repeat", + "stretch round", + "repeat round", + "stretch repeat", + "round round", + "repeat repeat", + "space", + "stretch space", + "repeat space", + "round space", + "space space", + ], + invalid_values: ["none", "stretch stretch stretch", "0", "10", "0%", "0px"], + }, + "border-radius": { + domProp: "borderRadius", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + subproperties: [ + "border-bottom-left-radius", + "border-bottom-right-radius", + "border-top-left-radius", + "border-top-right-radius", + ], + initial_values: [ + "0", + "0px", + "0px 0 0 0px", + "calc(-2px)", + "calc(0px) calc(0pt)", + "calc(0px) calc(0pt) calc(0px) calc(0em)", + ], + other_values: [ + "0%", + "3%", + "1px", + "2em", + "3em 2px", + "2pt 3% 4em", + "2px 2px 2px 2px", // circular + "3% / 2%", + "1px / 4px", + "2em / 1em", + "3em 2px / 2px 3em", + "2pt 3% 4em / 4pt 1% 5em", + "2px 2px 2px 2px / 4px 4px 4px 4px", + "1pt / 2pt 3pt", + "4pt 5pt / 3pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "2px 2px calc(2px + 1%) 2px", + "1px 2px 2px 2px / 2px 2px calc(2px + 1%) 2px", + ], + invalid_values: [ + "2px -2px", + "inherit 2px", + "inherit / 2px", + "2px inherit", + "2px / inherit", + "2px 2px 2px 2px 2px", + "1px / 2px 2px 2px 2px 2px", + "2", + "2 2", + "2px 2px 2px 2px / 2px 2px 2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "unset / 2px", + "2px unset", + "2px / unset", + ], + }, + "border-bottom-left-radius": { + domProp: "borderBottomLeftRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-bottom-right-radius": { + domProp: "borderBottomRightRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-top-left-radius": { + domProp: "borderTopLeftRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-top-right-radius": { + domProp: "borderTopRightRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-start-start-radius": { + domProp: "borderStartStartRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-start-end-radius": { + domProp: "borderStartEndRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-end-start-radius": { + domProp: "borderEndStartRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-end-end-radius": { + domProp: "borderEndEndRadius", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { width: "200px", height: "100px", display: "inline-block" }, + initial_values: ["0", "0px", "calc(-2px)"], + other_values: [ + "0%", + "3%", + "1px", + "2em", // circular + "3% 2%", + "1px 4px", + "2em 2pt", // elliptical + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(3*25px) 5px", + "5px calc(3*25px)", + "calc(20%) calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "-1px", + "4px -2px", + "inherit 2px", + "2px inherit", + "2", + "2px 2", + "2 2px", + "2px calc(0px + rubbish)", + "unset 2px", + "2px unset", + ], + }, + "border-inline-start": { + domProp: "borderInlineStart", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-inline-start-color", + "border-inline-start-style", + "border-inline-start-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 green solid"], + }, + "border-inline-start-color": { + domProp: "borderInlineStartColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-inline-start-style": { + domProp: "borderInlineStartStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-inline-start-width": { + domProp: "borderInlineStartWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { "border-inline-start-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%", "5"], + }, + "-moz-box-align": { + domProp: "MozBoxAlign", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["stretch"], + other_values: ["start", "center", "baseline", "end"], + invalid_values: [], + }, + "-moz-box-direction": { + domProp: "MozBoxDirection", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["reverse"], + invalid_values: [], + }, + "-moz-box-flex": { + domProp: "MozBoxFlex", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0", "0.0", "-0.0"], + other_values: ["1", "100", "0.1"], + invalid_values: ["10px", "-1"], + }, + "-moz-box-ordinal-group": { + domProp: "MozBoxOrdinalGroup", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["1"], + other_values: ["2", "100", "0"], + invalid_values: ["1.0", "-1", "-1000"], + }, + "-moz-box-orient": { + domProp: "MozBoxOrient", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["horizontal", "inline-axis"], + other_values: ["vertical", "block-axis"], + invalid_values: [], + }, + "-moz-box-pack": { + domProp: "MozBoxPack", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["start"], + other_values: ["center", "end", "justify"], + invalid_values: [], + }, + "box-decoration-break": { + domProp: "boxDecorationBreak", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["slice"], + other_values: ["clone"], + invalid_values: ["auto", "none", "1px"], + }, + "box-sizing": { + domProp: "boxSizing", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["content-box"], + other_values: ["border-box"], + invalid_values: [ + "padding-box", + "margin-box", + "content", + "padding", + "border", + "margin", + ], + }, + "-moz-box-sizing": { + domProp: "MozBoxSizing", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "box-sizing", + subproperties: ["box-sizing"], + }, + "print-color-adjust": { + domProp: "printColorAdjust", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["economy"], + other_values: ["exact"], + invalid_values: [], + }, + "color-adjust": { + domProp: "colorAdjust", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "print-color-adjust", + subproperties: ["print-color-adjust"], + }, + "color-scheme": { + domProp: "colorScheme", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "light", + "dark", + "light dark", + "light dark purple", + "light light dark", + "only light", + "only light dark", + "only light dark purple", + "light only", + ], + invalid_values: ["only normal", "normal only", "only light only"], + }, + columns: { + domProp: "columns", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["column-count", "column-width"], + initial_values: ["auto", "auto auto"], + other_values: [ + "3", + "20px", + "2 10px", + "10px 2", + "2 auto", + "auto 2", + "auto 50px", + "50px auto", + ], + invalid_values: [ + "5%", + "-1px", + "-1", + "3 5", + "10px 4px", + "10 2px 5in", + "30px -1", + "auto 3 5px", + "5 auto 20px", + "auto auto auto", + "calc(50px + rubbish) 2", + ], + }, + "column-count": { + domProp: "columnCount", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["1", "17"], + // negative and zero invalid per editor's draft + invalid_values: ["-1", "0", "3px"], + }, + "column-fill": { + domProp: "columnFill", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["balance"], + other_values: ["auto"], + invalid_values: ["2px", "dotted", "5em"], + }, + "column-rule": { + domProp: "columnRule", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + prerequisites: { color: "green" }, + subproperties: [ + "column-rule-width", + "column-rule-style", + "column-rule-color", + ], + initial_values: [ + "medium none currentColor", + "none", + "medium", + "currentColor", + ], + other_values: [ + "2px blue solid", + "red dotted 1px", + "ridge 4px orange", + "5px solid", + ], + invalid_values: [ + "2px 3px 4px red", + "dotted dashed", + "5px dashed green 3px", + "5 solid", + "5 green solid", + ], + }, + "column-rule-width": { + domProp: "columnRuleWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { "column-rule-style": "solid" }, + initial_values: ["medium", "3px", "calc(3px)", "calc(5em + 3px - 5em)"], + other_values: [ + "thin", + "15px", + /* valid calc() values */ + "calc(-2px)", + "calc(2px)", + "calc(3em)", + "calc(3em + 2px)", + "calc( 3em + 2px)", + "calc(3em + 2px )", + "calc( 3em + 2px )", + "calc(3*25px)", + "calc(3 *25px)", + "calc(3 * 25px)", + "calc(3* 25px)", + "calc(25px*3)", + "calc(25px *3)", + "calc(25px* 3)", + "calc(25px * 3)", + "calc(25px * 3 / 4)", + "calc((25px * 3) / 4)", + "calc(25px * (3 / 4))", + "calc(3 * 25px / 4)", + "calc((3 * 25px) / 4)", + "calc(3 * (25px / 4))", + "calc(3em + 25px * 3 / 4)", + "calc(3em + (25px * 3) / 4)", + "calc(3em + 25px * (3 / 4))", + "calc(25px * 3 / 4 + 3em)", + "calc((25px * 3) / 4 + 3em)", + "calc(25px * (3 / 4) + 3em)", + "calc(3em + (25px * 3 / 4))", + "calc(3em + ((25px * 3) / 4))", + "calc(3em + (25px * (3 / 4)))", + "calc((25px * 3 / 4) + 3em)", + "calc(((25px * 3) / 4) + 3em)", + "calc((25px * (3 / 4)) + 3em)", + "calc(3*25px + 1in)", + "calc(1in - 3em + 2px)", + "calc(1in - (3em + 2px))", + "calc((1in - 3em) + 2px)", + "calc(50px/2)", + "calc(50px/(2 - 1))", + "calc(-3px)", + /* numeric reduction cases */ + "calc(5 * 3 * 2em)", + "calc(2em * 5 * 3)", + "calc((5 * 3) * 2em)", + "calc(2em * (5 * 3))", + "calc((5 + 3) * 2em)", + "calc(2em * (5 + 3))", + "calc(2em / (5 + 3))", + "calc(2em * (5*2 + 3))", + "calc(2em * ((5*2) + 3))", + "calc(2em * (5*(2 + 3)))", + + "calc((5 + 7) * 3em)", + "calc((5em + 3em) - 2em)", + "calc((5em - 3em) + 2em)", + "calc(2em - (5em - 3em))", + "calc(2em + (5em - 3em))", + "calc(2em - (5em + 3em))", + "calc(2em + (5em + 3em))", + "calc(2em + 5em - 3em)", + "calc(2em - 5em - 3em)", + "calc(2em + 5em + 3em)", + "calc(2em - 5em + 3em)", + + "calc(2em / 4 * 3)", + "calc(2em * 4 / 3)", + "calc(2em * 4 * 3)", + "calc(2em / 4 / 3)", + "calc(4 * 2em / 3)", + "calc(4 / 3 * 2em)", + + "calc((2em / 4) * 3)", + "calc((2em * 4) / 3)", + "calc((2em * 4) * 3)", + "calc((2em / 4) / 3)", + "calc((4 * 2em) / 3)", + "calc((4 / 3) * 2em)", + + "calc(2em / (4 * 3))", + "calc(2em * (4 / 3))", + "calc(2em * (4 * 3))", + "calc(2em / (4 / 3))", + "calc(4 * (2em / 3))", + + "min(5px)", + "min(5px,2em)", + + "max(5px)", + "max(5px,2em)", + + "calc(min(5px))", + "calc(min(5px,2em))", + + "calc(max(5px))", + "calc(max(5px,2em))", + + // Valid cases with unitless zero (which is never + // a length). + "calc(0 * 2em)", + "calc(2em * 0)", + "calc(3em + 0 * 2em)", + "calc(3em + 2em * 0)", + "calc((0 + 2) * 2em)", + "calc((2 + 0) * 2em)", + // And test zero lengths while we're here. + "calc(2 * 0px)", + "calc(0 * 0px)", + "calc(2 * 0em)", + "calc(0 * 0em)", + "calc(0px * 0)", + "calc(0px * 2)", + ], + invalid_values: [ + "20", + "-1px", + "red", + "50%", + /* invalid calc() values */ + "calc(2em+ 2px)", + "calc(2em +2px)", + "calc(2em+2px)", + "calc(2em- 2px)", + "calc(2em -2px)", + "calc(2em-2px)", + "-moz-min()", + "calc(min())", + "-moz-max()", + "calc(max())", + "-moz-min(5px)", + "-moz-max(5px)", + "-moz-min(5px,2em)", + "-moz-max(5px,2em)", + "calc(5 + 5)", + "calc(5 * 5)", + "calc(5em * 5em)", + "calc(5em / 5em * 5em)", + + "calc(4 * 3 / 2em)", + "calc((4 * 3) / 2em)", + "calc(4 * (3 / 2em))", + "calc(4 / (3 * 2em))", + + // Tests for handling of unitless zero, which cannot + // be a length inside calc(). + "calc(0)", + "calc(0 + 2em)", + "calc(2em + 0)", + "calc(0 * 2)", + "calc(2 * 0)", + "calc(1 * (2em + 0))", + "calc((2em + 0))", + "calc((2em + 0) * 1)", + "calc(1 * (0 + 2em))", + "calc((0 + 2em))", + "calc((0 + 2em) * 1)", + ], + }, + "column-rule-style": { + domProp: "columnRuleStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "solid", + "hidden", + "ridge", + "groove", + "inset", + "outset", + "double", + "dotted", + "dashed", + ], + invalid_values: ["20", "foo"], + }, + "column-rule-color": { + domProp: "columnRuleColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "green" }, + initial_values: ["currentColor"], + other_values: ["red", "blue", "#ffff00"], + invalid_values: ["ffff00"], + }, + "column-span": { + domProp: "columnSpan", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["all"], + invalid_values: ["-1", "0", "auto", "2px"], + }, + "column-width": { + domProp: "columnWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "15px", + "calc(15px)", + "calc(30px - 3em)", + "calc(-15px)", + "0px", + "calc(0px)", + ], + invalid_values: ["20", "-1px", "50%"], + }, + d: { + domProp: "d", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["path('')", "path(' ')"].concat(pathValues.other_values), + invalid_values: pathValues.invalid_values, + }, + "-moz-float-edge": { + domProp: "MozFloatEdge", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["content-box"], + other_values: ["margin-box"], + invalid_values: ["content", "padding", "border", "margin"], + }, + "-moz-force-broken-image-icon": { + domProp: "MozForceBrokenImageIcon", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["1"], + invalid_values: [], + }, + "margin-inline": { + domProp: "marginInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["margin-inline-start", "margin-inline-end"], + initial_values: ["0", "0px 0em"], + other_values: [ + "1px", + "3em 1%", + "5%", + "calc(2px) 1%", + "calc(-2px) 1%", + "calc(50%) 1%", + "calc(3*25px) calc(2px)", + "calc(25px*3) 1em", + "calc(3*25px + 50%) calc(3*25px - 50%)", + ], + invalid_values: [ + "5", + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + "margin-inline-end": { + domProp: "marginInlineEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* no subproperties */ + /* auto may or may not be initial */ + initial_values: [ + "0", + "0px", + "0%", + "0em", + "0ex", + "calc(0pt)", + "calc(0% + 0px)", + ], + other_values: [ + "1px", + "3em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "5", + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + "margin-inline-start": { + domProp: "marginInlineStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* no subproperties */ + /* auto may or may not be initial */ + initial_values: [ + "0", + "0px", + "0%", + "0em", + "0ex", + "calc(0pt)", + "calc(0% + 0px)", + ], + other_values: [ + "1px", + "3em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "5", + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + mask: { + domProp: "mask", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + /* FIXME: All mask-border-* should be added when we implement them. */ + subproperties: [ + "mask-clip", + "mask-image", + "mask-mode", + "mask-origin", + "mask-position-x", + "mask-position-y", + "mask-repeat", + "mask-size", + "mask-composite", + ], + initial_values: [ + "match-source", + "none", + "repeat", + "add", + "0% 0%", + "top left", + "0% 0% / auto", + "top left / auto", + "left top / auto", + "0% 0% / auto auto", + "top left none", + "left top none", + "none left top", + "none top left", + "none 0% 0%", + "top left / auto none", + "left top / auto none", + "top left / auto auto none", + "match-source none repeat add top left", + "top left repeat none add", + "none repeat add top left / auto", + "top left / auto repeat none add match-source", + "none repeat add 0% 0% / auto auto match-source", + "border-box", + "border-box border-box", + ], + other_values: [ + "none alpha repeat add left top", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + "no-repeat url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==') alpha left top add", + "repeat-x", + "repeat-y", + "no-repeat", + "none repeat-y alpha add 0% 0%", + "subtract", + "0% top subtract alpha repeat none", + "top", + "left", + "50% 50%", + "center", + "top / 100px", + "left / contain", + "left / cover", + "10px / 10%", + "10em / calc(20px)", + "top left / 100px 100px", + "top left / 100px auto", + "top left / 100px 10%", + "top left / 100px calc(20px)", + "bottom right add none alpha repeat", + "50% alpha", + "alpha 50%", + "50%", + "url(#mymask)", + "radial-gradient(at 10% bottom, #ffffff, black) add no-repeat", + "repeating-radial-gradient(at 10% bottom, #ffffff, black) no-repeat", + "-moz-element(#test) alpha", + /* multiple mask-image */ + "url(404.png), url(404.png)", + "repeat-x, subtract, none", + "0% top url(404.png), url(404.png) 50% top", + "subtract repeat-y top left url(404.png), repeat-x alpha", + "top left / contain, bottom right / cover", + /* test cases with clip+origin in the shorthand */ + "url(404.png) alpha padding-box", + "url(404.png) border-box alpha", + "content-box url(404.png)", + "url(404.png) alpha padding-box padding-box", + "url(404.png) alpha padding-box border-box", + "content-box border-box url(404.png)", + "alpha padding-box url(404.png) border-box", + "alpha padding-box url(404.png) padding-box", + ], + invalid_values: [ + /* mixes with keywords have to be in correct order */ + "50% left", + "top 50%", + /* no quirks mode colors */ + "radial-gradient(at 10% bottom, ffffff, black) add no-repeat", + /* no quirks mode lengths */ + "linear-gradient(red -99, yellow, green, blue 120%)", + /* bug 258080: don't accept background-position separated */ + "left url(404.png) top", + "top url(404.png) left", + "-moz-element(#a rubbish)", + "left top / match-source", + ], + }, + "mask-clip": { + domProp: "maskClip", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["border-box"], + other_values: [ + "content-box", + "fill-box", + "stroke-box", + "view-box", + "no-clip", + "padding-box", + "border-box, padding-box", + "padding-box, padding-box, padding-box", + "border-box, border-box", + ], + invalid_values: ["content-box content-box", "margin-box"], + }, + "mask-composite": { + domProp: "maskComposite", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["add"], + other_values: [ + "subtract", + "intersect", + "exclude", + "add, add", + "subtract, intersect", + "subtract, subtract, add", + ], + invalid_values: ["add subtract", "intersect exclude"], + }, + "mask-image": { + domProp: "maskImage", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==')", + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + "none, none", + "none, none, none, none, none", + "url(#mymask)", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), none", + "none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), none", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + ].concat(validNonUrlImageValues), + invalid_values: [].concat(invalidNonUrlImageValues), + unbalanced_values: [].concat(unbalancedGradientAndElementValues), + }, + "mask-mode": { + domProp: "maskMode", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["match-source"], + other_values: [ + "alpha", + "luminance", + "match-source, match-source", + "match-source, alpha", + "alpha, luminance, match-source", + ], + invalid_values: ["match-source match-source", "alpha match-source"], + }, + "mask-origin": { + domProp: "maskOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["border-box"], + other_values: [ + "padding-box", + "content-box", + "fill-box", + "stroke-box", + "view-box", + "border-box, padding-box", + "padding-box, padding-box, padding-box", + "border-box, border-box", + ], + invalid_values: ["padding-box padding-box", "no-clip", "margin-box"], + }, + "mask-position": { + domProp: "maskPosition", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + initial_values: [ + "top 0% left 0%", + "top left", + "left top", + "0% 0%", + "0% top", + "left 0%", + ], + other_values: [ + "top", + "left", + "right", + "bottom", + "center", + "center bottom", + "bottom center", + "center right", + "right center", + "center top", + "top center", + "center left", + "left center", + "right bottom", + "bottom right", + "50%", + "top left, top left", + "top left, top right", + "top right, top left", + "left top, 0% 0%", + "10% 20%, 30%, 40%", + "top left, bottom right", + "right bottom, left top", + "0%", + "0px", + "30px", + "0%, 10%, 20%, 30%", + "top, top, top, top, top", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + "0px 0px", + "right 20px top 60px", + "right 20px bottom 60px", + "left 20px top 60px", + "left 20px bottom 60px", + "right -50px top -50px", + "left -50px bottom -50px", + "right 20px top -50px", + "right -20px top 50px", + "right 3em bottom 10px", + "bottom 3em right 10px", + "top 3em right 10px", + "left 15px", + "10px top", + "left 20%", + "right 20%", + ], + subproperties: ["mask-position-x", "mask-position-y"], + invalid_values: [ + "center 10px center 4px", + "center 10px center", + "top 20%", + "bottom 20%", + "50% left", + "top 50%", + "50% bottom 10%", + "right 10% 50%", + "left right", + "top bottom", + "left 10% right", + "top 20px bottom 20px", + "left left", + "0px calc(0px + rubbish)", + "left top 15px", + "left 10px top", + ], + }, + "mask-position-x": { + domProp: "maskPositionX", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["left", "0%"], + other_values: [ + "right", + "center", + "50%", + "center, center", + "center, right", + "right, center", + "center, 50%", + "10%, 20%, 40%", + "1px", + "30px", + "50%, 10%, 20%, 30%", + "center, center, center, center, center", + "calc(20px)", + "calc(20px + 1em)", + "calc(20px / 2)", + "calc(20px + 50%)", + "calc(50% - 10px)", + "calc(-20px)", + "calc(-50%)", + "calc(-20%)", + "right 20px", + "left 20px", + "right -50px", + "left -50px", + "right 20px", + "right 3em", + ], + invalid_values: [ + "center 10px", + "right 10% 50%", + "left right", + "left left", + "bottom 20px", + "top 10%", + "bottom 3em", + "top", + "bottom", + "top, top", + "top, bottom", + "bottom, top", + "top, 0%", + "top, top, top, top, top", + "calc(0px + rubbish)", + "center 0%", + ], + }, + "mask-position-y": { + domProp: "maskPositionY", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["top", "0%"], + other_values: [ + "bottom", + "center", + "50%", + "center, center", + "center, bottom", + "bottom, center", + "center, 0%", + "10%, 20%, 40%", + "1px", + "30px", + "50%, 10%, 20%, 30%", + "center, center, center, center, center", + "calc(20px)", + "calc(20px + 1em)", + "calc(20px / 2)", + "calc(20px + 50%)", + "calc(50% - 10px)", + "calc(-20px)", + "calc(-50%)", + "calc(-20%)", + "bottom 20px", + "top 20px", + "bottom -50px", + "top -50px", + "bottom 20px", + "bottom 3em", + ], + invalid_values: [ + "center 10px", + "bottom 10% 50%", + "top bottom", + "top top", + "right 20px", + "left 10%", + "right 3em", + "left", + "right", + "left, left", + "left, right", + "right, left", + "left, 0%", + "left, left, left, left, left", + "calc(0px + rubbish)", + "center 0%", + ], + }, + "mask-repeat": { + domProp: "maskRepeat", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["repeat", "repeat repeat"], + other_values: [ + "repeat-x", + "repeat-y", + "no-repeat", + "repeat-x, repeat-x", + "repeat, no-repeat", + "repeat-y, no-repeat, repeat-y", + "repeat, repeat, repeat", + "repeat no-repeat", + "no-repeat repeat", + "no-repeat no-repeat", + "repeat no-repeat", + "no-repeat no-repeat, no-repeat no-repeat", + ], + invalid_values: [ + "repeat repeat repeat", + "repeat-x repeat-y", + "repeat repeat-x", + "repeat repeat-y", + "repeat-x repeat", + "repeat-y repeat", + ], + }, + "mask-size": { + domProp: "maskSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto", "auto auto"], + other_values: [ + "contain", + "cover", + "100px auto", + "auto 100px", + "100% auto", + "auto 100%", + "25% 50px", + "3em 40%", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + ], + invalid_values: [ + "contain contain", + "cover cover", + "cover auto", + "auto cover", + "contain cover", + "cover contain", + "-5px 3px", + "3px -5px", + "auto -5px", + "-5px auto", + "5 3", + "10px calc(10px + rubbish)", + ], + }, + "mask-type": { + domProp: "maskType", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["luminance"], + other_values: ["alpha"], + invalid_values: [], + }, + "padding-inline-end": { + domProp: "paddingInlineEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + logical: true, + /* no subproperties */ + initial_values: [ + "0", + "0px", + "0%", + "0em", + "0ex", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "3em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: ["5"], + }, + "padding-inline-start": { + domProp: "paddingInlineStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + logical: true, + /* no subproperties */ + initial_values: [ + "0", + "0px", + "0%", + "0em", + "0ex", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "3em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: ["5"], + }, + resize: { + domProp: "resize", + inherited: false, + type: CSS_TYPE_LONGHAND, + // No applies_to_placeholder because we have a !important rule in forms.css. + prerequisites: { display: "block", overflow: "auto" }, + initial_values: ["none"], + other_values: ["both", "horizontal", "vertical", "inline", "block"], + invalid_values: [], + }, + "tab-size": { + domProp: "tabSize", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["8"], + other_values: [ + "0", + "2.5", + "3", + "99", + "12000", + "0px", + "1em", + "calc(1px + 1em)", + "calc(1px - 2px)", + "calc(1 + 1)", + "calc(-2.5)", + ], + invalid_values: [ + "9%", + "calc(9% + 1px)", + "calc(1 + 1em)", + "-1", + "-808", + "auto", + ], + }, + "-moz-text-size-adjust": { + domProp: "MozTextSizeAdjust", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["-5%", "0", "100", "0%", "50%", "100%", "220.3%"], + }, + transform: { + domProp: "transform", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { width: "300px", height: "50px" }, + initial_values: ["none"], + other_values: [ + "translatex(1px)", + "translatex(4em)", + "translatex(-4px)", + "translatex(3px)", + "translatex(0px) translatex(1px) translatex(2px) translatex(3px) translatex(4px)", + "translatey(4em)", + "translate(3px)", + "translate(10px, -3px)", + "rotate(45deg)", + "rotate(45grad)", + "rotate(45rad)", + "rotate(0.25turn)", + "rotate(0)", + "scalex(10)", + "scalex(10%)", + "scalex(-10)", + "scalex(-10%)", + "scaley(10)", + "scaley(10%)", + "scaley(-10)", + "scaley(-10%)", + "scale(10)", + "scale(10%)", + "scale(10, 20)", + "scale(10%, 20%)", + "scale(-10)", + "scale(-10%)", + "scale(-10, 20)", + "scale(10%, -20%)", + "scale(10, 20%)", + "scale(-10, 20%)", + "skewx(30deg)", + "skewx(0)", + "skewy(0)", + "skewx(30grad)", + "skewx(30rad)", + "skewx(0.08turn)", + "skewy(30deg)", + "skewy(30grad)", + "skewy(30rad)", + "skewy(0.08turn)", + "rotate(45deg) scale(2, 1)", + "skewx(45deg) skewx(-50grad)", + "translate(0, 0) scale(1, 1) skewx(0) skewy(0) matrix(1, 0, 0, 1, 0, 0)", + "translatex(50%)", + "translatey(50%)", + "translate(50%)", + "translate(3%, 5px)", + "translate(5px, 3%)", + "matrix(1, 2, 3, 4, 5, 6)", + /* valid calc() values */ + "translatex(calc(5px + 10%))", + "translatey(calc(0.25 * 5px + 10% / 3))", + "translate(calc(5px - 10% * 3))", + "translate(calc(5px - 3 * 10%), 50px)", + "translate(-50px, calc(5px - 10% * 3))", + "translate(10px, calc(min(5px,10%)))", + "translate(calc(max(5px,10%)), 10%)", + "translate(max(5px,10%), 10%)", + "translatez(1px)", + "translatez(4em)", + "translatez(-4px)", + "translatez(0px)", + "translatez(2px) translatez(5px)", + "translate3d(3px, 4px, 5px)", + "translate3d(2em, 3px, 1em)", + "translatex(2px) translate3d(4px, 5px, 6px) translatey(1px)", + "scale3d(4, 4, 4)", + "scale3d(4%, 4%, 4%)", + "scale3d(-2, 3, -7)", + "scale3d(-2%, 3%, -7%)", + "scalez(4)", + "scalez(4%)", + "scalez(-6)", + "scalez(-6%)", + "rotate3d(2, 3, 4, 45deg)", + "rotate3d(-3, 7, 0, 12rad)", + "rotatex(15deg)", + "rotatey(-12grad)", + "rotatez(72rad)", + "rotatex(0.125turn)", + "rotate3d(0, 0, 0, 0rad)", + "perspective(0px)", + "perspective(1000px)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)", + ], + invalid_values: [ + "1px", + "#0000ff", + "red", + "auto", + "translatex(1)", + "translatey(1)", + "translate(2)", + "translate(-3, -4)", + "translatex(1px 1px)", + "translatex(translatex(1px))", + "translatex(#0000ff)", + "translatex(red)", + "translatey()", + "matrix(1px, 2px, 3px, 4px, 5px, 6px)", + "skewx(red)", + "matrix(1%, 0, 0, 0, 0px, 0px)", + "matrix(0, 1%, 2, 3, 4px,5px)", + "matrix(0, 1, 2%, 3, 4px, 5px)", + "matrix(0, 1, 2, 3%, 4%, 5%)", + "matrix(1, 2, 3, 4, 5px, 6%)", + "matrix(1, 2, 3, 4, 5%, 6px)", + "matrix(1, 2, 3, 4, 5%, 6%)", + "matrix(1, 2, 3, 4, 5px, 6em)", + /* invalid calc() values */ + "translatey(-moz-min(5px,10%))", + "translatex(-moz-max(5px,10%))", + "matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))", + "perspective(-10px)", + "matrix3d(dinosaur)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15%, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16px)", + "rotatey(words)", + "rotatex(7)", + "translate3d(3px, 4px, 1px, 7px)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)", + ], + }, + "transform-box": { + domProp: "transformBox", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["view-box"], + other_values: ["fill-box", "border-box"], + invalid_values: ["padding-box", "margin-box"], + }, + "transform-origin": { + domProp: "transformOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* no subproperties */ + prerequisites: { width: "10px", height: "10px", display: "block" }, + initial_values: ["50% 50%", "center", "center center"], + other_values: [ + "25% 25%", + "6px 5px", + "20% 3em", + "0 0", + "0in 1in", + "top", + "bottom", + "top left", + "top right", + "top center", + "center left", + "center right", + "bottom left", + "bottom right", + "bottom center", + "20% center", + "6px center", + "13in bottom", + "left 50px", + "right 13%", + "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + "6px 5px 5px", + "top center 10px", + ], + invalid_values: [ + "red", + "auto", + "none", + "0.5 0.5", + "40px #0000ff", + "border", + "center red", + "right diagonal", + "#00ffff bottom", + "0px calc(0px + rubbish)", + "0px 0px calc(0px + rubbish)", + ], + }, + "perspective-origin": { + domProp: "perspectiveOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* no subproperties */ + prerequisites: { width: "10px", height: "10px", display: "block" }, + initial_values: ["50% 50%", "center", "center center"], + other_values: [ + "25% 25%", + "6px 5px", + "20% 3em", + "0 0", + "0in 1in", + "top", + "bottom", + "top left", + "top right", + "top center", + "center left", + "center right", + "bottom left", + "bottom right", + "bottom center", + "20% center", + "6px center", + "13in bottom", + "left 50px", + "right 13%", + "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + ], + invalid_values: [ + "red", + "auto", + "none", + "0.5 0.5", + "40px #0000ff", + "border", + "center red", + "right diagonal", + "#00ffff bottom", + ], + }, + perspective: { + domProp: "perspective", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1000px", "500.2px", "0", "0px"], + invalid_values: ["pants", "200", "-100px", "-27.2em"], + }, + "backface-visibility": { + domProp: "backfaceVisibility", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["visible"], + other_values: ["hidden"], + invalid_values: ["collapse"], + }, + "transform-style": { + domProp: "transformStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["flat"], + other_values: ["preserve-3d"], + invalid_values: [], + }, + "-moz-user-input": { + domProp: "MozUserInput", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: [], + }, + "-moz-user-modify": { + domProp: "MozUserModify", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["read-only"], + other_values: ["read-write", "write-only"], + invalid_values: [], + }, + "-moz-user-select": { + domProp: "MozUserSelect", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "user-select", + subproperties: ["user-select"], + }, + "user-select": { + domProp: "userSelect", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none", "text", "all", "-moz-none"], + invalid_values: [], + }, + background: { + domProp: "background", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "background-attachment", + "background-color", + "background-image", + "background-position-x", + "background-position-y", + "background-repeat", + "background-clip", + "background-origin", + "background-size", + ], + initial_values: [ + "transparent", + "none", + "repeat", + "scroll", + "0% 0%", + "top left", + "left top", + "0% 0% / auto", + "top left / auto", + "left top / auto", + "0% 0% / auto auto", + "transparent none", + "top left none", + "left top none", + "none left top", + "none top left", + "none 0% 0%", + "left top / auto none", + "left top / auto auto none", + "transparent none repeat scroll top left", + "left top repeat none scroll transparent", + "transparent none repeat scroll top left / auto", + "left top / auto repeat none scroll transparent", + "none repeat scroll 0% 0% / auto auto transparent", + "padding-box border-box", + ], + other_values: [ + /* without multiple backgrounds */ + "green", + "none green repeat scroll left top", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + "repeat url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==') transparent left top scroll", + "repeat-x", + "repeat-y", + "no-repeat", + "none repeat-y transparent scroll 0% 0%", + "fixed", + "0% top transparent fixed repeat none", + "top", + "left", + "50% 50%", + "center", + "top / 100px", + "left / contain", + "left / cover", + "10px / 10%", + "10em / calc(20px)", + "top left / 100px 100px", + "top left / 100px auto", + "top left / 100px 10%", + "top left / 100px calc(20px)", + "bottom right 8px scroll none transparent repeat", + "50% transparent", + "transparent 50%", + "50%", + "radial-gradient(at 10% bottom, #ffffff, black) scroll no-repeat", + "repeating-radial-gradient(at 10% bottom, #ffffff, black) scroll no-repeat", + "-moz-element(#test) lime", + /* multiple backgrounds */ + "url(404.png), url(404.png)", + "url(404.png), url(404.png) transparent", + "url(404.png), url(404.png) red", + "repeat-x, fixed, none", + "0% top url(404.png), url(404.png) 0% top", + "fixed repeat-y top left url(404.png), repeat-x green", + "top left / contain, bottom right / cover", + /* test cases with clip+origin in the shorthand */ + "url(404.png) green padding-box", + "url(404.png) border-box transparent", + "content-box url(404.png) blue", + "url(404.png) green padding-box padding-box", + "url(404.png) green padding-box border-box", + "content-box border-box url(404.png) blue", + "url(404.png) green padding-box text", + "content-box text url(404.png) blue", + /* clip and origin separated in the shorthand */ + "url(404.png) padding-box green border-box", + "url(404.png) padding-box green padding-box", + "transparent padding-box url(404.png) border-box", + "transparent padding-box url(404.png) padding-box", + /* text */ + "text", + "text border-box", + ], + invalid_values: [ + /* mixes with keywords have to be in correct order */ + "50% left", + "top 50%", + /* no quirks mode colors */ + "radial-gradient(at 10% bottom, ffffff, black) scroll no-repeat", + /* no quirks mode lengths */ + "linear-gradient(red -99, yellow, green, blue 120%)", + /* bug 258080: don't accept background-position separated */ + "left url(404.png) top", + "top url(404.png) left", + /* not allowed to have color in non-bottom layer */ + "url(404.png) transparent, url(404.png)", + "url(404.png) red, url(404.png)", + "url(404.png) transparent, url(404.png) transparent", + "url(404.png) transparent red, url(404.png) transparent red", + "url(404.png) red, url(404.png) red", + "url(404.png) rgba(0, 0, 0, 0), url(404.png)", + "url(404.png) rgb(255, 0, 0), url(404.png)", + "url(404.png) rgba(0, 0, 0, 0), url(404.png) rgba(0, 0, 0, 0)", + "url(404.png) rgba(0, 0, 0, 0) rgb(255, 0, 0), url(404.png) rgba(0, 0, 0, 0) rgb(255, 0, 0)", + "url(404.png) rgb(255, 0, 0), url(404.png) rgb(255, 0, 0)", + /* error inside functions */ + "-moz-element(#a rubbish) black", + "content-box text text", + "padding-box text url(404.png) text", + ], + }, + "background-attachment": { + domProp: "backgroundAttachment", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["scroll"], + other_values: [ + "fixed", + "local", + "scroll,scroll", + "fixed, scroll", + "scroll, fixed, local, scroll", + "fixed, fixed", + ], + invalid_values: [], + }, + "background-blend-mode": { + domProp: "backgroundBlendMode", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + invalid_values: ["none", "10px", "multiply multiply", "plus-lighter"], + }, + "background-clip": { + /* + * When we rename this to 'background-clip', we also + * need to rename the values to match the spec. + */ + domProp: "backgroundClip", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["border-box"], + other_values: [ + "content-box", + "padding-box", + "border-box, padding-box", + "padding-box, padding-box, padding-box", + "border-box, border-box", + "text", + "content-box, text", + "text, border-box", + "text, text", + ], + invalid_values: [ + "margin-box", + "border-box border-box", + "fill-box", + "stroke-box", + "view-box", + "no-clip", + ], + }, + "background-color": { + domProp: "backgroundColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["transparent", "rgba(0, 0, 0, 0)"], + other_values: [ + "green", + "rgb(255, 0, 128)", + "#fc2", + "#96ed2a", + "black", + "rgba(255,255,0,3)", + "hsl(240, 50%, 50%)", + "rgb(50%, 50%, 50%)", + "-moz-default-background-color", + "rgb(100, 100.0, 100)", + "rgba(255, 127, 15, 0)", + "hsla(240, 97%, 50%, 0.0)", + "rgba(255,255,255,-3.7)", + ], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "rgb(100, 100%, 100)", + ], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "background-image": { + domProp: "backgroundImage", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["none"], + other_values: [ + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==')", + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + "none, none", + "none, none, none, none, none", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), none", + "none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), none", + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + ].concat(validNonUrlImageValues), + invalid_values: [].concat(invalidNonUrlImageValues), + unbalanced_values: [].concat(unbalancedGradientAndElementValues), + }, + "background-origin": { + domProp: "backgroundOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["padding-box"], + other_values: [ + "border-box", + "content-box", + "border-box, padding-box", + "padding-box, padding-box, padding-box", + "border-box, border-box", + ], + invalid_values: [ + "margin-box", + "padding-box padding-box", + "fill-box", + "stroke-box", + "view-box", + "no-clip", + ], + }, + "background-position": { + domProp: "backgroundPosition", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: [ + "top 0% left 0%", + "top 0% left", + "top left", + "left top", + "0% 0%", + "0% top", + "left 0%", + ], + other_values: [ + "top", + "left", + "right", + "bottom", + "center", + "center bottom", + "bottom center", + "center right", + "right center", + "center top", + "top center", + "center left", + "left center", + "right bottom", + "bottom right", + "50%", + "top left, top left", + "top left, top right", + "top right, top left", + "left top, 0% 0%", + "10% 20%, 30%, 40%", + "top left, bottom right", + "right bottom, left top", + "0%", + "0px", + "30px", + "0%, 10%, 20%, 30%", + "top, top, top, top, top", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + "0px 0px", + "right 20px top 60px", + "right 20px bottom 60px", + "left 20px top 60px", + "left 20px bottom 60px", + "right -50px top -50px", + "left -50px bottom -50px", + "right 20px top -50px", + "right -20px top 50px", + "right 3em bottom 10px", + "bottom 3em right 10px", + "top 3em right 10px", + "left 15px", + "10px top", + "left top 15px", + "left 10px top", + "left 20%", + "right 20%", + ], + subproperties: ["background-position-x", "background-position-y"], + invalid_values: [ + "center 10px center 4px", + "center 10px center", + "top 20%", + "bottom 20%", + "50% left", + "top 50%", + "50% bottom 10%", + "right 10% 50%", + "left right", + "top bottom", + "left 10% right", + "top 20px bottom 20px", + "left left", + "0px calc(0px + rubbish)", + ], + quirks_values: { + "20 20": "20px 20px", + "10 5px": "10px 5px", + "7px 2": "7px 2px", + }, + }, + "background-position-x": { + domProp: "backgroundPositionX", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["left 0%", "left", "0%"], + other_values: [ + "right", + "center", + "50%", + "left, left", + "left, right", + "right, left", + "left, 0%", + "10%, 20%, 40%", + "0px", + "30px", + "0%, 10%, 20%, 30%", + "left, left, left, left, left", + "calc(20px)", + "calc(20px + 1em)", + "calc(20px / 2)", + "calc(20px + 50%)", + "calc(50% - 10px)", + "calc(-20px)", + "calc(-50%)", + "calc(-20%)", + "right 20px", + "left 20px", + "right -50px", + "left -50px", + "right 20px", + "right 3em", + ], + invalid_values: [ + "center 10px", + "right 10% 50%", + "left right", + "left left", + "bottom 20px", + "top 10%", + "bottom 3em", + "top", + "bottom", + "top, top", + "top, bottom", + "bottom, top", + "top, 0%", + "top, top, top, top, top", + "calc(0px + rubbish)", + ], + }, + "background-position-y": { + domProp: "backgroundPositionY", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["top 0%", "top", "0%"], + other_values: [ + "bottom", + "center", + "50%", + "top, top", + "top, bottom", + "bottom, top", + "top, 0%", + "10%, 20%, 40%", + "0px", + "30px", + "0%, 10%, 20%, 30%", + "top, top, top, top, top", + "calc(20px)", + "calc(20px + 1em)", + "calc(20px / 2)", + "calc(20px + 50%)", + "calc(50% - 10px)", + "calc(-20px)", + "calc(-50%)", + "calc(-20%)", + "bottom 20px", + "top 20px", + "bottom -50px", + "top -50px", + "bottom 20px", + "bottom 3em", + ], + invalid_values: [ + "center 10px", + "bottom 10% 50%", + "top bottom", + "top top", + "right 20px", + "left 10%", + "right 3em", + "left", + "right", + "left, left", + "left, right", + "right, left", + "left, 0%", + "left, left, left, left, left", + "calc(0px + rubbish)", + ], + }, + "background-repeat": { + domProp: "backgroundRepeat", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["repeat", "repeat repeat"], + other_values: [ + "repeat-x", + "repeat-y", + "no-repeat", + "repeat-x, repeat-x", + "repeat, no-repeat", + "repeat-y, no-repeat, repeat-y", + "repeat, repeat, repeat", + "repeat no-repeat", + "no-repeat repeat", + "no-repeat no-repeat", + "repeat repeat, repeat repeat", + "round, repeat", + "round repeat, repeat-x", + "round no-repeat, repeat-y", + "round round", + "space, repeat", + "space repeat, repeat-x", + "space no-repeat, repeat-y", + "space space", + "space round", + ], + invalid_values: [ + "repeat repeat repeat", + "repeat-x repeat-y", + "repeat repeat-x", + "repeat repeat-y", + "repeat-x repeat", + "repeat-y repeat", + "round round round", + "repeat-x round", + "round repeat-x", + "repeat-y round", + "round repeat-y", + "space space space", + "repeat-x space", + "space repeat-x", + "repeat-y space", + "space repeat-y", + ], + }, + "background-size": { + domProp: "backgroundSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto", "auto auto"], + other_values: [ + "contain", + "cover", + "100px auto", + "auto 100px", + "100% auto", + "auto 100%", + "25% 50px", + "3em 40%", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + ], + invalid_values: [ + "contain contain", + "cover cover", + "cover auto", + "auto cover", + "contain cover", + "cover contain", + "-5px 3px", + "3px -5px", + "auto -5px", + "-5px auto", + "5 3", + "10px calc(10px + rubbish)", + ], + }, + border: { + domProp: "border", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-bottom-color", + "border-bottom-style", + "border-bottom-width", + "border-left-color", + "border-left-style", + "border-left-width", + "border-right-color", + "border-right-style", + "border-right-width", + "border-top-color", + "border-top-style", + "border-top-width", + "border-image-source", + "border-image-slice", + "border-image-width", + "border-image-outset", + "border-image-repeat", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + "calc(4px - 1px) none", + ], + other_values: [ + "solid", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "calc(2px) solid blue", + ], + invalid_values: ["5%", "medium solid ff00ff", "5 solid green"], + }, + "border-bottom": { + domProp: "borderBottom", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-bottom-color", + "border-bottom-style", + "border-bottom-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-bottom-color": { + domProp: "borderBottomColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000"], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "border-bottom-style": { + domProp: "borderBottomStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-bottom-width": { + domProp: "borderBottomWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { "border-bottom-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%"], + quirks_values: { 5: "5px" }, + }, + "border-collapse": { + domProp: "borderCollapse", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["separate"], + other_values: ["collapse"], + invalid_values: [], + }, + "border-color": { + domProp: "borderColor", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-top-color", + "border-right-color", + "border-bottom-color", + "border-left-color", + ], + initial_values: [ + "currentColor", + "currentColor currentColor", + "currentColor currentColor currentColor", + "currentColor currentColor currentcolor CURRENTcolor", + ], + other_values: [ + "green", + "currentColor green", + "currentColor currentColor green", + "currentColor currentColor currentColor green", + "rgba(255,128,0,0.5)", + "transparent", + ], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "red rgb(nonsense)", + "red 1px", + ], + unbalanced_values: ["red rgb("], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "border-left": { + domProp: "borderLeft", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-left-color", + "border-left-style", + "border-left-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: [ + "5%", + "5", + "5 solid green", + "calc(5px + rubbish) green solid", + "5px rgb(0, rubbish, 0) solid", + ], + }, + "border-left-color": { + domProp: "borderLeftColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000"], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "border-left-style": { + domProp: "borderLeftStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-left-width": { + domProp: "borderLeftWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { "border-left-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%"], + quirks_values: { 5: "5px" }, + }, + "border-right": { + domProp: "borderRight", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-right-color", + "border-right-style", + "border-right-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-right-color": { + domProp: "borderRightColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000"], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "border-right-style": { + domProp: "borderRightStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-right-width": { + domProp: "borderRightWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { "border-right-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%"], + quirks_values: { 5: "5px" }, + }, + "border-spacing": { + domProp: "borderSpacing", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: [ + "0", + "0 0", + "0px", + "0 0px", + "calc(0px)", + "calc(0px) calc(0em)", + "calc(2em - 2em) calc(3px + 7px - 10px)", + "calc(-5px)", + "calc(-5px) calc(-5px)", + ], + other_values: [ + "3px", + "4em 2px", + "4em 0", + "0px 2px", + "calc(7px)", + "0 calc(7px)", + "calc(7px) 0", + "calc(0px) calc(7px)", + "calc(7px) calc(0px)", + "7px calc(0px)", + "calc(0px) 7px", + "7px calc(0px)", + "3px calc(2em)", + ], + invalid_values: [ + "0%", + "0 0%", + "-5px", + "-5px -5px", + "0 -5px", + "-5px 0", + "0 calc(0px + rubbish)", + ], + quirks_values: { + "2px 5": "2px 5px", + 7: "7px", + "3 4px": "3px 4px", + }, + }, + "border-style": { + domProp: "borderStyle", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-top-style", + "border-right-style", + "border-bottom-style", + "border-left-style", + ], + /* XXX hidden is sometimes the same as initial */ + initial_values: [ + "none", + "none none", + "none none none", + "none none none none", + ], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + "none solid", + "none none solid", + "none none none solid", + "groove none none none", + "none ridge none none", + "none none double none", + "none none none dotted", + ], + invalid_values: [], + }, + "border-top": { + domProp: "borderTop", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-top-color", "border-top-style", "border-top-width"], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-top-color": { + domProp: "borderTopColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000"], + quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" }, + }, + "border-top-style": { + domProp: "borderTopStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-top-width": { + domProp: "borderTopWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + prerequisites: { "border-top-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%"], + quirks_values: { 5: "5px" }, + }, + "border-width": { + domProp: "borderWidth", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-top-width", + "border-right-width", + "border-bottom-width", + "border-left-width", + ], + prerequisites: { "border-style": "solid" }, + initial_values: [ + "medium", + "3px", + "medium medium", + "3px medium medium", + "medium 3px medium medium", + "calc(3px) 3px calc(5px - 2px) calc(2px - -1px)", + ], + other_values: ["thin", "thick", "1px", "2em", "2px 0 0px 1em", "calc(2em)"], + invalid_values: ["5%", "1px calc(nonsense)", "1px red"], + unbalanced_values: ["1px calc("], + quirks_values: { 5: "5px" }, + }, + bottom: { + domProp: "bottom", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "box-shadow": { + domProp: "boxShadow", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["none"], + prerequisites: { color: "blue" }, + other_values: [ + "2px 2px", + "2px 2px 1px", + "2px 2px 2px 2px", + "blue 3px 2px", + "2px 2px 1px 5px green", + "2px 2px red", + "green 2px 2px 1px", + "green 2px 2px, blue 1px 3px 4px", + "currentColor 3px 3px", + "blue 2px 2px, currentColor 1px 2px, 1px 2px 3px 2px orange", + "3px 0 0 0", + "inset 2px 2px 3px 4px black", + "2px -2px green inset, 4px 4px 3px blue, inset 2px 2px", + /* calc() values */ + "2px 2px calc(-5px)" /* clamped */, + "calc(3em - 2px) 2px green", + "green calc(3em - 2px) 2px", + "2px calc(2px + 0.2em)", + "blue 2px calc(2px + 0.2em)", + "2px calc(2px + 0.2em) blue", + "calc(-2px) calc(-2px)", + "-2px -2px", + "calc(2px) calc(2px)", + "calc(2px) calc(2px) calc(2px)", + "calc(2px) calc(2px) calc(2px) calc(2px)", + ], + invalid_values: [ + "3% 3%", + "1px 1px 1px 1px 1px", + "2px 2px, none", + "red 2px 2px blue", + "inherit, 2px 2px", + "2px 2px, inherit", + "2px 2px -5px", + "inset 4px 4px black inset", + "inset inherit", + "inset none", + "3 3", + "3px 3", + "3 3px", + "3px 3px 3", + "3px 3px 3px 3", + "3px calc(3px + rubbish)", + "3px 3px calc(3px + rubbish)", + "3px 3px 3px calc(3px + rubbish)", + "3px 3px 3px 3px rgb(0, rubbish, 0)", + "unset, 2px 2px", + "2px 2px, unset", + "inset unset", + ], + }, + "caption-side": { + domProp: "captionSide", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["top"], + other_values: ["bottom"], + invalid_values: ["right", "left", "top-outside", "bottom-outside"], + }, + "caret-color": { + domProp: "caretColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "black" }, + // Though "auto" is an independent computed-value time keyword value, + // it is not distinguishable from currentcolor because getComputedStyle + // always returns used value for . + initial_values: ["auto", "currentcolor", "black", "rgb(0,0,0)"], + other_values: ["green", "transparent", "rgba(128,128,128,.5)", "#123"], + invalid_values: ["#0", "#00", "#00000", "cc00ff"], + }, + clear: { + domProp: "clear", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["left", "right", "both", "inline-start", "inline-end"], + invalid_values: [], + }, + clip: { + domProp: "clip", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "rect(0 0 0 0)", + "rect(auto,auto,auto,auto)", + "rect(3px, 4px, 4em, 0)", + "rect(auto, 3em, 4pt, 2px)", + "rect(2px 3px 4px 5px)", + ], + invalid_values: ["rect(auto, 3em, 2%, 5px)"], + quirks_values: { "rect(1, 2, 3, 4)": "rect(1px, 2px, 3px, 4px)" }, + }, + color: { + domProp: "color", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + /* XXX should test currentColor, but may or may not be initial */ + initial_values: [ + "black", + "#000", + "#000f", + "#000000ff", + "-moz-default-color", + "rgb(0, 0, 0)", + "rgb(0%, 0%, 0%)", + /* css-color-4: */ + /* rgb() and rgba() are aliases of each other. */ + "rgb(0, 0, 0)", + "rgba(0, 0, 0)", + "rgb(0, 0, 0, 1)", + "rgba(0, 0, 0, 1)", + /* hsl() and hsla() are aliases of each other. */ + "hsl(0, 0%, 0%)", + "hsla(0, 0%, 0%)", + "hsl(0, 0%, 0%, 1)", + "hsla(0, 0%, 0%, 1)", + /* rgb() and rgba() functions now accept rather than . */ + "rgb(0.0, 0.0, 0.0)", + "rgba(0.0, 0.0, 0.0)", + "rgb(0.0, 0.0, 0.0, 1)", + "rgba(0.0, 0.0, 0.0, 1)", + /* now accepts as well as in rgba() and hsla(). */ + "rgb(0.0, 0.0, 0.0, 100%)", + "hsl(0, 0%, 0%, 100%)", + /* rgb() and hsl() now support comma-less expression. */ + "rgb(0 0 0)", + "rgb(0 0 0 / 1)", + "rgb(0/* comment */0/* comment */0)", + "rgb(0/* comment */0/* comment*/0/1.0)", + "hsl(0 0% 0%)", + "hsl(0 0% 0% / 1)", + "hsl(0/* comment */0%/* comment */0%)", + "hsl(0/* comment */0%/* comment */0%/1)", + /* Support for hsl() hue component. */ + "hsl(0deg, 0%, 0%)", + "hsl(360deg, 0%, 0%)", + "hsl(0grad, 0%, 0%)", + "hsl(400grad, 0%, 0%)", + "hsl(0rad, 0%, 0%)", + "hsl(0turn, 0%, 0%)", + "hsl(1turn, 0%, 0%)", + /* CSS4 System Colors */ + "canvastext", + /* Preserve previously available specially prefixed colors */ + "-moz-default-color", + ], + other_values: [ + "green", + "#f3c", + "#fed292", + "rgba(45,300,12,2)", + "transparent", + "LinkText", + "rgba(255,128,0,0.5)", + "#e0fc", + "#10fcee72", + /* css-color-4: */ + "rgb(100, 100.0, 100)", + "rgb(300 300 300 / 200%)", + "rgb(300.0 300.0 300.0 / 2.0)", + "hsl(720, 200%, 200%, 2.0)", + "hsla(720 200% 200% / 200%)", + "hsl(480deg, 20%, 30%, 0.3)", + "hsl(55grad, 400%, 30%)", + "hsl(0.5grad 400% 500% / 9.0)", + "hsl(33rad 100% 90% / 4)", + "hsl(0.33turn, 40%, 40%, 10%)", + "hsl(63e292, 41%, 34%)", + /* CSS4 System Colors */ + "canvas", + "linktext", + "visitedtext", + "activetext", + "buttonface", + "field", + "highlight", + "graytext", + /* Preserve previously available specially prefixed colors */ + "-moz-activehyperlinktext", + "-moz-default-background-color", + "-moz-hyperlinktext", + "-moz-visitedhyperlinktext", + /* color-mix */ + "color-mix(in srgb, red, blue)", + "color-mix(in srgb, highlight, rgba(0, 0, 0, .5))", + "color-mix(in srgb, color-mix(in srgb, red 10%, blue), green)", + "color-mix(in srgb, blue, red 80%)", + "color-mix(in srgb, rgba(0, 200, 32, .5) 90%, red 50%)", + "color-mix(in srgb, currentColor, red)", + ], + invalid_values: [ + "#f", + "#ff", + "#fffff", + "#fffffff", + "#fffffffff", + "rgb(100%, 0, 100%)", + "rgba(100, 0, 100%, 30%)", + "hsl(0, 0, 0%)", + "hsla(0%, 0%, 0%, 0.1)", + /* trailing commas */ + "rgb(0, 0, 0,)", + "rgba(0, 0, 0, 0,)", + "hsl(0, 0%, 0%,)", + "hsla(0, 0%, 0%, 1,)", + /* css-color-4: */ + /* comma and comma-less expressions should not mix together. */ + "rgb(0, 0, 0 / 1)", + "rgb(0 0 0, 1)", + "rgb(0, 0 0, 1)", + "rgb(0 0, 0 / 1)", + "hsl(0, 0%, 0% / 1)", + "hsl(0 0% 0%, 1)", + "hsl(0 0% 0%, 1)", + "hsl(0 0%, 0% / 1)", + /* trailing slash */ + "rgb(0 0 0 /)", + "rgb(0, 0, 0 /)", + "hsl(0 0% 0% /)", + "hsl(0, 0%, 0% /)", + /* color-mix */ + "color-mix(red, blue)", + "color-mix(red blue)", + "color-mix(in srgb, red blue)", + "color-mix(in srgb, red 10% blue)", + ], + quirks_values: { + "000000": "#000000", + "96ed2a": "#96ed2a", + fff: "#ffffff", + ffffff: "#ffffff", + }, + }, + content: { + domProp: "content", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + // XXX This really depends on pseudo-element-ness. + initial_values: ["normal", "none"], + other_values: [ + '""', + "''", + '"hello"', + "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==')", + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + "counter(foo)", + "counter(bar, upper-roman)", + 'counters(foo, ".")', + "counters(bar, '-', lower-greek)", + "'-' counter(foo) '.'", + "attr(title)", + "open-quote", + "close-quote", + "no-open-quote", + "no-close-quote", + "close-quote attr(title) counters(foo, '.', upper-alpha)", + "attr(\\32)", + "attr(\\2)", + "attr(-\\2)", + "attr(-\\32)", + 'attr(title, "fallback")', + 'attr(\\32, "fallback")', + 'attr(-\\32, "fallback")', + "counter(\\2)", + "counters(\\32, '.')", + "counter(-\\32, upper-roman)", + "counters(-\\2, '-', lower-greek)", + "counter(\\()", + "counters(a\\+b, '.')", + "counter(\\}, upper-alpha)", + "-moz-alt-content", + "counter(foo, symbols('*'))", + "counter(foo, symbols(numeric '0' '1'))", + "counters(foo, '.', symbols('*'))", + "counters(foo, '.', symbols(numeric '0' '1'))", + "image-set(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==))", + ].concat(validNonUrlImageValues), + invalid_values: [ + "counter(foo, none)", + "counters(bar, '.', none)", + "counters(foo)", + 'counter(foo, ".")', + 'attr("title")', + "attr('title')", + "attr(2)", + "attr(-2)", + "counter(2)", + "counters(-2, '.')", + "-moz-alt-content 'foo'", + "'foo' -moz-alt-content", + "counter(one, two, three) 'foo'", + ].concat(invalidNonUrlImageValues), + }, + "counter-increment": { + domProp: "counterIncrement", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "foo 1", + "bar", + "foo 3 bar baz 2", + "\\32 1", + "-\\32 1", + "-c 1", + "\\32 1", + "-\\32 1", + "\\2 1", + "-\\2 1", + "-c 1", + "\\2 1", + "-\\2 1", + "-\\7f \\9e 1", + ], + invalid_values: ["none foo", "none foo 3", "foo none", "foo 3 none"], + unbalanced_values: ["foo 1 ("], + }, + "counter-reset": { + domProp: "counterReset", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "foo 1", + "bar", + "foo 3 bar baz 2", + "\\32 1", + "-\\32 1", + "-c 1", + "\\32 1", + "-\\32 1", + "\\2 1", + "-\\2 1", + "-c 1", + "\\2 1", + "-\\2 1", + "-\\7f \\9e 1", + ], + invalid_values: ["none foo", "none foo 3", "foo none", "foo 3 none"], + }, + "counter-set": { + domProp: "counterSet", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "foo 1", + "bar", + "foo 3 bar baz 2", + "\\32 1", + "-\\32 1", + "-c 1", + "\\32 1", + "-\\32 1", + "\\2 1", + "-\\2 1", + "-c 1", + "\\2 1", + "-\\2 1", + "-\\7f \\9e 1", + ], + invalid_values: ["none foo", "none foo 3", "foo none", "foo 3 none"], + }, + cursor: { + domProp: "cursor", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "crosshair", + "default", + "pointer", + "move", + "e-resize", + "ne-resize", + "nw-resize", + "n-resize", + "se-resize", + "sw-resize", + "s-resize", + "w-resize", + "text", + "wait", + "help", + "progress", + "copy", + "alias", + "context-menu", + "cell", + "not-allowed", + "col-resize", + "row-resize", + "no-drop", + "vertical-text", + "all-scroll", + "nesw-resize", + "nwse-resize", + "ns-resize", + "ew-resize", + "none", + "grab", + "grabbing", + "zoom-in", + "zoom-out", + "-moz-grab", + "-moz-grabbing", + "-moz-zoom-in", + "-moz-zoom-out", + "url(foo.png), move", + "url(foo.png) 5 7, move", + "url(foo.png) 12 3, url(bar.png), no-drop", + "url(foo.png), url(bar.png) 7 2, wait", + "url(foo.png) 3 2, url(bar.png) 7 9, pointer", + "url(foo.png) calc(1 + 2) calc(3), pointer", + "image-set(url(foo.png)), auto", + ], + invalid_values: [ + "url(foo.png)", + "url(foo.png) 5 5", + "image-set(linear-gradient(red, blue)), auto", + // Gradients are supported per spec, but we don't have support for it yet + "linear-gradient(red, blue), auto", + ], + }, + direction: { + domProp: "direction", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["ltr"], + other_values: ["rtl"], + invalid_values: [], + }, + display: { + domProp: "display", + inherited: false, + type: CSS_TYPE_LONGHAND, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: ["inline"], + /* XXX none will really mess with other properties */ + prerequisites: { float: "none", position: "static", contain: "none" }, + other_values: [ + "block", + "flex", + "inline-flex", + "list-item", + "inline list-item", + "inline flow-root list-item", + "inline-block", + "table", + "inline-table", + "table-row-group", + "table-header-group", + "table-footer-group", + "table-row", + "table-column-group", + "table-column", + "table-cell", + "table-caption", + "block ruby", + "ruby", + "ruby-base", + "ruby-base-container", + "ruby-text", + "ruby-text-container", + "contents", + "none", + ], + invalid_values: [], + }, + "empty-cells": { + domProp: "emptyCells", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["show"], + other_values: ["hide"], + invalid_values: [], + }, + float: { + domProp: "cssFloat", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["none"], + other_values: ["left", "right", "inline-start", "inline-end"], + invalid_values: [], + }, + font: { + domProp: "font", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + prerequisites: { "writing-mode": "initial" }, + subproperties: [ + "font-style", + "font-variant", + "font-weight", + "font-size", + "line-height", + "font-family", + "font-stretch", + "font-size-adjust", + "font-feature-settings", + "font-language-override", + "font-kerning", + "font-variant-alternates", + "font-variant-caps", + "font-variant-east-asian", + "font-variant-ligatures", + "font-variant-numeric", + "font-variant-position", + ], + initial_values: [ + gInitialFontFamilyIsSansSerif ? "medium sans-serif" : "medium serif", + ], + other_values: [ + "large serif", + "9px fantasy", + "condensed bold italic small-caps 24px/1.4 Times New Roman, serif", + "small inherit roman", + "small roman inherit", + // system fonts + "caption", + "icon", + "menu", + "message-box", + "small-caption", + "status-bar", + // line-height with calc() + "condensed bold italic small-caps 24px/calc(2px) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(50%) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(3*25px) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(25px*3) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(3*25px + 50%) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(1 + 2*3/4) Times New Roman, serif", + ], + invalid_values: [ + "9 fantasy", + "-2px fantasy", + // line-height with calc() + "condensed bold italic small-caps 24px/calc(1 + 2px) Times New Roman, serif", + "condensed bold italic small-caps 24px/calc(100% + 0.1) Times New Roman, serif", + ], + }, + "font-family": { + domProp: "fontFamily", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: [gInitialFontFamilyIsSansSerif ? "sans-serif" : "serif"], + other_values: [ + gInitialFontFamilyIsSansSerif ? "serif" : "sans-serif", + "Times New Roman, serif", + "'Times New Roman', serif", + "cursive", + "fantasy", + '\\"Times New Roman', + '"Times New Roman"', + 'Times, \\"Times New Roman', + 'Times, "Times New Roman"', + "-no-such-font-installed", + "inherit roman", + "roman inherit", + "Times, inherit roman", + "inherit roman, Times", + "roman inherit, Times", + "Times, roman inherit", + ], + invalid_values: [ + '"Times New" Roman', + '"Times New Roman\n', + 'Times, "Times New Roman\n', + ], + }, + "font-feature-settings": { + domProp: "fontFeatureSettings", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "'liga' on", + "'liga'", + '"liga" 1', + "'liga', 'clig' 1", + '"liga" off', + '"liga" 0', + '"cv01" 3, "cv02" 4', + '"cswh", "smcp" off, "salt" 4', + '"cswh" 1, "smcp" off, "salt" 4', + '"cswh" 0, \'blah\', "liga", "smcp" off, "salt" 4', + '"liga" ,"smcp" 0 , "blah"', + '"ab\\"c"', + '"ab\\\\c"', + "'vert' calc(2)", + ], + invalid_values: [ + "liga", + "liga 1", + "liga normal", + '"liga" normal', + "normal liga", + 'normal "liga"', + 'normal, "liga"', + '"liga=1"', + "'foobar' on", + '"blahblah" 0', + '"liga" 3.14', + '"liga" 1 3.14', + '"liga" 1 normal', + '"liga" 1 off', + '"liga" on off', + '"liga" , 0 "smcp"', + '"liga" "smcp"', + ], + }, + "font-kerning": { + domProp: "fontKerning", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["normal", "none"], + invalid_values: ["on"], + }, + "font-language-override": { + domProp: "fontLanguageOverride", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: ["'ENG'", "'TRK'", '"TRK"', "'N\\'Ko'"], + invalid_values: ["TRK", "ja"], + }, + "font-size": { + domProp: "fontSize", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: [ + "medium", + "1rem", + "calc(1rem)", + "calc(0.75rem + 200% - 125% + 0.25rem - 75%)", + ], + other_values: [ + "large", + "2em", + "50%", + "xx-small", + "xxx-large", + "36pt", + "8px", + "larger", + "smaller", + "0px", + "0%", + "calc(2em)", + "calc(36pt + 75% + (30% + 2em + 2px))", + "calc(-2em)", + "calc(-50%)", + "calc(-1px)", + ], + invalid_values: ["-2em", "-50%", "-1px"], + quirks_values: { 5: "5px" }, + }, + "font-size-adjust": { + domProp: "fontSizeAdjust", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["none"], + other_values: [ + "0.7", + "0.0", + "0", + "3", + "from-font", + "cap-height 0.8", + "ch-width 0.4", + "ic-width 0.4", + "ic-height 0.9", + "ch-width from-font", + ], + invalid_values: [ + "-0.3", + "-1", + "normal", + "none none", + "cap-height none", + "none from-font", + "from-font none", + "0.5 from-font", + "0.5 cap-height", + "cap-height, 0.8", + ], + }, + "font-stretch": { + domProp: "fontStretch", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "ultra-condensed", + "extra-condensed", + "condensed", + "semi-condensed", + "semi-expanded", + "expanded", + "extra-expanded", + "ultra-expanded", + ], + invalid_values: ["narrower", "wider"], + }, + "font-style": { + domProp: "fontStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: ["italic", "oblique"], + invalid_values: [], + }, + "font-synthesis": { + domProp: "fontSynthesis", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + subproperties: [ + "font-synthesis-weight", + "font-synthesis-style", + "font-synthesis-small-caps", + "font-synthesis-position", + ], + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: [ + "weight style small-caps position", + "weight small-caps style position", + "small-caps weight position style", + "small-caps style position weight", + "style position weight small-caps", + "style position small-caps weight", + ], + other_values: [ + "none", + "weight", + "style", + "small-caps", + "position", + "weight style", + "style weight", + "weight small-caps", + "small-caps weight", + "weight position", + "position weight", + "style small-caps", + "small-caps style", + "style position", + "position style", + "small-caps position", + "position small-caps", + "weight style small-caps", + "small-caps weight style", + "weight style position", + "position weight style", + "weight small-caps position", + "position weight small-caps", + ], + invalid_values: [ + "10px", + "weight none", + "style none", + "none style", + "none 10px", + "weight 10px", + "weight weight", + "style style", + "small-caps none", + "small-caps small-caps", + "position none", + "position position", + ], + }, + "font-synthesis-weight": { + domProp: "fontSynthesisWeight", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["auto none", "weight", "normal", "0"], + }, + "font-synthesis-style": { + domProp: "fontSynthesisStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["auto none", "style", "normal", "0"], + }, + "font-synthesis-small-caps": { + domProp: "fontSynthesisSmallCaps", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["auto none", "small-caps", "normal", "0"], + }, + "font-synthesis-position": { + domProp: "fontSynthesisPosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["auto none", "position", "normal", "0"], + }, + "font-variant": { + domProp: "fontVariant", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "font-variant-alternates", + "font-variant-caps", + "font-variant-east-asian", + "font-variant-ligatures", + "font-variant-numeric", + "font-variant-position", + ], + initial_values: ["normal"], + other_values: [ + "small-caps", + "none", + "traditional oldstyle-nums", + "all-small-caps", + "common-ligatures no-discretionary-ligatures", + "proportional-nums oldstyle-nums", + "proportional-nums slashed-zero diagonal-fractions oldstyle-nums ordinal", + "traditional historical-forms styleset(ok-alt-a, ok-alt-b)", + "styleset(potato)", + ], + invalid_values: [ + "small-caps normal", + "small-caps small-caps", + "none common-ligatures", + "common-ligatures none", + "small-caps potato", + "small-caps jis83 all-small-caps", + "super historical-ligatures sub", + "stacked-fractions diagonal-fractions historical-ligatures", + "common-ligatures traditional common-ligatures", + "lining-nums traditional slashed-zero ordinal normal", + "traditional historical-forms styleset(ok-alt-a, ok-alt-b) historical-forms", + "historical-forms styleset(ok-alt-a, ok-alt-b) traditional styleset(potato)", + "annotation(a,b,c)", + ], + }, + "font-variant-alternates": { + domProp: "fontVariantAlternates", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "historical-forms", + "styleset(alt-a, alt-b)", + "character-variant(a, b, c)", + "annotation(circled)", + "swash(squishy)", + "styleset(complex\\ blob, a)", + "annotation(\\62 lah)", + ], + invalid_values: [ + "historical-forms normal", + "historical-forms historical-forms", + "swash", + "swash(3)", + "annotation(a, b)", + "ornaments(a,b)", + "styleset(1234blah)", + "annotation(a), annotation(b)", + "annotation(a) normal", + ], + }, + "font-variant-caps": { + domProp: "fontVariantCaps", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "small-caps", + "all-small-caps", + "petite-caps", + "all-petite-caps", + "titling-caps", + "unicase", + ], + invalid_values: [ + "normal small-caps", + "petite-caps normal", + "unicase unicase", + ], + }, + "font-variant-east-asian": { + domProp: "fontVariantEastAsian", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "jis78", + "jis83", + "jis90", + "jis04", + "simplified", + "traditional", + "full-width", + "proportional-width", + "ruby", + "jis78 full-width", + "jis78 full-width ruby", + "simplified proportional-width", + "ruby simplified", + ], + invalid_values: [ + "jis78 normal", + "jis90 jis04", + "simplified traditional", + "full-width proportional-width", + "ruby simplified ruby", + "jis78 ruby simplified", + ], + }, + "font-variant-ligatures": { + domProp: "fontVariantLigatures", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "none", + "common-ligatures", + "no-common-ligatures", + "discretionary-ligatures", + "no-discretionary-ligatures", + "historical-ligatures", + "no-historical-ligatures", + "contextual", + "no-contextual", + "common-ligatures no-discretionary-ligatures", + "contextual no-discretionary-ligatures", + "historical-ligatures no-common-ligatures", + "no-historical-ligatures discretionary-ligatures", + "common-ligatures no-discretionary-ligatures historical-ligatures no-contextual", + ], + invalid_values: [ + "common-ligatures normal", + "common-ligatures no-common-ligatures", + "common-ligatures common-ligatures", + "no-historical-ligatures historical-ligatures", + "no-discretionary-ligatures discretionary-ligatures", + "no-contextual contextual", + "common-ligatures no-discretionary-ligatures no-common-ligatures", + "common-ligatures none", + "no-discretionary-ligatures none", + "none common-ligatures", + ], + }, + "font-variant-numeric": { + domProp: "fontVariantNumeric", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "lining-nums", + "oldstyle-nums", + "proportional-nums", + "tabular-nums", + "diagonal-fractions", + "stacked-fractions", + "slashed-zero", + "ordinal", + "lining-nums diagonal-fractions", + "tabular-nums stacked-fractions", + "tabular-nums slashed-zero stacked-fractions", + "proportional-nums slashed-zero diagonal-fractions oldstyle-nums ordinal", + ], + invalid_values: [ + "lining-nums normal", + "lining-nums oldstyle-nums", + "lining-nums normal slashed-zero ordinal", + "proportional-nums tabular-nums", + "diagonal-fractions stacked-fractions", + "slashed-zero diagonal-fractions slashed-zero", + "lining-nums slashed-zero diagonal-fractions oldstyle-nums", + "diagonal-fractions diagonal-fractions", + ], + }, + "font-variant-position": { + domProp: "fontVariantPosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: ["super", "sub"], + invalid_values: ["normal sub", "super sub"], + }, + "font-weight": { + domProp: "fontWeight", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal", "400"], + other_values: [ + "bold", + "100", + "200", + "300", + "500", + "600", + "700", + "800", + "900", + "bolder", + "lighter", + "10.5", + "calc(10 + 10)", + "calc(10 - 99)", + "100.0", + "107", + "399", + "401", + "699", + "710", + "1000", + ], + invalid_values: ["0", "1001", "calc(10%)"], + }, + height: { + domProp: "height", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* FIXME: test zero, and test calc clamping */ + initial_values: [" auto"], + /* computed value tests for height test more with display:block */ + prerequisites: { display: "block" }, + other_values: [ + "15px", + "3em", + "15%", + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none"], + quirks_values: { 5: "5px" }, + }, + "ime-mode": { + domProp: "imeMode", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["normal", "disabled", "active", "inactive"], + invalid_values: ["none", "enabled", "1px"], + }, + left: { + domProp: "left", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "letter-spacing": { + domProp: "letterSpacing", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["normal", "0", "0px", "calc(0px)"], + other_values: [ + "1em", + "2px", + "-3px", + "calc(1em)", + "calc(1em + 3px)", + "calc(15px / 2)", + "calc(15px/2)", + "calc(-3px)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "line-break": { + domProp: "lineBreak", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["loose", "normal", "strict", "anywhere"], + invalid_values: [], + }, + "line-height": { + domProp: "lineHeight", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + /* + * Inheritance tests require consistent font size, since + * getComputedStyle (which uses the CSS2 computed value, or + * CSS2.1 used value) doesn't match what the CSS2.1 computed + * value is. And they even require consistent font metrics for + * computation of 'normal'. + */ + prerequisites: { + "font-size": "19px", + "font-size-adjust": "none", + "font-family": "serif", + "font-weight": "normal", + "font-style": "normal", + height: "18px", + display: "block", + "writing-mode": "initial", + }, + + initial_values: ["normal"], + other_values: [ + "1.0", + "1", + "1em", + "47px", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "calc(1 + 2*3/4)", + ], + invalid_values: ["calc(1 + 2px)", "calc(100% + 0.1)"], + }, + "list-style": { + domProp: "listStyle", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "list-style-type", + "list-style-position", + "list-style-image", + ], + initial_values: [ + "outside", + "disc", + "disc outside", + "outside disc", + "disc none", + "none disc", + "none disc outside", + "none outside disc", + "disc none outside", + "disc outside none", + "outside none disc", + "outside disc none", + ], + other_values: [ + "inside none", + "none inside", + "none none inside", + "square", + "none", + "none none", + "outside none none", + "none outside none", + "none none outside", + "none outside", + "outside none", + "outside outside", + "outside inside", + "\\32 style", + "\\32 style inside", + '"-"', + "'-'", + "inside '-'", + "'-' outside", + "none '-'", + "inside none '-'", + 'symbols("*" "\\2020" "\\2021" "\\A7")', + 'symbols(cyclic "*" "\\2020" "\\2021" "\\A7")', + 'inside symbols("*" "\\2020" "\\2021" "\\A7")', + 'symbols("*" "\\2020" "\\2021" "\\A7") outside', + 'none symbols("*" "\\2020" "\\2021" "\\A7")', + 'inside none symbols("*" "\\2020" "\\2021" "\\A7")', + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + 'none url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") none', + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") outside', + 'outside url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + 'outside none url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + 'outside url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") none', + 'none url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") outside', + 'none outside url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") outside none', + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") none outside', + ], + invalid_values: [ + "disc disc", + "unknown value", + "none none none", + "none disc url(404.png)", + "none url(404.png) disc", + "disc none url(404.png)", + "disc url(404.png) none", + "url(404.png) none disc", + "url(404.png) disc none", + "none disc outside url(404.png)", + ], + }, + "list-style-image": { + domProp: "listStyleImage", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', + // Add some tests for interesting url() values here to test serialization, etc. + "url('data:text/plain,\"')", + 'url("data:text/plain,\'")', + "url('data:text/plain,\\'')", + 'url("data:text/plain,\\"")', + "url('data:text/plain,\\\"')", + 'url("data:text/plain,\\\'")', + "url(data:text/plain,\\\\)", + ].concat(validNonUrlImageValues), + invalid_values: ["url('border.png') url('border.png')"].concat( + invalidNonUrlImageValues + ), + unbalanced_values: [].concat(unbalancedGradientAndElementValues), + }, + "list-style-position": { + domProp: "listStylePosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["outside"], + other_values: ["inside"], + invalid_values: [], + }, + "list-style-type": { + domProp: "listStyleType", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["disc"], + other_values: [ + "none", + "circle", + "square", + "disclosure-closed", + "disclosure-open", + "decimal", + "decimal-leading-zero", + "lower-roman", + "upper-roman", + "lower-greek", + "lower-alpha", + "lower-latin", + "upper-alpha", + "upper-latin", + "hebrew", + "armenian", + "georgian", + "cjk-decimal", + "cjk-ideographic", + "hiragana", + "katakana", + "hiragana-iroha", + "katakana-iroha", + "japanese-informal", + "japanese-formal", + "korean-hangul-formal", + "korean-hanja-informal", + "korean-hanja-formal", + "simp-chinese-informal", + "simp-chinese-formal", + "trad-chinese-informal", + "trad-chinese-formal", + "ethiopic-numeric", + "-moz-cjk-heavenly-stem", + "-moz-cjk-earthly-branch", + "-moz-trad-chinese-informal", + "-moz-trad-chinese-formal", + "-moz-simp-chinese-informal", + "-moz-simp-chinese-formal", + "-moz-japanese-informal", + "-moz-japanese-formal", + "-moz-arabic-indic", + "-moz-persian", + "-moz-urdu", + "-moz-devanagari", + "-moz-gurmukhi", + "-moz-gujarati", + "-moz-oriya", + "-moz-kannada", + "-moz-malayalam", + "-moz-bengali", + "-moz-tamil", + "-moz-telugu", + "-moz-thai", + "-moz-lao", + "-moz-myanmar", + "-moz-khmer", + "-moz-hangul", + "-moz-hangul-consonant", + "-moz-ethiopic-halehame", + "-moz-ethiopic-numeric", + "-moz-ethiopic-halehame-am", + "-moz-ethiopic-halehame-ti-er", + "-moz-ethiopic-halehame-ti-et", + "other-style", + "inside", + "outside", + "\\32 style", + '"-"', + "'-'", + 'symbols("*" "\\2020" "\\2021" "\\A7")', + "symbols(cyclic '*' '\\2020' '\\2021' '\\A7')", + ], + invalid_values: [], + }, + margin: { + domProp: "margin", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + ], + initial_values: ["0", "0px 0 0em", "0% 0px 0em 0pt"], + other_values: [ + "3px 0", + "2em 4px 2pt", + "1em 2em 3px 4px", + "1em calc(2em + 3px) 4ex 5cm", + ], + invalid_values: ["1px calc(nonsense)", "1px red"], + unbalanced_values: ["1px calc("], + quirks_values: { 5: "5px", "3px 6px 2 5px": "3px 6px 2px 5px" }, + }, + "margin-bottom": { + domProp: "marginBottom", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "margin-left": { + domProp: "marginLeft", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + ".5px", + "+32px", + "+.789px", + "-.328px", + "+0.56px", + "-0.974px", + "237px", + "-289px", + "-056px", + "1987.45px", + "-84.32px", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + quirks_values: { 5: "5px" }, + }, + "margin-right": { + domProp: "marginRight", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "margin-top": { + domProp: "marginTop", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "max-height": { + domProp: "maxHeight", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { display: "block" }, + initial_values: ["none"], + other_values: [ + "30px", + "50%", + "0", + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(-2px)", + "calc(0px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["auto"], + quirks_values: { 5: "5px" }, + }, + "max-width": { + domProp: "maxWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { display: "block" }, + initial_values: ["none"], + other_values: [ + "30px", + "50%", + "0", + // these four keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(-2px)", + "calc(0px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["auto"], + quirks_values: { 5: "5px" }, + }, + "min-height": { + domProp: "minHeight", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { display: "block" }, + initial_values: ["auto", "0", "calc(0em)", "calc(-2px)"], + other_values: [ + "30px", + "50%", + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none"], + quirks_values: { 5: "5px" }, + }, + "min-width": { + domProp: "minWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { display: "block" }, + initial_values: ["auto", "0", "calc(0em)", "calc(-2px)"], + other_values: [ + "30px", + "50%", + // these four keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none"], + quirks_values: { 5: "5px" }, + }, + "object-fit": { + domProp: "objectFit", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["fill"], + other_values: ["contain", "cover", "none", "scale-down"], + invalid_values: ["auto", "5px", "100%"], + }, + "object-position": { + domProp: "objectPosition", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["50% 50%", "50%", "center", "center center"], + other_values: [ + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + "0px 0px", + "right 20px top 60px", + "right 20px bottom 60px", + "left 20px top 60px", + "left 20px bottom 60px", + "right -50px top -50px", + "left -50px bottom -50px", + "right 20px top -50px", + "right -20px top 50px", + "right 3em bottom 10px", + "bottom 3em right 10px", + "top 3em right 10px", + "left 15px", + "10px top", + "left 20%", + "right 20%", + ], + invalid_values: [ + "center 10px center 4px", + "center 10px center", + "top 20%", + "bottom 20%", + "50% left", + "top 50%", + "50% bottom 10%", + "right 10% 50%", + "left right", + "top bottom", + "left 10% right", + "top 20px bottom 20px", + "left left", + "20 20", + "left top 15px", + "left 10px top", + ], + }, + opacity: { + domProp: "opacity", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: [ + "1", + "17", + "397.376", + "3e1", + "3e+1", + "3e0", + "3e+0", + "3e-0", + "300%", + ], + other_values: ["0", "0.4", "0.0000", "-3", "3e-1", "-100%", "50%"], + invalid_values: ["0px", "1px"], + }, + "-moz-orient": { + domProp: "MozOrient", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["inline"], + other_values: ["horizontal", "vertical", "block"], + invalid_values: ["none"], + }, + outline: { + domProp: "outline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["outline-color", "outline-style", "outline-width"], + initial_values: [ + "none", + "medium", + "thin", + // XXX Should be invert, but currently currentcolor. + //"invert", "none medium invert" + "currentColor", + "none medium currentcolor", + ], + other_values: [ + "solid", + "medium solid", + "green solid", + "10px solid", + "thick solid", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "outline-color": { + domProp: "outlineColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], // XXX should be invert + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "000000", + "cc00ff", + ], + }, + "outline-offset": { + domProp: "outlineOffset", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: [ + "0", + "0px", + "-0", + "calc(0px)", + "calc(3em + 2px - 2px - 3em)", + "calc(-0em)", + ], + other_values: [ + "-3px", + "1em", + "calc(3em)", + "calc(7pt + 3 * 2em)", + "calc(-3px)", + ], + invalid_values: ["5%"], + }, + "outline-style": { + domProp: "outlineStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + // XXX Should 'hidden' be the same as initial? + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + "auto", + ], + invalid_values: [], + }, + "outline-width": { + domProp: "outlineWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + prerequisites: { "outline-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0px)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%", "5"], + }, + overflow: { + domProp: "overflow", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + prerequisites: { display: "block", contain: "none" }, + subproperties: ["overflow-x", "overflow-y"], + initial_values: ["visible"], + other_values: [ + "auto", + "scroll", + "hidden", + "clip", + "auto auto", + "auto scroll", + "hidden scroll", + "auto hidden", + "clip clip", + "overlay", + "overlay overlay", + ], + invalid_values: [ + "clip -moz-scrollbars-none", + "-moz-scrollbars-none", + "-moz-scrollbars-horizontal", + "-moz-scrollbars-vertical", + ], + }, + "overflow-x": { + domProp: "overflowX", + inherited: false, + type: CSS_TYPE_LONGHAND, + // No applies_to_placeholder because we have a !important rule in forms.css. + prerequisites: { + display: "block", + "overflow-y": "visible", + contain: "none", + }, + initial_values: ["visible"], + other_values: ["auto", "scroll", "hidden", "clip", "overlay"], + invalid_values: [], + }, + "overflow-y": { + domProp: "overflowY", + inherited: false, + type: CSS_TYPE_LONGHAND, + // No applies_to_placeholder because we have a !important rule in forms.css. + prerequisites: { + display: "block", + "overflow-x": "visible", + contain: "none", + }, + initial_values: ["visible"], + other_values: ["auto", "scroll", "hidden", "clip", "overlay"], + invalid_values: [], + }, + "overflow-inline": { + domProp: "overflowInline", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + prerequisites: { + display: "block", + "overflow-block": "visible", + contain: "none", + }, + initial_values: ["visible"], + other_values: ["auto", "scroll", "hidden", "clip"], + invalid_values: [], + }, + "overflow-block": { + domProp: "overflowBlock", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + prerequisites: { + display: "block", + "overflow-inline": "visible", + contain: "none", + }, + initial_values: ["visible"], + other_values: ["auto", "scroll", "hidden", "clip"], + invalid_values: [], + }, + "overflow-clip-margin": { + domProp: "overflowClipMargin", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["1px", "2em", "calc(10px + 1vh)"], + invalid_values: ["-10px"], + }, + padding: { + domProp: "padding", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + ], + initial_values: [ + "0", + "0px 0 0em", + "0% 0px 0em 0pt", + "calc(0px) calc(0em) calc(-2px) calc(-1%)", + ], + other_values: ["3px 0", "2em 4px 2pt", "1em 2em 3px 4px"], + invalid_values: ["1px calc(nonsense)", "1px red", "-1px"], + unbalanced_values: ["1px calc("], + quirks_values: { 5: "5px", "3px 6px 2 5px": "3px 6px 2px 5px" }, + }, + "padding-block": { + domProp: "paddingBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["padding-block-start", "padding-block-end"], + initial_values: ["0", "0px 0em"], + other_values: ["3px 0", "2% 4px", "1em", "calc(1px) calc(-1%)"], + invalid_values: ["1px calc(nonsense)", "1px red", "-1px", "auto", "none"], + unbalanced_values: ["1px calc("], + }, + "padding-inline": { + domProp: "paddingInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["padding-inline-start", "padding-inline-end"], + initial_values: ["0", "0px 0em"], + other_values: ["3px 0", "2% 4px", "1em", "calc(1px) calc(-1%)"], + invalid_values: ["1px calc(nonsense)", "1px red", "-1px", "auto", "none"], + unbalanced_values: ["1px calc("], + }, + "padding-bottom": { + domProp: "paddingBottom", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "padding-left": { + domProp: "paddingLeft", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "padding-right": { + domProp: "paddingRight", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "padding-top": { + domProp: "paddingTop", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "page-break-after": { + domProp: "pageBreakAfter", + inherited: false, + type: CSS_TYPE_LEGACY_SHORTHAND, + alias_for: "break-after", + subproperties: ["break-after"], + initial_values: ["auto"], + other_values: ["always", "avoid", "left", "right"], + legacy_mapping: { + always: "page", + }, + invalid_values: ["page", "column"], + }, + "page-break-before": { + domProp: "pageBreakBefore", + inherited: false, + type: CSS_TYPE_LEGACY_SHORTHAND, + alias_for: "break-before", + subproperties: ["break-before"], + initial_values: ["auto"], + other_values: ["always", "avoid", "left", "right"], + legacy_mapping: { + always: "page", + }, + invalid_values: ["page", "column"], + }, + "break-after": { + domProp: "breakAfter", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["always", "page", "avoid", "left", "right"], + invalid_values: [], + }, + "break-before": { + domProp: "breakBefore", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["always", "page", "avoid", "left", "right"], + invalid_values: [], + }, + "break-inside": { + domProp: "breakInside", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["avoid", "avoid-page", "avoid-column"], + invalid_values: ["left", "right", "always"], + }, + "page-break-inside": { + domProp: "pageBreakInside", + inherited: false, + type: CSS_TYPE_LEGACY_SHORTHAND, + alias_for: "break-inside", + subproperties: ["break-inside"], + initial_values: ["auto"], + other_values: ["avoid"], + invalid_values: ["avoid-page", "avoid-column"], + }, + "paint-order": { + domProp: "paintOrder", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["normal"], + other_values: [ + "fill", + "fill stroke", + "fill stroke markers", + "stroke markers fill", + ], + invalid_values: ["fill stroke markers fill", "fill normal"], + }, + "pointer-events": { + domProp: "pointerEvents", + inherited: true, + type: CSS_TYPE_LONGHAND, + // No applies_to_placeholder because we have a !important rule in forms.css. + initial_values: ["auto"], + other_values: [ + "visiblePainted", + "visibleFill", + "visibleStroke", + "visible", + "painted", + "fill", + "stroke", + "all", + "none", + ], + invalid_values: [], + }, + position: { + domProp: "position", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["static"], + other_values: ["relative", "absolute", "fixed", "sticky"], + invalid_values: [], + }, + quotes: { + domProp: "quotes", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "none", + "'\"' '\"'", + "'' ''", + '"\u201C" "\u201D" "\u2018" "\u2019"', + '"\\201C" "\\201D" "\\2018" "\\2019"', + ], + invalid_values: ["'\"'", '"" "" ""'], + }, + right: { + domProp: "right", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "ruby-align": { + domProp: "rubyAlign", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["space-around"], + other_values: ["start", "center", "space-between"], + invalid_values: ["end", "1", "10px", "50%", "start center"], + }, + "ruby-position": { + domProp: "rubyPosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + initial_values: ["alternate", "alternate over", "over alternate"], + other_values: ["over", "under", "alternate under", "under alternate"], + invalid_values: [ + "left", + "right", + "auto", + "none", + "not_a_position", + "over left", + "right under", + "over under", + "alternate alternate", + "0", + "100px", + "50%", + ], + }, + "scroll-behavior": { + domProp: "scrollBehavior", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["smooth"], + invalid_values: ["none", "1px"], + }, + "scroll-snap-stop": { + domProp: "scrollSnapStop", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["always"], + invalid_values: ["auto", "none", "1px"], + }, + "scroll-snap-type": { + domProp: "scrollSnapType", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "both mandatory", + "y mandatory", + "inline proximity", + "both", + "x", + "y", + "block", + "inline", + ], + invalid_values: [ + "auto", + "1px", + "x y", + "block mandatory inline", + "mandatory", + "proximity", + "mandatory inline", + "proximity both", + "mandatory x", + "proximity y", + "mandatory block", + "proximity mandatory", + ], + }, + "scroll-snap-align": { + domProp: "scrollSnapAlign", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "start", + "end", + "center", + "start none", + "center end", + "start start", + ], + invalid_values: ["auto", "start invalid", "start end center"], + }, + "scroll-margin": { + domProp: "scrollMargin", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "scroll-margin-top", + "scroll-margin-right", + "scroll-margin-bottom", + "scroll-margin-left", + ], + initial_values: ["0"], + other_values: [ + "-10px", + "calc(2em + 3ex)", + "1px 2px", + "1px 2px 3px", + "1px 2px 3px 4px", + ], + invalid_values: ["auto", "20%", "-30%", "1px 2px 3px 4px 5px"], + }, + "scroll-margin-top": { + domProp: "scrollMarginTop", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-right": { + domProp: "scrollMarginRight", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-bottom": { + domProp: "scrollMarginBottom", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-left": { + domProp: "scrollMarginLeft", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-inline": { + domProp: "scrollMarginInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["scroll-margin-inline-start", "scroll-margin-inline-end"], + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)", "1px 2px"], + invalid_values: ["auto", "20%", "-30%", "1px 2px 3px"], + }, + "scroll-margin-inline-start": { + domProp: "scrollMarginInlineStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-inline-end": { + domProp: "scrollMarginInlineEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-block": { + domProp: "scrollMarginBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["scroll-margin-block-start", "scroll-margin-block-end"], + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)", "1px 2px"], + invalid_values: ["auto", "20%", "-30%", "1px 2px 3px"], + }, + "scroll-margin-block-start": { + domProp: "scrollMarginBlockStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-margin-block-end": { + domProp: "scrollMarginBlockEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["0"], + other_values: ["-10px", "calc(2em + 3ex)"], + invalid_values: ["auto", "20%", "-30%", "1px 2px"], + }, + "scroll-padding": { + domProp: "scrollPadding", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "scroll-padding-top", + "scroll-padding-right", + "scroll-padding-bottom", + "scroll-padding-left", + ], + initial_values: ["auto"], + other_values: [ + "10px", + "0", + "20%", + "calc(2em + 3ex)", + "1px 2px", + "1px 2px 3%", + "1px 2px 3% 4px", + "1px auto", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-top": { + domProp: "scrollPaddingTop", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-right": { + domProp: "scrollPaddingRight", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-bottom": { + domProp: "scrollPaddingBottom", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-left": { + domProp: "scrollPaddingLeft", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-inline": { + domProp: "scrollPaddingInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["scroll-padding-inline-start", "scroll-padding-inline-end"], + initial_values: ["auto", "auto auto"], + other_values: [ + "10px", + "0", + "20%", + "calc(2em + 3ex)", + "1px 2px", + "1px auto", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-inline-start": { + domProp: "scrollPaddingInlineStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-inline-end": { + domProp: "scrollPaddingInlineEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-block": { + domProp: "scrollPaddingBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["scroll-padding-block-start", "scroll-padding-block-end"], + initial_values: ["auto", "auto auto"], + other_values: [ + "10px", + "0", + "20%", + "calc(2em + 3ex)", + "1px 2px", + "1px auto", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-block-start": { + domProp: "scrollPaddingBlockStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "scroll-padding-block-end": { + domProp: "scrollPaddingBlockEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + initial_values: ["auto"], + other_values: [ + "0", + "10px", + "20%", + "calc(2em + 3ex)", + "calc(50% + 60px)", + "calc(-50px)", + ], + invalid_values: ["20", "-20px"], + }, + "table-layout": { + domProp: "tableLayout", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["fixed"], + invalid_values: [], + }, + "text-align": { + domProp: "textAlign", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + // don't know whether left and right are same as start + initial_values: ["start"], + other_values: ["center", "justify", "end", "match-parent"], + invalid_values: [ + "true", + "true true", + "char", + "-moz-center-or-inherit", + "true left", + "unsafe left", + ], + }, + "text-align-last": { + domProp: "textAlignLast", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["center", "justify", "start", "end", "left", "right"], + invalid_values: [], + }, + "text-combine-upright": { + domProp: "textCombineUpright", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["none"], + other_values: ["all"], + invalid_values: [ + "auto", + "all 2", + "none all", + "digits -3", + "digits 0", + "digits 12", + "none 3", + "digits 3.1415", + "digits3", + "digits 1", + "digits 3 all", + "digits foo", + "digits all", + "digits 3.0", + ], + }, + "text-decoration": { + domProp: "textDecoration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + subproperties: [ + "text-decoration-color", + "text-decoration-line", + "text-decoration-style", + "text-decoration-thickness", + ], + initial_values: ["none"], + other_values: [ + "underline", + "overline", + "line-through", + "blink", + "blink line-through underline", + "underline overline line-through blink", + "underline red solid", + "underline #ff0000", + "solid underline", + "red underline", + "#ff0000 underline", + "dotted underline", + "solid underline 50px", + "underline 50px blue", + "50px dotted line-through purple", + "overline 2em", + "underline from-font", + "red from-font overline", + "5% underline blue", + "dotted line-through 25%", + ], + invalid_values: [ + "none none", + "underline none", + "none underline", + "blink none", + "none blink", + "line-through blink line-through", + "underline overline line-through blink none", + "underline overline line-throuh blink blink", + "rgb(0, rubbish, 0) underline", + "from font blue underline", + ], + }, + "text-decoration-color": { + domProp: "textDecorationColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "000000", + "ff00ff", + ], + }, + "text-decoration-line": { + domProp: "textDecorationLine", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["none"], + other_values: [ + "underline", + "overline", + "line-through", + "blink", + "blink line-through underline", + "underline overline line-through blink", + ], + invalid_values: [ + "none none", + "underline none", + "none underline", + "line-through blink line-through", + "underline overline line-through blink none", + "underline overline line-throuh blink blink", + ], + }, + "text-decoration-style": { + domProp: "textDecorationStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["solid"], + other_values: ["double", "dotted", "dashed", "wavy", "-moz-none"], + invalid_values: [ + "none", + "groove", + "ridge", + "inset", + "outset", + "solid dashed", + "wave", + ], + }, + "text-decoration-thickness": { + domProp: "textDecorationThickness", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: [ + "from-font", + "0", + "-14px", + "25px", + "100em", + "-45em", + "43%", + "-10%", + ], + invalid_values: ["13", "-25", "rubbish", ",./!@#$", "from font"], + }, + "text-decoration-skip-ink": { + domProp: "textDecorationSkipInk", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: ["none", "all"], + invalid_values: [ + "13", + "15%", + "-1", + "0", + "otto", + "trash", + "non", + "nada", + "!@#$%^", + "none auto", + "auto none", + ], + }, + "text-underline-offset": { + domProp: "textUnderlineOffset", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: ["0", "-14px", "25px", "100em", "-45em", "43%", "-10%"], + invalid_values: [ + "13", + "-25", + "rubbish", + ",./!@#$", + "from-font", + "from font", + ], + }, + "text-underline-position": { + domProp: "textUnderlinePosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: [ + "under", + "left", + "right", + "left under", + "under left", + "right under", + "under right", + "from-font", + "from-font left", + "from-font right", + "left from-font", + "right from-font", + ], + invalid_values: [ + "none", + "auto from-font", + "auto under", + "under from-font", + "left right", + "right auto", + "0", + "1px", + "10%", + "from font", + ], + }, + "text-emphasis": { + domProp: "textEmphasis", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + prerequisites: { color: "black" }, + subproperties: ["text-emphasis-style", "text-emphasis-color"], + initial_values: [ + "none currentColor", + "currentColor none", + "none", + "currentColor", + "none black", + ], + other_values: [ + "filled dot black", + "#f00 circle open", + "sesame filled rgba(0,0,255,0.5)", + "red", + "green none", + "currentColor filled", + "currentColor open", + ], + invalid_values: [ + "filled black dot", + "filled filled red", + "open open circle #000", + "circle dot #f00", + "rubbish", + ], + }, + "text-emphasis-color": { + domProp: "textEmphasisColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "black" }, + initial_values: ["currentColor", "black", "rgb(0,0,0)"], + other_values: ["red", "rgba(255,255,255,0.5)", "transparent"], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "000000", + "ff00ff", + "rgb(255,xxx,255)", + ], + }, + "text-emphasis-position": { + domProp: "textEmphasisPosition", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["over right", "right over", "over"], + other_values: [ + "over left", + "left over", + "under left", + "left under", + "under right", + "right under", + "under", + ], + invalid_values: [ + "over over", + "left left", + "over right left", + "rubbish left", + "over rubbish", + ], + }, + "text-emphasis-style": { + domProp: "textEmphasisStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "filled", + "open", + "dot", + "circle", + "double-circle", + "triangle", + "sesame", + "'#'", + "filled dot", + "filled circle", + "filled double-circle", + "filled triangle", + "filled sesame", + "dot filled", + "circle filled", + "double-circle filled", + "triangle filled", + "sesame filled", + "dot open", + "circle open", + "double-circle open", + "triangle open", + "sesame open", + ], + invalid_values: [ + "rubbish", + "dot rubbish", + "rubbish dot", + "open rubbish", + "rubbish open", + "open filled", + "dot circle", + "open '#'", + "'#' filled", + "dot '#'", + "'#' circle", + "1", + "1 open", + "open 1", + ], + }, + "text-indent": { + domProp: "textIndent", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["0", "calc(3em - 5em + 2px + 2em - 2px)"], + other_values: [ + "2em", + "5%", + "-10px", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "text-overflow": { + domProp: "textOverflow", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + initial_values: ["clip"], + other_values: [ + "ellipsis", + '""', + "''", + '"hello"', + "clip clip", + "ellipsis ellipsis", + "clip ellipsis", + 'clip ""', + '"hello" ""', + '"" ellipsis', + ], + invalid_values: [ + "none", + "auto", + '"hello" inherit', + 'inherit "hello"', + "clip initial", + "initial clip", + "initial inherit", + "inherit initial", + "inherit none", + '"hello" unset', + 'unset "hello"', + "clip unset", + "unset clip", + "unset inherit", + "unset none", + "initial unset", + ], + }, + "text-shadow": { + domProp: "textShadow", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + prerequisites: { color: "blue" }, + initial_values: ["none"], + other_values: [ + "2px 2px", + "2px 2px 1px", + "2px 2px green", + "2px 2px 1px green", + "green 2px 2px", + "green 2px 2px 1px", + "green 2px 2px, blue 1px 3px 4px", + "currentColor 3px 3px", + "blue 2px 2px, currentColor 1px 2px", + /* calc() values */ + "2px 2px calc(-5px)" /* clamped */, + "calc(3em - 2px) 2px green", + "green calc(3em - 2px) 2px", + "2px calc(2px + 0.2em)", + "blue 2px calc(2px + 0.2em)", + "2px calc(2px + 0.2em) blue", + "calc(-2px) calc(-2px)", + "-2px -2px", + "calc(2px) calc(2px)", + "calc(2px) calc(2px) calc(2px)", + ], + invalid_values: [ + "3% 3%", + "2px 2px -5px", + "2px 2px 2px 2px", + "2px 2px, none", + "none, 2px 2px", + "inherit, 2px 2px", + "2px 2px, inherit", + "2 2px", + "2px 2", + "2px 2px 2", + "2px 2px 2px 2", + "calc(2px) calc(2px) calc(2px) calc(2px)", + "3px 3px calc(3px + rubbish)", + "unset, 2px 2px", + "2px 2px, unset", + ], + }, + "text-transform": { + domProp: "textTransform", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_marker: true, + initial_values: ["none"], + other_values: [ + "capitalize", + "uppercase", + "lowercase", + "full-width", + "full-size-kana", + "uppercase full-width", + "full-size-kana capitalize", + "full-width lowercase full-size-kana", + ], + invalid_values: [ + "none none", + "none uppercase", + "full-width none", + "uppercase lowercase", + "full-width capitalize full-width", + "uppercase full-width lowercase", + ], + }, + "text-wrap": { + domProp: "textWrap", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["text-wrap-mode"], + applies_to_placeholder: true, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["wrap"], + other_values: ["nowrap"], + invalid_values: [], + }, + "text-wrap-mode": { + domProp: "textWrapMode", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + applies_to_placeholder: true, + applies_to_marker: true, + initial_values: ["wrap"], + other_values: ["nowrap"], + invalid_values: ["none", "normal", "on", "off", "wrap nowrap"], + }, + top: { + domProp: "top", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + transition: { + domProp: "transition", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + subproperties: [ + "transition-property", + "transition-duration", + "transition-timing-function", + "transition-delay", + ], + initial_values: ["all 0s ease 0s", "all", "0s", "0s 0s", "ease"], + other_values: [ + "all 0s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0s", + "width 1s linear 2s", + "width 1s 2s linear", + "width linear 1s 2s", + "linear width 1s 2s", + "linear 1s width 2s", + "linear 1s 2s width", + "1s width linear 2s", + "1s width 2s linear", + "1s 2s width linear", + "1s linear width 2s", + "1s linear 2s width", + "1s 2s linear width", + "width linear 1s", + "width 1s linear", + "linear width 1s", + "linear 1s width", + "1s width linear", + "1s linear width", + "1s 2s width", + "1s width 2s", + "width 1s 2s", + "1s 2s linear", + "1s linear 2s", + "linear 1s 2s", + "width 1s", + "1s width", + "linear 1s", + "1s linear", + "1s 2s", + "2s 1s", + "width", + "linear", + "1s", + "height", + "2s", + "ease-in-out", + "2s ease-in", + "opacity linear", + "ease-out 2s", + "2s color, 1s width, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", + "1s \\32width linear 2s", + "1s -width linear 2s", + "1s -\\32width linear 2s", + "1s \\32 0width linear 2s", + "1s -\\32 0width linear 2s", + "1s \\2width linear 2s", + "1s -\\2width linear 2s", + "2s, 1s width", + "1s width, 2s", + "2s all, 1s width", + "1s width, 2s all", + "2s all, 1s width", + "2s width, 1s all", + "3s --my-color", + "none", + "none 2s linear 2s", + ], + invalid_values: [ + "1s width, 2s none", + "2s none, 1s width", + "2s inherit", + "inherit 2s", + "2s width, 1s inherit", + "2s inherit, 1s width", + "2s initial", + "1s width,,2s color", + "1s width, ,2s color", + "bounce 1s cubic-bezier(0, rubbish) 2s", + "bounce 1s steps(rubbish) 2s", + "2s unset", + ], + }, + "transition-delay": { + domProp: "transitionDelay", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["0s", "0ms"], + other_values: ["1s", "250ms", "-100ms", "-1s", "1s, 250ms, 2.3s"], + invalid_values: ["0", "0px"], + }, + "transition-duration": { + domProp: "transitionDuration", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["0s", "0ms"], + other_values: ["1s", "250ms", "1s, 250ms, 2.3s"], + invalid_values: ["0", "0px", "-1ms", "-2s"], + }, + "transition-property": { + domProp: "transitionProperty", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["all"], + other_values: [ + "none", + "left", + "top", + "color", + "width, height, opacity", + "foobar", + "auto", + "\\32width", + "-width", + "-\\32width", + "\\32 0width", + "-\\32 0width", + "\\2width", + "-\\2width", + "all, all", + "all, color", + "color, all", + "--my-color", + ], + invalid_values: [ + "none, none", + "color, none", + "none, color", + "inherit, color", + "color, inherit", + "initial, color", + "color, initial", + "none, color", + "color, none", + "unset, color", + "color, unset", + ], + }, + "transition-timing-function": { + domProp: "transitionTimingFunction", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["ease"], + other_values: [ + "cubic-bezier(0.25, 0.1, 0.25, 1.0)", + "linear", + "ease-in", + "ease-out", + "ease-in-out", + "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", + "cubic-bezier(0.5, 0.5, 0.5, 0.5)", + "cubic-bezier(0.25, 1.5, 0.75, -0.5)", + "step-start", + "step-end", + "steps(1)", + "steps(2, start)", + "steps(386)", + "steps(3, end)", + "steps(1, jump-start)", + "steps(1, jump-end)", + "steps(2, jump-none)", + "steps(1, jump-both)", + ], + invalid_values: [ + "none", + "auto", + "cubic-bezier(0.25, 0.1, 0.25)", + "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", + "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", + "cubic-bezier(1.5, 0.5, 0.5, 0.5)", + "cubic-bezier(0.5, 0.5, -0.5, 0.5)", + "cubic-bezier(0.5, 0.5, 1.5, 0.5)", + "steps(2, step-end)", + "steps(0)", + "steps(-2)", + "steps(0, step-end, 1)", + "steps(0, jump-start)", + "steps(0, jump-end)", + "steps(1, jump-none)", + "steps(0, jump-both)", + ], + }, + "unicode-bidi": { + domProp: "unicodeBidi", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["normal"], + other_values: [ + "embed", + "bidi-override", + "isolate", + "plaintext", + "isolate-override", + ], + invalid_values: [ + "auto", + "none", + "-moz-isolate", + "-moz-plaintext", + "-moz-isolate-override", + ], + }, + "vertical-align": { + domProp: "verticalAlign", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["baseline"], + other_values: [ + "sub", + "super", + "top", + "text-top", + "middle", + "bottom", + "text-bottom", + "-moz-middle-with-baseline", + "15%", + "3px", + "0.2em", + "-5px", + "-3%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "baseline-source": { + domProp: "baselineSource", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: ["first", "last"], + invalid_values: [], + }, + visibility: { + domProp: "visibility", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_cue: true, + initial_values: ["visible"], + other_values: ["hidden", "collapse"], + invalid_values: [], + }, + "white-space": { + domProp: "whiteSpace", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["white-space-collapse", "text-wrap-mode"], + applies_to_placeholder: true, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["normal"], + other_values: [ + "pre", + "nowrap", + "pre-wrap", + "pre-line", + "-moz-pre-space", + "break-spaces", + ], + invalid_values: [], + }, + "white-space-collapse": { + domProp: "whiteSpaceCollapse", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["collapse"], + other_values: [ + "preserve", + "preserve-breaks", + "preserve-spaces", + "break-spaces", + ], + invalid_values: ["normal", "auto"], + }, + width: { + domProp: "width", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { + // computed value tests for width test more with display:block + display: "block", + // add some margin to avoid the initial "auto" value getting + // resolved to the same length as the parent element. + "margin-left": "5px", + }, + initial_values: [" auto"], + /* XXX these have prerequisites */ + other_values: [ + "15px", + "3em", + "15%", + // these three keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + // whether -moz-available computes to the initial value depends on + // the container size, and for the container size we're testing + // with, it does + // "-moz-available", + "3e1px", + "3e+1px", + "3e0px", + "3e+0px", + "3e-0px", + "3e-1px", + "3.2e1px", + "3.2e+1px", + "3.2e0px", + "3.2e+0px", + "3.2e-0px", + "3.2e-1px", + "3e1%", + "3e+1%", + "3e0%", + "3e+0%", + "3e-0%", + "3e-1%", + "3.2e1%", + "3.2e+1%", + "3.2e0%", + "3.2e+0%", + "3.2e-0%", + "3.2e-1%", + /* valid calc() values */ + "calc(-2px)", + "calc(2px)", + "calc(50%)", + "calc(50% + 2px)", + "calc( 50% + 2px)", + "calc(50% + 2px )", + "calc( 50% + 2px )", + "calc(50% - -2px)", + "calc(2px - -50%)", + "calc(3*25px)", + "calc(3 *25px)", + "calc(3 * 25px)", + "calc(3* 25px)", + "calc(25px*3)", + "calc(25px *3)", + "calc(25px* 3)", + "calc(25px * 3)", + "calc(3*25px + 50%)", + "calc(50% - 3em + 2px)", + "calc(50% - (3em + 2px))", + "calc((50% - 3em) + 2px)", + "calc(2em)", + "calc(50%)", + "calc(50px/2)", + "calc(50px/(2 - 1))", + "calc(min(5px))", + "calc(min(5px,2em))", + "calc(max(5px))", + "calc(max(5px,2em))", + "min(5px)", + "min(5px,2em)", + "max(5px)", + "max(5px,2em)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: [ + "none", + "-2px", + "content" /* (valid for 'flex-basis' but not 'width') */, + /* invalid calc() values */ + "calc(50%+ 2px)", + "calc(50% +2px)", + "calc(50%+2px)", + "-moz-min()", + "calc(min())", + "-moz-max()", + "calc(max())", + "-moz-min(5px)", + "-moz-max(5px)", + "-moz-min(5px,2em)", + "-moz-max(5px,2em)", + /* If we ever support division by values, which is + * complicated for the reasons described in + * http://lists.w3.org/Archives/Public/www-style/2010Jan/0007.html + * , we should support all 4 of these as described in + * http://lists.w3.org/Archives/Public/www-style/2009Dec/0296.html + */ + "calc((3em / 100%) * 3em)", + "calc(3em / 100% * 3em)", + "calc(3em * (3em / 100%))", + "calc(3em * 3em / 100%)", + ], + quirks_values: { 5: "5px" }, + }, + "will-change": { + domProp: "willChange", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "scroll-position", + "contents", + "transform", + "opacity", + "scroll-position, transform", + "transform, opacity", + "contents, transform", + "property-that-doesnt-exist-yet", + ], + invalid_values: [ + "none", + "all", + "default", + "auto, scroll-position", + "scroll-position, auto", + "transform scroll-position", + ",", + "trailing,", + "will-change", + "transform, will-change", + ], + }, + "word-break": { + domProp: "wordBreak", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["break-all", "keep-all"], + invalid_values: [], + }, + "word-spacing": { + domProp: "wordSpacing", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["normal", "0", "0px", "-0em", "calc(-0px)", "calc(0em)"], + other_values: [ + "1em", + "2px", + "-3px", + "0%", + "50%", + "-120%", + "calc(1em)", + "calc(1em + 3px)", + "calc(15px / 2)", + "calc(15px/2)", + "calc(-2em)", + "calc(0% + 0px)", + "calc(-10%/2 - 1em)", + ], + invalid_values: [], + quirks_values: { 5: "5px" }, + }, + "overflow-wrap": { + domProp: "overflowWrap", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["break-word"], + invalid_values: [], + }, + hyphens: { + domProp: "hyphens", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["manual"], + other_values: ["none", "auto"], + invalid_values: [], + }, + "z-index": { + domProp: "zIndex", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* XXX requires position */ + initial_values: ["auto"], + other_values: ["0", "3", "-7000", "12000"], + invalid_values: ["3.0", "17.5", "3e1"], + }, + "clip-path": { + domProp: "clipPath", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "path(nonzero, 'M 10 10 h 100 v 100 h-100 v-100 z')", + "path(evenodd, 'M 10 10 h 100 v 100 h-100 v-100 z')", + "path('M10,30A20,20 0,0,1 50,30A20,20 0,0,1 90,30Q90,60 50,90Q10,60 10,30z')", + "url(#mypath)", + "url('404.svg#mypath')", + "url(#my-clip-path)", + "margin-box", + ] + .concat(basicShapeSVGBoxValues) + .concat(basicShapeOtherValues) + .concat(basicShapeOtherValuesWithFillRule) + .concat(basicShapeXywhRectValues), + invalid_values: [ + "path(nonzero)", + "path(abs, 'M 10 10 L 10 10 z')", + "path(evenodd, '')", + "path('')", + ].concat(basicShapeInvalidValues), + unbalanced_values: basicShapeUnbalancedValues, + }, + "clip-rule": { + domProp: "clipRule", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["nonzero"], + other_values: ["evenodd"], + invalid_values: [], + }, + "color-interpolation": { + domProp: "colorInterpolation", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["sRGB"], + other_values: ["auto", "linearRGB"], + invalid_values: [], + }, + "color-interpolation-filters": { + domProp: "colorInterpolationFilters", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["linearRGB"], + other_values: ["sRGB", "auto"], + invalid_values: [], + }, + "dominant-baseline": { + domProp: "dominantBaseline", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "ideographic", + "alphabetic", + "hanging", + "mathematical", + "central", + "middle", + "text-after-edge", + "text-before-edge", + ], + invalid_values: [], + }, + fill: { + domProp: "fill", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + prerequisites: { color: "blue" }, + initial_values: ["black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)"], + other_values: [ + "green", + "#fc3", + "url('#myserver')", + "url(foo.svg#myserver)", + 'url("#myserver") green', + "none", + "currentColor", + "context-fill", + "context-stroke", + ], + invalid_values: ["000000", "ff00ff", "url('#myserver') rgb(0, rubbish, 0)"], + }, + "fill-opacity": { + domProp: "fillOpacity", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["1", "2.8", "1.000", "300%"], + other_values: [ + "0", + "0.3", + "-7.3", + "-100%", + "50%", + "context-fill-opacity", + "context-stroke-opacity", + ], + invalid_values: [], + }, + "fill-rule": { + domProp: "fillRule", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["nonzero"], + other_values: ["evenodd"], + invalid_values: [], + }, + filter: { + domProp: "filter", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + // SVG reference filters + "url(#my-filter)", + "url(#my-filter-1) url(#my-filter-2)", + + // Filter functions + "opacity(50%) saturate(1.0)", + "invert(50%) sepia(0.1) brightness(90%)", + + // Mixed SVG reference filters and filter functions + "grayscale(1) url(#my-filter-1)", + "url(#my-filter-1) brightness(50%) contrast(0.9)", + + // Bad URLs + "url('badscheme:badurl')", + "blur(3px) url('badscheme:badurl') grayscale(50%)", + + "blur()", + "blur(0)", + "blur(0px)", + "blur(0.5px)", + "blur(3px)", + "blur(100px)", + "blur(0.1em)", + "blur(calc(-1px))", // Parses and becomes blur(0px). + "blur(calc(0px))", + "blur(calc(5px))", + "blur(calc(2 * 5px))", + + "brightness()", + "brightness(0)", + "brightness(50%)", + "brightness(1)", + "brightness(1.0)", + "brightness(2)", + "brightness(350%)", + "brightness(4.567)", + + "contrast()", + "contrast(0)", + "contrast(50%)", + "contrast(1)", + "contrast(1.0)", + "contrast(2)", + "contrast(350%)", + "contrast(4.567)", + + "drop-shadow(2px 2px)", + "drop-shadow(2px 2px 1px)", + "drop-shadow(2px 2px green)", + "drop-shadow(2px 2px 1px green)", + "drop-shadow(green 2px 2px)", + "drop-shadow(green 2px 2px 1px)", + "drop-shadow(currentColor 3px 3px)", + "drop-shadow(2px 2px calc(-5px))" /* clamped */, + "drop-shadow(calc(3em - 2px) 2px green)", + "drop-shadow(green calc(3em - 2px) 2px)", + "drop-shadow(2px calc(2px + 0.2em))", + "drop-shadow(blue 2px calc(2px + 0.2em))", + "drop-shadow(2px calc(2px + 0.2em) blue)", + "drop-shadow(calc(-2px) calc(-2px))", + "drop-shadow(-2px -2px)", + "drop-shadow(calc(2px) calc(2px))", + "drop-shadow(calc(2px) calc(2px) calc(2px))", + + "grayscale()", + "grayscale(0)", + "grayscale(50%)", + "grayscale(1)", + "grayscale(1.0)", + "grayscale(2)", + "grayscale(350%)", + "grayscale(4.567)", + + "hue-rotate()", + "hue-rotate(0)", + "hue-rotate(0deg)", + "hue-rotate(90deg)", + "hue-rotate(540deg)", + "hue-rotate(-90deg)", + "hue-rotate(10grad)", + "hue-rotate(1.6rad)", + "hue-rotate(-1.6rad)", + "hue-rotate(0.5turn)", + "hue-rotate(-2turn)", + + "invert()", + "invert(0)", + "invert(50%)", + "invert(1)", + "invert(1.0)", + "invert(2)", + "invert(350%)", + "invert(4.567)", + + "opacity()", + "opacity(0)", + "opacity(50%)", + "opacity(1)", + "opacity(1.0)", + "opacity(2)", + "opacity(350%)", + "opacity(4.567)", + + "saturate()", + "saturate(0)", + "saturate(50%)", + "saturate(1)", + "saturate(1.0)", + "saturate(2)", + "saturate(350%)", + "saturate(4.567)", + + "sepia()", + "sepia(0)", + "sepia(50%)", + "sepia(1)", + "sepia(1.0)", + "sepia(2)", + "sepia(350%)", + "sepia(4.567)", + ], + invalid_values: [ + // none + "none none", + "url(#my-filter) none", + "none url(#my-filter)", + "blur(2px) none url(#my-filter)", + + // Nested filters + "grayscale(invert(1.0))", + + // Comma delimited filters + "url(#my-filter),", + "invert(50%), url(#my-filter), brightness(90%)", + + // Test the following situations for each filter function: + // - Invalid number of arguments + // - Comma delimited arguments + // - Wrong argument type + // - Argument value out of range + "blur(3px 5px)", + "blur(3px,)", + "blur(3px, 5px)", + "blur(#my-filter)", + "blur(0.5)", + "blur(50%)", + "blur(calc(0))", // Unitless zero in calc is not a valid length. + "blur(calc(0.1))", + "blur(calc(10%))", + "blur(calc(20px - 5%))", + "blur(-3px)", + + "brightness(0.5 0.5)", + "brightness(0.5,)", + "brightness(0.5, 0.5)", + "brightness(#my-filter)", + "brightness(10px)", + "brightness(-1)", + + "contrast(0.5 0.5)", + "contrast(0.5,)", + "contrast(0.5, 0.5)", + "contrast(#my-filter)", + "contrast(10px)", + "contrast(-1)", + + "drop-shadow()", + "drop-shadow(3% 3%)", + "drop-shadow(2px 2px -5px)", + "drop-shadow(2px 2px 2px 2px)", + "drop-shadow(2px 2px, none)", + "drop-shadow(none, 2px 2px)", + "drop-shadow(inherit, 2px 2px)", + "drop-shadow(2px 2px, inherit)", + "drop-shadow(2 2px)", + "drop-shadow(2px 2)", + "drop-shadow(2px 2px 2)", + "drop-shadow(2px 2px 2px 2)", + "drop-shadow(calc(2px) calc(2px) calc(2px) calc(2px))", + "drop-shadow(green 2px 2px, blue 1px 3px 4px)", + "drop-shadow(blue 2px 2px, currentColor 1px 2px)", + "drop-shadow(unset, 2px 2px)", + "drop-shadow(2px 2px, unset)", + + "grayscale(0.5 0.5)", + "grayscale(0.5,)", + "grayscale(0.5, 0.5)", + "grayscale(#my-filter)", + "grayscale(10px)", + "grayscale(-1)", + + "hue-rotate(0.5 0.5)", + "hue-rotate(0.5,)", + "hue-rotate(0.5, 0.5)", + "hue-rotate(#my-filter)", + "hue-rotate(10px)", + "hue-rotate(-1)", + "hue-rotate(45deg,)", + + "invert(0.5 0.5)", + "invert(0.5,)", + "invert(0.5, 0.5)", + "invert(#my-filter)", + "invert(10px)", + "invert(-1)", + + "opacity(0.5 0.5)", + "opacity(0.5,)", + "opacity(0.5, 0.5)", + "opacity(#my-filter)", + "opacity(10px)", + "opacity(-1)", + + "saturate(0.5 0.5)", + "saturate(0.5,)", + "saturate(0.5, 0.5)", + "saturate(#my-filter)", + "saturate(10px)", + "saturate(-1)", + + "sepia(0.5 0.5)", + "sepia(0.5,)", + "sepia(0.5, 0.5)", + "sepia(#my-filter)", + "sepia(10px)", + "sepia(-1)", + ], + }, + "flood-color": { + domProp: "floodColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "blue" }, + initial_values: ["black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)"], + other_values: ["green", "#fc3", "currentColor"], + invalid_values: [ + "url('#myserver')", + "url(foo.svg#myserver)", + 'url("#myserver") green', + "000000", + "ff00ff", + ], + }, + "flood-opacity": { + domProp: "floodOpacity", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["1", "2.8", "1.000", "300%"], + other_values: ["0", "0.3", "-7.3", "-100%", "50%"], + invalid_values: [], + }, + "image-orientation": { + domProp: "imageOrientation", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["from-image"], + other_values: ["none"], + invalid_values: ["0", "0deg"], + }, + "image-rendering": { + domProp: "imageRendering", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "optimizeSpeed", + "optimizeQuality", + "-moz-crisp-edges", + "crisp-edges", + "smooth", + "pixelated", + ], + invalid_values: [], + }, + isolation: { + domProp: "isolation", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["isolate"], + invalid_values: [], + }, + "lighting-color": { + domProp: "lightingColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "blue" }, + initial_values: [ + "white", + "#fff", + "#ffffff", + "rgb(255,255,255)", + "rgba(255,255,255,1.0)", + "rgba(255,255,255,42.0)", + ], + other_values: ["green", "#fc3", "currentColor"], + invalid_values: [ + "url('#myserver')", + "url(foo.svg#myserver)", + 'url("#myserver") green', + "000000", + "ff00ff", + ], + }, + marker: { + domProp: "marker", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["marker-start", "marker-mid", "marker-end"], + initial_values: ["none"], + other_values: ["url(#mysym)"], + invalid_values: [ + "none none", + "url(#mysym) url(#mysym)", + "none url(#mysym)", + "url(#mysym) none", + ], + }, + "marker-end": { + domProp: "markerEnd", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["url(#mysym)"], + invalid_values: [], + }, + "marker-mid": { + domProp: "markerMid", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["url(#mysym)"], + invalid_values: [], + }, + "marker-start": { + domProp: "markerStart", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["url(#mysym)"], + invalid_values: [], + }, + "mix-blend-mode": { + domProp: "mixBlendMode", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + "plus-lighter", + ], + invalid_values: [], + }, + "shape-image-threshold": { + domProp: "shapeImageThreshold", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["0", "0.0000", "-3", "0%", "-100%"], + other_values: [ + "0.4", + "1", + "17", + "397.376", + "3e1", + "3e+1", + "3e-1", + "3e0", + "3e+0", + "3e-0", + "50%", + "300%", + ], + invalid_values: ["0px", "1px", "default", "auto"], + }, + "shape-margin": { + domProp: "shapeMargin", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["0"], + other_values: ["2px", "2%", "1em", "calc(1px + 1em)", "calc(1%)"], + invalid_values: ["-1px", "auto", "none", "1px 1px", "-1%"], + }, + "shape-outside": { + domProp: "shapeOutside", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["none"], + other_values: ["url(#my-shape-outside)", "margin-box"].concat( + basicShapeOtherValues, + basicShapeOtherValuesWithFillRule, + validNonUrlImageValues + ), + invalid_values: [].concat( + basicShapeSVGBoxValues, + basicShapeInvalidValues, + invalidNonUrlImageValues + ), + unbalanced_values: [].concat( + basicShapeUnbalancedValues, + unbalancedGradientAndElementValues + ), + }, + "shape-rendering": { + domProp: "shapeRendering", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["optimizeSpeed", "crispEdges", "geometricPrecision"], + invalid_values: [], + }, + "stop-color": { + domProp: "stopColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "blue" }, + initial_values: ["black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)"], + other_values: ["green", "#fc3", "currentColor"], + invalid_values: [ + "url('#myserver')", + "url(foo.svg#myserver)", + 'url("#myserver") green', + "000000", + "ff00ff", + ], + }, + "stop-opacity": { + domProp: "stopOpacity", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["1", "2.8", "1.000", "300%"], + other_values: ["0", "0.3", "-7.3", "-100%", "50%"], + invalid_values: [], + }, + stroke: { + domProp: "stroke", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["none"], + other_values: [ + "black", + "#000", + "#000000", + "rgb(0,0,0)", + "rgba(0,0,0,1)", + "green", + "#fc3", + "url('#myserver')", + "url(foo.svg#myserver)", + 'url("#myserver") green', + "currentColor", + "context-fill", + "context-stroke", + ], + invalid_values: ["000000", "ff00ff"], + }, + "stroke-dasharray": { + domProp: "strokeDasharray", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["none"], + other_values: [ + "5px,3px,2px", + "5px 3px 2px", + " 5px ,3px\t, 2px ", + "1px", + "5%", + "3em", + "0.0002", + "context-value", + ], + invalid_values: ["-5px,3px,2px", "5px,3px,-2px"], + }, + "stroke-dashoffset": { + domProp: "strokeDashoffset", + inherited: true, + applies_to_first_letter: true, + applies_to_first_line: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["0", "-0px", "0em"], + other_values: ["3px", "3%", "1em", "0.0002", "context-value"], + invalid_values: [], + }, + "stroke-linecap": { + domProp: "strokeLinecap", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["butt"], + other_values: ["round", "square"], + invalid_values: [], + }, + "stroke-linejoin": { + domProp: "strokeLinejoin", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["miter"], + other_values: ["round", "bevel"], + invalid_values: [], + }, + "stroke-miterlimit": { + domProp: "strokeMiterlimit", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["4"], + other_values: ["0", "0.9", "1", "7", "5000", "1.1"], + invalid_values: ["-1", "3px", "-0.3"], + }, + "stroke-opacity": { + domProp: "strokeOpacity", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["1", "2.8", "1.000", "300%"], + other_values: [ + "0", + "0.3", + "-7.3", + "-100%", + "50%", + "context-fill-opacity", + "context-stroke-opacity", + ], + invalid_values: [], + }, + "stroke-width": { + domProp: "strokeWidth", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["1px"], + other_values: [ + "0", + "0px", + "-0em", + "17px", + "0.2em", + "0.0002", + "context-value", + ], + invalid_values: ["-0.1px", "-3px"], + }, + x: { + domProp: "x", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["-1em", "17px", "0.2em", "23.4%"], + invalid_values: ["auto", "context-value", "0.0002"], + }, + y: { + domProp: "y", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["-1em", "17px", "0.2em", "23.4%"], + invalid_values: ["auto", "context-value", "0.0002"], + }, + cx: { + domProp: "cx", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["-1em", "17px", "0.2em", "23.4%"], + invalid_values: ["auto", "context-value", "0.0002"], + }, + cy: { + domProp: "cy", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["-1em", "17px", "0.2em", "23.4%"], + invalid_values: ["auto", "context-value", "0.0002"], + }, + r: { + domProp: "r", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0px"], + other_values: ["17px", "0.2em", "23.4%"], + invalid_values: ["auto", "-1", "-1.5px", "0.0002"], + }, + rx: { + domProp: "rx", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["17px", "0.2em", "23.4%"], + invalid_values: ["hello", "-12px", "0.0002"], + }, + ry: { + domProp: "ry", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["17px", "0.2em", "23.4%"], + invalid_values: ["hello", "-1.3px", "0.0002"], + }, + "text-anchor": { + domProp: "textAnchor", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["start"], + other_values: ["middle", "end"], + invalid_values: [], + }, + "text-rendering": { + domProp: "textRendering", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["auto"], + other_values: ["optimizeSpeed", "optimizeLegibility", "geometricPrecision"], + invalid_values: [], + }, + "vector-effect": { + domProp: "vectorEffect", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + initial_values: ["none"], + other_values: ["non-scaling-stroke"], + invalid_values: [], + }, + "-moz-window-dragging": { + domProp: "MozWindowDragging", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["default"], + other_values: ["drag", "no-drag"], + invalid_values: ["none"], + }, + "accent-color": { + domProp: "accentColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + prerequisites: { color: "black" }, + initial_values: ["auto"], + other_values: [ + "currentcolor", + "black", + "green", + "transparent", + "rgba(128,128,128,.5)", + "#123", + ], + invalid_values: ["#0", "#00", "#00000", "cc00ff"], + }, + "align-content": { + domProp: "alignContent", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "start", + "end", + "flex-start", + "flex-end", + "center", + "space-between", + "space-around", + "space-evenly", + "first baseline", + "last baseline", + "baseline", + "stretch", + "safe start", + "unsafe end", + "safe end", + ], + invalid_values: [ + "none", + "5", + "self-end", + "safe", + "normal unsafe", + "unsafe safe", + "safe baseline", + "baseline unsafe", + "baseline end", + "end normal", + "safe end unsafe start", + "safe end unsafe", + "normal safe start", + "unsafe end start", + "end start safe", + "space-between unsafe", + "stretch safe", + "auto", + "first", + "last", + "left", + "right", + ], + }, + "align-items": { + domProp: "alignItems", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "end", + "flex-start", + "flex-end", + "self-start", + "self-end", + "center", + "stretch", + "first baseline", + "last baseline", + "baseline", + "start", + "unsafe center", + "safe center", + ], + invalid_values: [ + "space-between", + "abc", + "5%", + "legacy", + "legacy end", + "end legacy", + "unsafe", + "unsafe baseline", + "normal unsafe", + "safe left unsafe", + "safe stretch", + "end end", + "auto", + "left", + "right", + ], + }, + "align-self": { + domProp: "alignSelf", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "normal", + "start", + "flex-start", + "flex-end", + "center", + "stretch", + "first baseline", + "last baseline", + "baseline", + "unsafe center", + "self-start", + "safe self-end", + ], + invalid_values: [ + "space-between", + "abc", + "30px", + "stretch safe", + "safe", + "left", + "right", + ], + }, + "justify-content": { + domProp: "justifyContent", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "start", + "end", + "flex-start", + "flex-end", + "center", + "left", + "right", + "space-between", + "space-around", + "space-evenly", + "stretch", + "safe start", + "unsafe end", + "safe end", + ], + invalid_values: [ + "30px", + "5%", + "self-end", + "safe", + "normal unsafe", + "unsafe safe", + "safe baseline", + "baseline unsafe", + "baseline end", + "normal end", + "safe end unsafe start", + "safe end unsafe", + "normal safe start", + "unsafe end start", + "end start safe", + "space-around unsafe", + "safe stretch", + "auto", + "first", + "last", + ], + }, + "justify-items": { + domProp: "justifyItems", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["legacy", "normal"], + other_values: [ + "end", + "flex-start", + "flex-end", + "self-start", + "self-end", + "center", + "left", + "right", + "stretch", + "start", + "legacy left", + "right legacy", + "legacy center", + "unsafe right", + "unsafe left", + "safe right", + "safe center", + ], + invalid_values: [ + "auto", + "space-between", + "abc", + "30px", + "legacy start", + "end legacy", + "legacy baseline", + "legacy legacy", + "unsafe", + "safe legacy left", + "legacy left safe", + "legacy safe left", + "safe left legacy", + "legacy left legacy", + "baseline unsafe", + "safe unsafe", + "safe left unsafe", + "safe stretch", + "last", + ], + }, + "justify-self": { + domProp: "justifySelf", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "normal", + "start", + "end", + "flex-start", + "flex-end", + "self-start", + "self-end", + "center", + "left", + "right", + "stretch", + "unsafe left", + "baseline", + "last baseline", + "first baseline", + "unsafe right", + "safe right", + "safe center", + ], + invalid_values: [ + "space-between", + "abc", + "30px", + "none", + "first", + "last", + "legacy left", + "right legacy", + "baseline first", + "baseline last", + ], + }, + "place-content": { + domProp: "placeContent", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["align-content", "justify-content"], + initial_values: ["normal"], + other_values: [ + "normal start", + "baseline end", + "end end", + "space-between flex-end", + "last baseline start", + "space-evenly", + "flex-start", + "end", + "unsafe start", + "safe center", + "baseline", + "last baseline", + ], + invalid_values: [ + "none", + "center safe", + "right / end", + "left", + "right", + "left left", + "right right", + ], + }, + "place-items": { + domProp: "placeItems", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["align-items", "justify-items"], + initial_values: ["normal"], + other_values: [ + "normal center", + "baseline end", + "end legacy", + "end", + "flex-end left", + "last baseline start", + "stretch", + "safe center", + "end legacy left", + ], + invalid_values: [ + "space-between", + "start space-evenly", + "none", + "end/end", + "center safe", + "auto start", + "left", + "right", + "left left", + "right right", + ], + }, + "place-self": { + domProp: "placeSelf", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["align-self", "justify-self"], + initial_values: ["auto"], + other_values: [ + "normal start", + "first baseline end", + "end auto", + "end", + "normal", + "baseline start", + "baseline", + "start baseline", + "self-end left", + "last baseline start", + "stretch", + ], + invalid_values: [ + "space-between", + "start space-evenly", + "none", + "end safe", + "auto legacy left", + "legacy left", + "auto/auto", + "left", + "right", + "left left", + "right right", + ], + }, + flex: { + domProp: "flex", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["flex-grow", "flex-shrink", "flex-basis"], + initial_values: ["0 1 auto", "auto 0 1", "0 auto", "auto 0"], + other_values: [ + "none", + "1", + "0", + "0 1", + "0.5", + "1.2 3.4", + "0 0 0", + "0 0 0px", + "0px 0 0", + "5px 0 0", + "2 auto", + "auto 4", + "auto 5.6 7.8", + "max-content", + "1 max-content", + "1 2 max-content", + "max-content 1", + "max-content 1 2", + "-0", + ], + invalid_values: [ + "1 2px 3", + "1 auto 3", + "1px 2 3px", + "1px 2 3 4px", + "-1", + "1 -1", + "0 1 calc(0px + rubbish)", + ], + }, + "flex-basis": { + domProp: "flexBasis", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: [" auto"], + // NOTE: Besides "content", this is cribbed directly from the "width" + // chunk, since this property takes the exact same values as width + // (plus 'content' & with different semantics on 'auto'). + // XXXdholbert (Maybe these should get separated out into + // a reusable array defined at the top of this file?) + other_values: [ + "content", + "15px", + "3em", + "15%", + "max-content", + "min-content", + "fit-content", + "-moz-max-content", + "-moz-min-content", + "-moz-fit-content", + "-moz-available", + // valid calc() values + "calc(-2px)", + "calc(2px)", + "calc(50%)", + "calc(50% + 2px)", + "calc( 50% + 2px)", + "calc(50% + 2px )", + "calc( 50% + 2px )", + "calc(50% - -2px)", + "calc(2px - -50%)", + "calc(3*25px)", + "calc(3 *25px)", + "calc(3 * 25px)", + "calc(3* 25px)", + "calc(25px*3)", + "calc(25px *3)", + "calc(25px* 3)", + "calc(25px * 3)", + "calc(3*25px + 50%)", + "calc(50% - 3em + 2px)", + "calc(50% - (3em + 2px))", + "calc((50% - 3em) + 2px)", + "calc(2em)", + "calc(50%)", + "calc(50px/2)", + "calc(50px/(2 - 1))", + "calc(min(5px))", + "calc(min(5px,2em))", + "calc(max(5px))", + "calc(max(5px,2em))", + "min(5px)", + "min(5px,2em)", + "max(5px)", + "max(5px,2em)", + ], + invalid_values: [ + "none", + "-2px", + // invalid calc() values + "calc(50%+ 2px)", + "calc(50% +2px)", + "calc(50%+2px)", + "-moz-min()", + "calc(min())", + "-moz-max()", + "calc(max())", + "-moz-min(5px)", + "-moz-max(5px)", + "-moz-min(5px,2em)", + "-moz-max(5px,2em)", + // If we ever support division by values, which is + // complicated for the reasons described in + // http://lists.w3.org/Archives/Public/www-style/2010Jan/0007.html + // , we should support all 4 of these as described in + // http://lists.w3.org/Archives/Public/www-style/2009Dec/0296.html + "calc((3em / 100%) * 3em)", + "calc(3em / 100% * 3em)", + "calc(3em * (3em / 100%))", + "calc(3em * 3em / 100%)", + ], + }, + "flex-direction": { + domProp: "flexDirection", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["row"], + other_values: ["row-reverse", "column", "column-reverse"], + invalid_values: ["10px", "30%", "justify", "column wrap"], + }, + "flex-flow": { + domProp: "flexFlow", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["flex-direction", "flex-wrap"], + initial_values: ["row nowrap", "nowrap row", "row", "nowrap"], + other_values: [ + // only specifying one property: + "column", + "wrap", + "wrap-reverse", + // specifying both properties, 'flex-direction' first: + "row wrap", + "row wrap-reverse", + "column wrap", + "column wrap-reverse", + // specifying both properties, 'flex-wrap' first: + "wrap row", + "wrap column", + "wrap-reverse row", + "wrap-reverse column", + ], + invalid_values: [ + // specifying flex-direction twice (invalid): + "row column", + "row column nowrap", + "row nowrap column", + "nowrap row column", + // specifying flex-wrap twice (invalid): + "nowrap wrap-reverse", + "nowrap wrap-reverse row", + "nowrap row wrap-reverse", + "row nowrap wrap-reverse", + // Invalid data-type / invalid keyword type: + "1px", + "5%", + "justify", + "none", + ], + }, + "flex-grow": { + domProp: "flexGrow", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["3", "1", "1.0", "2.5", "123"], + invalid_values: ["0px", "-5", "1%", "3em", "stretch", "auto"], + }, + "flex-shrink": { + domProp: "flexShrink", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["1"], + other_values: ["3", "0", "0.0", "2.5", "123"], + invalid_values: ["0px", "-5", "1%", "3em", "stretch", "auto"], + }, + "flex-wrap": { + domProp: "flexWrap", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["nowrap"], + other_values: ["wrap", "wrap-reverse"], + invalid_values: ["10px", "30%", "justify", "column wrap", "auto"], + }, + order: { + domProp: "order", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["1", "99999", "-1", "-50"], + invalid_values: ["0px", "1.0", "1.", "1%", "0.2", "3em", "stretch"], + }, + + // Aliases + "word-wrap": { + domProp: "wordWrap", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "overflow-wrap", + subproperties: ["overflow-wrap"], + }, + "-moz-tab-size": { + domProp: "MozTabSize", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "tab-size", + subproperties: ["tab-size"], + }, + "-moz-border-image": { + domProp: "MozBorderImage", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-image", + subproperties: [ + "border-image-source", + "border-image-slice", + "border-image-width", + "border-image-outset", + "border-image-repeat", + ], + }, + "-moz-font-feature-settings": { + domProp: "MozFontFeatureSettings", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + alias_for: "font-feature-settings", + subproperties: ["font-feature-settings"], + }, + "-moz-font-language-override": { + domProp: "MozFontLanguageOverride", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + alias_for: "font-language-override", + subproperties: ["font-language-override"], + }, + "-moz-hyphens": { + domProp: "MozHyphens", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "hyphens", + subproperties: ["hyphens"], + }, + // vertical text properties + "writing-mode": { + domProp: "writingMode", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["horizontal-tb", "lr", "lr-tb", "rl", "rl-tb"], + other_values: [ + "vertical-lr", + "vertical-rl", + "sideways-rl", + "sideways-lr", + "tb", + "tb-rl", + ], + invalid_values: ["10px", "30%", "justify", "auto", "1em"], + }, + "text-orientation": { + domProp: "textOrientation", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["mixed"], + other_values: [ + "upright", + "sideways", + "sideways-right", + ] /* sideways-right alias for backward compatibility */, + invalid_values: [ + "none", + "3em", + "sideways-left", + ] /* sideways-left removed from CSS Writing Modes */, + }, + "block-size": { + domProp: "blockSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + /* XXX testing auto has prerequisites */ + initial_values: ["auto"], + prerequisites: { display: "block" }, + other_values: [ + "15px", + "3em", + "15%", + // These keywords are treated as initial value. + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none"], + }, + "border-block": { + domProp: "borderBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-block-start-color", + "border-block-start-style", + "border-block-start-width", + "border-block-end-color", + "border-block-end-style", + "border-block-end-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-block-end": { + domProp: "borderBlockEnd", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-block-end-color", + "border-block-end-style", + "border-block-end-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-block-color": { + domProp: "borderBlockColor", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-block-start-color", "border-block-end-color"], + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5) blue", "blue transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-block-end-color": { + domProp: "borderBlockEndColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-block-style": { + domProp: "borderBlockStyle", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-block-start-style", "border-block-end-style"], + initial_values: ["none"], + other_values: [ + "solid", + "dashed solid", + "solid dotted", + "double double", + "inset outset", + "inset double", + "none groove", + "ridge none", + ], + invalid_values: [], + }, + "border-block-end-style": { + domProp: "borderBlockEndStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-block-width": { + domProp: "borderBlockWidth", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["border-block-start-width", "border-block-end-width"], + prerequisites: { "border-style": "solid" }, + initial_values: ["medium", "3px", "medium medium"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(2px) thin", + "calc(-2px)", + "calc(-2px) thick", + "calc(0em)", + "medium calc(0em)", + "calc(0px)", + "1px calc(0px)", + "calc(5em)", + "1em calc(5em)", + ], + invalid_values: ["5%", "5", "5 thin", "thin 5%", "blue", "solid"], + }, + "border-block-end-width": { + domProp: "borderBlockEndWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { "border-block-end-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%", "5"], + }, + "border-block-start": { + domProp: "borderBlockStart", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "border-block-start-color", + "border-block-start-style", + "border-block-start-width", + ], + initial_values: [ + "none", + "medium", + "currentColor", + "thin", + "none medium currentcolor", + ], + other_values: [ + "solid", + "green", + "medium solid", + "green solid", + "10px solid", + "thick solid", + "5px green none", + ], + invalid_values: ["5%", "5", "5 solid green"], + }, + "border-block-start-color": { + domProp: "borderBlockStartColor", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + initial_values: ["currentColor"], + other_values: ["green", "rgba(255,128,0,0.5)", "transparent"], + invalid_values: ["#0", "#00", "#00000", "#0000000", "#000000000", "000000"], + }, + "border-block-start-style": { + domProp: "borderBlockStartStyle", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX hidden is sometimes the same as initial */ + initial_values: ["none"], + other_values: [ + "solid", + "dashed", + "dotted", + "double", + "outset", + "inset", + "groove", + "ridge", + ], + invalid_values: [], + }, + "border-block-start-width": { + domProp: "borderBlockStartWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + prerequisites: { "border-block-start-style": "solid" }, + initial_values: ["medium", "3px", "calc(4px - 1px)"], + other_values: [ + "thin", + "thick", + "1px", + "2em", + "calc(2px)", + "calc(-2px)", + "calc(0em)", + "calc(0px)", + "calc(5em)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 5em)", + ], + invalid_values: ["5%", "5"], + }, + "-moz-border-end": { + domProp: "MozBorderEnd", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-inline-end", + subproperties: [ + "-moz-border-end-color", + "-moz-border-end-style", + "-moz-border-end-width", + ], + }, + "-moz-border-end-color": { + domProp: "MozBorderEndColor", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-end-color", + subproperties: ["border-inline-end-color"], + }, + "-moz-border-end-style": { + domProp: "MozBorderEndStyle", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-end-style", + subproperties: ["border-inline-end-style"], + }, + "-moz-border-end-width": { + domProp: "MozBorderEndWidth", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-end-width", + subproperties: ["border-inline-end-width"], + }, + "-moz-border-start": { + domProp: "MozBorderStart", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-inline-start", + subproperties: [ + "-moz-border-start-color", + "-moz-border-start-style", + "-moz-border-start-width", + ], + }, + "-moz-border-start-color": { + domProp: "MozBorderStartColor", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-start-color", + subproperties: ["border-inline-start-color"], + }, + "-moz-border-start-style": { + domProp: "MozBorderStartStyle", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-start-style", + subproperties: ["border-inline-start-style"], + }, + "-moz-border-start-width": { + domProp: "MozBorderStartWidth", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-inline-start-width", + subproperties: ["border-inline-start-width"], + }, + "inline-size": { + domProp: "inlineSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + /* XXX testing auto has prerequisites */ + initial_values: ["auto"], + prerequisites: { + display: "block", + // add some margin to avoid the initial "auto" value getting + // resolved to the same length as the parent element. + "margin-left": "5px", + }, + other_values: [ + "15px", + "3em", + "15%", + // these three keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + // whether -moz-available computes to the initial value depends on + // the container size, and for the container size we're testing + // with, it does + // "-moz-available", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none"], + }, + "margin-block": { + domProp: "marginBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["margin-block-start", "margin-block-end"], + initial_values: ["0", "0px 0em"], + other_values: [ + "1px", + "3em 1%", + "5%", + "calc(2px) 1%", + "calc(-2px) 1%", + "calc(50%) 1%", + "calc(3*25px) calc(2px)", + "calc(25px*3) 1em", + "calc(3*25px + 50%) calc(3*25px - 50%)", + ], + invalid_values: [ + "5", + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + "margin-block-end": { + domProp: "marginBlockEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + "margin-block-start": { + domProp: "marginBlockStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + logical: true, + /* XXX testing auto has prerequisites */ + initial_values: ["0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)"], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [ + "..25px", + ".+5px", + ".px", + "-.px", + "++5px", + "-+4px", + "+-3px", + "--7px", + "+-.6px", + "-+.5px", + "++.7px", + "--.4px", + ], + }, + "-moz-margin-end": { + domProp: "MozMarginEnd", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "margin-inline-end", + subproperties: ["margin-inline-end"], + }, + "-moz-margin-start": { + domProp: "MozMarginStart", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "margin-inline-start", + subproperties: ["margin-inline-start"], + }, + "max-block-size": { + domProp: "maxBlockSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + prerequisites: { display: "block" }, + initial_values: ["none"], + other_values: [ + "30px", + "50%", + // These keywords are treated as initial value. + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["auto", "5"], + }, + "max-inline-size": { + domProp: "maxInlineSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + prerequisites: { display: "block" }, + initial_values: ["none"], + other_values: [ + "30px", + "50%", + // these four keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["auto", "5"], + }, + "min-block-size": { + domProp: "minBlockSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + prerequisites: { display: "block" }, + initial_values: ["auto", "0", "calc(0em)", "calc(-2px)"], + other_values: [ + "30px", + "50%", + // These keywords are treated as initial value. + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + "-moz-max-content", + "-moz-min-content", + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none", "5"], + }, + "min-inline-size": { + domProp: "minInlineSize", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + axis: true, + prerequisites: { display: "block" }, + initial_values: ["auto", "0", "calc(0em)", "calc(-2px)"], + other_values: [ + "30px", + "50%", + // these four keywords compute to the initial value only when the + // writing mode is vertical, and we're testing with a horizontal + // writing mode + "max-content", + "min-content", + "fit-content", + "-moz-fit-content", + "-moz-available", + // these two keywords are the aliases of above first two. + "-moz-max-content", + "-moz-min-content", + "calc(-1%)", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + "fit-content(100px)", + "fit-content(10%)", + "fit-content(calc(3*25px + 50%))", + ], + invalid_values: ["none", "5"], + }, + inset: { + domProp: "inset", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["top", "right", "bottom", "left"], + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + initial_values: ["auto"], + other_values: [ + "3px 0", + "2em 4px 2pt", + "1em 2em 3px 4px", + "1em calc(2em + 3px) 4ex 5cm", + ], + invalid_values: ["1px calc(nonsense)", "1px red", "3"], + unbalanced_values: ["1px calc("], + }, + "inset-block": { + domProp: "insetBlock", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["inset-block-start", "inset-block-end"], + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + initial_values: ["auto", "auto auto"], + other_values: [ + "32px", + "-3em", + "12%", + "32px auto", + "auto -3em", + "12% auto", + "calc(2px)", + "calc(2px) auto", + "calc(-2px)", + "auto calc(-2px)", + "calc(50%)", + "auto calc(50%)", + "calc(3*25px)", + "calc(3*25px) auto", + "calc(25px*3)", + "auto calc(25px*3)", + "calc(3*25px + 50%)", + "auto calc(3*25px + 50%)", + ], + invalid_values: ["none"], + }, + "inset-block-end": { + domProp: "insetBlockEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "inset-block-start": { + domProp: "insetBlockStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "inset-inline": { + domProp: "insetInline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["inset-inline-start", "inset-inline-end"], + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + initial_values: ["auto", "auto auto"], + other_values: [ + "32px", + "-3em", + "12%", + "32px auto", + "auto -3em", + "12% auto", + "calc(2px)", + "calc(2px) auto", + "calc(-2px)", + "auto calc(-2px)", + "calc(50%)", + "auto calc(50%)", + "calc(3*25px)", + "calc(3*25px) auto", + "calc(25px*3)", + "auto calc(25px*3)", + "calc(3*25px + 50%)", + "auto calc(3*25px + 50%)", + ], + invalid_values: ["none"], + }, + "inset-inline-end": { + domProp: "insetInlineEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "inset-inline-start": { + domProp: "insetInlineStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + logical: true, + /* FIXME: run tests with multiple prerequisites */ + prerequisites: { position: "relative" }, + /* XXX 0 may or may not be equal to auto */ + initial_values: ["auto"], + other_values: [ + "32px", + "-3em", + "12%", + "calc(2px)", + "calc(-2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "padding-block-end": { + domProp: "paddingBlockEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + logical: true, + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "padding-block-start": { + domProp: "paddingBlockStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + // No applies_to_placeholder because we have a !important rule in forms.css. + logical: true, + initial_values: [ + "0", + "0px", + "0%", + "calc(0pt)", + "calc(0% + 0px)", + "calc(-3px)", + "calc(-1%)", + ], + other_values: [ + "1px", + "2em", + "5%", + "calc(2px)", + "calc(50%)", + "calc(3*25px)", + "calc(25px*3)", + "calc(3*25px + 50%)", + ], + invalid_values: [], + }, + "-moz-padding-end": { + domProp: "MozPaddingEnd", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "padding-inline-end", + subproperties: ["padding-inline-end"], + }, + "-moz-padding-start": { + domProp: "MozPaddingStart", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "padding-inline-start", + subproperties: ["padding-inline-start"], + }, + "-webkit-animation": { + domProp: "webkitAnimation", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + alias_for: "animation", + subproperties: [ + "animation-name", + "animation-duration", + "animation-timing-function", + "animation-delay", + "animation-direction", + "animation-fill-mode", + "animation-iteration-count", + "animation-play-state", + ], + }, + "-webkit-animation-delay": { + domProp: "webkitAnimationDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-delay", + subproperties: ["animation-delay"], + }, + "-webkit-animation-direction": { + domProp: "webkitAnimationDirection", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-direction", + subproperties: ["animation-direction"], + }, + "-webkit-animation-duration": { + domProp: "webkitAnimationDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-duration", + subproperties: ["animation-duration"], + }, + "-webkit-animation-fill-mode": { + domProp: "webkitAnimationFillMode", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-fill-mode", + subproperties: ["animation-fill-mode"], + }, + "-webkit-animation-iteration-count": { + domProp: "webkitAnimationIterationCount", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-iteration-count", + subproperties: ["animation-iteration-count"], + }, + "-webkit-animation-name": { + domProp: "webkitAnimationName", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-name", + subproperties: ["animation-name"], + }, + "-webkit-animation-play-state": { + domProp: "webkitAnimationPlayState", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-play-state", + subproperties: ["animation-play-state"], + }, + "-webkit-animation-timing-function": { + domProp: "webkitAnimationTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-timing-function", + subproperties: ["animation-timing-function"], + }, + "-webkit-clip-path": { + domProp: "webkitClipPath", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "clip-path", + subproperties: ["clip-path"], + }, + "-webkit-filter": { + domProp: "webkitFilter", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "filter", + subproperties: ["filter"], + }, + "-webkit-text-security": { + domProp: "webkitTextSecurity", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["none"], + other_values: ["circle", "disc", "square"], + invalid_values: ["0", "auto", "true", "'*'"], + }, + "-webkit-text-fill-color": { + domProp: "webkitTextFillColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor", "black", "#000", "#000000", "rgb(0,0,0)"], + other_values: ["red", "rgba(255,255,255,0.5)", "transparent"], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "000000", + "ff00ff", + "rgb(255,xxx,255)", + ], + }, + "-webkit-text-stroke": { + domProp: "webkitTextStroke", + inherited: true, + type: CSS_TYPE_TRUE_SHORTHAND, + prerequisites: { color: "black" }, + subproperties: ["-webkit-text-stroke-width", "-webkit-text-stroke-color"], + initial_values: [ + "0 currentColor", + "currentColor 0px", + "0", + "currentColor", + "0px black", + ], + other_values: [ + "thin black", + "#f00 medium", + "thick rgba(0,0,255,0.5)", + "calc(4px - 8px) green", + "2px", + "green 0", + "currentColor 4em", + "currentColor calc(5px - 1px)", + ], + invalid_values: ["-3px black", "calc(50%+ 2px) #000", "30% #f00"], + }, + "-webkit-text-stroke-color": { + domProp: "webkitTextStrokeColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + prerequisites: { color: "black" }, + initial_values: ["currentColor", "black", "#000", "#000000", "rgb(0,0,0)"], + other_values: ["red", "rgba(255,255,255,0.5)", "transparent"], + invalid_values: [ + "#0", + "#00", + "#00000", + "#0000000", + "#000000000", + "000000", + "ff00ff", + "rgb(255,xxx,255)", + ], + }, + "-webkit-text-stroke-width": { + domProp: "webkitTextStrokeWidth", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["0", "0px", "0em", "0ex", "calc(0pt)", "calc(4px - 8px)"], + other_values: [ + "thin", + "medium", + "thick", + "17px", + "0.2em", + "calc(3*25px + 5em)", + "calc(5px - 1px)", + ], + invalid_values: [ + "5%", + "1px calc(nonsense)", + "1px red", + "-0.1px", + "-3px", + "30%", + ], + }, + "-webkit-text-size-adjust": { + domProp: "webkitTextSizeAdjust", + inherited: true, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-text-size-adjust", + subproperties: ["-moz-text-size-adjust"], + }, + "-webkit-transform": { + domProp: "webkitTransform", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform", + subproperties: ["transform"], + }, + "-webkit-transform-origin": { + domProp: "webkitTransformOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-origin", + subproperties: ["transform-origin"], + }, + "-webkit-transform-style": { + domProp: "webkitTransformStyle", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-style", + subproperties: ["transform-style"], + }, + "-webkit-backface-visibility": { + domProp: "webkitBackfaceVisibility", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "backface-visibility", + subproperties: ["backface-visibility"], + }, + "-webkit-perspective": { + domProp: "webkitPerspective", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective", + subproperties: ["perspective"], + }, + "-webkit-perspective-origin": { + domProp: "webkitPerspectiveOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective-origin", + subproperties: ["perspective-origin"], + }, + "-webkit-transition": { + domProp: "webkitTransition", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + alias_for: "transition", + subproperties: [ + "transition-property", + "transition-duration", + "transition-timing-function", + "transition-delay", + ], + }, + "-webkit-transition-delay": { + domProp: "webkitTransitionDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-delay", + subproperties: ["transition-delay"], + }, + "-webkit-transition-duration": { + domProp: "webkitTransitionDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-duration", + subproperties: ["transition-duration"], + }, + "-webkit-transition-property": { + domProp: "webkitTransitionProperty", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-property", + subproperties: ["transition-property"], + }, + "-webkit-transition-timing-function": { + domProp: "webkitTransitionTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-timing-function", + subproperties: ["transition-timing-function"], + }, + "-webkit-border-radius": { + domProp: "webkitBorderRadius", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-radius", + subproperties: [ + "border-bottom-left-radius", + "border-bottom-right-radius", + "border-top-left-radius", + "border-top-right-radius", + ], + }, + "-webkit-border-top-left-radius": { + domProp: "webkitBorderTopLeftRadius", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-top-left-radius", + subproperties: ["border-top-left-radius"], + }, + "-webkit-border-top-right-radius": { + domProp: "webkitBorderTopRightRadius", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-top-right-radius", + subproperties: ["border-top-right-radius"], + }, + "-webkit-border-bottom-left-radius": { + domProp: "webkitBorderBottomLeftRadius", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-bottom-left-radius", + subproperties: ["border-bottom-left-radius"], + }, + "-webkit-border-bottom-right-radius": { + domProp: "webkitBorderBottomRightRadius", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "border-bottom-right-radius", + subproperties: ["border-bottom-right-radius"], + }, + "-webkit-background-clip": { + domProp: "webkitBackgroundClip", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + alias_for: "background-clip", + subproperties: ["background-clip"], + }, + "-webkit-background-origin": { + domProp: "webkitBackgroundOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + alias_for: "background-origin", + subproperties: ["background-origin"], + }, + "-webkit-background-size": { + domProp: "webkitBackgroundSize", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + alias_for: "background-size", + subproperties: ["background-size"], + }, + "-webkit-border-image": { + domProp: "webkitBorderImage", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-image", + subproperties: [ + "border-image-source", + "border-image-slice", + "border-image-width", + "border-image-outset", + "border-image-repeat", + ], + }, + "-webkit-box-shadow": { + domProp: "webkitBoxShadow", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_first_letter: true, + alias_for: "box-shadow", + subproperties: ["box-shadow"], + }, + "-webkit-box-sizing": { + domProp: "webkitBoxSizing", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "box-sizing", + subproperties: ["box-sizing"], + }, + "-webkit-box-flex": { + domProp: "webkitBoxFlex", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-flex", + subproperties: ["-moz-box-flex"], + }, + "-webkit-box-ordinal-group": { + domProp: "webkitBoxOrdinalGroup", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-ordinal-group", + subproperties: ["-moz-box-ordinal-group"], + }, + "-webkit-box-orient": { + domProp: "webkitBoxOrient", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-orient", + subproperties: ["-moz-box-orient"], + }, + "-webkit-box-direction": { + domProp: "webkitBoxDirection", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-direction", + subproperties: ["-moz-box-direction"], + }, + "-webkit-box-align": { + domProp: "webkitBoxAlign", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-align", + subproperties: ["-moz-box-align"], + }, + "-webkit-box-pack": { + domProp: "webkitBoxPack", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "-moz-box-pack", + subproperties: ["-moz-box-pack"], + }, + "-webkit-flex-direction": { + domProp: "webkitFlexDirection", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "flex-direction", + subproperties: ["flex-direction"], + }, + "-webkit-flex-wrap": { + domProp: "webkitFlexWrap", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "flex-wrap", + subproperties: ["flex-wrap"], + }, + "-webkit-flex-flow": { + domProp: "webkitFlexFlow", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "flex-flow", + subproperties: ["flex-direction", "flex-wrap"], + }, + "-webkit-line-clamp": { + domProp: "webkitLineClamp", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1", "2"], + invalid_values: ["auto", "0", "-1"], + }, + "-webkit-order": { + domProp: "webkitOrder", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "order", + subproperties: ["order"], + }, + "-webkit-flex": { + domProp: "webkitFlex", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "flex", + subproperties: ["flex-grow", "flex-shrink", "flex-basis"], + }, + "-webkit-flex-grow": { + domProp: "webkitFlexGrow", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "flex-grow", + subproperties: ["flex-grow"], + }, + "-webkit-flex-shrink": { + domProp: "webkitFlexShrink", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "flex-shrink", + subproperties: ["flex-shrink"], + }, + "-webkit-flex-basis": { + domProp: "webkitFlexBasis", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "flex-basis", + subproperties: ["flex-basis"], + }, + "-webkit-justify-content": { + domProp: "webkitJustifyContent", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "justify-content", + subproperties: ["justify-content"], + }, + "-webkit-align-items": { + domProp: "webkitAlignItems", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "align-items", + subproperties: ["align-items"], + }, + "-webkit-align-self": { + domProp: "webkitAlignSelf", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "align-self", + subproperties: ["align-self"], + }, + "-webkit-align-content": { + domProp: "webkitAlignContent", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "align-content", + subproperties: ["align-content"], + }, + "-webkit-user-select": { + domProp: "webkitUserSelect", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "user-select", + subproperties: ["user-select"], + }, + "-webkit-mask": { + domProp: "webkitMask", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "mask", + subproperties: [ + "mask-clip", + "mask-image", + "mask-mode", + "mask-origin", + "mask-position", + "mask-repeat", + "mask-size", + "mask-composite", + ], + }, + "-webkit-mask-clip": { + domProp: "webkitMaskClip", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-clip", + subproperties: ["mask-clip"], + }, + + "-webkit-mask-composite": { + domProp: "webkitMaskComposite", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-composite", + subproperties: ["mask-composite"], + }, + + "-webkit-mask-image": { + domProp: "webkitMaskImage", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-image", + subproperties: ["mask-image"], + }, + "-webkit-mask-origin": { + domProp: "webkitMaskOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-origin", + subproperties: ["mask-origin"], + }, + "-webkit-mask-position": { + domProp: "webkitMaskPosition", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-position", + subproperties: ["mask-position"], + }, + "-webkit-mask-position-x": { + domProp: "webkitMaskPositionX", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-position-x", + subproperties: ["mask-position-x"], + }, + "-webkit-mask-position-y": { + domProp: "webkitMaskPositionY", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-position-y", + subproperties: ["mask-position-y"], + }, + "-webkit-mask-repeat": { + domProp: "webkitMaskRepeat", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-repeat", + subproperties: ["mask-repeat"], + }, + "-webkit-mask-size": { + domProp: "webkitMaskSize", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "mask-size", + subproperties: ["mask-size"], + }, +}; // end of gCSSProperties + +// Get the computed value for a property. For shorthands, return the +// computed values of all the subproperties, delimited by " ; ". +function get_computed_value(cs, property) { + var info = gCSSProperties[property]; + if ( + info.type == CSS_TYPE_TRUE_SHORTHAND || + info.type == CSS_TYPE_LEGACY_SHORTHAND || + (info.type == CSS_TYPE_SHORTHAND_AND_LONGHAND && + (property == "text-decoration" || property == "mask")) + ) { + var results = []; + for (var idx in info.subproperties) { + var subprop = info.subproperties[idx]; + results.push(get_computed_value(cs, subprop)); + } + return results.join(" ; "); + } + return cs.getPropertyValue(property); +} + +{ + const mozHiddenUnscrollableEnabled = IsCSSPropertyPrefEnabled( + "layout.css.overflow-moz-hidden-unscrollable.enabled" + ); + for (let p of ["overflow", "overflow-x", "overflow-y"]) { + let prop = gCSSProperties[p]; + let mozHiddenUnscrollableValues = mozHiddenUnscrollableEnabled + ? prop.other_values + : prop.invalid_values; + mozHiddenUnscrollableValues.push("-moz-hidden-unscrollable"); + if (p == "overflow") { + mozHiddenUnscrollableValues.push( + "-moz-hidden-unscrollable -moz-hidden-unscrollable" + ); + } + } +} + +if (IsCSSPropertyPrefEnabled("layout.css.individual-transform.enabled")) { + gCSSProperties.rotate = { + domProp: "rotate", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "45deg", + "45grad", + "72rad", + "0.25turn", + ".57rad", + "0 0 0 0rad", + "0 0 1 45deg", + "0 0 1 0rad", + "0rad 0 0 1", + "10rad 10 20 30", + "x 10rad", + "y 10rad", + "z 10rad", + "10rad x", + "10rad y", + "10rad z", + /* valid calc() values */ + "calc(1) 0 0 calc(45deg + 5rad)", + "0 1 0 calc(400grad + 1rad)", + "calc(0.5turn + 10deg)", + ], + invalid_values: [ + "0", + "7", + "0, 0, 1, 45deg", + "0 0 45deg", + "0 0 20rad", + "0 0 0 0", + "x x 10rad", + "x y 10rad", + "0 0 1 10rad z", + "0 0 1 z 10rad", + "z 0 0 1 10rad", + "0 0 z 1 10rad", + /* invalid calc() values */ + "0.5 1 0 calc(45deg + 10)", + "calc(0.5turn + 10%)", + ], + }; + + gCSSProperties.translate = { + domProp: "translate", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { width: "10px", height: "10px", display: "block" }, + initial_values: ["none"], + other_values: [ + "-4px", + "3px", + "4em", + "50%", + "4px 5px 6px", + "4px 5px", + "50% 5px 6px", + "50% 10% 6em", + /* valid calc() values */ + "calc(5px + 10%)", + "calc(0.25 * 5px + 10% / 3)", + "calc(5px - 10% * 3)", + "calc(5px - 3 * 10%) 50px", + "-50px calc(5px - 10% * 3)", + "10px calc(min(5px,10%))", + ], + invalid_values: [ + "1", + "-moz-min(5px,10%)", + "4px, 5px, 6px", + "3px 4px 1px 7px", + "4px 5px 10%", + /* invalid calc() values */ + "calc(max(5px,10%) 10%)", + "calc(nonsense)", + ], + }; + gCSSProperties.scale = { + domProp: "scale", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "10", + "10%", + "10 20", + "10% 20%", + "10 20 30", + "10% 20% 30%", + "10 20% 30", + "-10", + "-10%", + "-10 20", + "-10% 20%", + "-10 20 -30", + "-10% 20% -30%", + "-10 20% -30", + "0 2.0", + /* valid calc() values */ + "calc(1 + 2)", + "calc(10) calc(20) 30", + ], + invalid_values: [ + "10px", + "10deg", + "10, 20, 30", + /* invalid calc() values */ + "calc(1 + 20%)", + "10 calc(1 + 10px)", + ], + }; +} + +if ( + IsCSSPropertyPrefEnabled("layout.css.transform-box-content-stroke.enabled") +) { + gCSSProperties["transform-box"]["other_values"].push( + "content-box", + "stroke-box" + ); +} + +gCSSProperties["touch-action"] = { + domProp: "touchAction", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "none", + "pan-x", + "pan-y", + "pinch-zoom", + "pan-x pan-y", + "pan-y pan-x", + "pinch-zoom pan-x", + "pinch-zoom pan-y", + "pan-x pinch-zoom", + "pan-y pinch-zoom", + "pinch-zoom pan-x pan-y", + "pinch-zoom pan-y pan-x", + "pan-x pinch-zoom pan-y", + "pan-y pinch-zoom pan-x", + "pan-x pan-y pinch-zoom", + "pan-y pan-x pinch-zoom", + "manipulation", + ], + invalid_values: [ + "zoom", + "pinch", + "tap", + "10px", + "2", + "auto pan-x", + "pan-x auto", + "none pan-x", + "pan-x none", + "auto pan-y", + "pan-y auto", + "none pan-y", + "pan-y none", + "pan-x pan-x", + "pan-y pan-y", + "auto pinch-zoom", + "pinch-zoom auto", + "none pinch-zoom", + "pinch-zoom none", + "pinch-zoom pinch-zoom", + "pan-x pan-y none", + "pan-x none pan-y", + "none pan-x pan-y", + "pan-y pan-x none", + "pan-y none pan-x", + "none pan-y pan-x", + "pan-x pinch-zoom none", + "pan-x none pinch-zoom", + "none pan-x pinch-zoom", + "pinch-zoom pan-x none", + "pinch-zoom none pan-x", + "none pinch-zoom pan-x", + "pinch-zoom pan-y none", + "pinch-zoom none pan-y", + "none pinch-zoom pan-y", + "pan-y pinch-zoom none", + "pan-y none pinch-zoom", + "none pan-y pinch-zoom", + "pan-x pan-y auto", + "pan-x auto pan-y", + "auto pan-x pan-y", + "pan-y pan-x auto", + "pan-y auto pan-x", + "auto pan-y pan-x", + "pan-x pinch-zoom auto", + "pan-x auto pinch-zoom", + "auto pan-x pinch-zoom", + "pinch-zoom pan-x auto", + "pinch-zoom auto pan-x", + "auto pinch-zoom pan-x", + "pinch-zoom pan-y auto", + "pinch-zoom auto pan-y", + "auto pinch-zoom pan-y", + "pan-y pinch-zoom auto", + "pan-y auto pinch-zoom", + "auto pan-y pinch-zoom", + "pan-x pan-y zoom", + "pan-x zoom pan-y", + "zoom pan-x pan-y", + "pan-y pan-x zoom", + "pan-y zoom pan-x", + "zoom pan-y pan-x", + "pinch-zoom pan-y zoom", + "pinch-zoom zoom pan-y", + "zoom pinch-zoom pan-y", + "pan-y pinch-zoom zoom", + "pan-y zoom pinch-zoom", + "zoom pan-y pinch-zoom", + "pan-x pinch-zoom zoom", + "pan-x zoom pinch-zoom", + "zoom pan-x pinch-zoom", + "pinch-zoom pan-x zoom", + "pinch-zoom zoom pan-x", + "zoom pinch-zoom pan-x", + "pan-x pan-y pan-x", + "pan-x pan-x pan-y", + "pan-y pan-x pan-x", + "pan-y pan-x pan-y", + "pan-y pan-y pan-x", + "pan-x pan-y pan-y", + "pan-x pinch-zoom pan-x", + "pan-x pan-x pinch-zoom", + "pinch-zoom pan-x pan-x", + "pinch-zoom pan-x pinch-zoom", + "pinch-zoom pinch-zoom pan-x", + "pan-x pinch-zoom pinch-zoom", + "pinch-zoom pan-y pinch-zoom", + "pinch-zoom pinch-zoom pan-y", + "pan-y pinch-zoom pinch-zoom", + "pan-y pinch-zoom pan-y", + "pan-y pan-y pinch-zoom", + "pinch-zoom pan-y pan-y", + "manipulation none", + "none manipulation", + "manipulation auto", + "auto manipulation", + "manipulation zoom", + "zoom manipulation", + "manipulation manipulation", + "manipulation pan-x", + "pan-x manipulation", + "manipulation pan-y", + "pan-y manipulation", + "manipulation pinch-zoom", + "pinch-zoom manipulation", + "manipulation pan-x pan-y", + "pan-x manipulation pan-y", + "pan-x pan-y manipulation", + "manipulation pan-y pan-x", + "pan-y manipulation pan-x", + "pan-y pan-x manipulation", + "manipulation pinch-zoom pan-y", + "pinch-zoom manipulation pan-y", + "pinch-zoom pan-y manipulation", + "manipulation pan-y pinch-zoom", + "pan-y manipulation pinch-zoom", + "pan-y pinch-zoom manipulation", + "manipulation pan-x pinch-zoom", + "pan-x manipulation pinch-zoom", + "pan-x pinch-zoom manipulation", + "manipulation pinch-zoom pan-x", + "pinch-zoom manipulation pan-x", + "pinch-zoom pan-x manipulation", + ], +}; + +gCSSProperties["page"] = { + domProp: "page", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["page", "small_page", "large_page", "A4"], + invalid_values: ["page1 page2", "auto page", "1cm"], +}; + +gCSSProperties["text-justify"] = { + domProp: "textJustify", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: ["none", "inter-word", "inter-character", "distribute"], + invalid_values: [], +}; + +if (IsCSSPropertyPrefEnabled("layout.css.text-indent-keywords.enabled")) { + gCSSProperties["text-indent"].other_values.push( + "2em hanging", + "5% each-line", + "-10px hanging each-line", + "hanging calc(2px)", + "each-line calc(-2px)", + "each-line calc(50%) hanging", + "hanging calc(3*25px) each-line", + "each-line hanging calc(25px*3)" + ); + gCSSProperties["text-indent"].invalid_values.push( + "hanging", + "each-line", + "-10px hanging hanging", + "each-line calc(2px) each-line" + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.font-variations.enabled")) { + gCSSProperties["font-variation-settings"] = { + domProp: "fontVariationSettings", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_marker: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: [ + "'wdth' 0", + "'wdth' -.1", + '"wdth" 1', + "'wdth' 2, 'wght' 3", + '"XXXX" 0', + ], + invalid_values: [ + "wdth", + "wdth 1", // unquoted tags + "'wdth'", + "'wdth' 'wght'", + "'wdth', 'wght'", // missing values + "'' 1", + "'wid' 1", + "'width' 1", // incorrect tag lengths + "'wd\th' 1", // non-graphic character in tag + "'wdth' 1 'wght' 2", // missing comma between pairs + "'wdth' 1,", // trailing comma + "'wdth' 1 , , 'wght' 2", // extra comma + "'wdth', 1", // comma within pair + ], + unbalanced_values: [ + "'wdth\" 1", + "\"wdth' 1", // mismatched quotes + ], + }; + gCSSProperties["font"].subproperties.push("font-variation-settings"); + gCSSProperties["font-optical-sizing"] = { + domProp: "fontOpticalSizing", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_marker: true, + applies_to_cue: true, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: ["on"], + }; + gCSSProperties["font"].subproperties.push("font-optical-sizing"); + gCSSProperties["font-variation-settings"].other_values.push( + "'vert' calc(2.5)" + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.font-palette.enabled")) { + gCSSProperties["font-palette"] = { + domProp: "fontPalette", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + initial_values: ["normal"], + other_values: ["light", "dark", "--custom"], + invalid_values: ["custom"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.font-variant-emoji.enabled")) { + gCSSProperties["font"].subproperties.push("font-variant-emoji"); + gCSSProperties["font-variant"].subproperties.push("font-variant-emoji"); + gCSSProperties["font-variant-emoji"] = { + domProp: "fontVariantEmoji", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_marker: true, + applies_to_placeholder: true, + applies_to_cue: true, + initial_values: ["normal"], + other_values: ["text", "emoji", "unicode"], + invalid_values: [ + "none", + "auto", + "text emoji", + "auto text", + "normal, unicode", + ], + }; +} + +var isGridTemplateMasonryValueEnabled = IsCSSPropertyPrefEnabled( + "layout.css.grid-template-masonry-value.enabled" +); + +if (isGridTemplateMasonryValueEnabled) { + gCSSProperties["masonry-auto-flow"] = { + domProp: "masonryAutoFlow", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["pack"], + other_values: ["pack ordered", "ordered next", "next definite-first"], + invalid_values: ["auto", "none", "10px", "row", "dense"], + }; + + let alignTracks = { ...gCSSProperties["align-content"] }; + alignTracks.domProp = "alignTracks"; + gCSSProperties["align-tracks"] = alignTracks; + + let justifyTracks = { ...gCSSProperties["justify-content"] }; + justifyTracks.domProp = "justifyTracks"; + gCSSProperties["justify-tracks"] = justifyTracks; +} + +gCSSProperties["display"].other_values.push("grid", "inline-grid"); +gCSSProperties["grid-auto-flow"] = { + domProp: "gridAutoFlow", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["row"], + other_values: [ + "column", + "column dense", + "row dense", + "dense column", + "dense row", + "dense", + ], + invalid_values: ["", "auto", "none", "10px", "column row", "dense row dense"], +}; + +gCSSProperties["grid-auto-columns"] = { + domProp: "gridAutoColumns", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "40px", + "2em", + "2.5fr", + "12%", + "min-content", + "max-content", + "calc(2px - 99%)", + "minmax(20px, max-content)", + "minmax(min-content, auto)", + "minmax(auto, max-content)", + "m\\69nmax(20px, 4Fr)", + "MinMax(min-content, calc(20px + 10%))", + "fit-content(1px)", + "fit-content(calc(1px - 99%))", + "fit-content(10%)", + "40px 12%", + "2.5fr min-content fit-content(1px)", + ], + invalid_values: [ + "", + "normal", + "40ms", + "-40px", + "-12%", + "-2em", + "-2.5fr", + "minmax()", + "minmax(20px)", + "mİnmax(20px, 100px)", + "minmax(20px, 100px, 200px)", + "maxmin(100px, 20px)", + "minmax(min-content, minmax(30px, max-content))", + "fit-content(-1px)", + "fit-content(auto)", + "fit-content(min-content)", + "1px [a] 1px", + ], +}; +gCSSProperties["grid-auto-rows"] = { + domProp: "gridAutoRows", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: gCSSProperties["grid-auto-columns"].initial_values, + other_values: gCSSProperties["grid-auto-columns"].other_values, + invalid_values: gCSSProperties["grid-auto-columns"].invalid_values, +}; + +gCSSProperties["grid-template-columns"] = { + domProp: "gridTemplateColumns", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "auto", + "40px", + "2.5fr", + "[normal] 40px [] auto [ ] 12%", + "[foo] 40px min-content [ bar ] calc(2px - 99%) max-content", + "40px min-content calc(20px + 10%) max-content", + "minmax(min-content, auto)", + "minmax(auto, max-content)", + "m\\69nmax(20px, 4Fr)", + "40px MinMax(min-content, calc(20px + 10%)) max-content", + "40px 2em", + "[] 40px [-foo] 2em [bar baz This is one ident]", + // TODO bug 978478: "[a] repeat(3, [b] 20px [c] 40px [d]) [e]", + "repeat(1, 20px)", + "repeat(1, [a] 20px)", + "[a] Repeat(4, [a] 20px [] auto [b c]) [d]", + "[a] 2.5fr Repeat(4, [a] 20px [] auto [b c]) [d]", + "[a] 2.5fr [z] Repeat(4, [a] 20px [] auto [b c]) [d]", + "[a] 2.5fr [z] Repeat(4, [a] 20px [] auto) [d]", + "[a] 2.5fr [z] Repeat(4, 20px [b c] auto [b c]) [d]", + "[a] 2.5fr [z] Repeat(4, 20px auto) [d]", + "repeat(auto-fill, 0)", + "[a] repeat( Auto-fill,1%)", + "minmax(auto,0) [a] repeat(Auto-fit, 0) minmax(0,auto)", + "minmax(calc(1% + 1px),auto) repeat(Auto-fit,[] 1%) minmax(auto,1%)", + "[a] repeat( auto-fit,[a b] minmax(0,0) )", + "[a] 40px repeat(auto-fit,[a b] minmax(1px, 0) [])", + "[a] calc(1px - 99%) [b] repeat(auto-fit,[a b] minmax(1mm, 1%) [c]) [c]", + "repeat(auto-fill, 0 0)", + "repeat(auto-fill, 0 [] 0)", + "repeat(auto-fill,minmax(1%,auto))", + "repeat(auto-fill,minmax(1em,min-content)) minmax(min-content,0)", + "repeat(auto-fill,minmax(max-content,1mm))", + "repeat(2, fit-content(1px))", + "fit-content(1px) 1fr", + "[a] fit-content(calc(1px - 99%)) [b]", + "[a] fit-content(10%) [b c] fit-content(1em)", + // See https://bugzilla.mozilla.org/show_bug.cgi?id=981300 + "[none subgrid min-content max-content foo] 40px", + "subgrid", + "subgrid [] [foo bar]", + "subgrid repeat(1, [])", + "subgrid Repeat(4, [a] [b c] [] [d])", + "subgrid repeat(auto-fill, [])", + "subgrid repeat(Auto-fill, [a b c]) [a] []", + "subgrid [x] repeat( Auto-fill, [a b c]) []", + "subgrid [x] repeat( auto-fill , [a b] [c]) [y]", + "subgrid repeat(auto-fill, [a] [b] [c]) [d]", + "subgrid repeat(Auto-fill, [a] [b c] [] [d])", + "subgrid [x y] [x] repeat(auto-fill, [a b] [c] [d] [d]) [x] [x]", + "subgrid [x] repeat(auto-fill, []) [y z]", + "subgrid [x] repeat(auto-fill, [y]) [z] [] repeat(2, [a] [b]) [y] []", + "subgrid [x] repeat(auto-fill, []) [x y] [z] [] []", + ], + invalid_values: [ + "", + "normal", + "40ms", + "-40px", + "-12%", + "-2fr", + "[foo]", + "[inherit] 40px", + "[initial] 40px", + "[unset] 40px", + "[default] 40px", + "[span] 40px", + "[6%] 40px", + "[5th] 40px", + "[foo[] bar] 40px", + "[foo]] 40px", + "(foo) 40px", + "[foo] [bar] 40px", + "40px [foo] [bar]", + "minmax()", + "minmax(20px)", + "mİnmax(20px, 100px)", + "minmax(20px, 100px, 200px)", + "maxmin(100px, 20px)", + "minmax(min-content, minmax(30px, max-content))", + "repeat(0, 20px)", + "repeat(-3, 20px)", + "rêpeat(1, 20px)", + "repeat(1)", + "repeat(1, )", + "repeat(3px, 20px)", + "repeat(2.0, 20px)", + "repeat(2.5, 20px)", + "repeat(2, (foo))", + "repeat(2, foo)", + "40px calc(0px + rubbish)", + "repeat(1, repeat(1, 20px))", + "repeat(auto-fill, auto)", + "repeat(auto-fit,auto)", + "repeat(auto-fill, fit-content(1px))", + "repeat(auto-fit, fit-content(1px))", + "repeat(auto-fit,[])", + "repeat(auto-fill, 0) repeat(auto-fit, 0) ", + "repeat(auto-fit, 0) repeat(auto-fill, 0) ", + "[a] repeat(auto-fit, 0) repeat(auto-fit, 0) ", + "[a] repeat(auto-fill, 0) [a] repeat(auto-fill, 0) ", + "repeat(auto-fill, min-content)", + "repeat(auto-fit,max-content)", + "repeat(auto-fit,1fr)", + "repeat(auto-fit,minmax(auto,auto))", + "repeat(auto-fit,minmax(min-content,1fr))", + "repeat(auto-fit,minmax(1fr,auto))", + "repeat(auto-fill,minmax(1fr,1em))", + "repeat(auto-fill, 10px) auto", + "auto repeat(auto-fit, 10px)", + "minmax(min-content,max-content) repeat(auto-fit, 0)", + "10px [a] 10px [b a] 1fr [b] repeat(auto-fill, 0)", + "fit-content(-1px)", + "fit-content(auto)", + "fit-content(min-content)", + "fit-content(1px) repeat(auto-fit, 1px)", + "fit-content(1px) repeat(auto-fill, 1px)", + "subgrid [inherit]", + "subgrid [initial]", + "subgrid [unset]", + "subgrid [default]", + "subgrid [span]", + "subgrid [foo] 40px", + "subgrid [foo 40px]", + "[foo] subgrid", + "subgrid rêpeat(1, [])", + "subgrid repeat(0, [])", + "subgrid repeat(-3, [])", + "subgrid repeat(2.0, [])", + "subgrid repeat(2.5, [])", + "subgrid repeat(3px, [])", + "subgrid repeat(1)", + "subgrid repeat(1, )", + "subgrid repeat(2, [40px])", + "subgrid repeat(2, foo)", + "subgrid repeat(1, repeat(1, []))", + "subgrid repeat(auto-fill)", + "subgrid repeat(auto-fill) [a]", + "subgrid repeat(auto-fill) []", + "subgrid [a] repeat(auto-fill)", + "subgrid repeat(auto-fill,)", + "subgrid repeat(auto-fill,)", + "subgrid repeat(auto-fill,) [a]", + "subgrid repeat(auto-fill,) []", + "subgrid [a] repeat(auto-fill,)", + "subgrid repeat(auto-fit,[])", + "subgrid [] repeat(auto-fit,[])", + "subgrid [a] repeat(auto-fit,[])", + "subgrid repeat(auto-fill, 1px)", + "subgrid repeat(auto-fill, 1px [])", + "subgrid repeat(auto-fill, []) repeat(auto-fill, [])", + ], + unbalanced_values: ["(foo] 40px"], +}; +if (isGridTemplateMasonryValueEnabled) { + gCSSProperties["grid-template-columns"].other_values.push("masonry"); + gCSSProperties["grid-template-columns"].invalid_values.push( + "masonry []", + "masonry [foo] 40px", + "masonry 40px", + "[foo] masonry", + "0px masonry", + "masonry masonry", + "subgrid masonry", + "masonry subgrid", + "masonry repeat(1, [])" + ); +} +gCSSProperties["grid-template-rows"] = { + domProp: "gridTemplateRows", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: gCSSProperties["grid-template-columns"].initial_values, + other_values: gCSSProperties["grid-template-columns"].other_values, + invalid_values: gCSSProperties["grid-template-columns"].invalid_values, +}; +gCSSProperties["grid-template-areas"] = { + domProp: "gridTemplateAreas", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "'1a-é_ .' \"b .\"", + "' Z\t\\aZ' 'Z Z'", + " '. . a b' '. .a b' ", + "'a.b' '. . .'", + "'.' '..'", + "'...' '.'", + "'...-blah' '. .'", + "'.. ..' '.. ...'", + ], + invalid_values: [ + "''", + "' '", + "'' ''", + "'a b' 'a/b'", + "'a . a'", + "'. a a' 'a a a'", + "'a a .' 'a a a'", + "'a a' 'a .'", + "'a a'\n'..'\n'a a'", + ], +}; + +gCSSProperties["grid-template"] = { + domProp: "gridTemplate", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "grid-template-areas", + "grid-template-rows", + "grid-template-columns", + ], + initial_values: ["none", "none / none"], + other_values: [ + // <'grid-template-rows'> / <'grid-template-columns'> + "40px / 100px", + "[foo] 40px [bar] / [baz] repeat(auto-fill,100px) [fizz]", + " none/100px", + "40px/none", + // [ ? ? ? ]+ [ / ]? + "'fizz'", + "[bar] 'fizz'", + "'fizz' / [foo] 40px", + "[bar] 'fizz' / [foo] 40px", + "'fizz' 100px / [foo] 40px", + "[bar] 'fizz' 100px / [foo] 40px", + "[bar] 'fizz' 100px [buzz] / [foo] 40px", + "[bar] 'fizz' 100px [buzz] \n [a] '.' 200px [b] / [foo] 40px", + "subgrid / subgrid", + "subgrid/40px 20px", + "subgrid [foo] [] [bar baz] / 40px 20px", + "40px 20px/subgrid", + "40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]", + "subgrid/subgrid", + "subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]", + ], + invalid_values: [ + "'fizz' / repeat(1, 100px)", + "'fizz' repeat(1, 100px) / 0px", + "[foo] [bar] 40px / 100px", + "[fizz] [buzz] 100px / 40px", + "[fizz] [buzz] 'foo' / 40px", + "'foo' / none", + "subgrid", + "subgrid []", + "subgrid [] / 'fizz'", + "subgrid / 'fizz'", + ], +}; +if (isGridTemplateMasonryValueEnabled) { + gCSSProperties["grid-template"].other_values.push( + "masonry / subgrid", + "subgrid / masonry", + "masonry / masonry" /* valid but behaves as 'masonry / none' */, + "masonry/40px 20px", + "subgrid [foo] [] [bar baz] / masonry", + "40px 20px/masonry", + "masonry/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]", + "subgrid [foo] [] [bar baz]/masonry" + ); + gCSSProperties["grid-template"].invalid_values.push( + "masonry", + "masonry / 'fizz'" + ); +} + +gCSSProperties["grid"] = { + domProp: "grid", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "grid-template-areas", + "grid-template-rows", + "grid-template-columns", + "grid-auto-flow", + "grid-auto-rows", + "grid-auto-columns", + ], + initial_values: ["none", "none / none"], + other_values: [ + "auto-flow 40px / none", + "auto-flow 40px 100px / 0", + "auto-flow / 40px", + "auto-flow dense auto / auto", + "dense auto-flow minmax(min-content, 2fr) / auto", + "dense auto-flow / 100px", + "none / auto-flow 40px", + "40px / auto-flow", + "none / dense auto-flow auto", + ].concat(gCSSProperties["grid-template"].other_values), + invalid_values: [ + "auto-flow", + " / auto-flow", + "dense 0 / 0", + "dense dense 40px / 0", + "auto-flow / auto-flow", + "auto-flow / dense", + "auto-flow [a] 0 / 0", + "0 / auto-flow [a] 0", + "auto-flow -20px / 0", + "auto-flow 200ms / 0", + "auto-flow 1px [a] 1px / 0", + ].concat( + gCSSProperties["grid-template"].invalid_values, + gCSSProperties["grid-auto-flow"].other_values, + gCSSProperties["grid-auto-flow"].invalid_values.filter(v => v != "none") + ), +}; + +var gridLineOtherValues = [ + "foo", + "2", + "2 foo", + "foo 2", + "-3", + "-3 bar", + "bar -3", + "span 2", + "2 span", + "span foo", + "foo span", + "span 2 foo", + "span foo 2", + "2 foo span", + "foo 2 span", +]; +var gridLineInvalidValues = [ + "", + "4th", + "span", + "inherit 2", + "2 inherit", + "20px", + "2 3", + "2.5", + "2.0", + "0", + "0 foo", + "span 0", + "2 foo 3", + "foo 2 foo", + "2 span foo", + "foo span 2", + "span -3", + "span -3 bar", + "span 2 span", + "span foo span", + "span 2 foo span", +]; + +gCSSProperties["grid-column-start"] = { + domProp: "gridColumnStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: gridLineOtherValues, + invalid_values: gridLineInvalidValues, +}; +gCSSProperties["grid-column-end"] = { + domProp: "gridColumnEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: gridLineOtherValues, + invalid_values: gridLineInvalidValues, +}; +gCSSProperties["grid-row-start"] = { + domProp: "gridRowStart", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: gridLineOtherValues, + invalid_values: gridLineInvalidValues, +}; +gCSSProperties["grid-row-end"] = { + domProp: "gridRowEnd", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: gridLineOtherValues, + invalid_values: gridLineInvalidValues, +}; + +// The grid-column and grid-row shorthands take values of the form +// [ / ]? +var gridColumnRowOtherValues = [].concat(gridLineOtherValues); +gridLineOtherValues.concat(["auto"]).forEach(function (val) { + gridColumnRowOtherValues.push(" foo / " + val); + gridColumnRowOtherValues.push(val + "/2"); +}); +var gridColumnRowInvalidValues = ["foo, bar", "foo / bar / baz"].concat( + gridLineInvalidValues +); +gridLineInvalidValues.forEach(function (val) { + gridColumnRowInvalidValues.push("span 3 / " + val); + gridColumnRowInvalidValues.push(val + " / foo"); +}); +gCSSProperties["grid-column"] = { + domProp: "gridColumn", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["grid-column-start", "grid-column-end"], + initial_values: ["auto", "auto / auto"], + other_values: gridColumnRowOtherValues, + invalid_values: gridColumnRowInvalidValues, +}; +gCSSProperties["grid-row"] = { + domProp: "gridRow", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["grid-row-start", "grid-row-end"], + initial_values: ["auto", "auto / auto"], + other_values: gridColumnRowOtherValues, + invalid_values: gridColumnRowInvalidValues, +}; + +var gridAreaOtherValues = gridLineOtherValues.slice(); +gridLineOtherValues.forEach(function (val) { + gridAreaOtherValues.push("foo / " + val); + gridAreaOtherValues.push(val + "/2/3"); + gridAreaOtherValues.push("foo / bar / " + val + " / baz"); +}); +var gridAreaInvalidValues = [ + "foo, bar", + "foo / bar / baz / fizz / buzz", + "default / foo / bar / baz", + "foo / initial / bar / baz", + "foo / bar / inherit / baz", + "foo / bar / baz / unset", +].concat(gridLineInvalidValues); +gridLineInvalidValues.forEach(function (val) { + gridAreaInvalidValues.push("foo / " + val); + gridAreaInvalidValues.push("foo / bar / " + val); + gridAreaInvalidValues.push("foo / 4 / bar / " + val); +}); + +gCSSProperties["grid-area"] = { + domProp: "gridArea", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "grid-row-start", + "grid-column-start", + "grid-row-end", + "grid-column-end", + ], + initial_values: [ + "auto", + "auto / auto", + "auto / auto / auto", + "auto / auto / auto / auto", + ], + other_values: gridAreaOtherValues, + invalid_values: gridAreaInvalidValues, +}; + +gCSSProperties["column-gap"] = { + domProp: "columnGap", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "2px", + "2%", + "1em", + "calc(1px + 1em)", + "calc(1%)", + "calc(1% + 1ch)", + "calc(1px - 99%)", + ], + invalid_values: [ + "-1px", + "auto", + "none", + "1px 1px", + "-1%", + "fit-content(1px)", + ], +}; +gCSSProperties["grid-column-gap"] = { + domProp: "gridColumnGap", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "column-gap", + subproperties: ["column-gap"], +}; +gCSSProperties["row-gap"] = { + domProp: "rowGap", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "2px", + "2%", + "1em", + "calc(1px + 1em)", + "calc(1%)", + "calc(1% + 1ch)", + "calc(1px - 99%)", + ], + invalid_values: ["-1px", "auto", "none", "1px 1px", "-1%", "min-content"], +}; +gCSSProperties["grid-row-gap"] = { + domProp: "gridRowGap", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "row-gap", + subproperties: ["row-gap"], +}; +gCSSProperties["gap"] = { + domProp: "gap", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["column-gap", "row-gap"], + initial_values: ["normal", "normal normal"], + other_values: [ + "1ch 0", + "1px 1%", + "1em 1px", + "calc(1px) calc(1%)", + "normal 0", + "1% normal", + ], + invalid_values: [ + "-1px", + "1px -1px", + "1px 1px 1px", + "inherit 1px", + "1px auto", + ], +}; +gCSSProperties["grid-gap"] = { + domProp: "gridGap", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "gap", + subproperties: ["column-gap", "row-gap"], +}; + +gCSSProperties["contain"] = { + domProp: "contain", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "strict", + "layout", + "size", + "content", + "paint", + "layout paint", + "paint layout", + "size layout", + "paint size", + "layout size paint", + "layout paint size", + "size paint layout", + "paint size layout", + ], + invalid_values: [ + "none strict", + "none size", + "strict layout", + "strict layout size", + "layout strict", + "layout content", + "strict content", + "layout size strict", + "layout size paint strict", + "paint strict", + "size strict", + "paint paint", + "content content", + "size content", + "content strict size", + "paint layout content", + "layout size content", + "size size", + "strict strict", + "auto", + "10px", + "0", + ], +}; + +if (IsCSSPropertyPrefEnabled("layout.css.initial-letter.enabled")) { + gCSSProperties["initial-letter"] = { + domProp: "initialLetter", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + initial_values: ["normal"], + other_values: ["2", "2.5", "3.7 2", "4 3"], + invalid_values: ["-3", "3.7 -2", "25%", "16px", "1 0", "0", "0 1"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.osx-font-smoothing.enabled")) { + gCSSProperties["-moz-osx-font-smoothing"] = { + domProp: "MozOsxFontSmoothing", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["auto"], + other_values: ["grayscale"], + invalid_values: ["none", "subpixel-antialiased", "antialiased"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.scroll-anchoring.enabled")) { + gCSSProperties["overflow-anchor"] = { + domProp: "overflowAnchor", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: [], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.overflow-clip-box.enabled")) { + gCSSProperties["overflow-clip-box-block"] = { + domProp: "overflowClipBoxBlock", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + initial_values: ["padding-box"], + other_values: ["content-box"], + invalid_values: ["auto", "border-box", "0", "padding-box padding-box"], + }; + gCSSProperties["overflow-clip-box-inline"] = { + domProp: "overflowClipBoxInline", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + initial_values: ["padding-box"], + other_values: ["content-box"], + invalid_values: ["none", "border-box", "0", "content-box content-box"], + }; + gCSSProperties["overflow-clip-box"] = { + domProp: "overflowClipBox", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["overflow-clip-box-block", "overflow-clip-box-inline"], + initial_values: ["padding-box"], + other_values: [ + "content-box", + "padding-box content-box", + "content-box padding-box", + "content-box content-box", + ], + invalid_values: [ + "none", + "auto", + "content-box none", + "border-box", + "0", + "content-box, content-box", + ], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.overscroll-behavior.enabled")) { + gCSSProperties["overscroll-behavior-x"] = { + domProp: "overscrollBehaviorX", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["contain", "none"], + invalid_values: ["left", "1px"], + }; + gCSSProperties["overscroll-behavior-y"] = { + domProp: "overscrollBehaviorY", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["contain", "none"], + invalid_values: ["left", "1px"], + }; + gCSSProperties["overscroll-behavior-inline"] = { + domProp: "overscrollBehaviorInline", + inherited: false, + logical: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["contain", "none"], + invalid_values: ["left", "1px"], + }; + gCSSProperties["overscroll-behavior-block"] = { + domProp: "overscrollBehaviorBlock", + inherited: false, + logical: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["contain", "none"], + invalid_values: ["left", "1px"], + }; + gCSSProperties["overscroll-behavior"] = { + domProp: "overscrollBehavior", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["overscroll-behavior-x", "overscroll-behavior-y"], + initial_values: ["auto"], + other_values: [ + "contain", + "none", + "contain contain", + "contain auto", + "none contain", + ], + invalid_values: ["left", "1px", "contain auto none", "contain nonsense"], + }; +} + +{ + const patterns = { + background: [ + "{} scroll no-repeat", + "{} repeat", + "url(404.png), {}, -moz-element(#a) black", + ], + mask: [ + "{} add no-repeat", + "{} repeat", + "url(404.png), {}, -moz-element(#a) alpha", + ], + }; + + for (const prop of ["background", "mask"]) { + let i = 0; + const p = patterns[prop]; + for (const v of invalidNonUrlImageValues) { + gCSSProperties[prop].invalid_values.push( + p[i++ % p.length].replace("{}", v) + ); + } + for (const v of validNonUrlImageValues) { + gCSSProperties[prop].other_values.push( + p[i++ % p.length].replace("{}", v) + ); + } + } +} + +gCSSProperties["display"].other_values.push("flow-root"); + +gCSSProperties["hyphenate-character"] = { + domProp: "hyphenateCharacter", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_first_letter: true, + applies_to_first_line: true, + applies_to_placeholder: true, + initial_values: ["auto"], + other_values: ['"="', '"/-/"', '"\1400"', '""'], + invalid_values: ["none", "auto auto", "1400", "U+1400"], +}; + +if (IsCSSPropertyPrefEnabled("layout.css.content-visibility.enabled")) { + gCSSProperties["content-visibility"] = { + domProp: "contentVisibility", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["visible"], + other_values: ["auto", "hidden"], + invalid_values: [ + "invisible", + "partially-visible", + "auto auto", + "visible hidden", + ], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.contain-intrinsic-size.enabled")) { + gCSSProperties["contain-intrinsic-width"] = { + domProp: "containIntrinsicWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1em", "1px", "auto 1px", "auto none"], + invalid_values: ["auto auto", "auto", "-1px"], + }; + gCSSProperties["contain-intrinsic-height"] = { + domProp: "containIntrinsicHeight", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1em", "1px", "auto 1px", "auto none"], + invalid_values: ["auto auto", "auto", "-1px"], + }; + gCSSProperties["contain-intrinsic-block-size"] = { + domProp: "containIntrinsicBlockSize", + inherited: false, + logical: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1em", "1px", "auto 1px", "auto none"], + invalid_values: ["auto auto", "auto", "-1px"], + }; + gCSSProperties["contain-intrinsic-inline-size"] = { + domProp: "containIntrinsicInlineSize", + inherited: false, + logical: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["1em", "1px", "auto 1px", "auto none"], + invalid_values: ["auto auto", "auto", "-1px"], + }; + + gCSSProperties["contain-intrinsic-size"] = { + domProp: "containIntrinsicSize", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["contain-intrinsic-width", "contain-intrinsic-height"], + initial_values: ["none"], + other_values: ["1em 1em", "1px 1px", "auto 1px auto 1px", "1px auto 1px"], + invalid_values: ["auto auto", "-1px -1px", "1px, auto none"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.container-queries.enabled")) { + gCSSProperties["container-type"] = { + domProp: "containerType", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["inline-size", "size"], + invalid_values: [ + "none style", + "none inline-size", + "inline-size none", + "style none", + "style style", + "inline-size style inline-size", + "inline-size block-size", + "block-size", + "block-size style", + "size inline-size", + "size block-size", + ], + }; + gCSSProperties["container-name"] = { + domProp: "containerName", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: ["foo bar", "foo", "baz bazz", "foo foo"], + invalid_values: ["foo unset", "none bar", "foo initial", "initial foo"], + }; + gCSSProperties["container"] = { + domProp: "container", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["container-type", "container-name"], + initial_values: ["none"], + other_values: ["foo / size", "foo bar / size", "foo / inline-size", "foo"], + invalid_values: ["size / foo", "size / foo bar"], + }; +} + +if (false) { + // TODO These properties are chrome-only, and are not exposed via CSSOM. + // We may still want to find a way to test them. See bug 1206999. + gCSSProperties["-moz-window-shadow"] = { + //domProp: "MozWindowShadow", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["default"], + other_values: ["none", "menu", "tooltip", "sheet", "cliprounded"], + invalid_values: [], + }; + + gCSSProperties["-moz-window-opacity"] = { + // domProp: "MozWindowOpacity", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: [ + "1", + "17", + "397.376", + "3e1", + "3e+1", + "3e0", + "3e+0", + "3e-0", + "300%", + ], + other_values: ["0", "0.4", "0.0000", "-3", "3e-1", "-100%", "50%"], + invalid_values: ["0px", "1px", "20%", "default", "auto"], + }; + + gCSSProperties["-moz-window-transform"] = { + // domProp: "MozWindowTransform", + inherited: false, + type: CSS_TYPE_LONGHAND, + prerequisites: { width: "300px", height: "50px" }, + initial_values: ["none"], + other_values: [ + "translatex(1px)", + "translatex(4em)", + "translatex(-4px)", + "translatex(3px)", + "translatex(0px) translatex(1px) translatex(2px) translatex(3px) translatex(4px)", + "translatey(4em)", + "translate(3px)", + "translate(10px, -3px)", + "rotate(45deg)", + "rotate(45grad)", + "rotate(45rad)", + "rotate(0.25turn)", + "rotate(0)", + "scalex(10)", + "scalex(10%)", + "scalex(-10)", + "scalex(-10%)", + "scaley(10)", + "scaley(10%)", + "scaley(-10)", + "scaley(-10%)", + "scale(10)", + "scale(10%)", + "scale(10, 20)", + "scale(10%, 20%)", + "scale(-10)", + "scale(-10%)", + "scale(-10, 20)", + "scale(10%, -20%)", + "scale(10, 20%)", + "scale(-10, 20%)", + "skewx(30deg)", + "skewx(0)", + "skewy(0)", + "skewx(30grad)", + "skewx(30rad)", + "skewx(0.08turn)", + "skewy(30deg)", + "skewy(30grad)", + "skewy(30rad)", + "skewy(0.08turn)", + "rotate(45deg) scale(2, 1)", + "skewx(45deg) skewx(-50grad)", + "translate(0, 0) scale(1, 1) skewx(0) skewy(0) matrix(1, 0, 0, 1, 0, 0)", + "translatex(50%)", + "translatey(50%)", + "translate(50%)", + "translate(3%, 5px)", + "translate(5px, 3%)", + "matrix(1, 2, 3, 4, 5, 6)", + /* valid calc() values */ + "translatex(calc(5px + 10%))", + "translatey(calc(0.25 * 5px + 10% / 3))", + "translate(calc(5px - 10% * 3))", + "translate(calc(5px - 3 * 10%), 50px)", + "translate(-50px, calc(5px - 10% * 3))", + "translatez(1px)", + "translatez(4em)", + "translatez(-4px)", + "translatez(0px)", + "translatez(2px) translatez(5px)", + "translate3d(3px, 4px, 5px)", + "translate3d(2em, 3px, 1em)", + "translatex(2px) translate3d(4px, 5px, 6px) translatey(1px)", + "scale3d(4, 4, 4)", + "scale3d(4%, 4%, 4%)", + "scale3d(-2, 3, -7)", + "scale3d(-2%, 3%, -7%)", + "scalez(4)", + "scalez(4%)", + "scalez(-6)", + "scalez(-6%)", + "rotate3d(2, 3, 4, 45deg)", + "rotate3d(-3, 7, 0, 12rad)", + "rotatex(15deg)", + "rotatey(-12grad)", + "rotatez(72rad)", + "rotatex(0.125turn)", + "perspective(0px)", + "perspective(1000px)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)", + "translate(10px, calc(min(5px,10%)))", + "translate(calc(max(5px,10%)), 10%)", + "translate(max(5px,10%), 10%)", + ], + invalid_values: [ + "1px", + "#0000ff", + "red", + "auto", + "translatex(1)", + "translatey(1)", + "translate(2)", + "translate(-3, -4)", + "translatex(1px 1px)", + "translatex(translatex(1px))", + "translatex(#0000ff)", + "translatex(red)", + "translatey()", + "matrix(1px, 2px, 3px, 4px, 5px, 6px)", + "skewx(red)", + "matrix(1%, 0, 0, 0, 0px, 0px)", + "matrix(0, 1%, 2, 3, 4px,5px)", + "matrix(0, 1, 2%, 3, 4px, 5px)", + "matrix(0, 1, 2, 3%, 4%, 5%)", + "matrix(1, 2, 3, 4, 5px, 6%)", + "matrix(1, 2, 3, 4, 5%, 6px)", + "matrix(1, 2, 3, 4, 5%, 6%)", + "matrix(1, 2, 3, 4, 5px, 6em)", + /* invalid calc() values */ + "translatey(-moz-min(5px,10%))", + "translatex(-moz-max(5px,10%))", + "matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))", + "perspective(-10px)", + "matrix3d(dinosaur)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15%, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16px)", + "rotatey(words)", + "rotatex(7)", + "translate3d(3px, 4px, 1px, 7px)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)", + ], + }; + + gCSSProperties["-moz-window-transform-origin"] = { + // domProp: "MozWindowTransformOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* no subproperties */ + prerequisites: { width: "10px", height: "10px", display: "block" }, + initial_values: ["50% 50%", "center", "center center"], + other_values: [ + "25% 25%", + "6px 5px", + "20% 3em", + "0 0", + "0in 1in", + "top", + "bottom", + "top left", + "top right", + "top center", + "center left", + "center right", + "bottom left", + "bottom right", + "bottom center", + "20% center", + "6px center", + "13in bottom", + "left 50px", + "right 13%", + "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "calc(20px) 25%", + "25% calc(20px)", + "calc(20px) calc(20px)", + "calc(20px + 1em) calc(20px / 2)", + "calc(20px + 50%) calc(50% - 10px)", + "calc(-20px) calc(-50%)", + "calc(-20%) calc(-50%)", + ], + invalid_values: [ + "red", + "auto", + "none", + "0.5 0.5", + "40px #0000ff", + "border", + "center red", + "right diagonal", + "#00ffff bottom", + "0px calc(0px + rubbish)", + "0px 0px calc(0px + rubbish)", + "6px 5px 5px", + "top center 10px", + ], + }; + + gCSSProperties["-moz-context-properties"] = { + //domProp: "MozContextProperties", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "fill", + "stroke", + "fill, stroke", + "fill, stroke, fill", + "fill, foo", + "foo", + ], + invalid_values: [ + "default", + "fill, auto", + "all, stroke", + "none, fill", + "fill, none", + "fill, default", + "2px", + ], + }; +} + +gCSSProperties["scrollbar-color"] = { + domProp: "scrollbarColor", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["red green", "blue yellow", "#ffff00 white"], + invalid_values: ["ffff00 red", "auto red", "red auto", "green"], +}; + +gCSSProperties["scrollbar-width"] = { + domProp: "scrollbarWidth", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none", "thin"], + invalid_values: ["1px"], +}; + +gCSSProperties["offset"] = { + domProp: "offset", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "offset-path", + "offset-distance", + "offset-rotate", + "offset-anchor", + ], + initial_values: ["none"], + other_values: [ + "none 30deg reverse", + "none 50px reverse 30deg", + "none calc(10px + 20%) auto", + "none reverse", + "none / left center", + "path('M 0 0 H 1') -200% auto", + "path('M 0 0 H 1') -200%", + "path('M 0 0 H 1') 50px", + "path('M 0 0 H 1') auto", + "path('M 0 0 H 1') reverse 30deg 50px", + "path('M 0 0 H 1')", + "path('m 20 0 h 100') -7rad 8px / auto", + "path('m 0 30 v 100') -7rad 8px / left top", + "path('m 0 0 h 100') -7rad 8px", + "path('M 0 0 H 100') 100px 0deg", + ], + invalid_values: [ + "100px 0deg path('m 0 0 h 100')", + "30deg", + "auto 30deg 100px", + "auto / none", + "none /", + "none / 100px 20px 30deg", + "path('M 20 30 A 60 70 80') bottom", + "path('M 20 30 A 60 70 80') bottom top", + "path('M 20 30 A 60 70 80') 100px 200px", + "path('M 20 30 A 60 70 80') reverse auto", + "path('M 20 30 A 60 70 80') reverse 10px 30deg", + "path('M 20 30 A 60 70 80') /", + ], +}; + +gCSSProperties["offset-path"] = { + domProp: "offsetPath", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [...pathValues.other_values], + invalid_values: ["path('')"].concat(pathValues.invalid_values), +}; + +if (IsCSSPropertyPrefEnabled("layout.css.motion-path-ray.enabled")) { + gCSSProperties["offset-path"]["other_values"].push( + "ray(0deg)", + "ray(45deg closest-side)", + "ray(0rad farthest-side)", + "ray(0.5turn closest-corner contain)", + "ray(200grad farthest-corner)", + "ray(sides 180deg)", + "ray(contain farthest-side 180deg)", + "ray(calc(180deg - 45deg) farthest-side)", + "ray(0deg at center center)", + "ray(at 10% 10% 1rad)" + ); + + gCSSProperties["offset-path"]["invalid_values"].push( + "ray(closest-side)", + "ray(0deg, closest-side)", + "ray(contain 0deg closest-side contain)" + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.motion-path-basic-shapes.enabled")) { + gCSSProperties["offset-path"]["other_values"].push( + ...basicShapeOtherValues, + ...basicShapeXywhRectValues + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.motion-path-url.enabled")) { + gCSSProperties["offset-path"]["other_values"].push("url(#svgPath)"); +} + +gCSSProperties["offset-distance"] = { + domProp: "offsetDistance", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["10px", "10%", "190%", "-280%", "calc(30px + 40%)"], + invalid_values: ["none", "45deg"], +}; + +gCSSProperties["offset-rotate"] = { + domProp: "offsetRotate", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["reverse", "0deg", "0rad reverse", "-45deg", "5turn auto"], + invalid_values: ["none", "10px", "reverse 0deg reverse", "reverse auto"], +}; + +gCSSProperties["offset-anchor"] = { + domProp: "offsetAnchor", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "left bottom", + "center center", + "calc(20% + 10px) center", + "right 30em", + "10px 20%", + "left -10px top -20%", + "right 10% bottom 20em", + ], + invalid_values: ["none", "10deg", "left 10% top"], +}; + +if ( + IsCSSPropertyPrefEnabled("layout.css.motion-path-offset-position.enabled") +) { + gCSSProperties["offset"]["subproperties"].push("offset-position"); + gCSSProperties["offset"]["other_values"].push("top right / top left"); + + if (IsCSSPropertyPrefEnabled("layout.css.motion-path-ray.enabled")) { + gCSSProperties["offset"]["other_values"].push( + "top right ray(45deg closest-side)", + "50% 50% ray(0rad farthest-side)" + ); + } + + gCSSProperties["offset-position"] = { + domProp: "offsetPosition", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "auto", + "left bottom", + "center center", + "calc(20% + 10px) center", + "right 30em", + "10px 20%", + "left -10px top -20%", + "right 10% bottom 20em", + ], + invalid_values: ["none", "10deg", "left 10% top"], + }; +} + +{ + let linear_function_other_values = [ + "linear(0, 1)", + "linear(0 0% 50%, 1 50% 100%)", + ]; + + let linear_function_invalid_values = [ + "linear()", + "linear(0.5)", + "linear(0% 0 100%)", + "linear(0,)", + ]; + gCSSProperties["animation-timing-function"].other_values.push( + ...linear_function_other_values + ); + gCSSProperties["animation-timing-function"].invalid_values.push( + ...linear_function_invalid_values + ); + + gCSSProperties["transition-timing-function"].other_values.push( + ...linear_function_other_values + ); + gCSSProperties["transition-timing-function"].invalid_values.push( + ...linear_function_invalid_values + ); + + gCSSProperties["animation"].other_values.push( + "1s 2s linear(0, 1) bounce", + "4s linear(0, 0.5 25% 75%, 1 100% 100%)" + ); +} + +if (IsCSSPropertyPrefEnabled("layout.css.backdrop-filter.enabled")) { + gCSSProperties["backdrop-filter"] = { + domProp: "backdropFilter", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: gCSSProperties["filter"].other_values, + invalid_values: gCSSProperties["filter"].invalid_values, + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.math-depth.enabled")) { + gCSSProperties["math-depth"] = { + domProp: "mathDepth", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: [ + // auto-add cannot be tested here because it has no effect when the + // inherited math-style is equal to the default (normal). + "123", + "-123", + "add(123)", + "add(-123)", + "calc(1 + 2*3)", + "add(calc(4 - 2/3))", + ], + invalid_values: ["auto", "1,23", "1.23", "add(1,23)", "add(1.23)"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.math-style.enabled")) { + gCSSProperties["math-style"] = { + domProp: "mathStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["compact"], + invalid_values: [], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.forced-color-adjust.enabled")) { + gCSSProperties["forced-color-adjust"] = { + domProp: "forcedColorAdjust", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["none"], + invalid_values: [], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.animation-composition.enabled")) { + gCSSProperties["animation-composition"] = { + domProp: "animationComposition", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["replace"], + other_values: [ + "add", + "accumulate", + "replace, add", + "add, accumulate", + "replace, add, accumulate", + ], + invalid_values: ["all", "none"], + }; +} + +if (IsCSSPropertyPrefEnabled("layout.css.prefixes.animations")) { + Object.assign(gCSSProperties, { + "-moz-animation": { + domProp: "MozAnimation", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + alias_for: "animation", + subproperties: [ + "animation-name", + "animation-duration", + "animation-timing-function", + "animation-delay", + "animation-direction", + "animation-fill-mode", + "animation-iteration-count", + "animation-play-state", + ], + }, + "-moz-animation-delay": { + domProp: "MozAnimationDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-delay", + subproperties: ["animation-delay"], + }, + "-moz-animation-direction": { + domProp: "MozAnimationDirection", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-direction", + subproperties: ["animation-direction"], + }, + "-moz-animation-duration": { + domProp: "MozAnimationDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-duration", + subproperties: ["animation-duration"], + }, + "-moz-animation-fill-mode": { + domProp: "MozAnimationFillMode", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-fill-mode", + subproperties: ["animation-fill-mode"], + }, + "-moz-animation-iteration-count": { + domProp: "MozAnimationIterationCount", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-iteration-count", + subproperties: ["animation-iteration-count"], + }, + "-moz-animation-name": { + domProp: "MozAnimationName", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-name", + subproperties: ["animation-name"], + }, + "-moz-animation-play-state": { + domProp: "MozAnimationPlayState", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-play-state", + subproperties: ["animation-play-state"], + }, + "-moz-animation-timing-function": { + domProp: "MozAnimationTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "animation-timing-function", + subproperties: ["animation-timing-function"], + }, + }); +} + +if (IsCSSPropertyPrefEnabled("layout.css.scroll-driven-animations.enabled")) { + // Basically, web-platform-tests should cover most cases, so here we only + // put some basic test cases. + gCSSProperties["animation"].subproperties.push("animation-timeline"); + gCSSProperties["animation"].initial_values.push( + "none none 0s 0s ease normal running 1.0 auto", + "none none auto" + ); + gCSSProperties["animation"].other_values.push( + "none none 0s 0s cubic-bezier(0.25, 0.1, 0.25, 1.0) normal running 1.0 auto", + "bounce 1s linear 2s timeline", + "bounce 1s 2s linear none", + "bounce timeline", + "2s, 1s bounce timeline", + "1s bounce timeline, 2s", + "1s bounce none, 2s none auto" + ); + + gCSSProperties["-moz-animation"].subproperties.push("animation-timeline"); + gCSSProperties["-webkit-animation"].subproperties.push("animation-timeline"); + + gCSSProperties["animation-timeline"] = { + domProp: "animationTimeline", + inherited: false, + type: CSS_TYPE_LONGHAND, + applies_to_marker: true, + initial_values: ["auto"], + other_values: [ + "none", + "all", + "ball", + "mall", + "color", + "bounce, bubble, opacity", + "foobar", + "\\32bounce", + "-bounce", + "-\\32bounce", + "\\32 0bounce", + "-\\32 0bounce", + "\\2bounce", + "-\\2bounce", + "scroll()", + "scroll(block)", + "scroll(inline)", + "scroll(horizontal)", + "scroll(vertical)", + "scroll(root)", + "scroll(nearest)", + "scroll(inline nearest)", + "scroll(vertical root)", + "scroll(root horizontal)", + "view()", + "view(inline)", + "view(auto)", + "view(auto 1px)", + "view(inline auto)", + "view(vertical auto auto)", + "view(horizontal 1px 1%)", + "view(1px 1% block)", + ], + invalid_values: [ + "bounce, initial", + "initial, bounce", + "bounce, inherit", + "inherit, bounce", + "bounce, unset", + "unset, bounce", + ], + }; + + gCSSProperties["scroll-timeline-name"] = { + domProp: "scrollTimelineName", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "all", + "auto", + "ball", + "mall", + "color", + "foobar", + "\\32bounce", + "-bounce", + "-\\32bounce", + "\\32 0bounce", + "-\\32 0bounce", + "\\2bounce", + "-\\2bounce", + ], + invalid_values: ["abc bounce", "10px", "rgb(1, 2, 3)"], + }; + + gCSSProperties["scroll-timeline-axis"] = { + domProp: "scrollTimelineAxis", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["block"], + other_values: ["inline", "vertical", "horizontal"], + invalid_values: ["auto", "none", "abc"], + }; + + gCSSProperties["scroll-timeline"] = { + domProp: "scrollTimeline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["scroll-timeline-name", "scroll-timeline-axis"], + initial_values: ["none block", "none"], + other_values: [ + "auto inline", + "bounce inline", + "bounce vertical", + "\\32bounce inline", + "-bounce block", + "\\32 0bounce vertical", + "-\\32 0bounce horizontal", + "a, b, c", + "a block, b inline, c vertical", + ], + invalid_values: ["", "bounce bounce", "horizontal a", "block abc"], + }; + + gCSSProperties["view-timeline-name"] = { + domProp: "viewTimelineName", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "all", + "auto", + "ball", + "mall", + "color", + "foobar", + "\\32bounce", + "-bounce", + "-\\32bounce", + "\\32 0bounce", + "-\\32 0bounce", + "\\2bounce", + "-\\2bounce", + "bounce, abc", + "none, none", + ], + invalid_values: ["abc bounce", "10px", "rgb(1, 2, 3)"], + }; + + gCSSProperties["view-timeline-axis"] = { + domProp: "viewTimelineAxis", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["block"], + other_values: ["inline", "vertical", "horizontal", "inline, block"], + invalid_values: ["auto", "none", "abc", "inline block"], + }; + + gCSSProperties["view-timeline-inset"] = { + domProp: "viewTimelineInset", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["0px", "1%", "1px 1%", "0px 0%", "calc(0px) auto"], + invalid_values: ["none", "rgb(1, 2, 3)", "foo bar", "1px 2px 3px"], + }; + + gCSSProperties["view-timeline"] = { + domProp: "viewTimeline", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: ["view-timeline-name", "view-timeline-axis"], + initial_values: ["none block", "none"], + other_values: [ + "auto inline", + "bounce inline", + "bounce vertical", + "\\32bounce inline", + "-bounce block", + "\\32 0bounce vertical", + "-\\32 0bounce horizontal", + "a, b, c", + "a block, b inline, c vertical", + ], + invalid_values: ["", ",", "abc abc", "horizontal a", "block abc"], + }; +} + +gCSSProperties["scrollbar-gutter"] = { + domProp: "scrollbarGutter", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["stable", "stable both-edges", "both-edges stable"], + invalid_values: [ + "auto stable", + "auto both-edges", + "both-edges", + "stable mirror", + // The following values are from scrollbar-gutter extension in CSS + // Overflow 4 https://drafts.csswg.org/css-overflow-4/#sbg-ext. + "always", + "always both-edges", + "always force", + "always both-edges force", + "stable both-edges force", + "match-parent", + ], +}; + +if (IsCSSPropertyPrefEnabled("layout.css.text-wrap-balance.enabled")) { + gCSSProperties["text-wrap-style"] = { + domProp: "textWrapStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + applies_to_placeholder: true, + applies_to_cue: true, + applies_to_marker: true, + initial_values: ["auto"], + other_values: ["stable", "balance"], + invalid_values: ["wrap", "nowrap", "normal"], + }; + gCSSProperties["text-wrap"].subproperties.push("text-wrap-style"); + gCSSProperties["text-wrap"].other_values.push("stable"); + gCSSProperties["text-wrap"].other_values.push("balance"); + gCSSProperties["text-wrap"].other_values.push("wrap stable"); + gCSSProperties["text-wrap"].other_values.push("nowrap balance"); +} + +if (IsCSSPropertyPrefEnabled("layout.css.prefixes.transforms")) { + Object.assign(gCSSProperties, { + "-moz-transform": { + domProp: "MozTransform", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform", + subproperties: ["transform"], + }, + "-moz-transform-origin": { + domProp: "MozTransformOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-origin", + subproperties: ["transform-origin"], + }, + "-moz-perspective-origin": { + domProp: "MozPerspectiveOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective-origin", + subproperties: ["perspective-origin"], + }, + "-moz-perspective": { + domProp: "MozPerspective", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective", + subproperties: ["perspective"], + }, + "-moz-backface-visibility": { + domProp: "MozBackfaceVisibility", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "backface-visibility", + subproperties: ["backface-visibility"], + }, + "-moz-transform-style": { + domProp: "MozTransformStyle", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-style", + subproperties: ["transform-style"], + }, + }); +} + +if (IsCSSPropertyPrefEnabled("layout.css.zoom.enabled")) { + Object.assign(gCSSProperties, { + zoom: { + domProp: "zoom", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal", "1", "100%", "0", "0%"], + other_values: ["1.5", "2", "150%", "200%"], + invalid_values: ["-1", "-40%"], + }, + }); +} + +if (IsCSSPropertyPrefEnabled("layout.css.prefixes.transitions")) { + Object.assign(gCSSProperties, { + "-moz-transition": { + domProp: "MozTransition", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + applies_to_marker: true, + alias_for: "transition", + subproperties: [ + "transition-property", + "transition-duration", + "transition-timing-function", + "transition-delay", + ], + }, + "-moz-transition-delay": { + domProp: "MozTransitionDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-delay", + subproperties: ["transition-delay"], + }, + "-moz-transition-duration": { + domProp: "MozTransitionDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-duration", + subproperties: ["transition-duration"], + }, + "-moz-transition-property": { + domProp: "MozTransitionProperty", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-property", + subproperties: ["transition-property"], + }, + "-moz-transition-timing-function": { + domProp: "MozTransitionTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + applies_to_marker: true, + alias_for: "transition-timing-function", + subproperties: ["transition-timing-function"], + }, + }); +} + +// Copy aliased properties' fields from their alias targets. Keep this logic +// at the bottom of this file to ensure all the aliased properties are +// processed. +for (var prop in gCSSProperties) { + var entry = gCSSProperties[prop]; + if (entry.alias_for) { + var aliasTargetEntry = gCSSProperties[entry.alias_for]; + if (!aliasTargetEntry) { + ok( + false, + "Alias '" + + prop + + "' alias_for field, '" + + entry.alias_for + + "', " + + "must be set to a recognized CSS property in gCSSProperties" + ); + } else { + // Copy 'values' fields & 'prerequisites' field from aliasTargetEntry: + var fieldsToCopy = [ + "initial_values", + "other_values", + "invalid_values", + "quirks_values", + "unbalanced_values", + "prerequisites", + ]; + + fieldsToCopy.forEach(function (fieldName) { + // (Don't copy the field if the alias already has something there, + // or if the aliased property doesn't have anything to copy.) + if (!(fieldName in entry) && fieldName in aliasTargetEntry) { + entry[fieldName] = aliasTargetEntry[fieldName]; + } + }); + } + } +} diff --git a/layout/style/test/redirect.sjs b/layout/style/test/redirect.sjs new file mode 100644 index 0000000000..43fec90b5a --- /dev/null +++ b/layout/style/test/redirect.sjs @@ -0,0 +1,4 @@ +function handleRequest(request, response) { + response.setStatusLine(request.httpVersion, 301, "Moved Permanently"); + response.setHeader("Location", request.queryString, false); +} diff --git a/layout/style/test/redundant_font_download.sjs b/layout/style/test/redundant_font_download.sjs new file mode 100644 index 0000000000..09236563de --- /dev/null +++ b/layout/style/test/redundant_font_download.sjs @@ -0,0 +1,63 @@ +"use strict"; + +const BinaryOutputStream = Components.Constructor( + "@mozilla.org/binaryoutputstream;1", + "nsIBinaryOutputStream", + "setOutputStream" +); + +// this is simply a hex dump of a red square .PNG image +// prettier-ignore +const RED_SQUARE = + [ + 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, + 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x20, 0x08, 0x02, 0x00, 0x00, 0x00, 0xFC, + 0x18, 0xED, 0xA3, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, + 0x42, 0x00, 0xAE, 0xCE, 0x1C, 0xE9, 0x00, 0x00, 0x00, 0x28, + 0x49, 0x44, 0x41, 0x54, 0x48, 0xC7, 0xED, 0xCD, 0x41, 0x0D, + 0x00, 0x00, 0x08, 0x04, 0xA0, 0xD3, 0xFE, 0x9D, 0x35, 0x85, + 0x0F, 0x37, 0x28, 0x40, 0x4D, 0x6E, 0x75, 0x04, 0x02, 0x81, + 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0xC1, 0x93, 0x60, 0x01, + 0xA3, 0xC4, 0x01, 0x3F, 0x58, 0x1D, 0xEF, 0x27, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 + ]; + +function handleRequest(request, response) { + let query = {}; + request.queryString.split("&").forEach(function (val) { + let [name, value] = val.split("="); + query[name] = unescape(value); + }); + + response.setHeader("Cache-Control", "no-cache"); + + response.setStatusLine(request.httpVersion, 200, "OK"); + response.setHeader("Content-Type", "text/plain", false); + + let log = getState("bug-879963-request-log") || ""; + + let stream = new BinaryOutputStream(response.bodyOutputStream); + + if (query.q == "init") { + log = "init"; // initialize the log, and return a PNG image + response.setHeader("Content-Type", "image/png", false); + stream.writeByteArray(RED_SQUARE); + } else if (query.q == "image") { + log = log + ";" + query.q; + response.setHeader("Content-Type", "image/png", false); + stream.writeByteArray(RED_SQUARE); + } else if (query.q == "font") { + log = log + ";" + query.q; + // we don't provide a real font; that's ok, OTS will just reject it + response.write("Junk"); + } else if (query.q == "report") { + // don't include the actual "report" request in the log we return + response.write(log); + } else { + log = log + ";" + query.q; + response.setStatusLine(request.httpVersion, 404, "Not Found"); + } + + setState("bug-879963-request-log", log); +} diff --git a/layout/style/test/slow_broken_sheet.sjs b/layout/style/test/slow_broken_sheet.sjs new file mode 100644 index 0000000000..6af03ee4c6 --- /dev/null +++ b/layout/style/test/slow_broken_sheet.sjs @@ -0,0 +1,19 @@ +// Make sure our timer stays alive. +let gTimer; + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/html", false); + response.setStatusLine("1.1", 404, "Not Found"); + response.processAsync(); + + gTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + // Wait for 1s before responding; this should usually make sure this load comes in last. + gTimer.init( + () => { + response.write("

Hello

"); + response.finish(); + }, + 1000, + Ci.nsITimer.TYPE_ONE_SHOT + ); +} diff --git a/layout/style/test/slow_load.sjs b/layout/style/test/slow_load.sjs new file mode 100644 index 0000000000..3873f466ce --- /dev/null +++ b/layout/style/test/slow_load.sjs @@ -0,0 +1,29 @@ +// Make sure our timer stays alive. +let gTimer; + +function handleRequest(request, response) { + let isCss = request.queryString.indexOf("css") != -1; + + response.setHeader("Content-Type", isCss ? "text/css" : "text/plain", false); + response.setStatusLine("1.1", 200, "OK"); + response.processAsync(); + + let time = Date.now(); + + gTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + // Wait for 1s before responding; this should usually make sure this load comes in last. + gTimer.init( + () => { + if (isCss) { + // FIXME(emilio): This clamps the date to the 32-bit integer range which + // is what we use to store the z-index... We don't seem to store f64s + // anywhere in the specified values... + time = time % (Math.pow(2, 31) - 1); + response.write(":root { z-index: " + time + "}"); + } + response.finish(); + }, + 1000, + Ci.nsITimer.TYPE_ONE_SHOT + ); +} diff --git a/layout/style/test/slow_ok_sheet.sjs b/layout/style/test/slow_ok_sheet.sjs new file mode 100644 index 0000000000..5673bb2be8 --- /dev/null +++ b/layout/style/test/slow_ok_sheet.sjs @@ -0,0 +1,21 @@ +// Make sure our timer stays alive. +let gTimer; + +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/css", false); + response.setStatusLine("1.1", 200, "OK"); + response.processAsync(); + + gTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + // Wait for 1s before responding; this should usually make sure this load comes in last. + gTimer.init( + () => { + // This sheet _does_ still get applied even though its importing link + // overall reports failure... + response.write("nosuchelement { background: red }"); + response.finish(); + }, + 1000, + Ci.nsITimer.TYPE_ONE_SHOT + ); +} diff --git a/layout/style/test/sourcemap_css.html b/layout/style/test/sourcemap_css.html new file mode 100644 index 0000000000..1f29a38d5f --- /dev/null +++ b/layout/style/test/sourcemap_css.html @@ -0,0 +1,11 @@ + + + + Test for bug 1306887 + + + + + Mozilla Bug 1306887 + + diff --git a/layout/style/test/style_attribute_tests.js b/layout/style/test/style_attribute_tests.js new file mode 100644 index 0000000000..243ec3380d --- /dev/null +++ b/layout/style/test/style_attribute_tests.js @@ -0,0 +1,25 @@ +SimpleTest.waitForExplicitFinish(); + +window.addEventListener("load", runTests); + +function runTests(event) { + if (event.target != document) { + return; + } + + var elt = document.getElementById("content"); + + elt.setAttribute("style", "color: blue; background-color: fuchsia"); + is(elt.style.color, "blue", "setting correct style attribute (color)"); + is( + elt.style.backgroundColor, + "fuchsia", + "setting correct style attribute (color)" + ); + + elt.setAttribute("style", "{color: blue; background-color: fuchsia}"); + is(elt.style.color, "", "setting braced style attribute (color)"); + is(elt.style.backgroundColor, "", "setting braced style attribute (color)"); + + SimpleTest.finish(); +} diff --git a/layout/style/test/support/1x1-transparent.png b/layout/style/test/support/1x1-transparent.png new file mode 100644 index 0000000000..56cd9eb930 Binary files /dev/null and b/layout/style/test/support/1x1-transparent.png differ diff --git a/layout/style/test/support/blue-100x100.png b/layout/style/test/support/blue-100x100.png new file mode 100644 index 0000000000..3b72d5ce53 Binary files /dev/null and b/layout/style/test/support/blue-100x100.png differ diff --git a/layout/style/test/support/external-variable-url.css b/layout/style/test/support/external-variable-url.css new file mode 100644 index 0000000000..d730ac0cea --- /dev/null +++ b/layout/style/test/support/external-variable-url.css @@ -0,0 +1,3 @@ +#t4 { + --a: url('image.png'); +} diff --git a/layout/style/test/test_acid3_test46.html b/layout/style/test/test_acid3_test46.html new file mode 100644 index 0000000000..4ec50cfddc --- /dev/null +++ b/layout/style/test/test_acid3_test46.html @@ -0,0 +1,140 @@ + + + + + + Test for Bug 156716 + + + + + +Mozilla Bug 156716 + +
+
+
+

+ +

+ + diff --git a/layout/style/test/test_addSheet.html b/layout/style/test/test_addSheet.html new file mode 100644 index 0000000000..06f9f93fc3 --- /dev/null +++ b/layout/style/test/test_addSheet.html @@ -0,0 +1,44 @@ + + + + Test for addSheet + + + + +Mozilla Bug 1024707 + + + + +
+
+
+
diff --git a/layout/style/test/test_additional_sheets.html b/layout/style/test/test_additional_sheets.html
new file mode 100644
index 0000000000..8cd8ffd93a
--- /dev/null
+++ b/layout/style/test/test_additional_sheets.html
@@ -0,0 +1,310 @@
+
+
+
+  Test for additional sheets
+  
+  
+
+
+Mozilla Bug 737003
+
+
+
+
+ + diff --git a/layout/style/test/test_align_justify_computed_values.html b/layout/style/test/test_align_justify_computed_values.html new file mode 100644 index 0000000000..aa13762cb7 --- /dev/null +++ b/layout/style/test/test_align_justify_computed_values.html @@ -0,0 +1,484 @@ + + + + + + Test align/justify-items/self/content computed values + + + + +Mozilla Bug 696253 + +
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_all_shorthand.html b/layout/style/test/test_all_shorthand.html new file mode 100644 index 0000000000..0a3bfd29fd --- /dev/null +++ b/layout/style/test/test_all_shorthand.html @@ -0,0 +1,157 @@ + +Test the 'all' shorthand property + + + + + + + +
+
+
+
+
+ + diff --git a/layout/style/test/test_animations.html b/layout/style/test/test_animations.html new file mode 100644 index 0000000000..846eb1d2a0 --- /dev/null +++ b/layout/style/test/test_animations.html @@ -0,0 +1,2107 @@ + + + + + + Test for css3-animations (Bug 435442) + + + + + + +Mozilla Bug 435442 +
+
+
+
+ + diff --git a/layout/style/test/test_animations_async_tests.html b/layout/style/test/test_animations_async_tests.html new file mode 100644 index 0000000000..7ad1d0d598 --- /dev/null +++ b/layout/style/test/test_animations_async_tests.html @@ -0,0 +1,24 @@ + + + + + Test for Bug 1086937 + + + + + + +Mozilla Bug 1086937 +
+
+
+ + diff --git a/layout/style/test/test_animations_dynamic_changes.html b/layout/style/test/test_animations_dynamic_changes.html new file mode 100644 index 0000000000..1863d08829 --- /dev/null +++ b/layout/style/test/test_animations_dynamic_changes.html @@ -0,0 +1,65 @@ + + + + + Test for Bug 978833 + + + + + +Mozilla Bug 978833 +

+
+
+
+ + diff --git a/layout/style/test/test_animations_effect_timing_duration.html b/layout/style/test/test_animations_effect_timing_duration.html new file mode 100644 index 0000000000..7b3c443669 --- /dev/null +++ b/layout/style/test/test_animations_effect_timing_duration.html @@ -0,0 +1,81 @@ + + + + + Test for animation.effect.updateTiming({ duration }) on compositor + animations + + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_effect_timing_enddelay.html b/layout/style/test/test_animations_effect_timing_enddelay.html new file mode 100644 index 0000000000..ad018f6373 --- /dev/null +++ b/layout/style/test/test_animations_effect_timing_enddelay.html @@ -0,0 +1,141 @@ + + + + + Test for animation.effect.updateTiming({ endDelay }) on compositor + animations + + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_effect_timing_iterations.html b/layout/style/test/test_animations_effect_timing_iterations.html new file mode 100644 index 0000000000..380cab1763 --- /dev/null +++ b/layout/style/test/test_animations_effect_timing_iterations.html @@ -0,0 +1,68 @@ + + + + + Test for Animation.effect.updateTiming({ iterations }) on compositor + animations + + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_event_handler_attribute.html b/layout/style/test/test_animations_event_handler_attribute.html new file mode 100644 index 0000000000..7a9da1809c --- /dev/null +++ b/layout/style/test/test_animations_event_handler_attribute.html @@ -0,0 +1,204 @@ + + + + + + Test for CSS Animation and Transition event handler + attributes. (Bug 911987) + + + + + + +Mozilla Bug + 911987 +
+
+
+
+
diff --git a/layout/style/test/test_animations_event_order.html b/layout/style/test/test_animations_event_order.html
new file mode 100644
index 0000000000..7caee2bdcb
--- /dev/null
+++ b/layout/style/test/test_animations_event_order.html
@@ -0,0 +1,710 @@
+
+
+
+
+
+  
+  Test for CSS Animation and Transition event ordering
+         (Bug 1183461)
+  
+  
+  
+  
+  
+
+
+Mozilla Bug
+  1183461
+
+
+
+
+
diff --git a/layout/style/test/test_animations_iterationstart.html b/layout/style/test/test_animations_iterationstart.html
new file mode 100644
index 0000000000..dbca9490e4
--- /dev/null
+++ b/layout/style/test/test_animations_iterationstart.html
@@ -0,0 +1,53 @@
+
+
+
+  
+    Test for Animation.effect.timing.iterationStart on compositor animations
+  
+  
+  
+  
+  
+  
+
+
+
+ + + diff --git a/layout/style/test/test_animations_omta.html b/layout/style/test/test_animations_omta.html new file mode 100644 index 0000000000..06a409b490 --- /dev/null +++ b/layout/style/test/test_animations_omta.html @@ -0,0 +1,2969 @@ + + + + + + + Test for css3-animations running on the compositor thread (Bug + 964646) + + + + + + + +Mozilla Bug + 964646 +
+
+
+
diff --git a/layout/style/test/test_animations_omta_scroll.html b/layout/style/test/test_animations_omta_scroll.html
new file mode 100644
index 0000000000..324264c3e7
--- /dev/null
+++ b/layout/style/test/test_animations_omta_scroll.html
@@ -0,0 +1,25 @@
+
+
+
+  Test for css-animations running on the compositor thread with
+    scroll-timeline
+  
+  
+
+
+Scroll-driven
+   animations generated by CSS
+

+
+
+ + diff --git a/layout/style/test/test_animations_omta_scroll_rtl.html b/layout/style/test/test_animations_omta_scroll_rtl.html new file mode 100644 index 0000000000..73339211c5 --- /dev/null +++ b/layout/style/test/test_animations_omta_scroll_rtl.html @@ -0,0 +1,25 @@ + + + + Test for css-animations running on the compositor thread with + scroll-timeline with right to left writing mode + + + + +Scroll-driven + animations generated by CSS +

+
+
+ + diff --git a/layout/style/test/test_animations_omta_start.html b/layout/style/test/test_animations_omta_start.html new file mode 100644 index 0000000000..92423bf67d --- /dev/null +++ b/layout/style/test/test_animations_omta_start.html @@ -0,0 +1,187 @@ + + + + + + Test OMTA animations start correctly (Bug 975261) + + + + + + + +Mozilla Bug + 975261 +
+
+
+
+ + diff --git a/layout/style/test/test_animations_pausing.html b/layout/style/test/test_animations_pausing.html new file mode 100644 index 0000000000..8aba46b5e8 --- /dev/null +++ b/layout/style/test/test_animations_pausing.html @@ -0,0 +1,79 @@ + + + + + Test for Animation.play() and Animation.pause() on compositor animations + + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_playbackrate.html b/layout/style/test/test_animations_playbackrate.html new file mode 100644 index 0000000000..8ecfdb6f28 --- /dev/null +++ b/layout/style/test/test_animations_playbackrate.html @@ -0,0 +1,94 @@ + + + + Test for Animation.playbackRate on compositor animations + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_reverse.html b/layout/style/test/test_animations_reverse.html new file mode 100644 index 0000000000..93ff8c37a9 --- /dev/null +++ b/layout/style/test/test_animations_reverse.html @@ -0,0 +1,64 @@ + + + + + Test for Animation.reverse() on compositor animations + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_styles_on_event.html b/layout/style/test/test_animations_styles_on_event.html new file mode 100644 index 0000000000..0e96711530 --- /dev/null +++ b/layout/style/test/test_animations_styles_on_event.html @@ -0,0 +1,66 @@ + + + + + Test that mouse movement immediately after finish() should involve + restyling for finished state (Bug 1228137) + + + + + + + + + +
+ + + diff --git a/layout/style/test/test_animations_variable_changes.html b/layout/style/test/test_animations_variable_changes.html new file mode 100644 index 0000000000..ac254e1136 --- /dev/null +++ b/layout/style/test/test_animations_variable_changes.html @@ -0,0 +1,58 @@ + + +Tests that animations respond to changes to variables + + + + + +
+ + diff --git a/layout/style/test/test_animations_with_disabled_properties.html b/layout/style/test/test_animations_with_disabled_properties.html new file mode 100644 index 0000000000..9eb395003f --- /dev/null +++ b/layout/style/test/test_animations_with_disabled_properties.html @@ -0,0 +1,33 @@ + + + + + Test CSS animations ignore disabled properties (Bug 1265611) + + + + +Mozilla Bug + 1265611 +
+
+
+ + diff --git a/layout/style/test/test_any_dynamic.html b/layout/style/test/test_any_dynamic.html new file mode 100644 index 0000000000..9c9a9e2a3f --- /dev/null +++ b/layout/style/test/test_any_dynamic.html @@ -0,0 +1,49 @@ + + + + + Test for Bug 544834 + + + + + +Mozilla Bug 544834 +

+
+
+
+ + diff --git a/layout/style/test/test_area_url_cursor.html b/layout/style/test/test_area_url_cursor.html new file mode 100644 index 0000000000..cbc5efed74 --- /dev/null +++ b/layout/style/test/test_area_url_cursor.html @@ -0,0 +1,34 @@ + +cursor: url() doesn't assert for area elements + + + + + + + +
+ diff --git a/layout/style/test/test_asyncopen.html b/layout/style/test/test_asyncopen.html new file mode 100644 index 0000000000..9a52ea37eb --- /dev/null +++ b/layout/style/test/test_asyncopen.html @@ -0,0 +1,54 @@ + + + + + Bug 1195173 - Test asyncOpen security exception + + + + + + + + +Mozilla Bug 1195173 +

+ + + + + diff --git a/layout/style/test/test_at_rule_parse_serialize.html b/layout/style/test/test_at_rule_parse_serialize.html new file mode 100644 index 0000000000..2c6f2e2d5c --- /dev/null +++ b/layout/style/test/test_at_rule_parse_serialize.html @@ -0,0 +1,43 @@ + + + + + Test for Bug 478160 + + + + + +Mozilla Bug 478160 +

+ +
+
+
+ + diff --git a/layout/style/test/test_attribute_selector_eof_behavior.html b/layout/style/test/test_attribute_selector_eof_behavior.html new file mode 100644 index 0000000000..76635f9ed0 --- /dev/null +++ b/layout/style/test/test_attribute_selector_eof_behavior.html @@ -0,0 +1,18 @@ + + +Test for EOF behavior of attribute selectors in selectors API + + +
+ diff --git a/layout/style/test/test_backdrop_filter_enabled_state.html b/layout/style/test/test_backdrop_filter_enabled_state.html new file mode 100644 index 0000000000..f8f2995b28 --- /dev/null +++ b/layout/style/test/test_backdrop_filter_enabled_state.html @@ -0,0 +1,21 @@ + + + + Test Backdrop-Filter Enabled State + + + + + diff --git a/layout/style/test/test_background_blend_mode.html b/layout/style/test/test_background_blend_mode.html new file mode 100644 index 0000000000..23551ebda9 --- /dev/null +++ b/layout/style/test/test_background_blend_mode.html @@ -0,0 +1,57 @@ + + + + Test for miscellaneous computed style issues + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_border_device_pixel_rounding_initial_style.html b/layout/style/test/test_border_device_pixel_rounding_initial_style.html new file mode 100644 index 0000000000..a8b5b0546d --- /dev/null +++ b/layout/style/test/test_border_device_pixel_rounding_initial_style.html @@ -0,0 +1,20 @@ + + + + + diff --git a/layout/style/test/test_box_size_keywords.html b/layout/style/test/test_box_size_keywords.html new file mode 100644 index 0000000000..c4074c7d8f --- /dev/null +++ b/layout/style/test/test_box_size_keywords.html @@ -0,0 +1,170 @@ + + + + Test for keywords on box sizing properties + + + + + +Mozilla Bug 1122253 +Mozilla Bug 1496558 + + + +
+
+
+
+ +
+
+
+ + diff --git a/layout/style/test/test_bug1055933.html b/layout/style/test/test_bug1055933.html new file mode 100644 index 0000000000..de96d1d441 --- /dev/null +++ b/layout/style/test/test_bug1055933.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 1055933 + + + + + +Mozilla Bug 1055933 +

+ +
+
+
+
+ + + + +
+ + diff --git a/layout/style/test/test_bug1089417.html b/layout/style/test/test_bug1089417.html new file mode 100644 index 0000000000..d4b09beffd --- /dev/null +++ b/layout/style/test/test_bug1089417.html @@ -0,0 +1,47 @@ + + + + + + Test for Bug 1089417 + + + + + +Mozilla Bug 1089417 +
+ +
+
+
+ + diff --git a/layout/style/test/test_bug1112014.html b/layout/style/test/test_bug1112014.html new file mode 100644 index 0000000000..cd4330e50f --- /dev/null +++ b/layout/style/test/test_bug1112014.html @@ -0,0 +1,89 @@ + + + + + + Test for Bug 1112014 + + + + + +Mozilla Bug 1112014 +

+ +
+
+ + diff --git a/layout/style/test/test_bug1203766.html b/layout/style/test/test_bug1203766.html new file mode 100644 index 0000000000..42da6520ac --- /dev/null +++ b/layout/style/test/test_bug1203766.html @@ -0,0 +1,112 @@ + + +Test for bug 1203766 + + + +Mozilla Bug 1203766 +

+
+
+
+
+
diff --git a/layout/style/test/test_bug1232829.html b/layout/style/test/test_bug1232829.html new file mode 100644 index 0000000000..65bea2014d --- /dev/null +++ b/layout/style/test/test_bug1232829.html @@ -0,0 +1,37 @@ + + + + + +Test for Bug 1232829 + + + + + + + + diff --git a/layout/style/test/test_bug1292447.html b/layout/style/test/test_bug1292447.html new file mode 100644 index 0000000000..6937b648c5 --- /dev/null +++ b/layout/style/test/test_bug1292447.html @@ -0,0 +1,350 @@ + + + + + Test for Bug 1292447 + + + + + +Mozilla Bug 1292447 +

+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+ + diff --git a/layout/style/test/test_bug1330375.html b/layout/style/test/test_bug1330375.html new file mode 100644 index 0000000000..c9bc0f6715 --- /dev/null +++ b/layout/style/test/test_bug1330375.html @@ -0,0 +1,59 @@ + + + +Test for Bug 1330375 + + + +
+ + + + + + + + + + + + + +
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
lorem ipsumdolor sitametconsectetur adipsicingelit.
+
+ + + diff --git a/layout/style/test/test_bug1371488.html b/layout/style/test/test_bug1371488.html new file mode 100644 index 0000000000..7e32fa0031 --- /dev/null +++ b/layout/style/test/test_bug1371488.html @@ -0,0 +1,23 @@ + + + + Test for bug 1371488 + + + + + +
+
+
+ + diff --git a/layout/style/test/test_bug1375944.html b/layout/style/test/test_bug1375944.html new file mode 100644 index 0000000000..c265691170 --- /dev/null +++ b/layout/style/test/test_bug1375944.html @@ -0,0 +1,34 @@ + + + + Test for bug 1375944 + + + + + +
+
+
+ + diff --git a/layout/style/test/test_bug1382568.html b/layout/style/test/test_bug1382568.html new file mode 100644 index 0000000000..23d4dfe5b6 --- /dev/null +++ b/layout/style/test/test_bug1382568.html @@ -0,0 +1,14 @@ + + +Test for bug 1382568: calling innerText on an uninitialized presshell doesn't crash + + + + diff --git a/layout/style/test/test_bug1394302.html b/layout/style/test/test_bug1394302.html new file mode 100644 index 0000000000..e21bcc4ea1 --- /dev/null +++ b/layout/style/test/test_bug1394302.html @@ -0,0 +1,32 @@ + + + + + Test for Bug 1394302 + + + + + +
+
+
+ + + diff --git a/layout/style/test/test_bug1443344-1.html b/layout/style/test/test_bug1443344-1.html new file mode 100644 index 0000000000..fbbcb1ecbb --- /dev/null +++ b/layout/style/test/test_bug1443344-1.html @@ -0,0 +1,48 @@ + + + + + + Test for Bug 1443344 + + + + + + +Mozilla Bug 1443344 +

+ +
+
+ + diff --git a/layout/style/test/test_bug1443344-2.html b/layout/style/test/test_bug1443344-2.html new file mode 100644 index 0000000000..224f575f36 --- /dev/null +++ b/layout/style/test/test_bug1443344-2.html @@ -0,0 +1,48 @@ + + + + + + Test for Bug 1443344 + + + + + + +Mozilla Bug 1443344 +

+ +
+
+ + diff --git a/layout/style/test/test_bug1451199-1.html b/layout/style/test/test_bug1451199-1.html new file mode 100644 index 0000000000..4deb6aac1b --- /dev/null +++ b/layout/style/test/test_bug1451199-1.html @@ -0,0 +1,42 @@ + + + + + + Test for Bug 1451199 + + + + + +Mozilla Bug 1451199 +

+ +
+
+ + diff --git a/layout/style/test/test_bug1451199-2.html b/layout/style/test/test_bug1451199-2.html new file mode 100644 index 0000000000..d29d644c0b --- /dev/null +++ b/layout/style/test/test_bug1451199-2.html @@ -0,0 +1,43 @@ + + + + + + Test for Bug 1451199 + + + + + +Mozilla Bug 1451199 +

+ +
+
+ + diff --git a/layout/style/test/test_bug1490890.html b/layout/style/test/test_bug1490890.html new file mode 100644 index 0000000000..00a8176ed6 --- /dev/null +++ b/layout/style/test/test_bug1490890.html @@ -0,0 +1,112 @@ + + + + + + Test for Bug 1490890 + + + + + +Mozilla Bug 1490890 +
+
+
+
+ +
+
+
abc
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_bug1505254.html b/layout/style/test/test_bug1505254.html new file mode 100644 index 0000000000..9cb3d1e316 --- /dev/null +++ b/layout/style/test/test_bug1505254.html @@ -0,0 +1,152 @@ + + + + + + Test for Bug 1505254 + + + + + +Mozilla Bug 1505254 +
+
+
+
+
+
+
+
+
abc
+
def
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_bug160403.html b/layout/style/test/test_bug160403.html new file mode 100644 index 0000000000..79b10462d8 --- /dev/null +++ b/layout/style/test/test_bug160403.html @@ -0,0 +1,73 @@ + + + + + Test for Bug 160403 + + + + +Mozilla Bug 160403 + +
+
+
+ + diff --git a/layout/style/test/test_bug1729861.html b/layout/style/test/test_bug1729861.html new file mode 100644 index 0000000000..247b7c2644 --- /dev/null +++ b/layout/style/test/test_bug1729861.html @@ -0,0 +1,26 @@ + + + + + + Test that toggling the resistFingerprinting pref re-evaluates device media queries + + + + + + + +Bug 1729861 +

TEST

+ + diff --git a/layout/style/test/test_bug200089.html b/layout/style/test/test_bug200089.html new file mode 100644 index 0000000000..496de50e98 --- /dev/null +++ b/layout/style/test/test_bug200089.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 200089 + + + + +Mozilla Bug 200089 +
+ + +
Cell
+
+ +
+
+
+ + diff --git a/layout/style/test/test_bug221428.html b/layout/style/test/test_bug221428.html new file mode 100644 index 0000000000..7e84319462 --- /dev/null +++ b/layout/style/test/test_bug221428.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 221428 + + + + + + + + +Mozilla Bug 221428 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug229915.html b/layout/style/test/test_bug229915.html new file mode 100644 index 0000000000..0a23d8b799 --- /dev/null +++ b/layout/style/test/test_bug229915.html @@ -0,0 +1,95 @@ + + + + + Test for Bug 229915 + + + + + +Mozilla Bug 229915 +
+ +
+

After testing, this should turn green.

+
+ +
+

To be replaced.

+

After testing, this should turn green.

+
+ +
+

Previous paragraph.

+

To be removed.

+

After testing, this should turn green.

+
+ +
+ +
+
+
+ + diff --git a/layout/style/test/test_bug302186.html b/layout/style/test/test_bug302186.html new file mode 100644 index 0000000000..28ff676ff0 --- /dev/null +++ b/layout/style/test/test_bug302186.html @@ -0,0 +1,508 @@ + + + + + Test for Bug 302186 + + + + + + + + + + +Mozilla Bug 302186 +

+
+ + +
+
+ There should be no red. +
+
+ There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. + +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ + There should be no red. +
+
+ + +
+
+ + + There should be no red. +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ + There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ + There should be no red. +
+
+ There should be no red. +
+
+ + +
+
+ + There should be no red. +
+
+ There should be no red. + +
+
+ + +
+
+ There should be no red. +
+
+ + +
+
+ There should be no red. +
+
+ +
+ +
+
+
+ + + diff --git a/layout/style/test/test_bug319381.html b/layout/style/test/test_bug319381.html new file mode 100644 index 0000000000..d29f1bbd39 --- /dev/null +++ b/layout/style/test/test_bug319381.html @@ -0,0 +1,67 @@ + + + + + Test for Bug 319381 + + + + +Mozilla Bug 319381 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug357614.html b/layout/style/test/test_bug357614.html new file mode 100644 index 0000000000..37475512d4 --- /dev/null +++ b/layout/style/test/test_bug357614.html @@ -0,0 +1,73 @@ + + + + + Test for Bug 357614 + + + + + +Mozilla Bug 357614 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug363146.html b/layout/style/test/test_bug363146.html new file mode 100644 index 0000000000..09ed45a8e2 --- /dev/null +++ b/layout/style/test/test_bug363146.html @@ -0,0 +1,62 @@ + + + + + Test for Bug 363146 + + + + +Mozilla Bug 363146 +
+ + + + + +
Caption
Cell
+
+
+ + + + + +
Caption
Cell
+
+

+ + +
+
+
+ + diff --git a/layout/style/test/test_bug372770.html b/layout/style/test/test_bug372770.html new file mode 100644 index 0000000000..ac3879c9d4 --- /dev/null +++ b/layout/style/test/test_bug372770.html @@ -0,0 +1,85 @@ + + + + + Test for Bug 372770 + + + + + +Mozilla Bug 372770 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug373293.html b/layout/style/test/test_bug373293.html new file mode 100644 index 0000000000..d23c865b67 --- /dev/null +++ b/layout/style/test/test_bug373293.html @@ -0,0 +1,29 @@ + + + + + Test for Bug 373293 + + + + +Mozilla Bug 373293 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug377947.html b/layout/style/test/test_bug377947.html new file mode 100644 index 0000000000..88fccd0dc2 --- /dev/null +++ b/layout/style/test/test_bug377947.html @@ -0,0 +1,110 @@ + + + + + Test for Bug 377947 + + + + +Mozilla Bug 377947 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug379440.html b/layout/style/test/test_bug379440.html new file mode 100644 index 0000000000..56644f85cb --- /dev/null +++ b/layout/style/test/test_bug379440.html @@ -0,0 +1,74 @@ + + + + + Test for Bug 379440 + + + + + +Mozilla Bug 379440 +

+

+
+
+
+
+
+
+

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug379741.html b/layout/style/test/test_bug379741.html new file mode 100644 index 0000000000..7bb2463ce7 --- /dev/null +++ b/layout/style/test/test_bug379741.html @@ -0,0 +1,43 @@ + + + + + Test for Bug 379741 + + + + +Mozilla Bug 379741 + +
+
+
+ + + diff --git a/layout/style/test/test_bug382027.html b/layout/style/test/test_bug382027.html new file mode 100644 index 0000000000..795a17048a --- /dev/null +++ b/layout/style/test/test_bug382027.html @@ -0,0 +1,37 @@ + + + + + Test for Bug 382027 + + + + +Mozilla Bug 382027 + +
+
+
+ + + diff --git a/layout/style/test/test_bug383075.html b/layout/style/test/test_bug383075.html new file mode 100644 index 0000000000..8d902103e9 --- /dev/null +++ b/layout/style/test/test_bug383075.html @@ -0,0 +1,84 @@ + + + + + Test for bug 383075 + + + + + +Mozilla bug 383075 +

+ +The X'es below should have the same size:
+ +X +X +X +X +X +X +X +X +X + +
+ +X +X +X +X +X +X +X +X +X +

+ +
+
+
+ + + + diff --git a/layout/style/test/test_bug387615.html b/layout/style/test/test_bug387615.html new file mode 100644 index 0000000000..eec7109289 --- /dev/null +++ b/layout/style/test/test_bug387615.html @@ -0,0 +1,53 @@ + + + + + Test for Bug 387615 + + + + + +Mozilla Bug 387615 +

link

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug389464.html b/layout/style/test/test_bug389464.html new file mode 100644 index 0000000000..2e05ed848f --- /dev/null +++ b/layout/style/test/test_bug389464.html @@ -0,0 +1,48 @@ + + + + + + + Test for preference not to use document colors + + + + + +Mozilla Bug 58048 +Mozilla Bug 255411 +
+ +
text
+

text

+ +
+
+
+
+ + diff --git a/layout/style/test/test_bug391034.html b/layout/style/test/test_bug391034.html new file mode 100644 index 0000000000..f9544035b1 --- /dev/null +++ b/layout/style/test/test_bug391034.html @@ -0,0 +1,71 @@ + + + + + Test for Bug 391034 + + + + +Mozilla Bug 391034 +
+
+
+
+
+
+
+ +
+
+
+ + + diff --git a/layout/style/test/test_bug391221.html b/layout/style/test/test_bug391221.html new file mode 100644 index 0000000000..bf78711197 --- /dev/null +++ b/layout/style/test/test_bug391221.html @@ -0,0 +1,43 @@ + + + + + Test for Bug 391221 + + + + +Mozilla Bug 391221 +

+

+

+
+ +
+
+
+ +
+
+
+
+ + + diff --git a/layout/style/test/test_bug397427.html b/layout/style/test/test_bug397427.html new file mode 100644 index 0000000000..ff0e71f238 --- /dev/null +++ b/layout/style/test/test_bug397427.html @@ -0,0 +1,91 @@ + + + + + Test for Bug 397427 + + + + + + + + +Mozilla Bug 397427 +

+ + + +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug399349.html b/layout/style/test/test_bug399349.html new file mode 100644 index 0000000000..a36451927f --- /dev/null +++ b/layout/style/test/test_bug399349.html @@ -0,0 +1,80 @@ + + + + + Test for Bug 363146 + + + + + +Mozilla Bug 399349 + + +
+ + +
+
+
+ + +
+ + +
+ + +
+
+
+
+
+ + diff --git a/layout/style/test/test_bug401046.html b/layout/style/test/test_bug401046.html new file mode 100644 index 0000000000..e4492a5ca8 --- /dev/null +++ b/layout/style/test/test_bug401046.html @@ -0,0 +1,82 @@ + + + + + Test for Bug 401046 + + + + + + +Mozilla Bug 401046 +

+ 汉字 + 汉字 + 汉字 + 汉字 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug405818.html b/layout/style/test/test_bug405818.html new file mode 100644 index 0000000000..eff4da449b --- /dev/null +++ b/layout/style/test/test_bug405818.html @@ -0,0 +1,72 @@ + + + + + Test for Bug 405818 + + + + + + + + + + +Mozilla Bug 405818 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug412901.html b/layout/style/test/test_bug412901.html new file mode 100644 index 0000000000..fb37be57f7 --- /dev/null +++ b/layout/style/test/test_bug412901.html @@ -0,0 +1,42 @@ + + + + + Test for Bug 412901 + + + + +Mozilla Bug 412901 +
+
+

+
+ +
+
+
+ + diff --git a/layout/style/test/test_bug413958.html b/layout/style/test/test_bug413958.html new file mode 100644 index 0000000000..0b48e3aa68 --- /dev/null +++ b/layout/style/test/test_bug413958.html @@ -0,0 +1,75 @@ + + + + + Test for Bug 413958 + + + + + + +

Mozilla Bug 413958. All text below should be black on white.

+

Sheet: 1 + 2 + 3. + Style attr: 4. + Properties: 5.

+ + + diff --git a/layout/style/test/test_bug418986-2.html b/layout/style/test/test_bug418986-2.html new file mode 100644 index 0000000000..04443a3553 --- /dev/null +++ b/layout/style/test/test_bug418986-2.html @@ -0,0 +1,32 @@ + + + + + + Test 2/3 for Bug #418986: Resist fingerprinting by preventing exposure of screen and system info + + + + + + + +Bug 418986 +

TEST

+ +

+
+
+ + diff --git a/layout/style/test/test_bug437915.html b/layout/style/test/test_bug437915.html new file mode 100644 index 0000000000..fb6830dd57 --- /dev/null +++ b/layout/style/test/test_bug437915.html @@ -0,0 +1,70 @@ + + + + + Test for Bug 437915 + + + + + +Mozilla Bug 437915 +

+ +
+
+
+ + + diff --git a/layout/style/test/test_bug450191.html b/layout/style/test/test_bug450191.html new file mode 100644 index 0000000000..91488e9496 --- /dev/null +++ b/layout/style/test/test_bug450191.html @@ -0,0 +1,64 @@ + + + + + Test for Bug 450191 + + + + +Mozilla Bug 450191 + +
+
+
+ + diff --git a/layout/style/test/test_bug470769.html b/layout/style/test/test_bug470769.html new file mode 100644 index 0000000000..589cf790b0 --- /dev/null +++ b/layout/style/test/test_bug470769.html @@ -0,0 +1,31 @@ + + + + + Test for Bug 470769 + + + + +Mozilla Bug 470769 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug499655.html b/layout/style/test/test_bug499655.html new file mode 100644 index 0000000000..37ad553206 --- /dev/null +++ b/layout/style/test/test_bug499655.html @@ -0,0 +1,45 @@ + + + + Test for Bug 499655 + + + + +Mozilla Bug 499655 +

+
+
+
+
+
+ + diff --git a/layout/style/test/test_bug499655.xhtml b/layout/style/test/test_bug499655.xhtml new file mode 100644 index 0000000000..b398d33967 --- /dev/null +++ b/layout/style/test/test_bug499655.xhtml @@ -0,0 +1,48 @@ + + + + Test for Bug 499655 + + + + +Mozilla Bug 499655 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug517224.html b/layout/style/test/test_bug517224.html new file mode 100644 index 0000000000..83d2bb8d80 --- /dev/null +++ b/layout/style/test/test_bug517224.html @@ -0,0 +1,45 @@ + + + + + Test for Bug 517224 + + + + + + +Mozilla Bug 517224 +

Element with overridden background

+
+
+
+ + diff --git a/layout/style/test/test_bug524175.html b/layout/style/test/test_bug524175.html new file mode 100644 index 0000000000..5a57b61ba2 --- /dev/null +++ b/layout/style/test/test_bug524175.html @@ -0,0 +1,28 @@ + + + + + Test for Bug 524175 + + + + + +Mozilla Bug 524175 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug525952.html b/layout/style/test/test_bug525952.html new file mode 100644 index 0000000000..d3ad02419d --- /dev/null +++ b/layout/style/test/test_bug525952.html @@ -0,0 +1,46 @@ + + + + + Test for Bug 525952 + + + + +Mozilla Bug 525952 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug534804.html b/layout/style/test/test_bug534804.html new file mode 100644 index 0000000000..0b60e6d89c --- /dev/null +++ b/layout/style/test/test_bug534804.html @@ -0,0 +1,89 @@ + + + + + Test for Bug 534804 + + + + + + +Mozilla Bug 534804 +

+
+
+
+ + diff --git a/layout/style/test/test_bug573255.html b/layout/style/test/test_bug573255.html new file mode 100644 index 0000000000..182087e1ec --- /dev/null +++ b/layout/style/test/test_bug573255.html @@ -0,0 +1,32 @@ + + + + + Test for Bug 573255 + + + + + +Mozilla Bug 573255 +

+
+
+
+ + diff --git a/layout/style/test/test_bug580685.html b/layout/style/test/test_bug580685.html new file mode 100644 index 0000000000..e54dfc2d7f --- /dev/null +++ b/layout/style/test/test_bug580685.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 580685 + + + + +Mozilla Bug 580685 +

+ +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug621351.html b/layout/style/test/test_bug621351.html new file mode 100644 index 0000000000..6a6d373afc --- /dev/null +++ b/layout/style/test/test_bug621351.html @@ -0,0 +1,35 @@ + + +Test for Bug 160403 + + + + + diff --git a/layout/style/test/test_bug635286.html b/layout/style/test/test_bug635286.html new file mode 100644 index 0000000000..80ea5a98ef --- /dev/null +++ b/layout/style/test/test_bug635286.html @@ -0,0 +1,52 @@ + + + + + Test for Bug 635286 + + + + + + +Mozilla Bug 635286 +
case1, :-moz-any()
+
case2, :not()
+
case3, :not() in :-moz-any()
+
case4, :-moz-any() in :not()
+
+
+
+ + diff --git a/layout/style/test/test_bug645998.html b/layout/style/test/test_bug645998.html new file mode 100644 index 0000000000..ed8feccf7d --- /dev/null +++ b/layout/style/test/test_bug645998.html @@ -0,0 +1,29 @@ + + + + + Test for Bug 645998 + + + + + + + +Mozilla Bug 645998 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug652486.html b/layout/style/test/test_bug652486.html new file mode 100644 index 0000000000..cdee3f33a7 --- /dev/null +++ b/layout/style/test/test_bug652486.html @@ -0,0 +1,192 @@ + + + + + Test for Bug 652486, Bug 1039488 and Bug 1574222 + + + + +Mozilla Bug 652486 +Mozilla Bug 1039488 +Mozilla Bug 1574222 + +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug657143.html b/layout/style/test/test_bug657143.html new file mode 100644 index 0000000000..de8a1961d4 --- /dev/null +++ b/layout/style/test/test_bug657143.html @@ -0,0 +1,120 @@ + + + + + Test for Bug 657143 + + + + + +Mozilla Bug 657143 +

+ + +
+
+
+ + diff --git a/layout/style/test/test_bug667520.html b/layout/style/test/test_bug667520.html new file mode 100644 index 0000000000..fb46943e8e --- /dev/null +++ b/layout/style/test/test_bug667520.html @@ -0,0 +1,50 @@ + + + + + Test for Bug 667520 + + + + +Mozilla Bug 667520 +

+ + + + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug716226.html b/layout/style/test/test_bug716226.html new file mode 100644 index 0000000000..ed538cd822 --- /dev/null +++ b/layout/style/test/test_bug716226.html @@ -0,0 +1,52 @@ + + + + + + Test for Bug 716226 + + + + + +Mozilla Bug 716226 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug732153.html b/layout/style/test/test_bug732153.html new file mode 100644 index 0000000000..03591e3dc6 --- /dev/null +++ b/layout/style/test/test_bug732153.html @@ -0,0 +1,22 @@ + + +Test for Bug 732153 + + +Mozilla Bug 732153 +
+ diff --git a/layout/style/test/test_bug732209.html b/layout/style/test/test_bug732209.html new file mode 100644 index 0000000000..1bf5825000 --- /dev/null +++ b/layout/style/test/test_bug732209.html @@ -0,0 +1,95 @@ + + + + + + Test for Bug 732209 + + + + + + + + + + + + + + + + + +Mozilla Bug 732209 +

+ +
+
+
+ + diff --git a/layout/style/test/test_bug73586.html b/layout/style/test/test_bug73586.html new file mode 100644 index 0000000000..6a95703cd7 --- /dev/null +++ b/layout/style/test/test_bug73586.html @@ -0,0 +1,189 @@ + + + + + Test for Bug 73586 + + + + + +Mozilla Bug 73586 +
+ + +
+
+
+ + diff --git a/layout/style/test/test_bug74880.html b/layout/style/test/test_bug74880.html new file mode 100644 index 0000000000..054189056b --- /dev/null +++ b/layout/style/test/test_bug74880.html @@ -0,0 +1,119 @@ + + + + + Test for Bug 74880 + + + + + +Mozilla Bug 74880 +
+

+
+ +
+
+
+ + + diff --git a/layout/style/test/test_bug765590.html b/layout/style/test/test_bug765590.html new file mode 100644 index 0000000000..acc9f5b5c0 --- /dev/null +++ b/layout/style/test/test_bug765590.html @@ -0,0 +1,21 @@ + + + + + Test for Bug 765590 + + + + + + + diff --git a/layout/style/test/test_bug771043.html b/layout/style/test/test_bug771043.html new file mode 100644 index 0000000000..a5073d681e --- /dev/null +++ b/layout/style/test/test_bug771043.html @@ -0,0 +1,69 @@ + + + + + + Test for Bug 771043 + + + + + +Mozilla Bug 771043 + +

+

+ +
+
+
+ + diff --git a/layout/style/test/test_bug798843_pref.html b/layout/style/test/test_bug798843_pref.html new file mode 100644 index 0000000000..aea12ccc35 --- /dev/null +++ b/layout/style/test/test_bug798843_pref.html @@ -0,0 +1,53 @@ + + + + + Test that SVG glyph context-* values can be pref'ed off + + + + + + + + diff --git a/layout/style/test/test_bug829816.html b/layout/style/test/test_bug829816.html new file mode 100644 index 0000000000..a4614cf6eb --- /dev/null +++ b/layout/style/test/test_bug829816.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 829816 + + + + + + + + + + + +Mozilla Bug 829816 +

+ +
+
+ + diff --git a/layout/style/test/test_bug874919.html b/layout/style/test/test_bug874919.html new file mode 100644 index 0000000000..be480600b9 --- /dev/null +++ b/layout/style/test/test_bug874919.html @@ -0,0 +1,55 @@ + + + + + Test for Bug 874919 + + + + + +Mozilla Bug 874919 +

+
+ + + + + + +
+
+
+
+
+ + diff --git a/layout/style/test/test_bug887741_at-rules_in_declaration_lists.html b/layout/style/test/test_bug887741_at-rules_in_declaration_lists.html new file mode 100644 index 0000000000..739ace0f04 --- /dev/null +++ b/layout/style/test/test_bug887741_at-rules_in_declaration_lists.html @@ -0,0 +1,75 @@ + + + + + + Test for Bug 887741: at-rules in declaration lists + + + + + + +Mozilla Bug 887741 +

+ +
+  
+
+ + diff --git a/layout/style/test/test_bug892929.html b/layout/style/test/test_bug892929.html new file mode 100644 index 0000000000..a67db56ee3 --- /dev/null +++ b/layout/style/test/test_bug892929.html @@ -0,0 +1,74 @@ + + + + + Bug 892929 test + + + + + + + + +
+

+
+
+
+
diff --git a/layout/style/test/test_bug98997.html b/layout/style/test/test_bug98997.html
new file mode 100644
index 0000000000..5dc325f9ef
--- /dev/null
+++ b/layout/style/test/test_bug98997.html
@@ -0,0 +1,144 @@
+
+
+
+
+  Test for Bug 98997
+  
+  
+  
+
+
+Mozilla Bug 98997
+
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+ + diff --git a/layout/style/test/test_cascade.html b/layout/style/test/test_cascade.html new file mode 100644 index 0000000000..6479d52617 --- /dev/null +++ b/layout/style/test/test_cascade.html @@ -0,0 +1,91 @@ + + + + + + Test for Author style sheet aspects of CSS cascading + + + + + +Mozilla Bug +
+
+
+
+ + + diff --git a/layout/style/test/test_ch_ex_no_infloops.html b/layout/style/test/test_ch_ex_no_infloops.html new file mode 100644 index 0000000000..db9eda20df --- /dev/null +++ b/layout/style/test/test_ch_ex_no_infloops.html @@ -0,0 +1,60 @@ + + + + + Test for Bug 678671 + + + + + +Mozilla Bug 678671 +

+
+ +
+ + diff --git a/layout/style/test/test_change_hint_optimizations.html b/layout/style/test/test_change_hint_optimizations.html new file mode 100644 index 0000000000..82e149154c --- /dev/null +++ b/layout/style/test/test_change_hint_optimizations.html @@ -0,0 +1,57 @@ + + + + + Test for style change hint optimizations + + + + + + + +
+
+ + diff --git a/layout/style/test/test_clip-path_polygon.html b/layout/style/test/test_clip-path_polygon.html new file mode 100644 index 0000000000..3c77103ba2 --- /dev/null +++ b/layout/style/test/test_clip-path_polygon.html @@ -0,0 +1,40 @@ + + + + +clip-path with polygon() hit test + + + +
+

+ + diff --git a/layout/style/test/test_color_rounding.html b/layout/style/test/test_color_rounding.html new file mode 100644 index 0000000000..46698ede3d --- /dev/null +++ b/layout/style/test/test_color_rounding.html @@ -0,0 +1,38 @@ + + + + + Test rounding of CSS color valus + + + + + + +

+ + + diff --git a/layout/style/test/test_compute_data_with_start_struct.html b/layout/style/test/test_compute_data_with_start_struct.html new file mode 100644 index 0000000000..6970270c95 --- /dev/null +++ b/layout/style/test/test_compute_data_with_start_struct.html @@ -0,0 +1,87 @@ + + + + Test for correct handling of aStartStruct parameter to nsRuleNode::Compute*Data + + + + + + +Mozilla Bug 216456 +

+ + +

+ +
+
+
+ + diff --git a/layout/style/test/test_computed_style.html b/layout/style/test/test_computed_style.html new file mode 100644 index 0000000000..c2dc667f2f --- /dev/null +++ b/layout/style/test/test_computed_style.html @@ -0,0 +1,664 @@ + + + + Test for miscellaneous computed style issues + + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_computed_style_bfcache_display_none.html b/layout/style/test/test_computed_style_bfcache_display_none.html new file mode 100644 index 0000000000..8322e4977a --- /dev/null +++ b/layout/style/test/test_computed_style_bfcache_display_none.html @@ -0,0 +1,60 @@ + +Test for getting the computed style on the root node of a display:none subtree in a document in the bfcache + + +Mozilla Bug 1377010 +

+ diff --git a/layout/style/test/test_computed_style_difference.html b/layout/style/test/test_computed_style_difference.html new file mode 100644 index 0000000000..f4008ff476 --- /dev/null +++ b/layout/style/test/test_computed_style_difference.html @@ -0,0 +1,104 @@ + +Test that the difference of the computed style of an element is always correctly propagated + + + + +
+
+
+ diff --git a/layout/style/test/test_computed_style_grid_with_pseudo.html b/layout/style/test/test_computed_style_grid_with_pseudo.html new file mode 100644 index 0000000000..24eb520776 --- /dev/null +++ b/layout/style/test/test_computed_style_grid_with_pseudo.html @@ -0,0 +1,91 @@ + + + + +Test for Bug 1350780 + + + + + + + + +
+Mozilla Bug 1350780 + + diff --git a/layout/style/test/test_computed_style_in_created_document.html b/layout/style/test/test_computed_style_in_created_document.html new file mode 100644 index 0000000000..72ff0f5921 --- /dev/null +++ b/layout/style/test/test_computed_style_in_created_document.html @@ -0,0 +1,52 @@ + + + + Test for bug 1398619 + + + + + + + diff --git a/layout/style/test/test_computed_style_min_size_auto.html b/layout/style/test/test_computed_style_min_size_auto.html new file mode 100644 index 0000000000..12b4e48b46 --- /dev/null +++ b/layout/style/test/test_computed_style_min_size_auto.html @@ -0,0 +1,129 @@ + + + + + + Test behavior of 'min-height:auto' and 'min-width:auto' (Bug 763689 and Bug 1304636) + + + + +Mozilla Bug 763689 +Mozilla Bug 1304636 + +
+
abc
+ +
+
abc
+
def
+
+ +
+
abc
+
def
+
+ +
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_computed_style_no_flush.html b/layout/style/test/test_computed_style_no_flush.html new file mode 100644 index 0000000000..2caea9d294 --- /dev/null +++ b/layout/style/test/test_computed_style_no_flush.html @@ -0,0 +1,63 @@ + + + + Test for bug 1363805: We only restyle as little as needed + + + + +
+
+
+
+
+
+
+
+ diff --git a/layout/style/test/test_computed_style_no_pseudo.html b/layout/style/test/test_computed_style_no_pseudo.html new file mode 100644 index 0000000000..efb0dda7b4 --- /dev/null +++ b/layout/style/test/test_computed_style_no_pseudo.html @@ -0,0 +1,53 @@ + + + + + Test for Bug 505515 + + + + + +Mozilla Bug 505515 +

This is some text in which the first line is in a different color.

+
+
+
+ + diff --git a/layout/style/test/test_computed_style_prefs.html b/layout/style/test/test_computed_style_prefs.html new file mode 100644 index 0000000000..0f297477d6 --- /dev/null +++ b/layout/style/test/test_computed_style_prefs.html @@ -0,0 +1,94 @@ + + + + Test that preffed off properties do not appear in computed style + + + + +Mozilla Bug 919594 +

+ +
+
+
+ + diff --git a/layout/style/test/test_condition_text.html b/layout/style/test/test_condition_text.html new file mode 100644 index 0000000000..e2462979c2 --- /dev/null +++ b/layout/style/test/test_condition_text.html @@ -0,0 +1,74 @@ + + + + + Test for Bug 814907 + + + + + +Mozilla Bug 814907 +

+ +
+
+
+ + diff --git a/layout/style/test/test_constructable_stylesheets_chrome_only_rules_in_content.html b/layout/style/test/test_constructable_stylesheets_chrome_only_rules_in_content.html new file mode 100644 index 0000000000..6d80b2bb7b --- /dev/null +++ b/layout/style/test/test_constructable_stylesheets_chrome_only_rules_in_content.html @@ -0,0 +1,17 @@ + + +Test for chrome-only rules in constructable stylesheets (in content) + + diff --git a/layout/style/test/test_counter_descriptor_storage.html b/layout/style/test/test_counter_descriptor_storage.html new file mode 100644 index 0000000000..bb91b6d12c --- /dev/null +++ b/layout/style/test/test_counter_descriptor_storage.html @@ -0,0 +1,268 @@ + + + + Test for parsing, storage and serialization of CSS @counter-style descriptor values + + + + +Mozilla Bug 966166 +
+
+
+
+ + diff --git a/layout/style/test/test_counter_style.html b/layout/style/test/test_counter_style.html new file mode 100644 index 0000000000..58f5763451 --- /dev/null +++ b/layout/style/test/test_counter_style.html @@ -0,0 +1,121 @@ + + + + + Test for css3-counter-style (Bug 966166) + + + + + + +Mozilla Bug 966166 +
+

+

+

+

+
+
+
+ + diff --git a/layout/style/test/test_crash_with_content_policy.html b/layout/style/test/test_crash_with_content_policy.html new file mode 100644 index 0000000000..9acec58243 --- /dev/null +++ b/layout/style/test/test_crash_with_content_policy.html @@ -0,0 +1,75 @@ + + + + Crashtests for style system with content policy + + + + + + + + diff --git a/layout/style/test/test_css_cross_domain.html b/layout/style/test/test_css_cross_domain.html new file mode 100644 index 0000000000..8541c9c5ce --- /dev/null +++ b/layout/style/test/test_css_cross_domain.html @@ -0,0 +1,158 @@ + + + + + Test cross-domain CSS loading + + + + + +Mozilla + Bug 524223 + +
+ +
+

 

+
  1. text/css
    1. same origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    2. +
    3. cross origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    4. +
    5. same to cross
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    6. +
    7. cross to same
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
  2. +
  3. text/html
    1. same origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    2. +
    3. cross origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    4. +
    5. same to cross
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    6. +
    7. cross to same
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
  4. +
+
+ +
+

Quirks

+
+
+ +
+

Standards

+
+
+ + + + diff --git a/layout/style/test/test_css_cross_domain_no_orb.html b/layout/style/test/test_css_cross_domain_no_orb.html new file mode 100644 index 0000000000..27ede793be --- /dev/null +++ b/layout/style/test/test_css_cross_domain_no_orb.html @@ -0,0 +1,147 @@ + + + + + Test cross-domain CSS loading + + + + + +Mozilla + Bug 524223 + +
+ +
+

 

+
  1. text/css
    1. same origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    2. +
    3. cross origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    4. +
    5. same to cross
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    6. +
    7. cross to same
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
  2. +
  3. text/html
    1. same origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    2. +
    3. cross origin
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    4. +
    5. same to cross
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
    6. +
    7. cross to same
      1. valid
      2. +
      3. malformed
      4. +
      5. http error
  4. +
+
+ +
+

Quirks

+
+
+ +
+

Standards

+
+
+ + + + diff --git a/layout/style/test/test_css_eof_handling.html b/layout/style/test/test_css_eof_handling.html new file mode 100644 index 0000000000..099ca4c752 --- /dev/null +++ b/layout/style/test/test_css_eof_handling.html @@ -0,0 +1,268 @@ + + + + Test for CSS EOF handling + + + + +

bug 311616, +bug 325064

+ +

+
+
+
+ + diff --git a/layout/style/test/test_css_escape_api.html b/layout/style/test/test_css_escape_api.html new file mode 100644 index 0000000000..2bcc094be1 --- /dev/null +++ b/layout/style/test/test_css_escape_api.html @@ -0,0 +1,94 @@ + + + + + + Test for Bug 955860 + + + + + +Mozilla Bug 955860 +

+ +
+
+
+ + diff --git a/layout/style/test/test_css_function_mismatched_parenthesis.html b/layout/style/test/test_css_function_mismatched_parenthesis.html new file mode 100644 index 0000000000..e7e78cc545 --- /dev/null +++ b/layout/style/test/test_css_function_mismatched_parenthesis.html @@ -0,0 +1,63 @@ + + + + + Test for Bug 897094 + + + + + +Mozilla Bug 897094 +

+ +
+
+
+ + diff --git a/layout/style/test/test_css_loader_crossorigin_data_url.html b/layout/style/test/test_css_loader_crossorigin_data_url.html new file mode 100644 index 0000000000..67105d61f0 --- /dev/null +++ b/layout/style/test/test_css_loader_crossorigin_data_url.html @@ -0,0 +1,17 @@ + + +Test for handling of 'crossorigin' attribute on CSS link with data: URL + + + +
+
+ diff --git a/layout/style/test/test_css_parse_error_smoketest.html b/layout/style/test/test_css_parse_error_smoketest.html new file mode 100644 index 0000000000..96d8edce3a --- /dev/null +++ b/layout/style/test/test_css_parse_error_smoketest.html @@ -0,0 +1,160 @@ + + + + + Test for CSS parser reporting parsing errors with expected precision + + + + + + diff --git a/layout/style/test/test_css_supports.html b/layout/style/test/test_css_supports.html new file mode 100644 index 0000000000..a6b1e8d303 --- /dev/null +++ b/layout/style/test/test_css_supports.html @@ -0,0 +1,134 @@ + + + + + Test for Bug 779917 + + + + +Mozilla Bug 779917 +

+ +
+
+
+ + diff --git a/layout/style/test/test_css_supports_variables.html b/layout/style/test/test_css_supports_variables.html new file mode 100644 index 0000000000..7efc14a4fc --- /dev/null +++ b/layout/style/test/test_css_supports_variables.html @@ -0,0 +1,247 @@ + + + + + Test for Bug 773296 + + + + +Mozilla Bug 773296 +

+ +
+
+
+ + diff --git a/layout/style/test/test_cue_restrictions.html b/layout/style/test/test_cue_restrictions.html new file mode 100644 index 0000000000..c5b3cf3bda --- /dev/null +++ b/layout/style/test/test_cue_restrictions.html @@ -0,0 +1,34 @@ + + +Test for ::cue property restrictions. + + + + + + + diff --git a/layout/style/test/test_custom_content_inheritance.html b/layout/style/test/test_custom_content_inheritance.html new file mode 100644 index 0000000000..625f1ad9c3 --- /dev/null +++ b/layout/style/test/test_custom_content_inheritance.html @@ -0,0 +1,24 @@ + +Test for custom content inheritance + + + diff --git a/layout/style/test/test_default_bidi_css.html b/layout/style/test/test_default_bidi_css.html new file mode 100644 index 0000000000..9033c9b6a7 --- /dev/null +++ b/layout/style/test/test_default_bidi_css.html @@ -0,0 +1,80 @@ + + + + + Test for Bug + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_default_computed_style.html b/layout/style/test/test_default_computed_style.html new file mode 100644 index 0000000000..56b5863935 --- /dev/null +++ b/layout/style/test/test_default_computed_style.html @@ -0,0 +1,58 @@ + + + + + + Test for Bug 800983 + + + + + +Mozilla Bug 800983 +

+ +
+
+
+ + diff --git a/layout/style/test/test_descriptor_storage.html b/layout/style/test/test_descriptor_storage.html new file mode 100644 index 0000000000..27750a2bad --- /dev/null +++ b/layout/style/test/test_descriptor_storage.html @@ -0,0 +1,118 @@ + + + + + Test for parsing, storage, and serialization of CSS @font-face descriptor values + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_descriptor_syntax_errors.html b/layout/style/test/test_descriptor_syntax_errors.html new file mode 100644 index 0000000000..bf73b15b64 --- /dev/null +++ b/layout/style/test/test_descriptor_syntax_errors.html @@ -0,0 +1,53 @@ + + + + + Test that we reject syntax errors listed in descriptor_database.js + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_display_mode.html b/layout/style/test/test_display_mode.html new file mode 100644 index 0000000000..2fbf78bdb4 --- /dev/null +++ b/layout/style/test/test_display_mode.html @@ -0,0 +1,70 @@ + + + + + Test for displayMode + + + + + +

+ +

+
+
+
+ + diff --git a/layout/style/test/test_dont_use_document_colors.html b/layout/style/test/test_dont_use_document_colors.html new file mode 100644 index 0000000000..71fc48278d --- /dev/null +++ b/layout/style/test/test_dont_use_document_colors.html @@ -0,0 +1,201 @@ + + + + + Test for preference not to use document colors + + + + + +Mozilla Bug 58048 +Mozilla Bug 255411 +Mozilla Bug 1430969 +
+ +
Hello
+
Hello
+ + +
Hello
+
Hello
+
Hello
+
I have a border-image
+
I do not have a border-image
+ + + + +
+
+
+
+ + diff --git a/layout/style/test/test_dont_use_document_fonts.html b/layout/style/test/test_dont_use_document_fonts.html new file mode 100644 index 0000000000..59bc6c6d62 --- /dev/null +++ b/layout/style/test/test_dont_use_document_fonts.html @@ -0,0 +1,116 @@ + +Test for preference to not use document fonts + + + +
+ diff --git a/layout/style/test/test_dynamic_change_causing_reflow.html b/layout/style/test/test_dynamic_change_causing_reflow.html new file mode 100644 index 0000000000..7a000c87a6 --- /dev/null +++ b/layout/style/test/test_dynamic_change_causing_reflow.html @@ -0,0 +1,1014 @@ + + + + + + Test for Bug 1131371 + + + + +Mozilla Bug 1131371 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_exposed_prop_accessors.html b/layout/style/test/test_exposed_prop_accessors.html new file mode 100644 index 0000000000..765818bae4 --- /dev/null +++ b/layout/style/test/test_exposed_prop_accessors.html @@ -0,0 +1,41 @@ + + + + + Test for cloning of CSS property values (including 'inherit', 'initial' and 'unset') + + + + + +

+
+
+
+ + diff --git a/layout/style/test/test_extra_inherit_initial.html b/layout/style/test/test_extra_inherit_initial.html new file mode 100644 index 0000000000..34c63b3626 --- /dev/null +++ b/layout/style/test/test_extra_inherit_initial.html @@ -0,0 +1,109 @@ + + + + + Test handling extra inherit/initial/unset in CSS declarations (Bug 940229) + + + + + +Mozilla Bug 940229 +

+ +
+
+
+ + diff --git a/layout/style/test/test_first_letter_restrictions.html b/layout/style/test/test_first_letter_restrictions.html new file mode 100644 index 0000000000..99aaba8b93 --- /dev/null +++ b/layout/style/test/test_first_letter_restrictions.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 1382786 + + + + + + +Mozilla Bug 1382786 +

+ +
+
+ + + diff --git a/layout/style/test/test_first_line_restrictions.html b/layout/style/test/test_first_line_restrictions.html new file mode 100644 index 0000000000..bb8e116e8b --- /dev/null +++ b/layout/style/test/test_first_line_restrictions.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 1382786 + + + + + + +Mozilla Bug 1382786 +

+ +
+
+ + + diff --git a/layout/style/test/test_flexbox_child_display_values.xhtml b/layout/style/test/test_flexbox_child_display_values.xhtml new file mode 100644 index 0000000000..7ba870c69f --- /dev/null +++ b/layout/style/test/test_flexbox_child_display_values.xhtml @@ -0,0 +1,178 @@ + + + + + Test "display" values of content in a flex container (Bug 783415) + + + + +Mozilla Bug 783415 +
+
+
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_flex_grow_and_shrink.html b/layout/style/test/test_flexbox_flex_grow_and_shrink.html new file mode 100644 index 0000000000..fc5090fd61 --- /dev/null +++ b/layout/style/test/test_flexbox_flex_grow_and_shrink.html @@ -0,0 +1,154 @@ + + + + + + Test for flex-grow and flex-shrink animation (Bug 696253) + + + + + + +Mozilla Bug 696253 +
+
+
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_flex_shorthand.html b/layout/style/test/test_flexbox_flex_shorthand.html new file mode 100644 index 0000000000..b8416403b6 --- /dev/null +++ b/layout/style/test/test_flexbox_flex_shorthand.html @@ -0,0 +1,280 @@ + + + + + + Test for Bug 696253 + + + + + +Mozilla Bug 696253 +
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_focus_order.html b/layout/style/test/test_flexbox_focus_order.html new file mode 100644 index 0000000000..0c1f023e3c --- /dev/null +++ b/layout/style/test/test_flexbox_focus_order.html @@ -0,0 +1,83 @@ + + + + + Test for Bug 812687: focus order of reordered flex items + + + + + + +Mozilla Bug 812687 +

+ Link before container + +

+ 1 + + + + 5 +
+

+ + +
+
+
+ + diff --git a/layout/style/test/test_flexbox_layout.html b/layout/style/test/test_flexbox_layout.html new file mode 100644 index 0000000000..49ee287aa2 --- /dev/null +++ b/layout/style/test/test_flexbox_layout.html @@ -0,0 +1,184 @@ + + + + + + Test for Bug 666041 + + + + + + +Mozilla Bug 666041 +
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_order.html b/layout/style/test/test_flexbox_order.html new file mode 100644 index 0000000000..64b5431da8 --- /dev/null +++ b/layout/style/test/test_flexbox_order.html @@ -0,0 +1,194 @@ + + + + + + Test for Bug 666041 + + + + + + +Mozilla Bug 666041 +
+ + +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_order_abspos.html b/layout/style/test/test_flexbox_order_abspos.html new file mode 100644 index 0000000000..bf4c99aa76 --- /dev/null +++ b/layout/style/test/test_flexbox_order_abspos.html @@ -0,0 +1,217 @@ + + + + + + Test for Bug 1345873 + + + + + + +Mozilla Bug 1345873 +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_order_table.html b/layout/style/test/test_flexbox_order_table.html new file mode 100644 index 0000000000..2423d5d6d6 --- /dev/null +++ b/layout/style/test/test_flexbox_order_table.html @@ -0,0 +1,198 @@ + + + + + + Test for Bug 799775 + + + + + + +Mozilla Bug 799775 +
+ + +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+ + diff --git a/layout/style/test/test_flexbox_reflow_counts.html b/layout/style/test/test_flexbox_reflow_counts.html new file mode 100644 index 0000000000..a8f4913f7d --- /dev/null +++ b/layout/style/test/test_flexbox_reflow_counts.html @@ -0,0 +1,199 @@ + + + + + + Test for Bug 1142686 + + + + + +Mozilla Bug 1142686 +
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_flushing_frame.html b/layout/style/test/test_flushing_frame.html new file mode 100644 index 0000000000..fa6d751647 --- /dev/null +++ b/layout/style/test/test_flushing_frame.html @@ -0,0 +1,40 @@ + + + + Test for bug 1545516: We don't flush layout unnecessarily on the parent + document when the frame is already disconnected. + + + +
+ diff --git a/layout/style/test/test_font_face_cascade.html b/layout/style/test/test_font_face_cascade.html new file mode 100644 index 0000000000..0d98f9d606 --- /dev/null +++ b/layout/style/test/test_font_face_cascade.html @@ -0,0 +1,35 @@ + +Test that @font-face rules from different origins cascade correctly + + + diff --git a/layout/style/test/test_font_face_parser.html b/layout/style/test/test_font_face_parser.html new file mode 100644 index 0000000000..448db4ff14 --- /dev/null +++ b/layout/style/test/test_font_face_parser.html @@ -0,0 +1,386 @@ + + + + + Test of @font-face parser + + + + +

@font-face parsing (bug 441469)

+

+
+
+
+
diff --git a/layout/style/test/test_font_family_parsing.html b/layout/style/test/test_font_family_parsing.html
new file mode 100644
index 0000000000..59bedc0b94
--- /dev/null
+++ b/layout/style/test/test_font_family_parsing.html
@@ -0,0 +1,272 @@
+
+
+
+  
+  Font family name parsing tests
+  
+  
+  
+  
+  
+  
+  
+
+
+
+

+
+
+
+
+
diff --git a/layout/style/test/test_font_family_serialization.html b/layout/style/test/test_font_family_serialization.html
new file mode 100644
index 0000000000..ad922158f5
--- /dev/null
+++ b/layout/style/test/test_font_family_serialization.html
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+ diff --git a/layout/style/test/test_font_loading_api.html b/layout/style/test/test_font_loading_api.html new file mode 100644 index 0000000000..7b2a0d9e1b --- /dev/null +++ b/layout/style/test/test_font_loading_api.html @@ -0,0 +1,1895 @@ + + +Test for the CSS Font Loading API + + + + + + + + + + + + +
diff --git a/layout/style/test/test_garbage_at_end_of_declarations.html b/layout/style/test/test_garbage_at_end_of_declarations.html new file mode 100644 index 0000000000..95882d1591 --- /dev/null +++ b/layout/style/test/test_garbage_at_end_of_declarations.html @@ -0,0 +1,156 @@ + + + + + Test handling of garbage at the end of CSS declarations + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_grid_computed_values.html b/layout/style/test/test_grid_computed_values.html new file mode 100644 index 0000000000..68a183606c --- /dev/null +++ b/layout/style/test/test_grid_computed_values.html @@ -0,0 +1,113 @@ + + + + + Test computed grid values + + + + + + + + +
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/layout/style/test/test_grid_container_shorthands.html b/layout/style/test/test_grid_container_shorthands.html new file mode 100644 index 0000000000..1b7a434208 --- /dev/null +++ b/layout/style/test/test_grid_container_shorthands.html @@ -0,0 +1,271 @@ + + + + + Test parsing of grid container shorthands (grid-template, grid) + + + + + + + + + + diff --git a/layout/style/test/test_grid_item_shorthands.html b/layout/style/test/test_grid_item_shorthands.html new file mode 100644 index 0000000000..a50be6112d --- /dev/null +++ b/layout/style/test/test_grid_item_shorthands.html @@ -0,0 +1,153 @@ + + + + + Test parsing of grid item shorthands (grid-column, grid-row, grid-area) + + + + + + + + + + + diff --git a/layout/style/test/test_grid_shorthand_serialization.html b/layout/style/test/test_grid_shorthand_serialization.html new file mode 100644 index 0000000000..b2d32b9364 --- /dev/null +++ b/layout/style/test/test_grid_shorthand_serialization.html @@ -0,0 +1,221 @@ + + + + + Test serialization of CSS 'grid' shorthand property + + + + + + + + + + diff --git a/layout/style/test/test_group_insertRule.html b/layout/style/test/test_group_insertRule.html new file mode 100644 index 0000000000..85edc2a1a0 --- /dev/null +++ b/layout/style/test/test_group_insertRule.html @@ -0,0 +1,243 @@ + + + + CSS Variables Allowed Syntax + + + + + + + + + + +
+
+ + + + diff --git a/layout/style/test/test_hover_on_part.html b/layout/style/test/test_hover_on_part.html new file mode 100644 index 0000000000..fc39dcc307 --- /dev/null +++ b/layout/style/test/test_hover_on_part.html @@ -0,0 +1,52 @@ + +Shadow parts are invalidated correctly when only a pseudo-class state to the right of the part matches + + + +
+
+ diff --git a/layout/style/test/test_hover_quirk.html b/layout/style/test/test_hover_quirk.html new file mode 100644 index 0000000000..61e19f2a60 --- /dev/null +++ b/layout/style/test/test_hover_quirk.html @@ -0,0 +1,118 @@ + + + + + Test for the :active and :hover quirk + + + + + + + + Mozilla Bug 783213 +

+
+
+
+
+ Span
+
+ Link
+
Div

+
+

+
+
diff --git a/layout/style/test/test_html_attribute_computed_values.html b/layout/style/test/test_html_attribute_computed_values.html
new file mode 100644
index 0000000000..74e5b9754a
--- /dev/null
+++ b/layout/style/test/test_html_attribute_computed_values.html
@@ -0,0 +1,84 @@
+
+
+
+
+  Test for Bug 
+  
+  
+
+
+Mozilla Bug 
+
+
+
+
+ + diff --git a/layout/style/test/test_ident_escaping.html b/layout/style/test/test_ident_escaping.html new file mode 100644 index 0000000000..d727e7f207 --- /dev/null +++ b/layout/style/test/test_ident_escaping.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 543428 + + + + + + +Mozilla Bug 543428 +

+ +
+
+
+ + diff --git a/layout/style/test/test_img_src_causing_reflow.html b/layout/style/test/test_img_src_causing_reflow.html new file mode 100644 index 0000000000..e63b39f9fe --- /dev/null +++ b/layout/style/test/test_img_src_causing_reflow.html @@ -0,0 +1,36 @@ + + +Test for bug 1787072 + + + + diff --git a/layout/style/test/test_import_preload.html b/layout/style/test/test_import_preload.html new file mode 100644 index 0000000000..1c095c9768 --- /dev/null +++ b/layout/style/test/test_import_preload.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/layout/style/test/test_inherit_computation.html b/layout/style/test/test_inherit_computation.html new file mode 100644 index 0000000000..9ac056518c --- /dev/null +++ b/layout/style/test/test_inherit_computation.html @@ -0,0 +1,176 @@ + + + + + Test for computation of CSS 'inherit' on all properties and 'unset' on inherited properties + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_inherit_storage.html b/layout/style/test/test_inherit_storage.html new file mode 100644 index 0000000000..a9587d34d9 --- /dev/null +++ b/layout/style/test/test_inherit_storage.html @@ -0,0 +1,120 @@ + + + + + Test for parsing, storage, and serialization of CSS 'inherit' on all properties and 'unset' on inherited properties + + + + + +Mozilla Bug 375363 +

+ +
+
+
+ + diff --git a/layout/style/test/test_initial_computation.html b/layout/style/test/test_initial_computation.html new file mode 100644 index 0000000000..c8a36af227 --- /dev/null +++ b/layout/style/test/test_initial_computation.html @@ -0,0 +1,159 @@ + + + + + Test for computation of CSS 'initial' on all properties and 'unset' on reset properties + + + + + + + + +

+ + +

+ +
+
+
+ + diff --git a/layout/style/test/test_initial_storage.html b/layout/style/test/test_initial_storage.html new file mode 100644 index 0000000000..a1a081c5a6 --- /dev/null +++ b/layout/style/test/test_initial_storage.html @@ -0,0 +1,134 @@ + + + + + Test for parsing, storage, and serialization of CSS 'initial' on all properties and 'unset' on reset properties + + + + + +Mozilla Bug 375363 +

+ +
+
+
+ + diff --git a/layout/style/test/test_invalidation_basic.html b/layout/style/test/test_invalidation_basic.html new file mode 100644 index 0000000000..b5a6928405 --- /dev/null +++ b/layout/style/test/test_invalidation_basic.html @@ -0,0 +1,45 @@ + + + + Test for bug 1368240: We only invalidate style as little as needed + + + + +
+
+
+
+
+
+
+ diff --git a/layout/style/test/test_keyframes_rules.html b/layout/style/test/test_keyframes_rules.html new file mode 100644 index 0000000000..027a406009 --- /dev/null +++ b/layout/style/test/test_keyframes_rules.html @@ -0,0 +1,134 @@ + + + + + Test for Bug 577974 + + + + + +Mozilla Bug 577974 +

+ +
+
+
+ + diff --git a/layout/style/test/test_keyframes_vendor_prefix.html b/layout/style/test/test_keyframes_vendor_prefix.html new file mode 100644 index 0000000000..4463bd259a --- /dev/null +++ b/layout/style/test/test_keyframes_vendor_prefix.html @@ -0,0 +1,167 @@ + + + +Test for interaction between prefixed and non-prefixed @keyframes rules with +the same name + + + +
+ diff --git a/layout/style/test/test_load_events_on_stylesheets.html b/layout/style/test/test_load_events_on_stylesheets.html new file mode 100644 index 0000000000..7344e27b22 --- /dev/null +++ b/layout/style/test/test_load_events_on_stylesheets.html @@ -0,0 +1,176 @@ + + + + + Test for Bug 185236 + + + + + + +Mozilla Bug 185236 +

+ +
+
+
+ + diff --git a/layout/style/test/test_logical_properties.html b/layout/style/test/test_logical_properties.html new file mode 100644 index 0000000000..a6947791cb --- /dev/null +++ b/layout/style/test/test_logical_properties.html @@ -0,0 +1,422 @@ + + +Test for handling of logical and physical properties + + + + + + + +
+ + + diff --git a/layout/style/test/test_marker_restrictions.html b/layout/style/test/test_marker_restrictions.html new file mode 100644 index 0000000000..f547f928cb --- /dev/null +++ b/layout/style/test/test_marker_restrictions.html @@ -0,0 +1,35 @@ + + +Test for ::marker property restrictions. + + + + +
+
+ diff --git a/layout/style/test/test_mask_image_CORS.html b/layout/style/test/test_mask_image_CORS.html new file mode 100644 index 0000000000..8edd8af48e --- /dev/null +++ b/layout/style/test/test_mask_image_CORS.html @@ -0,0 +1,63 @@ + + + + +Test mask-image CORS anonymous retrieval + + + + + + + + + +

There should be a green square, but no red square.

+
+
+ + diff --git a/layout/style/test/test_media_queries.html b/layout/style/test/test_media_queries.html new file mode 100644 index 0000000000..441fc1105a --- /dev/null +++ b/layout/style/test/test_media_queries.html @@ -0,0 +1,867 @@ + + + + + Test for Bug 156716 + + + + + +Mozilla Bug 156716 + + +
+
+
+ + diff --git a/layout/style/test/test_media_queries_dynamic.html b/layout/style/test/test_media_queries_dynamic.html new file mode 100644 index 0000000000..52e5fda9ca --- /dev/null +++ b/layout/style/test/test_media_queries_dynamic.html @@ -0,0 +1,207 @@ + + + + + Test for Bug 473400 + + + + +Mozilla Bug 473400 + + +
+
+
+ + + diff --git a/layout/style/test/test_media_query_list.html b/layout/style/test/test_media_query_list.html new file mode 100644 index 0000000000..5f213117e5 --- /dev/null +++ b/layout/style/test/test_media_query_list.html @@ -0,0 +1,373 @@ + + + + + Test for MediaQueryList (Bug 542058) + + + + +Mozilla Bug 542058 + + +
+
+
+ + diff --git a/layout/style/test/test_media_query_serialization.html b/layout/style/test/test_media_query_serialization.html new file mode 100644 index 0000000000..ed82653db0 --- /dev/null +++ b/layout/style/test/test_media_query_serialization.html @@ -0,0 +1,53 @@ + + + +Test media query list serialization + + + + + + + + diff --git a/layout/style/test/test_moz_device_pixel_ratio.html b/layout/style/test/test_moz_device_pixel_ratio.html new file mode 100644 index 0000000000..0e3e143fe8 --- /dev/null +++ b/layout/style/test/test_moz_device_pixel_ratio.html @@ -0,0 +1,73 @@ + + + + + Test for Bug 474356 + + + + + + +Mozilla Bug 474356 + + +
+
+
+
+ +
+ + diff --git a/layout/style/test/test_moz_prefixed_cursor.html b/layout/style/test/test_moz_prefixed_cursor.html new file mode 100644 index 0000000000..db7ffaaf56 --- /dev/null +++ b/layout/style/test/test_moz_prefixed_cursor.html @@ -0,0 +1,14 @@ + +Cursor aliases compute to the unprefixed keyword + + +
+ diff --git a/layout/style/test/test_mq_any_hover_and_any_pointer.html b/layout/style/test/test_mq_any_hover_and_any_pointer.html new file mode 100644 index 0000000000..1725af0725 --- /dev/null +++ b/layout/style/test/test_mq_any_hover_and_any_pointer.html @@ -0,0 +1,97 @@ + + + + + + Test for Bug 1035774 + + + + +Mozilla Bug 1483111 +

+ +
+
+ + + diff --git a/layout/style/test/test_mq_changes_in_iframe.html b/layout/style/test/test_mq_changes_in_iframe.html new file mode 100644 index 0000000000..3a36476c42 --- /dev/null +++ b/layout/style/test/test_mq_changes_in_iframe.html @@ -0,0 +1,54 @@ + + + + + Media feature value change propagation in an iframe + + + + +

+ + +

+
+
+
diff --git a/layout/style/test/test_mq_hover_and_pointer.html b/layout/style/test/test_mq_hover_and_pointer.html
new file mode 100644
index 0000000000..40eaed5d0b
--- /dev/null
+++ b/layout/style/test/test_mq_hover_and_pointer.html
@@ -0,0 +1,127 @@
+
+
+
+
+  
+  Test for Bug 1035774
+  
+  
+
+
+Mozilla Bug 1035774
+

+ +
+
+ + + diff --git a/layout/style/test/test_mq_prefers_contrast_dynamic.html b/layout/style/test/test_mq_prefers_contrast_dynamic.html new file mode 100644 index 0000000000..c3ccebbe82 --- /dev/null +++ b/layout/style/test/test_mq_prefers_contrast_dynamic.html @@ -0,0 +1,82 @@ + + + + + + Test for Bug 1691793 + + + + +Mozilla Bug 1691793 +

+ +
+
+ + + diff --git a/layout/style/test/test_mq_prefers_reduced_motion_dynamic.html b/layout/style/test/test_mq_prefers_reduced_motion_dynamic.html new file mode 100644 index 0000000000..570c0d3954 --- /dev/null +++ b/layout/style/test/test_mq_prefers_reduced_motion_dynamic.html @@ -0,0 +1,86 @@ + + + + + + Test for Bug 1478519 + + + + +Mozilla Bug 1486971 +

+ +
+
+ + + diff --git a/layout/style/test/test_mql_event_listener_leaks.html b/layout/style/test/test_mql_event_listener_leaks.html new file mode 100644 index 0000000000..3ceb5412a2 --- /dev/null +++ b/layout/style/test/test_mql_event_listener_leaks.html @@ -0,0 +1,43 @@ + + + + + Bug 1450271 - Test MediaQueryList event listener leak conditions + + + + + + +
+ + + diff --git a/layout/style/test/test_namespace_rule.html b/layout/style/test/test_namespace_rule.html new file mode 100644 index 0000000000..6e8ba52c90 --- /dev/null +++ b/layout/style/test/test_namespace_rule.html @@ -0,0 +1,461 @@ + + + + Test for CSS Namespace rules + + + + +

+
+
+
+ + diff --git a/layout/style/test/test_non_content_accessible_env_vars.html b/layout/style/test/test_non_content_accessible_env_vars.html new file mode 100644 index 0000000000..d9714216b7 --- /dev/null +++ b/layout/style/test/test_non_content_accessible_env_vars.html @@ -0,0 +1,39 @@ + + + + + + diff --git a/layout/style/test/test_non_content_accessible_properties.html b/layout/style/test/test_non_content_accessible_properties.html new file mode 100644 index 0000000000..220ddf2d26 --- /dev/null +++ b/layout/style/test/test_non_content_accessible_properties.html @@ -0,0 +1,85 @@ + + + + + + diff --git a/layout/style/test/test_non_content_accessible_pseudos.html b/layout/style/test/test_non_content_accessible_pseudos.html new file mode 100644 index 0000000000..81493b1a4a --- /dev/null +++ b/layout/style/test/test_non_content_accessible_pseudos.html @@ -0,0 +1,69 @@ + + + + + diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html new file mode 100644 index 0000000000..633427f8e1 --- /dev/null +++ b/layout/style/test/test_non_content_accessible_values.html @@ -0,0 +1,172 @@ + + + + +
+ diff --git a/layout/style/test/test_non_matching_sheet_media.html b/layout/style/test/test_non_matching_sheet_media.html new file mode 100644 index 0000000000..a57444df45 --- /dev/null +++ b/layout/style/test/test_non_matching_sheet_media.html @@ -0,0 +1,30 @@ + + +Test for Bug 1386840: non-matching media list doesn't block rendering + + + + + + + diff --git a/layout/style/test/test_of_type_selectors.xhtml b/layout/style/test/test_of_type_selectors.xhtml new file mode 100644 index 0000000000..edf2e6ee97 --- /dev/null +++ b/layout/style/test/test_of_type_selectors.xhtml @@ -0,0 +1,97 @@ + + + + Test for *-of-type selectors in Bug 75375 + + + + +Mozilla Bug 75375 + +
+
+
+ + diff --git a/layout/style/test/test_overscroll_behavior_pref.html b/layout/style/test/test_overscroll_behavior_pref.html new file mode 100644 index 0000000000..c12d4ce081 --- /dev/null +++ b/layout/style/test/test_overscroll_behavior_pref.html @@ -0,0 +1,24 @@ + + + + + Test pref for overscroll-behavior property + + + + diff --git a/layout/style/test/test_page_parser.html b/layout/style/test/test_page_parser.html new file mode 100644 index 0000000000..6f6860d0f2 --- /dev/null +++ b/layout/style/test/test_page_parser.html @@ -0,0 +1,93 @@ + + + + + + Test of @page parser + + + + +

@page parsing (bug 115199)

+

+
+
+
+
diff --git a/layout/style/test/test_parse_eof.html b/layout/style/test/test_parse_eof.html
new file mode 100644
index 0000000000..63ef95b980
--- /dev/null
+++ b/layout/style/test/test_parse_eof.html
@@ -0,0 +1,69 @@
+
+
+
+  
+  Test parsing behaviour of backslash just before EOF
+  
+  
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + + diff --git a/layout/style/test/test_parse_ident.html b/layout/style/test/test_parse_ident.html new file mode 100644 index 0000000000..390412e2fc --- /dev/null +++ b/layout/style/test/test_parse_ident.html @@ -0,0 +1,56 @@ + + + + Test for CSS identifier parsing + + + + +Mozilla Bug + +
+
+
+ + diff --git a/layout/style/test/test_parse_rule.html b/layout/style/test/test_parse_rule.html new file mode 100644 index 0000000000..0fb1cc80ed --- /dev/null +++ b/layout/style/test/test_parse_rule.html @@ -0,0 +1,261 @@ + + + + + + + + + +
+ diff --git a/layout/style/test/test_parse_url.html b/layout/style/test/test_parse_url.html new file mode 100644 index 0000000000..7a637c18e3 --- /dev/null +++ b/layout/style/test/test_parse_url.html @@ -0,0 +1,195 @@ + + + + + Test for Bug 473914 + + + + +Mozilla Bug 473914 +

+ +
+
+
+ + diff --git a/layout/style/test/test_parser_diagnostics_unprintables.html b/layout/style/test/test_parser_diagnostics_unprintables.html new file mode 100644 index 0000000000..f872c00a8f --- /dev/null +++ b/layout/style/test/test_parser_diagnostics_unprintables.html @@ -0,0 +1,220 @@ + + + + + Test for CSS parser diagnostics escaping unprintable + characters correctly + + + + +Mozilla Bug 229827 + + + + diff --git a/layout/style/test/test_pixel_lengths.html b/layout/style/test/test_pixel_lengths.html new file mode 100644 index 0000000000..346547507c --- /dev/null +++ b/layout/style/test/test_pixel_lengths.html @@ -0,0 +1,61 @@ + + + + Test that pixel lengths don't change based on DPI + + + + +
+ +
pt
+
pc
+
mm
+
cm
+
in
+
q
+ +
+
+
+
+ + diff --git a/layout/style/test/test_placeholder_restrictions.html b/layout/style/test/test_placeholder_restrictions.html new file mode 100644 index 0000000000..4e3e87ef16 --- /dev/null +++ b/layout/style/test/test_placeholder_restrictions.html @@ -0,0 +1,57 @@ + + + + + + Test for Bug 1382786 + + + + + + +Mozilla Bug 1382786 +

+ + + + + + diff --git a/layout/style/test/test_pointer-events.html b/layout/style/test/test_pointer-events.html new file mode 100644 index 0000000000..faeb6c6335 --- /dev/null +++ b/layout/style/test/test_pointer-events.html @@ -0,0 +1,114 @@ + + + + Test for pointer-events in HTML + + + + + + + +Mozilla Bug +
+ +
+
+
+
+
+ link + + + + + + + + + + + + +
noyesyes
noyesyes
+ + + +
+
+
+
+ + diff --git a/layout/style/test/test_position_float_display.html b/layout/style/test/test_position_float_display.html new file mode 100644 index 0000000000..ee75144dcb --- /dev/null +++ b/layout/style/test/test_position_float_display.html @@ -0,0 +1,111 @@ + + + + + + Test for Bug 1038929 + + + + + + +Mozilla Bug 1038929 +

+ +
+
+
+ + diff --git a/layout/style/test/test_position_sticky.html b/layout/style/test/test_position_sticky.html new file mode 100644 index 0000000000..b542737e54 --- /dev/null +++ b/layout/style/test/test_position_sticky.html @@ -0,0 +1,89 @@ + + + + + + Test for Bug 886646 + + + + + +Mozilla Bug 886646 +
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_prefers_contrast_color_pairs.html b/layout/style/test/test_prefers_contrast_color_pairs.html new file mode 100644 index 0000000000..f4a8945804 --- /dev/null +++ b/layout/style/test/test_prefers_contrast_color_pairs.html @@ -0,0 +1,49 @@ + +Test for Bug 922669 + + + + diff --git a/layout/style/test/test_priority_preservation.html b/layout/style/test/test_priority_preservation.html new file mode 100644 index 0000000000..7177949555 --- /dev/null +++ b/layout/style/test/test_priority_preservation.html @@ -0,0 +1,141 @@ + + + + Test for property priority preservation + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_property_database.html b/layout/style/test/test_property_database.html new file mode 100644 index 0000000000..ba04ec341a --- /dev/null +++ b/layout/style/test/test_property_database.html @@ -0,0 +1,173 @@ + + + + + Test that property_database.js contains all supported CSS properties + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_property_syntax_errors.html b/layout/style/test/test_property_syntax_errors.html new file mode 100644 index 0000000000..1e3f382036 --- /dev/null +++ b/layout/style/test/test_property_syntax_errors.html @@ -0,0 +1,155 @@ + + + + + Test that we reject syntax errors listed in property_database.js + + + + + +

+ + +
+
+
+ + diff --git a/layout/style/test/test_pseudo_display_fixup.html b/layout/style/test/test_pseudo_display_fixup.html new file mode 100644 index 0000000000..de4dd0f810 --- /dev/null +++ b/layout/style/test/test_pseudo_display_fixup.html @@ -0,0 +1,29 @@ + + +Test item blockification of pseudo-elements + + + +
+ diff --git a/layout/style/test/test_pseudoelement_parsing.html b/layout/style/test/test_pseudoelement_parsing.html new file mode 100644 index 0000000000..b6fcf783f7 --- /dev/null +++ b/layout/style/test/test_pseudoelement_parsing.html @@ -0,0 +1,43 @@ + +Test for Bug 922669 + + + + + + + + diff --git a/layout/style/test/test_pseudoelement_state.html b/layout/style/test/test_pseudoelement_state.html new file mode 100644 index 0000000000..0a8c3d52f6 --- /dev/null +++ b/layout/style/test/test_pseudoelement_state.html @@ -0,0 +1,185 @@ + +Test for Bug 922669 + + + + + + + + diff --git a/layout/style/test/test_query_container_for.html b/layout/style/test/test_query_container_for.html new file mode 100644 index 0000000000..90dca9fab9 --- /dev/null +++ b/layout/style/test/test_query_container_for.html @@ -0,0 +1,62 @@ + +Test for bug 1789191 + + + + +
+ +
+
+
+
+
+
+
+ + diff --git a/layout/style/test/test_redundant_font_download.html b/layout/style/test/test_redundant_font_download.html new file mode 100644 index 0000000000..c6930ae401 --- /dev/null +++ b/layout/style/test/test_redundant_font_download.html @@ -0,0 +1,131 @@ + + + + + + Test for bug 879963 + + + + + + + + + + + Mozilla Bug 879963 + +
+ + +
+ +
+ Test +
+ +
+ +
+ + + + + + diff --git a/layout/style/test/test_reframe_cb.html b/layout/style/test/test_reframe_cb.html new file mode 100644 index 0000000000..549d04c5c0 --- /dev/null +++ b/layout/style/test/test_reframe_cb.html @@ -0,0 +1,56 @@ + + + + Test for bug 1519371: We don't reframe for changes that affect our containing + block status unless whether we're a containing block really changed. + + + +
+ diff --git a/layout/style/test/test_reframe_image_loading.html b/layout/style/test/test_reframe_image_loading.html new file mode 100644 index 0000000000..2f8a44c361 --- /dev/null +++ b/layout/style/test/test_reframe_image_loading.html @@ -0,0 +1,29 @@ + + + + Test for bug 1395964: We don't reframe for image loading state changes. + + + + + diff --git a/layout/style/test/test_reframe_input.html b/layout/style/test/test_reframe_input.html new file mode 100644 index 0000000000..2887548abf --- /dev/null +++ b/layout/style/test/test_reframe_input.html @@ -0,0 +1,48 @@ + + +Test for bug 1658302: We don't reframe for placeholder attribute value changes. + + + + + diff --git a/layout/style/test/test_reframe_pseudo_element.html b/layout/style/test/test_reframe_pseudo_element.html new file mode 100644 index 0000000000..0e0b418e81 --- /dev/null +++ b/layout/style/test/test_reframe_pseudo_element.html @@ -0,0 +1,46 @@ + + + + Test for bug 1376352: We don't reframe all the time a replaced element that + matches generated content rules. + + + + + +
+ diff --git a/layout/style/test/test_rem_unit.html b/layout/style/test/test_rem_unit.html new file mode 100644 index 0000000000..bd46524798 --- /dev/null +++ b/layout/style/test/test_rem_unit.html @@ -0,0 +1,80 @@ + + + + + Test for CSS 'rem' unit + + + + +Mozilla Bug 478321 +

+

+ +
+
+
+ + diff --git a/layout/style/test/test_restyle_table_wrapper.html b/layout/style/test/test_restyle_table_wrapper.html new file mode 100644 index 0000000000..d8049b142e --- /dev/null +++ b/layout/style/test/test_restyle_table_wrapper.html @@ -0,0 +1,33 @@ + + + + Test for bug 1371955: We don't incorrectly think that a table wrapper style + is the main table element style. + + + + +
+ + diff --git a/layout/style/test/test_restyles_in_smil_animation.html b/layout/style/test/test_restyles_in_smil_animation.html new file mode 100644 index 0000000000..17c1ebb2ab --- /dev/null +++ b/layout/style/test/test_restyles_in_smil_animation.html @@ -0,0 +1,137 @@ + + + +Tests restyles in smil animation + + + + + + +
+ + + +
+ + + diff --git a/layout/style/test/test_revert.html b/layout/style/test/test_revert.html new file mode 100644 index 0000000000..48897a75ca --- /dev/null +++ b/layout/style/test/test_revert.html @@ -0,0 +1,103 @@ + +Test for computation of CSS 'revert' on all properties + + + + +
+
+
+
+
+
+
+
diff --git a/layout/style/test/test_root_node_display.html b/layout/style/test/test_root_node_display.html new file mode 100644 index 0000000000..54dd9c222c --- /dev/null +++ b/layout/style/test/test_root_node_display.html @@ -0,0 +1,74 @@ + + + + + + Test for Bug 969460 + + + + + +Mozilla Bug 969460 +

+ +
+
+
+ + diff --git a/layout/style/test/test_rule_insertion.html b/layout/style/test/test_rule_insertion.html new file mode 100644 index 0000000000..e3103309aa --- /dev/null +++ b/layout/style/test/test_rule_insertion.html @@ -0,0 +1,240 @@ + + + + + Test for Bug 816720 + + + + + + +

+
+

........

+

........

+

........

+ + + +

+

+

+ + + + + + diff --git a/layout/style/test/test_rules_out_of_sheets.html b/layout/style/test/test_rules_out_of_sheets.html new file mode 100644 index 0000000000..2ca53d31b7 --- /dev/null +++ b/layout/style/test/test_rules_out_of_sheets.html @@ -0,0 +1,115 @@ + + + + + Test for Bug 634373 + + + + +Mozilla Bug 634373 +

+ +
+
+
+ + diff --git a/layout/style/test/test_selectors.html b/layout/style/test/test_selectors.html new file mode 100644 index 0000000000..d688139d3c --- /dev/null +++ b/layout/style/test/test_selectors.html @@ -0,0 +1,1348 @@ + + + + Test for CSS Selectors + + + + +

+
+
+
+ + diff --git a/layout/style/test/test_setPropertyWithNull.html b/layout/style/test/test_setPropertyWithNull.html new file mode 100644 index 0000000000..d54fd03cdd --- /dev/null +++ b/layout/style/test/test_setPropertyWithNull.html @@ -0,0 +1,47 @@ + + + + + + Test for Bug 830260 + + + + + +Mozilla Bug 830260 +

+ +
+
+ + diff --git a/layout/style/test/test_shape_outside_CORS.html b/layout/style/test/test_shape_outside_CORS.html new file mode 100644 index 0000000000..2d2ee1c32f --- /dev/null +++ b/layout/style/test/test_shape_outside_CORS.html @@ -0,0 +1,59 @@ + + + + +CSS Test: shape-outside with a CORS violation + + + + + + + + + + +
+
allow (image is blank, so text is flush left)
+
+
+
refuse (image unread, so text is moved to box edge)
+
+ + diff --git a/layout/style/test/test_shared_sheet_caching.html b/layout/style/test/test_shared_sheet_caching.html new file mode 100644 index 0000000000..e59c0c139e --- /dev/null +++ b/layout/style/test/test_shared_sheet_caching.html @@ -0,0 +1,35 @@ + + + + + + +Navigation + diff --git a/layout/style/test/test_sheet_privilege.html b/layout/style/test/test_sheet_privilege.html new file mode 100644 index 0000000000..d089fdc137 --- /dev/null +++ b/layout/style/test/test_sheet_privilege.html @@ -0,0 +1,33 @@ + +Test whether it can access a filed in MediaList with normal privilege after accessing with chrome privilege. + + + + diff --git a/layout/style/test/test_shorthand_property_getters.html b/layout/style/test/test_shorthand_property_getters.html new file mode 100644 index 0000000000..cade526183 --- /dev/null +++ b/layout/style/test/test_shorthand_property_getters.html @@ -0,0 +1,248 @@ + + + + + Test for Bug 376075 + + + + +Mozilla Bug 376075 +

+ +
+
+
+ + diff --git a/layout/style/test/test_specified_value_serialization.html b/layout/style/test/test_specified_value_serialization.html new file mode 100644 index 0000000000..5624b7398a --- /dev/null +++ b/layout/style/test/test_specified_value_serialization.html @@ -0,0 +1,281 @@ + + + + Test for miscellaneous specified value issues + + + + +Mozilla Bug +

+ + +
+
+
+ + diff --git a/layout/style/test/test_style_attr_listener.html b/layout/style/test/test_style_attr_listener.html new file mode 100644 index 0000000000..b824fe7ff4 --- /dev/null +++ b/layout/style/test/test_style_attr_listener.html @@ -0,0 +1,52 @@ + + + + Test for Bug 338679 (from bug 1340341) + + + + +
+ + + diff --git a/layout/style/test/test_style_attribute_quirks.html b/layout/style/test/test_style_attribute_quirks.html new file mode 100644 index 0000000000..5a5b87e122 --- /dev/null +++ b/layout/style/test/test_style_attribute_quirks.html @@ -0,0 +1,18 @@ + + + + + Test for Bug 915093 + + + + + +Mozilla Bug 915093 +
+
+
+ + diff --git a/layout/style/test/test_style_attribute_standards.html b/layout/style/test/test_style_attribute_standards.html new file mode 100644 index 0000000000..e6e64afc24 --- /dev/null +++ b/layout/style/test/test_style_attribute_standards.html @@ -0,0 +1,19 @@ + + + + + + Test for Bug 915093 + + + + + +Mozilla Bug 915093 +
+
+
+ + diff --git a/layout/style/test/test_style_struct_copy_constructors.html b/layout/style/test/test_style_struct_copy_constructors.html new file mode 100644 index 0000000000..95f727a58d --- /dev/null +++ b/layout/style/test/test_style_struct_copy_constructors.html @@ -0,0 +1,93 @@ + + + + + Test for style struct copy constructors + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_stylesheet_additions.html b/layout/style/test/test_stylesheet_additions.html new file mode 100644 index 0000000000..0e115e91f4 --- /dev/null +++ b/layout/style/test/test_stylesheet_additions.html @@ -0,0 +1,68 @@ + + + + Test for bug 1273303: Stylesheet additions and removals known to not + affect the document don't trigger restyles + + + +
+
+
+
+
+
+ + + diff --git a/layout/style/test/test_stylesheet_clone_font_face.html b/layout/style/test/test_stylesheet_clone_font_face.html new file mode 100644 index 0000000000..e50bfec661 --- /dev/null +++ b/layout/style/test/test_stylesheet_clone_font_face.html @@ -0,0 +1,26 @@ + + + + + + + + +
ABC
+ + diff --git a/layout/style/test/test_supports_rules.html b/layout/style/test/test_supports_rules.html new file mode 100644 index 0000000000..8b88fd7836 --- /dev/null +++ b/layout/style/test/test_supports_rules.html @@ -0,0 +1,88 @@ + + + + + Test for Bug 649740 + + + + + +Mozilla Bug 649740 +

+

+
+
+
+ + diff --git a/layout/style/test/test_system_font_serialization.html b/layout/style/test/test_system_font_serialization.html new file mode 100644 index 0000000000..10fb54c45a --- /dev/null +++ b/layout/style/test/test_system_font_serialization.html @@ -0,0 +1,84 @@ + + + + + Test for Bug 475214 + + + + +Mozilla Bug 475214 +

+
+ +
+
+
+
+ + diff --git a/layout/style/test/test_text_decoration_shorthands.html b/layout/style/test/test_text_decoration_shorthands.html new file mode 100644 index 0000000000..d2cfed6667 --- /dev/null +++ b/layout/style/test/test_text_decoration_shorthands.html @@ -0,0 +1,136 @@ + + + + + Test parsing of text-decoration shorthands + + + + + + + + + diff --git a/layout/style/test/test_transitions.html b/layout/style/test/test_transitions.html new file mode 100644 index 0000000000..c26ba9be8f --- /dev/null +++ b/layout/style/test/test_transitions.html @@ -0,0 +1,787 @@ + + + + + Test for Bug 435441 + + + + + + +Mozilla Bug 435441 +
+ +
+
+
+
+ + diff --git a/layout/style/test/test_transitions_and_reframes.html b/layout/style/test/test_transitions_and_reframes.html new file mode 100644 index 0000000000..dfc16e54d1 --- /dev/null +++ b/layout/style/test/test_transitions_and_reframes.html @@ -0,0 +1,298 @@ + + + + + + Test for Bug 625289 + + + + + +Mozilla Bug 625289 +
+
+ This text has an i element in it. +
+
+
+ hello + this appears + hello +
color transition
+
+
+
+
+
+ + diff --git a/layout/style/test/test_transitions_and_restyles.html b/layout/style/test/test_transitions_and_restyles.html new file mode 100644 index 0000000000..35fc608c20 --- /dev/null +++ b/layout/style/test/test_transitions_and_restyles.html @@ -0,0 +1,48 @@ + + + + + + Test for Bug 1030993 + + + + + +Mozilla Bug 1030993 +

+
+
+ + + diff --git a/layout/style/test/test_transitions_and_zoom.html b/layout/style/test/test_transitions_and_zoom.html new file mode 100644 index 0000000000..e95581be32 --- /dev/null +++ b/layout/style/test/test_transitions_and_zoom.html @@ -0,0 +1,49 @@ + + + + + Test for Bug 583219 + + + + + +Mozilla Bug 583219 +

+
+
+
+ + diff --git a/layout/style/test/test_transitions_at_start.html b/layout/style/test/test_transitions_at_start.html new file mode 100644 index 0000000000..bad36e7673 --- /dev/null +++ b/layout/style/test/test_transitions_at_start.html @@ -0,0 +1,39 @@ + + + + + + Test for transition value at start (Bug 1380133) + + + + + + +Test + + + diff --git a/layout/style/test/test_transitions_bug537151.html b/layout/style/test/test_transitions_bug537151.html new file mode 100644 index 0000000000..8d3b84a5fc --- /dev/null +++ b/layout/style/test/test_transitions_bug537151.html @@ -0,0 +1,51 @@ + + + + + Test for Bug 537151 + + + + + +Mozilla Bug 537151 +

Paragraph

+
+
+
+ + diff --git a/layout/style/test/test_transitions_cancel_near_end.html b/layout/style/test/test_transitions_cancel_near_end.html new file mode 100644 index 0000000000..496d95e6a1 --- /dev/null +++ b/layout/style/test/test_transitions_cancel_near_end.html @@ -0,0 +1,82 @@ + + + + + Test for Bug 613888 + + + + + + +Mozilla Bug 613888 +
+  canceled on a half of the animation
+  canceled too fast, and restyled on transitionend
+  canceled too fast, but not restyled on transitionend
+
+
+
+
+ + diff --git a/layout/style/test/test_transitions_computed_value_combinations.html b/layout/style/test/test_transitions_computed_value_combinations.html new file mode 100644 index 0000000000..3dfad41e58 --- /dev/null +++ b/layout/style/test/test_transitions_computed_value_combinations.html @@ -0,0 +1,170 @@ + + + + + Test for Bug 435441 + + + + +Mozilla Bug 435441 + +
+
+
+ + diff --git a/layout/style/test/test_transitions_computed_values.html b/layout/style/test/test_transitions_computed_values.html new file mode 100644 index 0000000000..7b350de6b2 --- /dev/null +++ b/layout/style/test/test_transitions_computed_values.html @@ -0,0 +1,113 @@ + + + + + Test for Bug 435441 + + + + +Mozilla Bug 435441 + +
+
+
+ + diff --git a/layout/style/test/test_transitions_dynamic_changes.html b/layout/style/test/test_transitions_dynamic_changes.html new file mode 100644 index 0000000000..4d49db1e3a --- /dev/null +++ b/layout/style/test/test_transitions_dynamic_changes.html @@ -0,0 +1,106 @@ + + + + + Test for Bug 525530 + + + + +Mozilla Bug 525530 +

+
+
+
+ + diff --git a/layout/style/test/test_transitions_events.html b/layout/style/test/test_transitions_events.html new file mode 100644 index 0000000000..d04348bc0a --- /dev/null +++ b/layout/style/test/test_transitions_events.html @@ -0,0 +1,294 @@ + + + + + Test for Bug 531585 (transitionend event) + + + + + +Mozilla Bug 531585 +

+ + + + + + + + + +

+
+
+
+ + diff --git a/layout/style/test/test_transitions_per_property.html b/layout/style/test/test_transitions_per_property.html new file mode 100644 index 0000000000..058152adfb --- /dev/null +++ b/layout/style/test/test_transitions_per_property.html @@ -0,0 +1,3245 @@ + + + + + Test for Bug 435441 + + + + + + + + +Mozilla Bug 435441 + + +
+ +
+
+ +
+
+
+
+ + diff --git a/layout/style/test/test_transitions_replacement_on_busy_frame.html b/layout/style/test/test_transitions_replacement_on_busy_frame.html new file mode 100644 index 0000000000..527c98ae85 --- /dev/null +++ b/layout/style/test/test_transitions_replacement_on_busy_frame.html @@ -0,0 +1,100 @@ + + + + + + Test for bug 1167519 + + + + + + + +
+ + + diff --git a/layout/style/test/test_transitions_replacement_with_setKeyframes.html b/layout/style/test/test_transitions_replacement_with_setKeyframes.html new file mode 100644 index 0000000000..85e9e40127 --- /dev/null +++ b/layout/style/test/test_transitions_replacement_with_setKeyframes.html @@ -0,0 +1,88 @@ + + + + + + Test for bug 1292001 + + + + + + + +
+ + + diff --git a/layout/style/test/test_transitions_step_functions.html b/layout/style/test/test_transitions_step_functions.html new file mode 100644 index 0000000000..c0205a8d2f --- /dev/null +++ b/layout/style/test/test_transitions_step_functions.html @@ -0,0 +1,131 @@ + + + + + Test for Bug 435441 + + + + + + +
+ +
+
+
+
+ + diff --git a/layout/style/test/test_unclosed_parentheses.html b/layout/style/test/test_unclosed_parentheses.html new file mode 100644 index 0000000000..7e8052892c --- /dev/null +++ b/layout/style/test/test_unclosed_parentheses.html @@ -0,0 +1,262 @@ + + + + + Test for Bug 575672 + + + + + + +Mozilla Bug 575672 +

+ +
+
+
+ + diff --git a/layout/style/test/test_unicode_range_loading.html b/layout/style/test/test_unicode_range_loading.html new file mode 100644 index 0000000000..43622e2ae5 --- /dev/null +++ b/layout/style/test/test_unicode_range_loading.html @@ -0,0 +1,366 @@ + + + + + unicode-range load tests using font loading api + + + + + + + + + +
+

+
+
+
+ + + + diff --git a/layout/style/test/test_units_angle.html b/layout/style/test/test_units_angle.html new file mode 100644 index 0000000000..a4432b7650 --- /dev/null +++ b/layout/style/test/test_units_angle.html @@ -0,0 +1,52 @@ + + + + Test for serialization and equivalence of angle units + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_units_frequency.html b/layout/style/test/test_units_frequency.html new file mode 100644 index 0000000000..cb5c0de20d --- /dev/null +++ b/layout/style/test/test_units_frequency.html @@ -0,0 +1,56 @@ + + + + Test for serialization and equivalence of frequency units + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_units_length.html b/layout/style/test/test_units_length.html new file mode 100644 index 0000000000..623f13df33 --- /dev/null +++ b/layout/style/test/test_units_length.html @@ -0,0 +1,60 @@ + + + + Test for serialization and equivalence of length units + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_units_time.html b/layout/style/test/test_units_time.html new file mode 100644 index 0000000000..16211c0207 --- /dev/null +++ b/layout/style/test/test_units_time.html @@ -0,0 +1,47 @@ + + + + Test for serialization and equivalence of time units + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/layout/style/test/test_use_counters.html b/layout/style/test/test_use_counters.html new file mode 100644 index 0000000000..0706c9702d --- /dev/null +++ b/layout/style/test/test_use_counters.html @@ -0,0 +1,159 @@ + +Test for Bug 1425700: CSS properties use-counters + + + + + + + diff --git a/layout/style/test/test_user_sheet_shadow_dom.html b/layout/style/test/test_user_sheet_shadow_dom.html new file mode 100644 index 0000000000..cd7a44b308 --- /dev/null +++ b/layout/style/test/test_user_sheet_shadow_dom.html @@ -0,0 +1,48 @@ + +Test for bug 1576229 - Nodes in Shadow DOM react properly to dynamic changes in user sheets + + +
+ + diff --git a/layout/style/test/test_value_cloning.html b/layout/style/test/test_value_cloning.html new file mode 100644 index 0000000000..ceaa9d3c66 --- /dev/null +++ b/layout/style/test/test_value_cloning.html @@ -0,0 +1,181 @@ + + + + + Test for cloning of CSS property values (including 'inherit', 'initial' and 'unset') + + + + + +

+
+
+
+ + diff --git a/layout/style/test/test_value_computation.html b/layout/style/test/test_value_computation.html new file mode 100644 index 0000000000..df38a24b9b --- /dev/null +++ b/layout/style/test/test_value_computation.html @@ -0,0 +1,236 @@ + + + + + Test for computation of values in property database + + + + + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_value_storage.html b/layout/style/test/test_value_storage.html new file mode 100644 index 0000000000..542cad91ed --- /dev/null +++ b/layout/style/test/test_value_storage.html @@ -0,0 +1,365 @@ + + + + + Test for parsing, storage, and serialization of CSS values + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_variable_serialization_computed.html b/layout/style/test/test_variable_serialization_computed.html new file mode 100644 index 0000000000..2814e4ab93 --- /dev/null +++ b/layout/style/test/test_variable_serialization_computed.html @@ -0,0 +1,79 @@ + +Test serialization of computed CSS variable values + + + + +
+ +
+ + diff --git a/layout/style/test/test_variable_serialization_specified.html b/layout/style/test/test_variable_serialization_specified.html new file mode 100644 index 0000000000..cae8871cb2 --- /dev/null +++ b/layout/style/test/test_variable_serialization_specified.html @@ -0,0 +1,116 @@ + +Test serialization of specified CSS variable values + + + + + + + + diff --git a/layout/style/test/test_variables.html b/layout/style/test/test_variables.html new file mode 100644 index 0000000000..e26dc5a0f7 --- /dev/null +++ b/layout/style/test/test_variables.html @@ -0,0 +1,129 @@ + +Assorted CSS variable tests + + + + + + + + + + + + +
+ + + +
+ + + + + + + + diff --git a/layout/style/test/test_variables_loop.html b/layout/style/test/test_variables_loop.html new file mode 100644 index 0000000000..76e97e26f3 --- /dev/null +++ b/layout/style/test/test_variables_loop.html @@ -0,0 +1,31 @@ + +CSS variables loop resolving + + + + +
+
+
+ diff --git a/layout/style/test/test_variables_order.html b/layout/style/test/test_variables_order.html new file mode 100644 index 0000000000..5adb9edf75 --- /dev/null +++ b/layout/style/test/test_variables_order.html @@ -0,0 +1,53 @@ + +CSS variables order tests + + + + + + +
+ + diff --git a/layout/style/test/test_video_object_fit.html b/layout/style/test/test_video_object_fit.html new file mode 100644 index 0000000000..e673ba204e --- /dev/null +++ b/layout/style/test/test_video_object_fit.html @@ -0,0 +1,53 @@ + + + + + + Test for Bug 1065766 + + + + +Mozilla Bug 1065766 + +
+
+
+ + diff --git a/layout/style/test/test_viewport_scrollbar_causing_reflow.html b/layout/style/test/test_viewport_scrollbar_causing_reflow.html new file mode 100644 index 0000000000..ced14f352a --- /dev/null +++ b/layout/style/test/test_viewport_scrollbar_causing_reflow.html @@ -0,0 +1,130 @@ + + + + + + Test for Bug 1367568 + + + + +Mozilla Bug 1367568 +
+ +
fixed-width
(child)
+
fixed-width
(child)
+
fixed-width
(child)
+
fixed-width
(child)
+
fixed-width
(child)
+
fixed-width
(child)
+
+ abs-fixed-width +
(child)
+
+
+
+
+
+ + diff --git a/layout/style/test/test_viewport_units.html b/layout/style/test/test_viewport_units.html new file mode 100644 index 0000000000..fa7df88eb6 --- /dev/null +++ b/layout/style/test/test_viewport_units.html @@ -0,0 +1,66 @@ + + + + + Test for dynamic changes to CSS 'vh', 'vw', 'vmin', and 'vmax' units + + + + +Mozilla Bug 804970 + +
+
+
+ + diff --git a/layout/style/test/test_visited_image_loading.html b/layout/style/test/test_visited_image_loading.html new file mode 100644 index 0000000000..09aae8e53c --- /dev/null +++ b/layout/style/test/test_visited_image_loading.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 557287 + + + + +Mozilla Bug 147777 +
+
+
+
+ + diff --git a/layout/style/test/test_visited_image_loading_empty.html b/layout/style/test/test_visited_image_loading_empty.html new file mode 100644 index 0000000000..6687254720 --- /dev/null +++ b/layout/style/test/test_visited_image_loading_empty.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 557287 + + + + +Mozilla Bug 147777 +
+
+
+
+ + diff --git a/layout/style/test/test_visited_lying.html b/layout/style/test/test_visited_lying.html new file mode 100644 index 0000000000..116d301cf1 --- /dev/null +++ b/layout/style/test/test_visited_lying.html @@ -0,0 +1,97 @@ + + + + + Test for Bug 147777 + + + + + +Mozilla Bug 147777 + +
+
+
+ + diff --git a/layout/style/test/test_visited_pref.html b/layout/style/test/test_visited_pref.html new file mode 100644 index 0000000000..481a71bfef --- /dev/null +++ b/layout/style/test/test_visited_pref.html @@ -0,0 +1,112 @@ + + + + + Test for visited link coloring pref Bug 147777 + + + + + + +Mozilla Bug 147777 + +
+
+
+ + diff --git a/layout/style/test/test_visited_reftests.html b/layout/style/test/test_visited_reftests.html new file mode 100644 index 0000000000..0353d948fc --- /dev/null +++ b/layout/style/test/test_visited_reftests.html @@ -0,0 +1,210 @@ + + + + + Test for Bug 147777 + + + + + +Mozilla Bug 147777 +
+
+
+ + diff --git a/layout/style/test/test_webkit_device_pixel_ratio.html b/layout/style/test/test_webkit_device_pixel_ratio.html new file mode 100644 index 0000000000..69e50c58ff --- /dev/null +++ b/layout/style/test/test_webkit_device_pixel_ratio.html @@ -0,0 +1,73 @@ + + + + + Test for Bug 1176968 + + + + + + +Mozilla Bug 1176968 + + +
+
+
+
+ +
+ + diff --git a/layout/style/test/test_webkit_flex_display.html b/layout/style/test/test_webkit_flex_display.html new file mode 100644 index 0000000000..2f329ed67d --- /dev/null +++ b/layout/style/test/test_webkit_flex_display.html @@ -0,0 +1,46 @@ + + + + + Test for Bug 1274096 + + + + +Mozilla Bug 1274096 + + +
+
+
+ + diff --git a/layout/style/test/unstyled-frame.css b/layout/style/test/unstyled-frame.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/layout/style/test/unstyled-frame.xml b/layout/style/test/unstyled-frame.xml new file mode 100644 index 0000000000..833b4f112f --- /dev/null +++ b/layout/style/test/unstyled-frame.xml @@ -0,0 +1,4 @@ + + + + diff --git a/layout/style/test/unstyled.css b/layout/style/test/unstyled.css new file mode 100644 index 0000000000..82767f9b2f --- /dev/null +++ b/layout/style/test/unstyled.css @@ -0,0 +1,2 @@ +/* we're testing computed style on elements without frames */ +root { display: none } diff --git a/layout/style/test/unstyled.xml b/layout/style/test/unstyled.xml new file mode 100644 index 0000000000..86b7c54acd --- /dev/null +++ b/layout/style/test/unstyled.xml @@ -0,0 +1,3 @@ + + + diff --git a/layout/style/test/viewport_units_iframe.html b/layout/style/test/viewport_units_iframe.html new file mode 100644 index 0000000000..fd71a3cd3e --- /dev/null +++ b/layout/style/test/viewport_units_iframe.html @@ -0,0 +1,6 @@ + +viewport units test +
+
+
+
diff --git a/layout/style/test/visited-lying-inner.html b/layout/style/test/visited-lying-inner.html new file mode 100644 index 0000000000..ad1dac7587 --- /dev/null +++ b/layout/style/test/visited-lying-inner.html @@ -0,0 +1,8 @@ + +Test document for test_visited_lying.html + + + diff --git a/layout/style/test/visited-pref-iframe.html b/layout/style/test/visited-pref-iframe.html new file mode 100644 index 0000000000..31da176e44 --- /dev/null +++ b/layout/style/test/visited-pref-iframe.html @@ -0,0 +1,7 @@ + +iframe for test_visited_pref.html + +link diff --git a/layout/style/test/visited_image_loading.sjs b/layout/style/test/visited_image_loading.sjs new file mode 100644 index 0000000000..79c03d7b54 --- /dev/null +++ b/layout/style/test/visited_image_loading.sjs @@ -0,0 +1,83 @@ +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + var query = request.queryString; + switch (query) { + case "reset": + response.setHeader("Content-Type", "application/ecmascript", false); + setState("1l", ""); + setState("1v", ""); + setState("2l", ""); + setState("2v", ""); + break; + case "1l": + case "1v": + case "2l": + case "2v": + setState(query, getState(query) + "load"); + response.setStatusLine("1.1", 302, "Found"); + // redirect to a solid blue image + response.setHeader( + "Location", + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12NgYPgPAAEDAQDZqt2zAAAAAElFTkSuQmCC" + ); + response.setHeader("Content-Type", "text/plain", false); + break; + + case "waitforresult": + response.setHeader("Content-Type", "application/ecmascript", false); + response.write("var start = Date.now();\n"); + // fall through! + + case "waitforresult-internal": + response.setHeader("Content-Type", "application/ecmascript", false); + response.write( + "if ('" + + getState("1l") + + "' == 'load' && '" + + getState("1v") + + "' == '' && '" + + getState("2l") + + "' == 'load' && '" + + getState("2v") + + "' == '') { \n" + ); + response.write("setTimeout(function() {\n"); + response.write("var s = document.createElement('script');\n"); + response.write("s.src = 'visited_image_loading.sjs?result';\n"); + response.write("document.body.appendChild(s);"); + response.write("}, Math.max(100, 2 * (Date.now() - start)));\n"); + response.write("} else setTimeout(function() {\n"); + response.write("var s = document.createElement('script');\n"); + response.write( + "s.src = 'visited_image_loading.sjs?waitforresult-internal';\n" + ); + response.write("document.body.appendChild(s);"); + response.write("}, 10);\n"); + break; + + case "result": + response.setHeader("Content-Type", "application/ecmascript", false); + response.write( + "is('" + + getState("1l") + + "', 'load', 'image 1l should have been loaded once')\n" + ); + response.write( + "is('" + + getState("1v") + + "', '', 'image 1v should not have been loaded')\n" + ); + response.write( + "is('" + + getState("2l") + + "', 'load', 'image 2l should have been loaded once')\n" + ); + response.write( + "is('" + + getState("2v") + + "', '', 'image 2v should not have been loaded')\n" + ); + response.write("SimpleTest.finish()"); + break; + } +} diff --git a/layout/style/test/visited_image_loading_frame.html b/layout/style/test/visited_image_loading_frame.html new file mode 100644 index 0000000000..f919f5eb75 --- /dev/null +++ b/layout/style/test/visited_image_loading_frame.html @@ -0,0 +1,15 @@ + +Test for :visited image loading + +unvisited link +visited link diff --git a/layout/style/test/visited_image_loading_frame_empty.html b/layout/style/test/visited_image_loading_frame_empty.html new file mode 100644 index 0000000000..21579bb9ca --- /dev/null +++ b/layout/style/test/visited_image_loading_frame_empty.html @@ -0,0 +1,15 @@ + +Test for :visited image loading + + + -- cgit v1.2.3