Changeset 147422 in webkit
- Timestamp:
- Apr 2, 2013 6:19:31 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147420 r147422 1 2012-03-29 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: display the number of dirty render objects in Layout timeline event 4 https://bugs.webkit.org/show_bug.cgi?id=95331 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/timeline/timeline-layout-expected.txt: rebaselined to include new properties; 9 1 10 2013-04-02 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 11 -
trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt
r147204 r147422 1 1 Tests the Timeline API instrumentation of a Layout event 2 2 3 Test data 3 text 4 text 5 text 6 text 7 text 4 8 Layout Properties: 5 9 { … … 7 11 counters : <object> 8 12 data : { 13 dirtyObjects : 3 14 partialLayout : true 9 15 root : <object> 16 totalObjects : 8 17 } 18 endTime : <number> 19 frameId : <string> 20 stackTrace : <object> 21 startTime : <number> 22 type : "Layout" 23 usedHeapSize : <number> 24 } 25 Layout Properties: 26 { 27 children : <object> 28 counters : <object> 29 data : { 30 dirtyObjects : 2 31 partialLayout : true 32 root : <object> 33 totalObjects : 11 10 34 } 11 35 endTime : <number> -
trunk/LayoutTests/inspector/timeline/timeline-layout.html
r143573 r147422 3 3 <script src="../../http/tests/inspector/inspector-test.js"></script> 4 4 <script src="../../http/tests/inspector/timeline-test.js"></script> 5 <style> 6 .relayout-boundary { 7 overflow: hidden; 8 width: 100px; 9 height: 100px; 10 } 11 </style> 5 12 <script> 13 14 function invalidateAndForceLayout(element) 15 { 16 element.style.marginTop = "10px"; 17 var unused = element.offsetHeight; 18 } 6 19 7 20 function performActions() 8 21 { 9 var element = document.createElement("div"); 10 element.innerHTML = "Test data"; 11 document.body.appendChild(element); 12 // Force layout. 13 var foo = element.offsetHeight; 22 invalidateAndForceLayout(document.getElementById("invalidate1")); 23 invalidateAndForceLayout(document.getElementById("invalidate2")); 14 24 } 15 25 16 26 function test() 17 27 { 18 InspectorTest.performActionsAndPrint("performActions()", "Layout"); 28 InspectorTest.evaluateInPage("testRunner.display()", function() { 29 InspectorTest.performActionsAndPrint("performActions()", "Layout"); 30 }); 19 31 } 20 32 … … 26 38 Tests the Timeline API instrumentation of a Layout event 27 39 </p> 40 <div class="relayout-boundary"> 41 <div>text</div> 42 <div></div> 43 <div> 44 <div id="invalidate1"><div>text</div></div> 45 </div> 46 </div> 47 <div class="relayout-boundary"> 48 <div></div> 49 <div>text</div> 50 <div id="invalidate2"><div>text</div></div> 51 <div></div> 52 <div></div> 53 <div>text</div> 54 </div> 28 55 29 56 </body> -
trunk/Source/WebCore/ChangeLog
r147421 r147422 1 2013-03-29 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: display the number of dirty render objects in Layout timeline event 4 https://bugs.webkit.org/show_bug.cgi?id=95331 5 6 Reviewed by Pavel Feldman. 7 8 Count the render objects that need layout in InspectorTimelineAgent::willLayout() 9 and display the number in popover over Layout record in Timeline panel. 10 11 * English.lproj/localizedStrings.js: 12 * inspector/InspectorTimelineAgent.cpp: 13 (WebCore::InspectorTimelineAgent::willLayout): 14 (WebCore::InspectorTimelineAgent::didLayout): 15 * inspector/TimelineRecordFactory.cpp: 16 (WebCore): 17 (WebCore::TimelineRecordFactory::createLayoutData): 18 (WebCore::TimelineRecordFactory::appendLayoutRoot): 19 * inspector/TimelineRecordFactory.h: 20 (TimelineRecordFactory): 21 * inspector/front-end/TimelinePresentationModel.js: 22 (WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview): 23 1 24 2013-04-02 Andrey Lushnikov <lushnikov@chromium.org> 2 25 -
trunk/Source/WebCore/English.lproj/localizedStrings.js
r147321 r147422 918 918 localizedStrings["Frames to capture"] = "Frames to capture"; 919 919 localizedStrings["Select node to inspect"] = "Select node to inspect"; 920 localizedStrings["Nodes that need layout"] = "Nodes that need layout"; 921 localizedStrings["Layout tree size"] = "Layout tree size"; 922 localizedStrings["Layout scope"] = "Layout scope"; 923 localizedStrings["Partial"] = "Partial"; 924 localizedStrings["Whole document"] = "Whole document"; -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r147204 r147422 264 264 void InspectorTimelineAgent::willLayout(Frame* frame) 265 265 { 266 pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true, frame); 266 RenderObject* root = frame->view()->layoutRoot(); 267 bool partialLayout = !!root; 268 269 if (!partialLayout) 270 root = frame->contentRenderer(); 271 272 unsigned dirtyObjects = 0; 273 unsigned totalObjects = 0; 274 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 275 ++totalObjects; 276 if (o->needsLayout()) 277 ++dirtyObjects; 278 } 279 pushCurrentRecord(TimelineRecordFactory::createLayoutData(dirtyObjects, totalObjects, partialLayout), TimelineRecordType::Layout, true, frame); 267 280 } 268 281 … … 276 289 root->absoluteQuads(quads); 277 290 if (quads.size() >= 1) 278 entry.data = TimelineRecordFactory::createLayoutData(quads[0]);291 TimelineRecordFactory::appendLayoutRoot(entry.data.get(), quads[0]); 279 292 else 280 293 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r147204 r147422 179 179 return data.release(); 180 180 } 181 182 PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout) 183 { 184 RefPtr<InspectorObject> data = InspectorObject::create(); 185 data->setNumber("dirtyObjects", dirtyObjects); 186 data->setNumber("totalObjects", totalObjects); 187 data->setBoolean("partialLayout", partialLayout); 188 return data.release(); 189 } 181 190 182 191 PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType) … … 236 245 } 237 246 238 PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(const FloatQuad& quad) 239 { 240 RefPtr<InspectorObject> data = InspectorObject::create(); 247 void TimelineRecordFactory::appendLayoutRoot(InspectorObject* data, const FloatQuad& quad) 248 { 241 249 data->setArray("root", createQuad(quad)); 242 return data.release();243 250 } 244 251 -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r147204 r147422 81 81 static PassRefPtr<InspectorObject> createResourceFinishData(const String& requestId, bool didFail, double finishTime); 82 82 83 static void addRectData(InspectorObject*, const LayoutRect&);83 static PassRefPtr<InspectorObject> createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout); 84 84 85 85 static PassRefPtr<InspectorObject> createDecodeImageData(const String& imageType); … … 95 95 static PassRefPtr<InspectorObject> createPaintData(const FloatQuad&); 96 96 97 static PassRefPtr<InspectorObject> createLayoutData(const FloatQuad&);97 static void appendLayoutRoot(InspectorObject* data, const FloatQuad&); 98 98 99 99 #if ENABLE(WEB_SOCKETS) -
trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
r147208 r147422 1046 1046 break; 1047 1047 case recordTypes.Layout: 1048 if (this.data["dirtyObjects"]) 1049 contentHelper.appendTextRow(WebInspector.UIString("Nodes that need layout"), this.data["dirtyObjects"]); 1050 if (this.data["totalObjects"]) 1051 contentHelper.appendTextRow(WebInspector.UIString("Layout tree size"), this.data["totalObjects"]); 1052 if (typeof this.data["partialLayout"] === "boolean") { 1053 contentHelper.appendTextRow(WebInspector.UIString("Layout scope"), 1054 this.data["partialLayout"] ? WebInspector.UIString("Partial") : WebInspector.UIString("Whole document")); 1055 } 1048 1056 callSiteStackTraceLabel = WebInspector.UIString("Layout invalidated"); 1049 1057 if (this.stackTrace) {
Note: See TracChangeset
for help on using the changeset viewer.