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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 _resetStyleSheets: function() | 589 _resetStyleSheets: function() |
590 { | 590 { |
591 var headers = this._styleSheetIdToHeader.values(); | 591 var headers = this._styleSheetIdToHeader.values(); |
592 this._styleSheetIdsForURL.clear(); | 592 this._styleSheetIdsForURL.clear(); |
593 this._styleSheetIdToHeader.clear(); | 593 this._styleSheetIdToHeader.clear(); |
594 for (var i = 0; i < headers.length; ++i) | 594 for (var i = 0; i < headers.length; ++i) |
595 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.Styl
eSheetRemoved, headers[i]); | 595 this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.Styl
eSheetRemoved, headers[i]); |
596 }, | 596 }, |
597 | 597 |
598 updateLocations: function() | |
599 { | |
600 var headers = this._styleSheetIdToHeader.values(); | |
601 for (var i = 0; i < headers.length; ++i) | |
602 headers[i].updateLocations(); | |
603 }, | |
604 | |
605 /** | |
606 * @param {?CSSAgent.StyleSheetId} styleSheetId | |
607 * @param {!WebInspector.CSSLocation} rawLocation | |
608 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel
egate | |
609 * @return {?WebInspector.LiveLocation} | |
610 */ | |
611 createLiveLocation: function(styleSheetId, rawLocation, updateDelegate) | |
612 { | |
613 if (!rawLocation) | |
614 return null; | |
615 var header = styleSheetId ? this.styleSheetHeaderForId(styleSheetId) : n
ull; | |
616 return new WebInspector.CSSStyleModel.LiveLocation(this, header, rawLoca
tion, updateDelegate); | |
617 }, | |
618 | |
619 /** | |
620 * @param {!WebInspector.CSSLocation} rawLocation | |
621 * @return {?WebInspector.UILocation} | |
622 */ | |
623 rawLocationToUILocation: function(rawLocation) | |
624 { | |
625 var frameIdToSheetIds = this._styleSheetIdsForURL.get(rawLocation.url); | |
626 if (!frameIdToSheetIds) | |
627 return null; | |
628 var styleSheetIds = []; | |
629 for (var frameId in frameIdToSheetIds) | |
630 styleSheetIds = styleSheetIds.concat(frameIdToSheetIds[frameId]); | |
631 var uiLocation; | |
632 for (var i = 0; !uiLocation && i < styleSheetIds.length; ++i) { | |
633 var header = this.styleSheetHeaderForId(styleSheetIds[i]); | |
634 console.assert(header); | |
635 uiLocation = header.rawLocationToUILocation(rawLocation.lineNumber,
rawLocation.columnNumber); | |
636 } | |
637 return uiLocation || null; | |
638 }, | |
639 | |
640 __proto__: WebInspector.SDKModel.prototype | 598 __proto__: WebInspector.SDKModel.prototype |
641 } | 599 } |
642 | 600 |
643 /** | 601 /** |
644 * @constructor | 602 * @constructor |
645 * @extends {WebInspector.LiveLocation} | |
646 * @param {!WebInspector.CSSStyleModel} model | |
647 * @param {?WebInspector.CSSStyleSheetHeader} header | |
648 * @param {!WebInspector.CSSLocation} rawLocation | |
649 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat
e | |
650 */ | |
651 WebInspector.CSSStyleModel.LiveLocation = function(model, header, rawLocation, u
pdateDelegate) | |
652 { | |
653 WebInspector.LiveLocation.call(this, rawLocation, updateDelegate); | |
654 this._model = model; | |
655 if (!header) | |
656 this._clearStyleSheet(); | |
657 else | |
658 this._setStyleSheet(header); | |
659 } | |
660 | |
661 WebInspector.CSSStyleModel.LiveLocation.prototype = { | |
662 /** | |
663 * @param {!WebInspector.Event} event | |
664 */ | |
665 _styleSheetAdded: function(event) | |
666 { | |
667 console.assert(!this._header); | |
668 var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.dat
a); | |
669 if (header.sourceURL && header.sourceURL === this.rawLocation().url) | |
670 this._setStyleSheet(header); | |
671 }, | |
672 | |
673 /** | |
674 * @param {!WebInspector.Event} event | |
675 */ | |
676 _styleSheetRemoved: function(event) | |
677 { | |
678 console.assert(this._header); | |
679 var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.dat
a); | |
680 if (this._header !== header) | |
681 return; | |
682 this._header._removeLocation(this); | |
683 this._clearStyleSheet(); | |
684 }, | |
685 | |
686 /** | |
687 * @param {!WebInspector.CSSStyleSheetHeader} header | |
688 */ | |
689 _setStyleSheet: function(header) | |
690 { | |
691 this._header = header; | |
692 this._header.addLiveLocation(this); | |
693 this._model.removeEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetAdded, this._styleSheetAdded, this); | |
694 this._model.addEventListener(WebInspector.CSSStyleModel.Events.StyleShee
tRemoved, this._styleSheetRemoved, this); | |
695 }, | |
696 | |
697 _clearStyleSheet: function() | |
698 { | |
699 delete this._header; | |
700 this._model.removeEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetRemoved, this._styleSheetRemoved, this); | |
701 this._model.addEventListener(WebInspector.CSSStyleModel.Events.StyleShee
tAdded, this._styleSheetAdded, this); | |
702 }, | |
703 | |
704 /** | |
705 * @return {?WebInspector.UILocation} | |
706 */ | |
707 uiLocation: function() | |
708 { | |
709 var cssLocation = /** @type WebInspector.CSSLocation */ (this.rawLocatio
n()); | |
710 if (this._header) | |
711 return this._header.rawLocationToUILocation(cssLocation.lineNumber,
cssLocation.columnNumber); | |
712 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(cssLocation
.url); | |
713 if (!uiSourceCode) | |
714 return null; | |
715 return uiSourceCode.uiLocation(cssLocation.lineNumber, cssLocation.colum
nNumber); | |
716 }, | |
717 | |
718 dispose: function() | |
719 { | |
720 WebInspector.LiveLocation.prototype.dispose.call(this); | |
721 if (this._header) | |
722 this._header._removeLocation(this); | |
723 this._model.removeEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetAdded, this._styleSheetAdded, this); | |
724 this._model.removeEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetRemoved, this._styleSheetRemoved, this); | |
725 }, | |
726 | |
727 __proto__: WebInspector.LiveLocation.prototype | |
728 } | |
729 | |
730 /** | |
731 * @constructor | |
732 * @implements {WebInspector.RawLocation} | 603 * @implements {WebInspector.RawLocation} |
733 * @extends {WebInspector.SDKObject} | 604 * @extends {WebInspector.SDKObject} |
734 * @param {!WebInspector.Target} target | 605 * @param {!WebInspector.Target} target |
735 * @param {?CSSAgent.StyleSheetId} styleSheetId | 606 * @param {?CSSAgent.StyleSheetId} styleSheetId |
736 * @param {string} url | 607 * @param {string} url |
737 * @param {number} lineNumber | 608 * @param {number} lineNumber |
738 * @param {number=} columnNumber | 609 * @param {number=} columnNumber |
739 */ | 610 */ |
740 WebInspector.CSSLocation = function(target, styleSheetId, url, lineNumber, colum
nNumber) | 611 WebInspector.CSSLocation = function(target, styleSheetId, url, lineNumber, colum
nNumber) |
741 { | 612 { |
742 WebInspector.SDKObject.call(this, target); | 613 WebInspector.SDKObject.call(this, target); |
743 this._cssModel = target.cssModel; | 614 this.styleSheetId = styleSheetId; |
744 this._styleSheetId = styleSheetId; | |
745 this.url = url; | 615 this.url = url; |
746 this.lineNumber = lineNumber; | 616 this.lineNumber = lineNumber; |
747 this.columnNumber = columnNumber || 0; | 617 this.columnNumber = columnNumber || 0; |
748 } | 618 } |
749 | 619 |
750 WebInspector.CSSLocation.prototype = { | 620 WebInspector.CSSLocation.prototype = { |
751 /** | |
752 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel
egate | |
753 * @return {!WebInspector.LiveLocation} | |
754 */ | |
755 createLiveLocation: function(updateDelegate) | |
756 { | |
757 var header = this._styleSheetId ? this._cssModel.styleSheetHeaderForId(t
his._styleSheetId) : null; | |
758 return new WebInspector.CSSStyleModel.LiveLocation(this._cssModel, heade
r, this, updateDelegate); | |
759 }, | |
760 | |
761 __proto__: WebInspector.SDKObject.prototype | 621 __proto__: WebInspector.SDKObject.prototype |
762 } | 622 } |
763 | 623 |
764 /** | 624 /** |
765 * @constructor | 625 * @constructor |
766 * @param {!WebInspector.CSSStyleModel} cssModel | 626 * @param {!WebInspector.CSSStyleModel} cssModel |
767 * @param {!CSSAgent.CSSStyle} payload | 627 * @param {!CSSAgent.CSSStyle} payload |
768 */ | 628 */ |
769 WebInspector.CSSStyleDeclaration = function(cssModel, payload) | 629 WebInspector.CSSStyleDeclaration = function(cssModel, payload) |
770 { | 630 { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 916 } |
1057 if (this.styleSheetId) { | 917 if (this.styleSheetId) { |
1058 var styleSheetHeader = cssModel.styleSheetHeaderForId(this.styleSheetId)
; | 918 var styleSheetHeader = cssModel.styleSheetHeaderForId(this.styleSheetId)
; |
1059 this.sourceURL = styleSheetHeader.sourceURL; | 919 this.sourceURL = styleSheetHeader.sourceURL; |
1060 } | 920 } |
1061 this.origin = payload.origin; | 921 this.origin = payload.origin; |
1062 this.style = WebInspector.CSSStyleDeclaration.parsePayload(this._cssModel, p
ayload.style); | 922 this.style = WebInspector.CSSStyleDeclaration.parsePayload(this._cssModel, p
ayload.style); |
1063 this.style.parentRule = this; | 923 this.style.parentRule = this; |
1064 if (payload.media) | 924 if (payload.media) |
1065 this.media = WebInspector.CSSMedia.parseMediaArrayPayload(cssModel, payl
oad.media); | 925 this.media = WebInspector.CSSMedia.parseMediaArrayPayload(cssModel, payl
oad.media); |
1066 this._setRawLocationAndFrameId(); | 926 this._setFrameId(); |
1067 } | 927 } |
1068 | 928 |
1069 /** | 929 /** |
1070 * @param {!WebInspector.CSSStyleModel} cssModel | 930 * @param {!WebInspector.CSSStyleModel} cssModel |
1071 * @param {!CSSAgent.CSSRule} payload | 931 * @param {!CSSAgent.CSSRule} payload |
1072 * @param {!Array.<number>=} matchingIndices | 932 * @param {!Array.<number>=} matchingIndices |
1073 * @return {!WebInspector.CSSRule} | 933 * @return {!WebInspector.CSSRule} |
1074 */ | 934 */ |
1075 WebInspector.CSSRule.parsePayload = function(cssModel, payload, matchingIndices) | 935 WebInspector.CSSRule.parsePayload = function(cssModel, payload, matchingIndices) |
1076 { | 936 { |
(...skipping 17 matching lines...) Expand all Loading... |
1094 selector.range = selector.range.rebaseAfterTextEdit(oldRange
, newRange); | 954 selector.range = selector.range.rebaseAfterTextEdit(oldRange
, newRange); |
1095 } | 955 } |
1096 } | 956 } |
1097 if (this.media) { | 957 if (this.media) { |
1098 for (var i = 0; i < this.media.length; ++i) | 958 for (var i = 0; i < this.media.length; ++i) |
1099 this.media[i].sourceStyleSheetEdited(styleSheetId, oldRange, new
Range); | 959 this.media[i].sourceStyleSheetEdited(styleSheetId, oldRange, new
Range); |
1100 } | 960 } |
1101 this.style.sourceStyleSheetEdited(styleSheetId, oldRange, newRange); | 961 this.style.sourceStyleSheetEdited(styleSheetId, oldRange, newRange); |
1102 }, | 962 }, |
1103 | 963 |
1104 _setRawLocationAndFrameId: function() | 964 _setFrameId: function() |
1105 { | 965 { |
1106 if (!this.styleSheetId) | 966 if (!this.styleSheetId) |
1107 return; | 967 return; |
1108 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); | 968 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); |
1109 this.frameId = styleSheetHeader.frameId; | 969 this.frameId = styleSheetHeader.frameId; |
1110 var url = styleSheetHeader.resourceURL(); | |
1111 if (!url) | |
1112 return; | |
1113 this.rawLocation = new WebInspector.CSSLocation(this._cssModel.target(),
this.styleSheetId, url, this.lineNumberInSource(0), this.columnNumberInSource(0
)); | |
1114 }, | 970 }, |
1115 | 971 |
1116 /** | 972 /** |
1117 * @return {string} | 973 * @return {string} |
1118 */ | 974 */ |
1119 resourceURL: function() | 975 resourceURL: function() |
1120 { | 976 { |
1121 if (!this.styleSheetId) | 977 if (!this.styleSheetId) |
1122 return ""; | 978 return ""; |
1123 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); | 979 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); |
(...skipping 20 matching lines...) Expand all Loading... |
1144 columnNumberInSource: function(selectorIndex) | 1000 columnNumberInSource: function(selectorIndex) |
1145 { | 1001 { |
1146 var selector = this.selectors[selectorIndex]; | 1002 var selector = this.selectors[selectorIndex]; |
1147 if (!selector || !selector.range || !this.styleSheetId) | 1003 if (!selector || !selector.range || !this.styleSheetId) |
1148 return undefined; | 1004 return undefined; |
1149 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); | 1005 var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSh
eetId); |
1150 console.assert(styleSheetHeader); | 1006 console.assert(styleSheetHeader); |
1151 return styleSheetHeader.columnNumberInSource(selector.range.startLine, s
elector.range.startColumn); | 1007 return styleSheetHeader.columnNumberInSource(selector.range.startLine, s
elector.range.startColumn); |
1152 }, | 1008 }, |
1153 | 1009 |
| 1010 /** |
| 1011 * @param {number} index |
| 1012 * @return {?WebInspector.CSSLocation} |
| 1013 */ |
| 1014 rawSelectorLocation: function(index) |
| 1015 { |
| 1016 var lineNumber = this.lineNumberInSource(index); |
| 1017 var columnNumber = this.columnNumberInSource(index); |
| 1018 return new WebInspector.CSSLocation(this._cssModel.target(), this.styleS
heetId || null, this.resourceURL(), lineNumber, columnNumber); |
| 1019 }, |
| 1020 |
1154 get isUserAgent() | 1021 get isUserAgent() |
1155 { | 1022 { |
1156 return this.origin === "user-agent"; | 1023 return this.origin === "user-agent"; |
1157 }, | 1024 }, |
1158 | 1025 |
1159 get isUser() | 1026 get isUser() |
1160 { | 1027 { |
1161 return this.origin === "user"; | 1028 return this.origin === "user"; |
1162 }, | 1029 }, |
1163 | 1030 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 header: function() | 1381 header: function() |
1515 { | 1382 { |
1516 return this.parentStyleSheetId ? this._cssModel.styleSheetHeaderForId(th
is.parentStyleSheetId) : null; | 1383 return this.parentStyleSheetId ? this._cssModel.styleSheetHeaderForId(th
is.parentStyleSheetId) : null; |
1517 }, | 1384 }, |
1518 | 1385 |
1519 /** | 1386 /** |
1520 * @return {?WebInspector.CSSLocation} | 1387 * @return {?WebInspector.CSSLocation} |
1521 */ | 1388 */ |
1522 rawLocation: function() | 1389 rawLocation: function() |
1523 { | 1390 { |
1524 if (!this.header() || typeof this.lineNumberInSource() === "undefined") | 1391 if (!this.header() || this.lineNumberInSource() === undefined) |
1525 return null; | 1392 return null; |
1526 var lineNumber = Number(this.lineNumberInSource()); | 1393 var lineNumber = Number(this.lineNumberInSource()); |
1527 return new WebInspector.CSSLocation(this._cssModel.target(), this.header
().id, this.sourceURL, lineNumber, this.columnNumberInSource()); | 1394 return new WebInspector.CSSLocation(this._cssModel.target(), this.header
().id, this.sourceURL, lineNumber, this.columnNumberInSource()); |
1528 }, | |
1529 | |
1530 /** | |
1531 * @return {?WebInspector.UILocation} | |
1532 */ | |
1533 uiLocation: function() | |
1534 { | |
1535 var styleSheetHeader = this.header(); | |
1536 var lineNumber = this.lineNumberInSource(); | |
1537 var columnNumber = this.columnNumberInSource(); | |
1538 if (typeof lineNumber !== "number") | |
1539 return null; | |
1540 if (styleSheetHeader) | |
1541 return styleSheetHeader.rawLocationToUILocation(lineNumber, columnNu
mber); | |
1542 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(this.source
URL); | |
1543 if (!uiSourceCode) | |
1544 return null; | |
1545 return uiSourceCode.uiLocation(lineNumber, columnNumber); | |
1546 } | 1395 } |
1547 } | 1396 } |
1548 | 1397 |
1549 /** | 1398 /** |
1550 * @constructor | 1399 * @constructor |
1551 * @implements {WebInspector.ContentProvider} | 1400 * @implements {WebInspector.ContentProvider} |
1552 * @param {!WebInspector.CSSStyleModel} cssModel | 1401 * @param {!WebInspector.CSSStyleModel} cssModel |
1553 * @param {!CSSAgent.CSSStyleSheetHeader} payload | 1402 * @param {!CSSAgent.CSSStyleSheetHeader} payload |
1554 */ | 1403 */ |
1555 WebInspector.CSSStyleSheetHeader = function(cssModel, payload) | 1404 WebInspector.CSSStyleSheetHeader = function(cssModel, payload) |
1556 { | 1405 { |
1557 this._cssModel = cssModel; | 1406 this._cssModel = cssModel; |
1558 this.id = payload.styleSheetId; | 1407 this.id = payload.styleSheetId; |
1559 this.frameId = payload.frameId; | 1408 this.frameId = payload.frameId; |
1560 this.sourceURL = payload.sourceURL; | 1409 this.sourceURL = payload.sourceURL; |
1561 this.hasSourceURL = !!payload.hasSourceURL; | 1410 this.hasSourceURL = !!payload.hasSourceURL; |
1562 this.sourceMapURL = payload.sourceMapURL; | 1411 this.sourceMapURL = payload.sourceMapURL; |
1563 this.origin = payload.origin; | 1412 this.origin = payload.origin; |
1564 this.title = payload.title; | 1413 this.title = payload.title; |
1565 this.disabled = payload.disabled; | 1414 this.disabled = payload.disabled; |
1566 this.isInline = payload.isInline; | 1415 this.isInline = payload.isInline; |
1567 this.startLine = payload.startLine; | 1416 this.startLine = payload.startLine; |
1568 this.startColumn = payload.startColumn; | 1417 this.startColumn = payload.startColumn; |
1569 /** @type {!Set.<!WebInspector.CSSStyleModel.LiveLocation>} */ | |
1570 this._locations = new Set(); | |
1571 /** @type {!Array.<!WebInspector.SourceMapping>} */ | |
1572 this._sourceMappings = []; | |
1573 } | 1418 } |
1574 | 1419 |
1575 WebInspector.CSSStyleSheetHeader.prototype = { | 1420 WebInspector.CSSStyleSheetHeader.prototype = { |
1576 /** | 1421 /** |
| 1422 * @return {!WebInspector.Target} |
| 1423 */ |
| 1424 target: function() |
| 1425 { |
| 1426 return this._cssModel.target(); |
| 1427 }, |
| 1428 |
| 1429 /** |
1577 * @return {string} | 1430 * @return {string} |
1578 */ | 1431 */ |
1579 resourceURL: function() | 1432 resourceURL: function() |
1580 { | 1433 { |
1581 return this.isViaInspector() ? this._viaInspectorResourceURL() : this.so
urceURL; | 1434 return this.isViaInspector() ? this._viaInspectorResourceURL() : this.so
urceURL; |
1582 }, | 1435 }, |
1583 | 1436 |
1584 /** | 1437 /** |
1585 * @param {!WebInspector.CSSStyleModel.LiveLocation} location | |
1586 */ | |
1587 addLiveLocation: function(location) | |
1588 { | |
1589 this._locations.add(location); | |
1590 location.update(); | |
1591 }, | |
1592 | |
1593 updateLocations: function() | |
1594 { | |
1595 var items = this._locations.values(); | |
1596 for (var i = 0; i < items.length; ++i) | |
1597 items[i].update(); | |
1598 }, | |
1599 | |
1600 /** | |
1601 * @param {!WebInspector.CSSStyleModel.LiveLocation} location | |
1602 */ | |
1603 _removeLocation: function(location) | |
1604 { | |
1605 this._locations.remove(location); | |
1606 }, | |
1607 | |
1608 /** | |
1609 * @param {number} lineNumber | |
1610 * @param {number=} columnNumber | |
1611 * @return {?WebInspector.UILocation} | |
1612 */ | |
1613 rawLocationToUILocation: function(lineNumber, columnNumber) | |
1614 { | |
1615 var uiLocation = null; | |
1616 var rawLocation = new WebInspector.CSSLocation(this._cssModel.target(),
this.id, this.resourceURL(), lineNumber, columnNumber); | |
1617 for (var i = this._sourceMappings.length - 1; !uiLocation && i >= 0; --i
) | |
1618 uiLocation = this._sourceMappings[i].rawLocationToUILocation(rawLoca
tion); | |
1619 return uiLocation; | |
1620 }, | |
1621 | |
1622 /** | |
1623 * @param {!WebInspector.SourceMapping} sourceMapping | |
1624 */ | |
1625 pushSourceMapping: function(sourceMapping) | |
1626 { | |
1627 this._sourceMappings.push(sourceMapping); | |
1628 this.updateLocations(); | |
1629 }, | |
1630 | |
1631 /** | |
1632 * @return {string} | 1438 * @return {string} |
1633 */ | 1439 */ |
1634 _viaInspectorResourceURL: function() | 1440 _viaInspectorResourceURL: function() |
1635 { | 1441 { |
1636 var frame = this._cssModel.target().resourceTreeModel.frameForId(this.fr
ameId); | 1442 var frame = this._cssModel.target().resourceTreeModel.frameForId(this.fr
ameId); |
1637 console.assert(frame); | 1443 console.assert(frame); |
1638 var parsedURL = new WebInspector.ParsedURL(frame.url); | 1444 var parsedURL = new WebInspector.ParsedURL(frame.url); |
1639 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp
onents; | 1445 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp
onents; |
1640 if (!fakeURL.endsWith("/")) | 1446 if (!fakeURL.endsWith("/")) |
1641 fakeURL += "/"; | 1447 fakeURL += "/"; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 newText += "\n/*# sourceURL=" + this.sourceURL + " */"; | 1544 newText += "\n/*# sourceURL=" + this.sourceURL + " */"; |
1739 this._cssModel._agent.setStyleSheetText(this.id, newText, callback); | 1545 this._cssModel._agent.setStyleSheetText(this.id, newText, callback); |
1740 }, | 1546 }, |
1741 | 1547 |
1742 /** | 1548 /** |
1743 * @return {boolean} | 1549 * @return {boolean} |
1744 */ | 1550 */ |
1745 isViaInspector: function() | 1551 isViaInspector: function() |
1746 { | 1552 { |
1747 return this.origin === "inspector"; | 1553 return this.origin === "inspector"; |
1748 }, | 1554 } |
1749 | |
1750 } | 1555 } |
1751 | 1556 |
1752 /** | 1557 /** |
1753 * @constructor | 1558 * @constructor |
1754 * @implements {CSSAgent.Dispatcher} | 1559 * @implements {CSSAgent.Dispatcher} |
1755 * @param {!WebInspector.CSSStyleModel} cssModel | 1560 * @param {!WebInspector.CSSStyleModel} cssModel |
1756 */ | 1561 */ |
1757 WebInspector.CSSDispatcher = function(cssModel) | 1562 WebInspector.CSSDispatcher = function(cssModel) |
1758 { | 1563 { |
1759 this._cssModel = cssModel; | 1564 this._cssModel = cssModel; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 for (var i = 0; i < callbacks.length; ++i) | 1641 for (var i = 0; i < callbacks.length; ++i) |
1837 callbacks[i](computedStyle); | 1642 callbacks[i](computedStyle); |
1838 } | 1643 } |
1839 } | 1644 } |
1840 } | 1645 } |
1841 | 1646 |
1842 /** | 1647 /** |
1843 * @type {!WebInspector.CSSStyleModel} | 1648 * @type {!WebInspector.CSSStyleModel} |
1844 */ | 1649 */ |
1845 WebInspector.cssModel; | 1650 WebInspector.cssModel; |
OLD | NEW |