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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 458213002: DevTools: add test to verify simple selector behavior. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebInspector.BlankStylePropertiesSection.makeNormal is private Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/inspector/elements/styles/styles-add-new-rule-tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 } 1867 }
1868 1868
1869 /** 1869 /**
1870 * @param {!WebInspector.CSSRule} newRule 1870 * @param {!WebInspector.CSSRule} newRule
1871 * @this {WebInspector.StylePropertiesSection} 1871 * @this {WebInspector.StylePropertiesSection}
1872 */ 1872 */
1873 function successCallback(newRule) 1873 function successCallback(newRule)
1874 { 1874 {
1875 var doesSelectorAffectSelectedNode = newRule.matchingSelectors.lengt h > 0; 1875 var doesSelectorAffectSelectedNode = newRule.matchingSelectors.lengt h > 0;
1876 var styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.resourceURL(), rule: newRule }; 1876 var styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.resourceURL(), rule: newRule };
1877 this.makeNormal(styleRule); 1877 this._makeNormal(styleRule);
1878 1878
1879 if (!doesSelectorAffectSelectedNode) { 1879 if (!doesSelectorAffectSelectedNode) {
1880 this.noAffect = true; 1880 this.noAffect = true;
1881 this.element.classList.add("no-affect"); 1881 this.element.classList.add("no-affect");
1882 } 1882 }
1883 1883
1884 this._updateRuleOrigin(); 1884 this._updateRuleOrigin();
1885 this.expand(); 1885 this.expand();
1886 if (this.element.parentElement) // Might have been detached already. 1886 if (this.element.parentElement) // Might have been detached already.
1887 this._moveEditorFromSelector(moveDirection); 1887 this._moveEditorFromSelector(moveDirection);
(...skipping 29 matching lines...) Expand all
1917 delete this._parentPane._userOperation; 1917 delete this._parentPane._userOperation;
1918 if (!this.isBlank) { 1918 if (!this.isBlank) {
1919 WebInspector.StylePropertiesSection.prototype.editingSelectorCancell ed.call(this); 1919 WebInspector.StylePropertiesSection.prototype.editingSelectorCancell ed.call(this);
1920 return; 1920 return;
1921 } 1921 }
1922 1922
1923 this._editingSelectorEnded(); 1923 this._editingSelectorEnded();
1924 this._parentPane.removeSection(this); 1924 this._parentPane.removeSection(this);
1925 }, 1925 },
1926 1926
1927 makeNormal: function(styleRule) 1927 _makeNormal: function(styleRule)
1928 { 1928 {
1929 this.element.classList.remove("blank-section"); 1929 this.element.classList.remove("blank-section");
1930 this.styleRule = styleRule; 1930 this.styleRule = styleRule;
1931 this.rule = styleRule.rule; 1931 this.rule = styleRule.rule;
1932 1932
1933 // FIXME: replace this instance by a normal WebInspector.StyleProperties Section. 1933 // FIXME: replace this instance by a normal WebInspector.StyleProperties Section.
1934 this._normal = true; 1934 this._normal = true;
1935 }, 1935 },
1936 1936
1937 __proto__: WebInspector.StylePropertiesSection.prototype 1937 __proto__: WebInspector.StylePropertiesSection.prototype
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) { 3311 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) {
3312 for (var i = 0; i < results.length; ++i) 3312 for (var i = 0; i < results.length; ++i)
3313 results[i] = results[i].toUpperCase(); 3313 results[i] = results[i].toUpperCase();
3314 } 3314 }
3315 var selectedIndex = this._cssCompletions.mostUsedOf(results); 3315 var selectedIndex = this._cssCompletions.mostUsedOf(results);
3316 completionsReadyCallback(results, selectedIndex); 3316 completionsReadyCallback(results, selectedIndex);
3317 }, 3317 },
3318 3318
3319 __proto__: WebInspector.TextPrompt.prototype 3319 __proto__: WebInspector.TextPrompt.prototype
3320 } 3320 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/styles/styles-add-new-rule-tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698