OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 UpdateLayer: "UpdateLayer", | 67 UpdateLayer: "UpdateLayer", |
68 UpdateLayerTree: "UpdateLayerTree", | 68 UpdateLayerTree: "UpdateLayerTree", |
69 PaintSetup: "PaintSetup", | 69 PaintSetup: "PaintSetup", |
70 Paint: "Paint", | 70 Paint: "Paint", |
71 PaintImage: "PaintImage", | 71 PaintImage: "PaintImage", |
72 Rasterize: "Rasterize", | 72 Rasterize: "Rasterize", |
73 RasterTask: "RasterTask", | 73 RasterTask: "RasterTask", |
74 ScrollLayer: "ScrollLayer", | 74 ScrollLayer: "ScrollLayer", |
75 CompositeLayers: "CompositeLayers", | 75 CompositeLayers: "CompositeLayers", |
76 | 76 |
| 77 ScheduleStyleInvalidationTracking: "ScheduleStyleInvalidationTracking", |
77 StyleRecalcInvalidationTracking: "StyleRecalcInvalidationTracking", | 78 StyleRecalcInvalidationTracking: "StyleRecalcInvalidationTracking", |
| 79 StyleInvalidatorInvalidationTracking: "StyleInvalidatorInvalidationTracking"
, |
78 LayoutInvalidationTracking: "LayoutInvalidationTracking", | 80 LayoutInvalidationTracking: "LayoutInvalidationTracking", |
79 LayerInvalidationTracking: "LayerInvalidationTracking", | 81 LayerInvalidationTracking: "LayerInvalidationTracking", |
80 PaintInvalidationTracking: "PaintInvalidationTracking", | 82 PaintInvalidationTracking: "PaintInvalidationTracking", |
81 | 83 |
82 ParseHTML: "ParseHTML", | 84 ParseHTML: "ParseHTML", |
83 ParseAuthorStyleSheet: "ParseAuthorStyleSheet", | 85 ParseAuthorStyleSheet: "ParseAuthorStyleSheet", |
84 | 86 |
85 TimerInstall: "TimerInstall", | 87 TimerInstall: "TimerInstall", |
86 TimerRemove: "TimerRemove", | 88 TimerRemove: "TimerRemove", |
87 TimerFire: "TimerFire", | 89 TimerFire: "TimerFire", |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 this._lastScheduleStyleRecalculation[event.args["data"]["frame"]] =
event; | 946 this._lastScheduleStyleRecalculation[event.args["data"]["frame"]] =
event; |
945 break; | 947 break; |
946 | 948 |
947 case recordTypes.RecalculateStyles: | 949 case recordTypes.RecalculateStyles: |
948 this._invalidationTracker.didRecalcStyle(event); | 950 this._invalidationTracker.didRecalcStyle(event); |
949 if (event.args["beginData"]) | 951 if (event.args["beginData"]) |
950 event.initiator = this._lastScheduleStyleRecalculation[event.arg
s["beginData"]["frame"]]; | 952 event.initiator = this._lastScheduleStyleRecalculation[event.arg
s["beginData"]["frame"]]; |
951 this._lastRecalculateStylesEvent = event; | 953 this._lastRecalculateStylesEvent = event; |
952 break; | 954 break; |
953 | 955 |
| 956 case recordTypes.ScheduleStyleInvalidationTracking: |
954 case recordTypes.StyleRecalcInvalidationTracking: | 957 case recordTypes.StyleRecalcInvalidationTracking: |
| 958 case recordTypes.StyleInvalidatorInvalidationTracking: |
955 case recordTypes.LayoutInvalidationTracking: | 959 case recordTypes.LayoutInvalidationTracking: |
956 case recordTypes.LayerInvalidationTracking: | 960 case recordTypes.LayerInvalidationTracking: |
957 case recordTypes.PaintInvalidationTracking: | 961 case recordTypes.PaintInvalidationTracking: |
958 this._invalidationTracker.addInvalidation(event); | 962 this._invalidationTracker.addInvalidation(new WebInspector.Invalidat
ionTrackingEvent(event)); |
959 break; | 963 break; |
960 | 964 |
961 case recordTypes.InvalidateLayout: | 965 case recordTypes.InvalidateLayout: |
962 // Consider style recalculation as a reason for layout invalidation, | 966 // Consider style recalculation as a reason for layout invalidation, |
963 // but only if we had no earlier layout invalidation records. | 967 // but only if we had no earlier layout invalidation records. |
964 var layoutInitator = event; | 968 var layoutInitator = event; |
965 var frameId = event.args["data"]["frame"]; | 969 var frameId = event.args["data"]["frame"]; |
966 if (!this._layoutInvalidate[frameId] && this._lastRecalculateStylesE
vent && this._lastRecalculateStylesEvent.endTime > event.startTime) | 970 if (!this._layoutInvalidate[frameId] && this._lastRecalculateStylesE
vent && this._lastRecalculateStylesEvent.endTime > event.startTime) |
967 layoutInitator = this._lastRecalculateStylesEvent.initiator; | 971 layoutInitator = this._lastRecalculateStylesEvent.initiator; |
968 this._layoutInvalidate[frameId] = layoutInitator; | 972 this._layoutInvalidate[frameId] = layoutInitator; |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 */ | 1661 */ |
1658 onError: function(reader, event) { }, | 1662 onError: function(reader, event) { }, |
1659 } | 1663 } |
1660 | 1664 |
1661 /** | 1665 /** |
1662 * @constructor | 1666 * @constructor |
1663 * @param {!WebInspector.TracingModel.Event} event | 1667 * @param {!WebInspector.TracingModel.Event} event |
1664 */ | 1668 */ |
1665 WebInspector.InvalidationTrackingEvent = function(event) | 1669 WebInspector.InvalidationTrackingEvent = function(event) |
1666 { | 1670 { |
| 1671 /** @type {string} */ |
1667 this.type = event.name; | 1672 this.type = event.name; |
1668 this.frameId = event.args["data"]["frame"]; | 1673 /** @type {number} */ |
1669 this.nodeId = event.args["data"]["nodeId"]; | 1674 this.startTime = event.startTime; |
1670 this.nodeName = event.args["data"]["nodeName"]; | 1675 /** @type {!WebInspector.TracingModel.Event} */ |
1671 this.paintId = event.args["data"]["paintId"]; | 1676 this._tracingEvent = event; |
1672 | 1677 |
1673 var reason = event.args["data"]["reason"]; | 1678 var eventData = event.args["data"]; |
1674 var stackTrace = event.args["data"]["stackTrace"]; | |
1675 | 1679 |
1676 if (!reason && stackTrace && this.type === WebInspector.TimelineModel.Record
Type.LayoutInvalidationTracking) | 1680 /** @type {number} */ |
1677 reason = "Layout forced"; | 1681 this.frame = eventData["frame"]; |
| 1682 /** @type {?number} */ |
| 1683 this.nodeId = eventData["nodeId"]; |
| 1684 /** @type {?string} */ |
| 1685 this.nodeName = eventData["nodeName"]; |
| 1686 /** @type {?number} */ |
| 1687 this.paintId = eventData["paintId"]; |
| 1688 /** @type {?number} */ |
| 1689 this.invalidationSet = eventData["invalidationSet"]; |
| 1690 /** @type {?string} */ |
| 1691 this.invalidatedSelectorId = eventData["invalidatedSelectorId"]; |
| 1692 /** @type {?string} */ |
| 1693 this.changedId = eventData["changedId"]; |
| 1694 /** @type {?string} */ |
| 1695 this.changedClass = eventData["changedClass"]; |
| 1696 /** @type {?string} */ |
| 1697 this.changedAttribute = eventData["changedAttribute"]; |
| 1698 /** @type {?string} */ |
| 1699 this.changedPseudo = eventData["changedPseudo"]; |
| 1700 /** @type {?string} */ |
| 1701 this.selectorPart = eventData["selectorPart"]; |
| 1702 /** @type {?string} */ |
| 1703 this.extraData = eventData["extraData"]; |
| 1704 /** @type {?Array.<!Object.<string, number>>} */ |
| 1705 this.invalidationList = eventData["invalidationList"]; |
| 1706 /** @type {!WebInspector.InvalidationCause} */ |
| 1707 this.cause = {reason: eventData["reason"], stackTrace: eventData["stackTrace
"]}; |
1678 | 1708 |
1679 if (reason || stackTrace) | 1709 // FIXME: Move this to TimelineUIUtils.js. |
1680 this.cause = {reason: reason, stackTrace: stackTrace}; | 1710 if (!this.cause.reason && this.cause.stackTrace && this.type === WebInspecto
r.TimelineModel.RecordType.LayoutInvalidationTracking) |
| 1711 this.cause.reason = "Layout forced"; |
1681 } | 1712 } |
1682 | 1713 |
1683 /** @typedef {{reason: string, stackTrace: ?Array.<!ConsoleAgent.CallFrame>}} */ | 1714 /** @typedef {{reason: string, stackTrace: ?Array.<!ConsoleAgent.CallFrame>}} */ |
1684 WebInspector.InvalidationCause; | 1715 WebInspector.InvalidationCause; |
1685 | 1716 |
1686 /** | 1717 /** |
1687 * @constructor | 1718 * @constructor |
1688 */ | 1719 */ |
1689 WebInspector.InvalidationTracker = function() | 1720 WebInspector.InvalidationTracker = function() |
1690 { | 1721 { |
1691 this._initializePerFrameState(); | 1722 this._initializePerFrameState(); |
1692 } | 1723 } |
1693 | 1724 |
1694 WebInspector.InvalidationTracker.prototype = { | 1725 WebInspector.InvalidationTracker.prototype = { |
1695 /** | 1726 /** |
1696 * @param {!WebInspector.TracingModel.Event} event | 1727 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
1697 */ | 1728 */ |
1698 addInvalidation: function(event) | 1729 addInvalidation: function(invalidation) |
1699 { | 1730 { |
1700 var invalidation = new WebInspector.InvalidationTrackingEvent(event); | |
1701 this._startNewFrameIfNeeded(); | 1731 this._startNewFrameIfNeeded(); |
1702 | 1732 |
1703 if (!invalidation.nodeId && !invalidation.paintId) { | 1733 if (!invalidation.nodeId && !invalidation.paintId) { |
1704 console.error("Invalidation lacks node information."); | 1734 console.error("Invalidation lacks node information."); |
1705 console.error(invalidation); | 1735 console.error(invalidation); |
1706 return; | 1736 return; |
1707 } | 1737 } |
1708 | 1738 |
1709 // PaintInvalidationTracking events provide a paintId and a nodeId which | 1739 // PaintInvalidationTracking events provide a paintId and a nodeId which |
1710 // we can use to update the paintId for all other invalidation tracking | 1740 // we can use to update the paintId for all other invalidation tracking |
1711 // events. | 1741 // events. |
1712 var recordTypes = WebInspector.TimelineModel.RecordType; | 1742 var recordTypes = WebInspector.TimelineModel.RecordType; |
1713 if (invalidation.type === recordTypes.PaintInvalidationTracking) { | 1743 if (invalidation.type === recordTypes.PaintInvalidationTracking) { |
1714 this._forAllInvalidations(updatePaintId); | 1744 this._forAllInvalidations(updatePaintId); |
1715 | 1745 |
1716 // PaintInvalidationTracking is only used for updating paintIds. | 1746 // PaintInvalidationTracking is only used for updating paintIds. |
1717 return; | 1747 return; |
1718 } | 1748 } |
1719 | 1749 |
1720 // StyleRecalcInvalidationTracking events can occur before and during | 1750 // Suppress StyleInvalidator StyleRecalcInvalidationTracking invalidatio
ns because they |
1721 // recalc style. didRecalcStyle handles StyleRecalcInvalidationTracking | 1751 // will be handled by StyleInvalidatorInvalidationTracking. |
1722 // events that occur before the recalc style event but we need to handle | 1752 // FIXME: Investigate if we can remove StyleInvalidator invalidations en
tirely. |
1723 // StyleRecalcInvalidationTracking events during recalc style here. | 1753 if (invalidation.type === recordTypes.StyleRecalcInvalidationTracking &&
invalidation.cause.reason === "StyleInvalidator") |
1724 if (invalidation.type === recordTypes.StyleRecalcInvalidationTracking) { | 1754 return; |
1725 var duringRecalcStyle = event.startTime && this._lastRecalcStyle | 1755 |
1726 && event.startTime >= this._lastRecalcStyle.startTime | 1756 // Style invalidation events can occur before and during recalc style. d
idRecalcStyle |
1727 && event.startTime <= this._lastRecalcStyle.endTime; | 1757 // handles style invalidations that occur before the recalc style event
but we need to |
| 1758 // handle style recalc invalidations during recalc style here. |
| 1759 var styleRecalcInvalidation = (invalidation.type === recordTypes.Schedul
eStyleInvalidationTracking |
| 1760 || invalidation.type === recordTypes.StyleInvalidatorInvalidationTra
cking |
| 1761 || invalidation.type === recordTypes.StyleRecalcInvalidationTracking
); |
| 1762 if (styleRecalcInvalidation) { |
| 1763 var duringRecalcStyle = invalidation.startTime && this._lastRecalcSt
yle |
| 1764 && invalidation.startTime >= this._lastRecalcStyle.startTime |
| 1765 && invalidation.startTime <= this._lastRecalcStyle.endTime; |
1728 if (duringRecalcStyle) | 1766 if (duringRecalcStyle) |
1729 this._associateWithLastRecalcStyleEvent(invalidation); | 1767 this._associateWithLastRecalcStyleEvent(invalidation); |
1730 } | 1768 } |
1731 | 1769 |
1732 // Record the invalidation so later events can look it up. | 1770 // Record the invalidation so later events can look it up. |
1733 if (this._invalidations[invalidation.type]) | 1771 if (this._invalidations[invalidation.type]) |
1734 this._invalidations[invalidation.type].push(invalidation); | 1772 this._invalidations[invalidation.type].push(invalidation); |
1735 else | 1773 else |
1736 this._invalidations[invalidation.type] = [ invalidation ]; | 1774 this._invalidations[invalidation.type] = [ invalidation ]; |
1737 | 1775 |
1738 | 1776 |
1739 /** | 1777 /** |
1740 * @param {!WebInspector.InvalidationTrackingEvent} invalidationToUpdate | 1778 * @param {!WebInspector.InvalidationTrackingEvent} invalidationToUpdate |
1741 */ | 1779 */ |
1742 function updatePaintId(invalidationToUpdate) | 1780 function updatePaintId(invalidationToUpdate) |
1743 { | 1781 { |
1744 if (invalidationToUpdate.nodeId === invalidation.nodeId) | 1782 if (invalidationToUpdate.nodeId === invalidation.nodeId) |
1745 invalidationToUpdate.paintId = invalidation.paintId; | 1783 invalidationToUpdate.paintId = invalidation.paintId; |
1746 } | 1784 } |
1747 }, | 1785 }, |
1748 | 1786 |
1749 /** | 1787 /** |
1750 * @param {!WebInspector.TracingModel.Event} recalcStyleEvent | 1788 * @param {!WebInspector.TracingModel.Event} recalcStyleEvent |
1751 */ | 1789 */ |
1752 didRecalcStyle: function(recalcStyleEvent) | 1790 didRecalcStyle: function(recalcStyleEvent) |
1753 { | 1791 { |
1754 this._lastRecalcStyle = recalcStyleEvent; | 1792 this._lastRecalcStyle = recalcStyleEvent; |
1755 this._forAllInvalidations(this._associateWithLastRecalcStyleEvent, | 1793 var types = [WebInspector.TimelineModel.RecordType.ScheduleStyleInvalida
tionTracking, |
1756 [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracki
ng]); | 1794 WebInspector.TimelineModel.RecordType.StyleInvalidatorInvalidati
onTracking, |
| 1795 WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTra
cking]; |
| 1796 this._forAllInvalidations(this._associateWithLastRecalcStyleEvent, types
); |
1757 }, | 1797 }, |
1758 | 1798 |
1759 /** | 1799 /** |
1760 * @param {!WebInspector.InvalidationTrackingEvent} invalidation | 1800 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
1761 */ | 1801 */ |
1762 _associateWithLastRecalcStyleEvent: function(invalidation) | 1802 _associateWithLastRecalcStyleEvent: function(invalidation) |
1763 { | 1803 { |
1764 if (invalidation.linkedRecalcStyleEvent) | 1804 if (invalidation.linkedRecalcStyleEvent) |
1765 return; | 1805 return; |
| 1806 |
| 1807 var recordTypes = WebInspector.TimelineModel.RecordType; |
1766 var recalcStyleFrameId = this._lastRecalcStyle.args["beginData"]["frame"
]; | 1808 var recalcStyleFrameId = this._lastRecalcStyle.args["beginData"]["frame"
]; |
1767 this._addInvalidationToEvent(this._lastRecalcStyle, recalcStyleFrameId,
invalidation); | 1809 if (invalidation.type === recordTypes.StyleInvalidatorInvalidationTracki
ng) { |
| 1810 // Instead of calling _addInvalidationToEvent directly, we create sy
nthetic |
| 1811 // StyleRecalcInvalidationTracking events which will be added in _ad
dInvalidationToEvent. |
| 1812 this._addSyntheticStyleRecalcInvalidations(this._lastRecalcStyle, re
calcStyleFrameId, invalidation); |
| 1813 } else if (invalidation.type === recordTypes.ScheduleStyleInvalidationTr
acking) { |
| 1814 // ScheduleStyleInvalidationTracking events are only used for adding
information to |
| 1815 // StyleInvalidatorInvalidationTracking events. See: _addSyntheticSt
yleRecalcInvalidations. |
| 1816 } else { |
| 1817 this._addInvalidationToEvent(this._lastRecalcStyle, recalcStyleFrame
Id, invalidation); |
| 1818 } |
| 1819 |
1768 invalidation.linkedRecalcStyleEvent = true; | 1820 invalidation.linkedRecalcStyleEvent = true; |
1769 }, | 1821 }, |
1770 | 1822 |
1771 /** | 1823 /** |
| 1824 * @param {!WebInspector.TracingModel.Event} event |
| 1825 * @param {number} frameId |
| 1826 * @param {!WebInspector.InvalidationTrackingEvent} styleInvalidatorInvalida
tion |
| 1827 */ |
| 1828 _addSyntheticStyleRecalcInvalidations: function(event, frameId, styleInvalid
atorInvalidation) |
| 1829 { |
| 1830 if (!styleInvalidatorInvalidation.invalidationList) { |
| 1831 this._addSyntheticStyleRecalcInvalidation(styleInvalidatorInvalidati
on._tracingEvent, styleInvalidatorInvalidation); |
| 1832 return; |
| 1833 } |
| 1834 |
| 1835 for (var i = 0; i < styleInvalidatorInvalidation.invalidationList.length
; i++) { |
| 1836 var setId = styleInvalidatorInvalidation.invalidationList[i]["id"]; |
| 1837 var lastScheduleStyleRecalculation; |
| 1838 |
| 1839 function findMatchingInvalidation(invalidation) |
| 1840 { |
| 1841 if (invalidation.frame !== frameId) |
| 1842 return; |
| 1843 if (invalidation.nodeId === styleInvalidatorInvalidation.nodeId
&& invalidation.invalidationSet === setId) |
| 1844 lastScheduleStyleRecalculation = invalidation; |
| 1845 } |
| 1846 |
| 1847 this._forAllInvalidations(findMatchingInvalidation, [WebInspector.Ti
melineModel.RecordType.ScheduleStyleInvalidationTracking]); |
| 1848 |
| 1849 if (!lastScheduleStyleRecalculation) { |
| 1850 console.error("Failed to lookup the event that scheduled a style
invalidator invalidation."); |
| 1851 continue; |
| 1852 } |
| 1853 this._addSyntheticStyleRecalcInvalidation(lastScheduleStyleRecalcula
tion._tracingEvent, styleInvalidatorInvalidation); |
| 1854 } |
| 1855 }, |
| 1856 |
| 1857 /** |
| 1858 * @param {!WebInspector.TracingModel.Event} baseEvent |
| 1859 * @param {!WebInspector.InvalidationTrackingEvent} styleInvalidatorInvalida
tion |
| 1860 */ |
| 1861 _addSyntheticStyleRecalcInvalidation: function(baseEvent, styleInvalidatorIn
validation) |
| 1862 { |
| 1863 var invalidation = new WebInspector.InvalidationTrackingEvent(baseEvent)
; |
| 1864 invalidation.type = WebInspector.TimelineModel.RecordType.StyleRecalcInv
alidationTracking; |
| 1865 invalidation.synthetic = true; |
| 1866 if (styleInvalidatorInvalidation.cause.reason) |
| 1867 invalidation.cause.reason = styleInvalidatorInvalidation.cause.reaso
n; |
| 1868 if (styleInvalidatorInvalidation.selectorPart) |
| 1869 invalidation.selectorPart = styleInvalidatorInvalidation.selectorPar
t; |
| 1870 |
| 1871 this.addInvalidation(invalidation); |
| 1872 if (!invalidation.linkedRecalcStyleEvent) |
| 1873 this._associateWithLastRecalcStyleEvent(invalidation); |
| 1874 }, |
| 1875 |
| 1876 /** |
1772 * @param {!WebInspector.TracingModel.Event} layoutEvent | 1877 * @param {!WebInspector.TracingModel.Event} layoutEvent |
1773 */ | 1878 */ |
1774 didLayout: function(layoutEvent) | 1879 didLayout: function(layoutEvent) |
1775 { | 1880 { |
1776 var layoutFrameId = layoutEvent.args["beginData"]["frame"]; | 1881 var layoutFrameId = layoutEvent.args["beginData"]["frame"]; |
1777 this._forAllInvalidations(associateWithLayoutEvent, | 1882 this._forAllInvalidations(associateWithLayoutEvent, |
1778 [WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking]); | 1883 [WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking]); |
1779 | 1884 |
1780 /** | 1885 /** |
1781 * @param {!WebInspector.InvalidationTrackingEvent} invalidation | 1886 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
(...skipping 21 matching lines...) Expand all Loading... |
1803 var layerId = paintEvent.args["data"]["layerId"]; | 1908 var layerId = paintEvent.args["data"]["layerId"]; |
1804 if (layerId) | 1909 if (layerId) |
1805 this._lastPaintWithLayer = paintEvent; | 1910 this._lastPaintWithLayer = paintEvent; |
1806 if (!this._lastPaintWithLayer) { | 1911 if (!this._lastPaintWithLayer) { |
1807 console.error("Failed to find a paint container for a paint event.")
; | 1912 console.error("Failed to find a paint container for a paint event.")
; |
1808 return; | 1913 return; |
1809 } | 1914 } |
1810 | 1915 |
1811 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"]; | 1916 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"]; |
1812 var paintFrameId = paintEvent.args["data"]["frame"]; | 1917 var paintFrameId = paintEvent.args["data"]["frame"]; |
1813 this._forAllInvalidations(associateWithPaintEvent); | 1918 var types = [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidati
onTracking, |
| 1919 WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking
, |
| 1920 WebInspector.TimelineModel.RecordType.PaintInvalidationTracking]
; |
| 1921 this._forAllInvalidations(associateWithPaintEvent, types); |
1814 | 1922 |
1815 /** | 1923 /** |
1816 * @param {!WebInspector.InvalidationTrackingEvent} invalidation | 1924 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
1817 * @suppressReceiverCheck | 1925 * @suppressReceiverCheck |
1818 * @this {WebInspector.InvalidationTracker} | 1926 * @this {WebInspector.InvalidationTracker} |
1819 */ | 1927 */ |
1820 function associateWithPaintEvent(invalidation) | 1928 function associateWithPaintEvent(invalidation) |
1821 { | 1929 { |
1822 if (invalidation.paintId === effectivePaintId) | 1930 if (invalidation.paintId === effectivePaintId) |
1823 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat
ion); | 1931 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat
ion); |
1824 } | 1932 } |
1825 }, | 1933 }, |
1826 | 1934 |
1827 /** | 1935 /** |
1828 * @param {!WebInspector.TracingModel.Event} event | 1936 * @param {!WebInspector.TracingModel.Event} event |
1829 * @param {number} eventFrameId | 1937 * @param {number} eventFrameId |
1830 * @param {!WebInspector.InvalidationTrackingEvent} invalidation | 1938 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
1831 */ | 1939 */ |
1832 _addInvalidationToEvent: function(event, eventFrameId, invalidation) | 1940 _addInvalidationToEvent: function(event, eventFrameId, invalidation) |
1833 { | 1941 { |
1834 if (eventFrameId !== invalidation.frameId) | 1942 if (eventFrameId !== invalidation.frame) |
1835 return; | 1943 return; |
1836 if (!event.invalidationTrackingEvents) | 1944 if (!event.invalidationTrackingEvents) |
1837 event.invalidationTrackingEvents = [ invalidation ]; | 1945 event.invalidationTrackingEvents = [ invalidation ]; |
1838 else | 1946 else |
1839 event.invalidationTrackingEvents.push(invalidation); | 1947 event.invalidationTrackingEvents.push(invalidation); |
1840 }, | 1948 }, |
1841 | 1949 |
1842 /** | 1950 /** |
1843 * @param {function(!WebInspector.InvalidationTrackingEvent)} callback | 1951 * @param {function(!WebInspector.InvalidationTrackingEvent)} callback |
1844 * @param {!Array.<string>=} types | 1952 * @param {!Array.<string>=} types |
(...skipping 27 matching lines...) Expand all Loading... |
1872 _initializePerFrameState: function() | 1980 _initializePerFrameState: function() |
1873 { | 1981 { |
1874 /** @type {!Object.<string, ?Array.<!WebInspector.InvalidationTrackingEv
ent>>} */ | 1982 /** @type {!Object.<string, ?Array.<!WebInspector.InvalidationTrackingEv
ent>>} */ |
1875 this._invalidations = {}; | 1983 this._invalidations = {}; |
1876 | 1984 |
1877 this._lastRecalcStyle = undefined; | 1985 this._lastRecalcStyle = undefined; |
1878 this._lastPaintWithLayer = undefined; | 1986 this._lastPaintWithLayer = undefined; |
1879 this._didPaint = false; | 1987 this._didPaint = false; |
1880 } | 1988 } |
1881 } | 1989 } |
OLD | NEW |