| 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 21 matching lines...) Expand all Loading... |
| 32 rules.push(rule); | 32 rules.push(rule); |
| 33 } | 33 } |
| 34 return new Sass.SASSSupport.AST(document, rules); | 34 return new Sass.SASSSupport.AST(document, rules); |
| 35 } | 35 } |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * @param {!Object} payload | 38 * @param {!Object} payload |
| 39 */ | 39 */ |
| 40 function createTextNode(payload) { | 40 function createTextNode(payload) { |
| 41 var range = Common.TextRange.fromObject(payload); | 41 var range = Common.TextRange.fromObject(payload); |
| 42 var value = text.extract(range); | |
| 43 return new Sass.SASSSupport.TextNode(document, text.extract(range), range); | 42 return new Sass.SASSSupport.TextNode(document, text.extract(range), range); |
| 44 } | 43 } |
| 45 | 44 |
| 46 /** | 45 /** |
| 47 * @param {!Object} payload | 46 * @param {!Object} payload |
| 48 */ | 47 */ |
| 49 function createProperty(payload) { | 48 function createProperty(payload) { |
| 50 var name = createTextNode(payload.name); | 49 var name = createTextNode(payload.name); |
| 51 var value = createTextNode(payload.value); | 50 var value = createTextNode(payload.value); |
| 52 return new Sass.SASSSupport.Property( | 51 return new Sass.SASSSupport.Property( |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 mapping.set(oldProperty.name, newProperty.name); | 657 mapping.set(oldProperty.name, newProperty.name); |
| 659 mapping.set(oldProperty.value, newProperty.value); | 658 mapping.set(oldProperty.value, newProperty.value); |
| 660 if (oldProperty.name.text.trim() !== newProperty.name.text.trim()) | 659 if (oldProperty.name.text.trim() !== newProperty.name.text.trim()) |
| 661 addChange(T.NameChanged, oldRule, newRule, oldPropertyIndex, newPropertyIn
dex); | 660 addChange(T.NameChanged, oldRule, newRule, oldPropertyIndex, newPropertyIn
dex); |
| 662 if (oldProperty.value.text.trim() !== newProperty.value.text.trim()) | 661 if (oldProperty.value.text.trim() !== newProperty.value.text.trim()) |
| 663 addChange(T.ValueChanged, oldRule, newRule, oldPropertyIndex, newPropertyI
ndex); | 662 addChange(T.ValueChanged, oldRule, newRule, oldPropertyIndex, newPropertyI
ndex); |
| 664 if (oldProperty.disabled !== newProperty.disabled) | 663 if (oldProperty.disabled !== newProperty.disabled) |
| 665 addChange(T.PropertyToggled, oldRule, newRule, oldPropertyIndex, newProper
tyIndex); | 664 addChange(T.PropertyToggled, oldRule, newRule, oldPropertyIndex, newProper
tyIndex); |
| 666 } | 665 } |
| 667 }; | 666 }; |
| OLD | NEW |