| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 Sass.SASSSupport = {}; | 4 Sass.SASSSupport = {}; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @param {string} url | 7 * @param {string} url |
| 8 * @param {string} content | 8 * @param {string} content |
| 9 * @return {!Promise<!Sass.SASSSupport.AST>} | 9 * @return {!Promise<!Sass.SASSSupport.AST>} |
| 10 */ | 10 */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 rules.push(rule); | 29 rules.push(rule); |
| 30 } | 30 } |
| 31 return new Sass.SASSSupport.AST(document, rules); | 31 return new Sass.SASSSupport.AST(document, rules); |
| 32 } | 32 } |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @param {!Object} payload | 35 * @param {!Object} payload |
| 36 */ | 36 */ |
| 37 function createTextNode(payload) { | 37 function createTextNode(payload) { |
| 38 var range = Common.TextRange.fromObject(payload); | 38 var range = Common.TextRange.fromObject(payload); |
| 39 var value = text.extract(range); | |
| 40 return new Sass.SASSSupport.TextNode(document, text.extract(range), range); | 39 return new Sass.SASSSupport.TextNode(document, text.extract(range), range); |
| 41 } | 40 } |
| 42 | 41 |
| 43 /** | 42 /** |
| 44 * @param {!Object} payload | 43 * @param {!Object} payload |
| 45 */ | 44 */ |
| 46 function createProperty(payload) { | 45 function createProperty(payload) { |
| 47 var name = createTextNode(payload.name); | 46 var name = createTextNode(payload.name); |
| 48 var value = createTextNode(payload.value); | 47 var value = createTextNode(payload.value); |
| 49 return new Sass.SASSSupport.Property( | 48 return new Sass.SASSSupport.Property( |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 mapping.set(oldProperty.name, newProperty.name); | 654 mapping.set(oldProperty.name, newProperty.name); |
| 656 mapping.set(oldProperty.value, newProperty.value); | 655 mapping.set(oldProperty.value, newProperty.value); |
| 657 if (oldProperty.name.text.trim() !== newProperty.name.text.trim()) | 656 if (oldProperty.name.text.trim() !== newProperty.name.text.trim()) |
| 658 addChange(T.NameChanged, oldRule, newRule, oldPropertyIndex, newPropertyIn
dex); | 657 addChange(T.NameChanged, oldRule, newRule, oldPropertyIndex, newPropertyIn
dex); |
| 659 if (oldProperty.value.text.trim() !== newProperty.value.text.trim()) | 658 if (oldProperty.value.text.trim() !== newProperty.value.text.trim()) |
| 660 addChange(T.ValueChanged, oldRule, newRule, oldPropertyIndex, newPropertyI
ndex); | 659 addChange(T.ValueChanged, oldRule, newRule, oldPropertyIndex, newPropertyI
ndex); |
| 661 if (oldProperty.disabled !== newProperty.disabled) | 660 if (oldProperty.disabled !== newProperty.disabled) |
| 662 addChange(T.PropertyToggled, oldRule, newRule, oldPropertyIndex, newProper
tyIndex); | 661 addChange(T.PropertyToggled, oldRule, newRule, oldPropertyIndex, newProper
tyIndex); |
| 663 } | 662 } |
| 664 }; | 663 }; |
| OLD | NEW |