OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 result.push(new WebInspector.CSSStyleRule(cssModel, matchArray[i].rule, matchArray[i].matchingSelectors)); | 63 result.push(new WebInspector.CSSStyleRule(cssModel, matchArray[i].rule, matchArray[i].matchingSelectors)); |
64 return result; | 64 return result; |
65 } | 65 } |
66 WebInspector.CSSStyleModel.Events = { | 66 WebInspector.CSSStyleModel.Events = { |
67 LayoutEditorChange: "LayoutEditorChange", | 67 LayoutEditorChange: "LayoutEditorChange", |
68 MediaQueryResultChanged: "MediaQueryResultChanged", | 68 MediaQueryResultChanged: "MediaQueryResultChanged", |
69 ModelWasEnabled: "ModelWasEnabled", | 69 ModelWasEnabled: "ModelWasEnabled", |
70 PseudoStateForced: "PseudoStateForced", | 70 PseudoStateForced: "PseudoStateForced", |
71 StyleSheetAdded: "StyleSheetAdded", | 71 StyleSheetAdded: "StyleSheetAdded", |
72 StyleSheetChanged: "StyleSheetChanged", | 72 StyleSheetChanged: "StyleSheetChanged", |
73 StyleSheetRemoved: "StyleSheetRemoved" | 73 StyleSheetRemoved: "StyleSheetRemoved", |
74 ExternalRangeEdit: "ExternalRangeEdit" | |
74 } | 75 } |
75 | 76 |
76 WebInspector.CSSStyleModel.MediaTypes = ["all", "braille", "embossed", "handheld ", "print", "projection", "screen", "speech", "tty", "tv"]; | 77 WebInspector.CSSStyleModel.MediaTypes = ["all", "braille", "embossed", "handheld ", "print", "projection", "screen", "speech", "tty", "tv"]; |
77 | 78 |
78 WebInspector.CSSStyleModel.PseudoStateMarker = "pseudo-state-marker"; | 79 WebInspector.CSSStyleModel.PseudoStateMarker = "pseudo-state-marker"; |
79 | 80 |
80 WebInspector.CSSStyleModel.prototype = { | 81 WebInspector.CSSStyleModel.prototype = { |
81 /** | 82 /** |
82 * @return {!Promise.<!Array.<!WebInspector.CSSMedia>>} | 83 * @return {!Promise.<!Array.<!WebInspector.CSSMedia>>} |
83 */ | 84 */ |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
558 * @return {?Protocol.Error} | 559 * @return {?Protocol.Error} |
559 * @this {WebInspector.CSSStyleModel} | 560 * @this {WebInspector.CSSStyleModel} |
560 */ | 561 */ |
561 function callback(error) | 562 function callback(error) |
562 { | 563 { |
563 if (error) | 564 if (error) |
564 return error; | 565 return error; |
565 | 566 |
566 if (majorChange) | 567 if (majorChange) |
567 this._domModel.markUndoableState(); | 568 this._domModel.markUndoableState(); |
568 this._fireStyleSheetChanged(styleSheetId); | |
569 return null; | 569 return null; |
570 } | 570 } |
571 }, | 571 }, |
572 | 572 |
573 _mainFrameNavigated: function() | 573 _mainFrameNavigated: function() |
574 { | 574 { |
575 this._resetStyleSheets(); | 575 this._resetStyleSheets(); |
576 }, | 576 }, |
577 | 577 |
578 _resetStyleSheets: function() | 578 _resetStyleSheets: function() |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1957 return this._cssModel._agent.setStyleSheetText(this.id, newText, callbac k.bind(this)); | 1957 return this._cssModel._agent.setStyleSheetText(this.id, newText, callbac k.bind(this)); |
1958 | 1958 |
1959 /** | 1959 /** |
1960 * @param {?Protocol.Error} error | 1960 * @param {?Protocol.Error} error |
1961 * @param {string=} sourceMapURL | 1961 * @param {string=} sourceMapURL |
1962 * @return {?Protocol.Error} | 1962 * @return {?Protocol.Error} |
1963 * @this {WebInspector.CSSStyleSheetHeader} | 1963 * @this {WebInspector.CSSStyleSheetHeader} |
1964 */ | 1964 */ |
1965 function callback(error, sourceMapURL) | 1965 function callback(error, sourceMapURL) |
1966 { | 1966 { |
1967 if (!error) | |
1968 this._cssModel._fireStyleSheetChanged(this.id); | |
1967 this.sourceMapURL = sourceMapURL; | 1969 this.sourceMapURL = sourceMapURL; |
1968 return error || null; | 1970 return error || null; |
1969 } | 1971 } |
1970 }, | 1972 }, |
1971 | 1973 |
1972 /** | 1974 /** |
1973 * @param {string} newText | 1975 * @param {string} newText |
1974 * @param {function(?Protocol.Error)} callback | 1976 * @param {function(?Protocol.Error)} callback |
1975 */ | 1977 */ |
1976 setContent: function(newText, callback) | 1978 setContent: function(newText, callback) |
dgozman
2016/01/27 23:14:04
Should we converge to a single method for setting
lushnikov
2016/01/28 00:04:30
Removed the method altogether.
| |
1977 { | 1979 { |
1978 this._setContentPromise(newText) | 1980 this._setContentPromise(newText) |
1979 .catchException(null) | 1981 .catchException(null) |
1980 .then(callback); | 1982 .then(callback); |
1981 }, | 1983 }, |
1982 | 1984 |
1983 /** | 1985 /** |
1984 * @return {boolean} | 1986 * @return {boolean} |
1985 */ | 1987 */ |
1986 isViaInspector: function() | 1988 isViaInspector: function() |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2420 * @constructor | 2422 * @constructor |
2421 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle | 2423 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle |
2422 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle | 2424 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle |
2423 */ | 2425 */ |
2424 WebInspector.CSSStyleModel.InlineStyleResult = function(inlineStyle, attributesS tyle) | 2426 WebInspector.CSSStyleModel.InlineStyleResult = function(inlineStyle, attributesS tyle) |
2425 { | 2427 { |
2426 this.inlineStyle = inlineStyle; | 2428 this.inlineStyle = inlineStyle; |
2427 this.attributesStyle = attributesStyle; | 2429 this.attributesStyle = attributesStyle; |
2428 } | 2430 } |
2429 | 2431 |
OLD | NEW |