Changeset 249089 in webkit
- Timestamp:
- Aug 24, 2019 11:21:04 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249078 r249089 1 2019-08-24 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: "Copy Rule" menu item does not propagate comments properly 4 https://bugs.webkit.org/show_bug.cgi?id=201095 5 6 Reviewed by Joseph Pecoraro. 7 8 * inspector/css/generateCSSRuleString.html: 9 * inspector/css/generateCSSRuleString-expected.txt: 10 1 11 2019-08-23 Devin Rousso <drousso@apple.com> 2 12 -
trunk/LayoutTests/inspector/css/generateCSSRuleString-expected.txt
r248202 r249089 5 5 -- Running test case: CSS.generateCSSRuleString.InlineStyle 6 6 #test-node { 7 a-b: 1; 8 c-d: 2; 7 a: 1; 8 b: 2; 9 c: 3; 10 } 11 12 -- Running test case: CSS.generateCSSRuleString.InlineStyle.WithCommentedProperty 13 #test-node { 14 a: 1; 15 /* b: 2; */ 16 c: 3; 9 17 } 10 18 … … 13 21 @media only screen and (min-height: 0px) { 14 22 body > div#test-node { 15 a-b: 1; 16 c-d: 2; 23 a: 1; 24 b: 2; 25 c: 3; 17 26 } 18 27 } … … 20 29 @media only screen and (min-width: 0px) { 21 30 body > #test-node { 22 a-b: 1; 23 c-d: 2; 31 a: 1; 32 b: 2; 33 c: 3; 24 34 } 25 35 } 26 36 body > div { 27 a-b: 1; 28 c-d: 2; 37 a: 1; 38 b: 2; 39 c: 3; 29 40 } 30 41 body > * { 31 a-b: 1; 32 c-d: 2; 42 a: 1; 43 b: 2; 44 c: 3; 33 45 } 34 46 * { 35 a-b: 1; 36 c-d: 2; 47 a: 1; 48 b: 2; 49 c: 3; 37 50 } 38 51 address, article, aside, div, footer, header, hgroup, layer, main, nav, section { … … 40 53 } 41 54 55 -- Running test case: CSS.generateCSSRuleString.MatchedRules.WithCommentedProperties 56 @media only screen and (min-width: 0px) { 57 @media only screen and (min-height: 0px) { 58 body > div#test-node { 59 a: 1; 60 /* b: 2; */ 61 c: 3; 62 } 63 } 64 } 65 @media only screen and (min-width: 0px) { 66 body > #test-node { 67 a: 1; 68 /* b: 2; */ 69 c: 3; 70 } 71 } 72 body > div { 73 a: 1; 74 /* b: 2; */ 75 c: 3; 76 } 77 body > * { 78 a: 1; 79 /* b: 2; */ 80 c: 3; 81 } 82 * { 83 a: 1; 84 /* b: 2; */ 85 c: 3; 86 } 87 -
trunk/LayoutTests/inspector/css/generateCSSRuleString.html
r248202 r249089 3 3 <head> 4 4 <style> 5 *{a -b:1;c-d:2}6 body>*{a -b:1;c-d:2}7 @media all {body>div{a -b:1;c-d:2}}8 @media only screen and (min-width:0px) {body>#test-node{a -b:1;c-d:2}}9 @media only screen and (min-width:0px) {@media only screen and (min-height:0px) {body>div#test-node{a -b:1;c-d:2}}}5 *{a:1;b:2;c:3} 6 body>*{a:1;b:2;c:3} 7 @media all {body>div{a:1;b:2;c:3}} 8 @media only screen and (min-width:0px) {body>#test-node{a:1;b:2;c:3}} 9 @media only screen and (min-width:0px) {@media only screen and (min-height:0px) {body>div#test-node{a:1;b:2;c:3}}} 10 10 </style> 11 11 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> … … 25 25 26 26 suite.addTestCase({ 27 name: "CSS.generateCSSRuleString.InlineStyle.WithCommentedProperty", 28 description: "Check the formatting of the generated inline style string if a property is commented out.", 29 test() { 30 nodeStyles.inlineStyle.properties[1].commentOut(true); 31 InspectorTest.log(nodeStyles.inlineStyle.generateCSSRuleString()); 32 }, 33 }); 34 35 suite.addTestCase({ 27 36 name: "CSS.generateCSSRuleString.MatchedRules", 28 37 description: "Check the formatting of the generated string for all matched CSS rules.", … … 30 39 for (let rule of nodeStyles.matchedRules) 31 40 InspectorTest.log(rule.style.generateCSSRuleString()); 41 } 42 }); 43 44 suite.addTestCase({ 45 name: "CSS.generateCSSRuleString.MatchedRules.WithCommentedProperties", 46 description: "Check the formatting of the generated string for all matched CSS rules if a property is commented out in each.", 47 test() { 48 for (let rule of nodeStyles.matchedRules) { 49 if (!rule.style.editable) 50 continue; 51 52 rule.style.properties[1].commentOut(true); 53 InspectorTest.log(rule.style.generateCSSRuleString()); 54 } 32 55 } 33 56 }); … … 54 77 <body onload="runTest()"> 55 78 <p>Testing that generated CSS rule strings have proper formatting.</p> 56 <div id="test-node" style="a -b:1;c-d:2"></div>79 <div id="test-node" style="a:1;b:2;c:3"></div> 57 80 </body> 58 81 </html> -
trunk/Source/WebInspectorUI/ChangeLog
r249078 r249089 1 2019-08-24 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: "Copy Rule" menu item does not propagate comments properly 4 https://bugs.webkit.org/show_bug.cgi?id=201095 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Models/CSSProperty.js: 9 (WI.CSSProperty.prototype.commentOut): 10 (WI.CSSProperty.prototype.get formattedText): 11 Wrap the `text` in `/* ${text} */` if the `WI.CSSProperty` isn't `enabled` (e.g. commented out). 12 1 13 2019-08-23 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
r248391 r249089 150 150 commentOut(disabled) 151 151 { 152 console.assert(this.editable); 152 153 if (this._enabled === !disabled) 153 154 return; … … 182 183 return ""; 183 184 184 return `${this._name}: ${this._rawValue};`; 185 let text = `${this._name}: ${this._rawValue};`; 186 if (!this._enabled) 187 text = "/* " + text + " */"; 188 return text; 185 189 } 186 190
Note: See TracChangeset
for help on using the changeset viewer.