mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
0b8deaf5a5
--HG-- rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_672746_default_styles.js => browser/devtools/styleinspector/test/browser_computedview_browser-styles.js rename : browser/devtools/styleinspector/test/browser_bug589375_keybindings.js => browser/devtools/styleinspector/test/browser_computedview_keybindings_01.js rename : browser/devtools/styleinspector/test/browser_computedview_bug835808_keyboard_nav.js => browser/devtools/styleinspector/test/browser_computedview_keybindings_02.js rename : browser/devtools/styleinspector/test/browser_bug913014_matched_expand.js => browser/devtools/styleinspector/test/browser_computedview_matched-selectors-toggle.js rename : browser/devtools/styleinspector/test/browser_bug683672.js => browser/devtools/styleinspector/test/browser_computedview_matched-selectors_01.js rename : browser/devtools/styleinspector/test/browser_bug_692400_element_style.js => browser/devtools/styleinspector/test/browser_computedview_matched-selectors_02.js rename : browser/devtools/styleinspector/test/browser_bug722196_property_view_media_queries.js => browser/devtools/styleinspector/test/browser_computedview_media-queries.js rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_689759_no_results_placeholder.js => browser/devtools/styleinspector/test/browser_computedview_no-results-placeholder.js rename : browser/devtools/styleinspector/test/browser_computedview_original_source_link.js => browser/devtools/styleinspector/test/browser_computedview_original-source-link.js rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_672744_search_filter.js => browser/devtools/styleinspector/test/browser_computedview_search-filter.js rename : browser/devtools/styleinspector/test/browser_computedview_copy.js => browser/devtools/styleinspector/test/browser_computedview_select-and-copy-styles.js rename : browser/devtools/styleinspector/test/browser_computedview_734259_style_editor_link.js => browser/devtools/styleinspector/test/browser_computedview_style-editor-link.js rename : browser/devtools/styleinspector/test/browser_ruleview_add_property_01.js => browser/devtools/styleinspector/test/browser_ruleview_add-property-and-reselect.js rename : browser/devtools/styleinspector/test/browser_ruleview_editor_changedvalues_01.js => browser/devtools/styleinspector/test/browser_ruleview_add-property-cancel_01.js rename : browser/devtools/styleinspector/test/browser_ruleview_editor_changedvalues_03.js => browser/devtools/styleinspector/test/browser_ruleview_add-property-cancel_02.js rename : browser/devtools/styleinspector/test/browser_ruleview_cancel.js => browser/devtools/styleinspector/test/browser_ruleview_add-property-cancel_03.js rename : browser/devtools/styleinspector/test/browser_ruleview_editor_changedvalues_02.js => browser/devtools/styleinspector/test/browser_ruleview_add-property_01.js rename : browser/devtools/styleinspector/test/browser_ruleview_add_property_02.js => browser/devtools/styleinspector/test/browser_ruleview_add-property_02.js rename : browser/devtools/styleinspector/test/browser_bug940500_rule_view_pick_gradient_color.js => browser/devtools/styleinspector/test/browser_ruleview_colorpicker-edit-gradient.js rename : browser/devtools/styleinspector/test/browser_bug893965_css_property_completion_existing_property.js => browser/devtools/styleinspector/test/browser_ruleview_completion-existing-property_01.js rename : browser/devtools/styleinspector/test/browser_bug894376_css_value_completion_existing_property_value_pair.js => browser/devtools/styleinspector/test/browser_ruleview_completion-existing-property_02.js rename : browser/devtools/styleinspector/test/browser_bug893965_css_property_completion_new_property.js => browser/devtools/styleinspector/test/browser_ruleview_completion-new-property_01.js rename : browser/devtools/styleinspector/test/browser_bug894376_css_value_completion_new_property_value_pair.js => browser/devtools/styleinspector/test/browser_ruleview_completion-new-property_02.js rename : browser/devtools/styleinspector/test/browser_ruleview_bug_902966_revert_value_on_ESC.js => browser/devtools/styleinspector/test/browser_ruleview_edit-property-commit.js rename : browser/devtools/styleinspector/test/browser_bug722691_rule_view_increment.js => browser/devtools/styleinspector/test/browser_ruleview_edit-property-increments.js rename : browser/devtools/styleinspector/test/browser_ruleview_manipulation.js => browser/devtools/styleinspector/test/browser_ruleview_edit-property-order.js rename : browser/devtools/styleinspector/test/browser_ruleview_editor_changedvalues_04.js => browser/devtools/styleinspector/test/browser_ruleview_edit-property_01.js rename : browser/devtools/styleinspector/test/browser_ruleview_edit.js => browser/devtools/styleinspector/test/browser_ruleview_edit-property_02.js rename : browser/devtools/styleinspector/test/browser_ruleview_focus.js => browser/devtools/styleinspector/test/browser_ruleview_keybindings.js rename : browser/devtools/styleinspector/test/browser_bug970532_mathml_element.js => browser/devtools/styleinspector/test/browser_ruleview_mathml-element.js rename : browser/devtools/styleinspector/test/browser_bug722196_rule_view_media_queries.js => browser/devtools/styleinspector/test/browser_ruleview_media-queries.js rename : browser/devtools/styleinspector/test/browser_ruleview_multiple_properties_02.js => browser/devtools/styleinspector/test/browser_ruleview_multiple-properties-duplicates.js rename : browser/devtools/styleinspector/test/browser_ruleview_multiple_properties_03.js => browser/devtools/styleinspector/test/browser_ruleview_multiple-properties-priority.js rename : browser/devtools/styleinspector/test/browser_ruleview_multiple_properties_04.js => browser/devtools/styleinspector/test/browser_ruleview_multiple-properties-unfinished_01.js rename : browser/devtools/styleinspector/test/browser_ruleview_multiple_properties_05.js => browser/devtools/styleinspector/test/browser_ruleview_multiple-properties-unfinished_02.js rename : browser/devtools/styleinspector/test/browser_ruleview_original_source_link.js => browser/devtools/styleinspector/test/browser_ruleview_original-source-link.js rename : browser/devtools/styleinspector/test/browser_ruleview_pseudoelement.js => browser/devtools/styleinspector/test/browser_ruleview_pseudo-element.js rename : browser/devtools/styleinspector/test/browser_ruleview_copy.js => browser/devtools/styleinspector/test/browser_ruleview_select-and-copy-styles.js rename : browser/devtools/styleinspector/test/browser_ruleview_734259_style_editor_link.js => browser/devtools/styleinspector/test/browser_ruleview_style-editor-link.js rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_677930_urls_clickable.js => browser/devtools/styleinspector/test/browser_ruleview_urls-clickable.js rename : browser/devtools/styleinspector/test/browser_bug942297_user_property_reset.js => browser/devtools/styleinspector/test/browser_ruleview_user-property-reset.js rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet.js => browser/devtools/styleinspector/test/browser_styleinspector_csslogic-content-stylesheets.js rename : browser/devtools/styleinspector/test/browser_csslogic_inherited.js => browser/devtools/styleinspector/test/browser_styleinspector_csslogic-inherited-properties.js rename : browser/devtools/styleinspector/test/browser_bug_592743_specificity.js => browser/devtools/styleinspector/test/browser_styleinspector_csslogic-specificity.js rename : browser/devtools/styleinspector/test/browser_ruleview_editor.js => browser/devtools/styleinspector/test/browser_styleinspector_inplace-editor.js rename : browser/devtools/styleinspector/test/browser_styleinspector_outputparser.js => browser/devtools/styleinspector/test/browser_styleinspector_output-parser.js rename : browser/devtools/styleinspector/test/browser_bug765105_background_image_tooltip.js => browser/devtools/styleinspector/test/browser_styleinspector_tooltip-background-image.js rename : browser/devtools/styleinspector/test/browser_bug946331_close_tooltip_on_new_selection.js => browser/devtools/styleinspector/test/browser_styleinspector_tooltip-closes-on-new-selection.js rename : browser/devtools/styleinspector/test/browser_bug702577_fontfamily_tooltip_longhand.js => browser/devtools/styleinspector/test/browser_styleinspector_tooltip-longhand-fontfamily.js rename : browser/devtools/styleinspector/test/browser_bug702577_fontfamily_tooltip_shorthand.js => browser/devtools/styleinspector/test/browser_styleinspector_tooltip-shorthand-fontfamily.js rename : browser/devtools/styleinspector/test/browser_bug726427_csstransform_tooltip.js => browser/devtools/styleinspector/test/browser_styleinspector_tooltip-transform.js rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet.html => browser/devtools/styleinspector/test/doc_content_stylesheet.html rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet.xul => browser/devtools/styleinspector/test/doc_content_stylesheet.xul rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet_imported.css => browser/devtools/styleinspector/test/doc_content_stylesheet_imported.css rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet_imported2.css => browser/devtools/styleinspector/test/doc_content_stylesheet_imported2.css rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet_linked.css => browser/devtools/styleinspector/test/doc_content_stylesheet_linked.css rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet_script.css => browser/devtools/styleinspector/test/doc_content_stylesheet_script.css rename : browser/devtools/styleinspector/test/browser_bug705707_is_content_stylesheet_xul.css => browser/devtools/styleinspector/test/doc_content_stylesheet_xul.css rename : browser/devtools/styleinspector/test/browser_bug683672.html => browser/devtools/styleinspector/test/doc_matched_selectors.html rename : browser/devtools/styleinspector/test/browser_bug722196_identify_media_queries.html => browser/devtools/styleinspector/test/doc_media_queries.html rename : browser/devtools/styleinspector/test/browser_ruleview_pseudoelement.html => browser/devtools/styleinspector/test/doc_pseudoelement.html rename : browser/devtools/styleinspector/test/sourcemaps.css => browser/devtools/styleinspector/test/doc_sourcemaps.css rename : browser/devtools/styleinspector/test/sourcemaps.css.map => browser/devtools/styleinspector/test/doc_sourcemaps.css.map rename : browser/devtools/styleinspector/test/sourcemaps.html => browser/devtools/styleinspector/test/doc_sourcemaps.html rename : browser/devtools/styleinspector/test/sourcemaps.scss => browser/devtools/styleinspector/test/doc_sourcemaps.scss rename : browser/devtools/styleinspector/test/browser_ruleview_734259_style_editor_link.css => browser/devtools/styleinspector/test/doc_style_editor_link.css rename : browser/devtools/styleinspector/test/test-image.png => browser/devtools/styleinspector/test/doc_test_image.png rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_677930_urls_clickable/browser_styleinspector_bug_677930_urls_clickable.css => browser/devtools/styleinspector/test/doc_urls_clickable.css rename : browser/devtools/styleinspector/test/browser_styleinspector_bug_677930_urls_clickable.html => browser/devtools/styleinspector/test/doc_urls_clickable.html
69 lines
2.6 KiB
JavaScript
69 lines
2.6 KiB
JavaScript
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
// Test cancelling the addition of a new property in the rule-view
|
|
|
|
let test = asyncTest(function*() {
|
|
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
|
|
let {toolbox, inspector, view} = yield openRuleView();
|
|
|
|
info("Creating the test document");
|
|
let style = "" +
|
|
"#testid {" +
|
|
" background-color: blue;" +
|
|
"}" +
|
|
".testclass, .unmatched {" +
|
|
" background-color: green;" +
|
|
"}";
|
|
let styleNode = addStyle(content.document, style);
|
|
content.document.body.innerHTML = "<div id='testid' class='testclass'>Styled Node</div>" +
|
|
"<div id='testid2'>Styled Node</div>";
|
|
|
|
yield testCancelNew(inspector, view);
|
|
yield testCancelNewOnEscape(inspector, view);
|
|
yield inspector.once("inspector-updated");
|
|
});
|
|
|
|
function* testCancelNew(inspector, ruleView) {
|
|
// Start at the beginning: start to add a rule to the element's style
|
|
// declaration, but leave it empty.
|
|
|
|
let elementRuleEditor = ruleView.element.children[0]._ruleEditor;
|
|
let editor = yield focusEditableField(elementRuleEditor.closeBrace);
|
|
|
|
is(inplaceEditor(elementRuleEditor.newPropSpan), editor,
|
|
"Property editor is focused");
|
|
|
|
let onBlur = once(editor.input, "blur");
|
|
editor.input.blur();
|
|
yield onBlur;
|
|
|
|
ok(!elementRuleEditor.rule._applyingModifications, "Shouldn't have an outstanding modification request after a cancel.");
|
|
is(elementRuleEditor.rule.textProps.length, 0, "Should have canceled creating a new text property.");
|
|
ok(!elementRuleEditor.propertyList.hasChildNodes(), "Should not have any properties.");
|
|
}
|
|
|
|
function* testCancelNewOnEscape(inspector, ruleView) {
|
|
// Start at the beginning: start to add a rule to the element's style
|
|
// declaration, add some text, then press escape.
|
|
|
|
let elementRuleEditor = ruleView.element.children[0]._ruleEditor;
|
|
let editor = yield focusEditableField(elementRuleEditor.closeBrace);
|
|
|
|
is(inplaceEditor(elementRuleEditor.newPropSpan), editor, "Next focused editor should be the new property editor.");
|
|
for (let ch of "background") {
|
|
EventUtils.sendChar(ch, ruleView.doc.defaultView);
|
|
}
|
|
|
|
let onBlur = once(editor.input, "blur");
|
|
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
|
yield onBlur;
|
|
|
|
ok(!elementRuleEditor.rule._applyingModifications, "Shouldn't have an outstanding modification request after a cancel.");
|
|
is(elementRuleEditor.rule.textProps.length, 0, "Should have canceled creating a new text property.");
|
|
ok(!elementRuleEditor.propertyList.hasChildNodes(), "Should not have any properties.");
|
|
}
|