Changeset 128184 in webkit
- Timestamp:
- Sep 11, 2012 7:34:35 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt
r128057 r128184 7 7 counters : <object> 8 8 data : { 9 height : <number> 10 width : <number> 11 x : 0 12 y : 0 9 13 } 10 14 endTime : <number> -
trunk/Source/WebCore/ChangeLog
r128182 r128184 1 2012-09-10 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: visualize layout root in Timeline 4 https://bugs.webkit.org/show_bug.cgi?id=96279 5 6 Reviewed by Pavel Feldman. 7 8 - pass layout root to InspectorTimelineAgent::didLayout 9 - show rectangles of the layout root upon hover over the Layout record; 10 11 * inspector/InspectorInstrumentation.cpp: 12 (WebCore): 13 (WebCore::InspectorInstrumentation::didLayoutImpl): 14 * inspector/InspectorInstrumentation.h: 15 (WebCore): 16 (InspectorInstrumentation): 17 (WebCore::InspectorInstrumentation::didLayout): 18 * inspector/InspectorTimelineAgent.cpp: 19 (WebCore::InspectorTimelineAgent::didLayout): 20 * inspector/InspectorTimelineAgent.h: 21 (WebCore): 22 (InspectorTimelineAgent): 23 * inspector/TimelineRecordFactory.cpp: 24 (WebCore::TimelineRecordFactory::createPaintData): 25 (WebCore::TimelineRecordFactory::addRectData): 26 (WebCore): 27 * inspector/TimelineRecordFactory.h: 28 (TimelineRecordFactory): 29 * inspector/front-end/TimelinePanel.js: 30 (WebInspector.TimelinePanel.prototype._mouseMove): 31 * page/FrameView.cpp: 32 (WebCore::FrameView::layout): 33 34 2012-09-10 Andrey Kosyakov <caseq@chromium.org> 35 36 Web Inspector: highlight of paint rectangles is broken 37 https://bugs.webkit.org/show_bug.cgi?id=96276 38 39 Reviewed by Pavel Feldman. 40 41 * inspector/InspectorOverlay.cpp: 42 (WebCore::InspectorOverlay::drawRectHighlight): Fix JS method name to match the one in InspectorOverlayPage.html 43 1 44 2012-09-11 Chris Guan <chris.guan@torchmobile.com.cn> 2 45 -
trunk/Source/WebCore/English.lproj/localizedStrings.js
r128057 r128184 732 732 localizedStrings["Override Device Orientation"] = "Override Device Orientation"; 733 733 localizedStrings["Note"] = "Note"; 734 localizedStrings["Forced synchronous layout is a possible performance bottlen ck."] = "Forced synchronous layout is a possible performance bottlenck.";734 localizedStrings["Forced synchronous layout is a possible performance bottleneck."] = "Forced synchronous layout is a possible performance bottleneck."; 735 735 localizedStrings["Styles invalidated"] = "Styles invalidated"; 736 736 localizedStrings["Styles recalculation forced"] = "Styles recalculation forced"; -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r127867 r128184 452 452 } 453 453 454 void InspectorInstrumentation::didLayoutImpl(const InspectorInstrumentationCookie& cookie )454 void InspectorInstrumentation::didLayoutImpl(const InspectorInstrumentationCookie& cookie, RenderObject* root) 455 455 { 456 456 if (!cookie.first) … … 458 458 459 459 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 460 timelineAgent->didLayout( );460 timelineAgent->didLayout(root); 461 461 462 462 if (InspectorPageAgent* pageAgent = cookie.first->inspectorPageAgent()) -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r127867 r128184 66 66 class KURL; 67 67 class Node; 68 class RenderObject; 68 69 class ResourceRequest; 69 70 class ResourceResponse; … … 145 146 static void didInvalidateLayout(Frame*); 146 147 static InspectorInstrumentationCookie willLayout(Frame*); 147 static void didLayout(const InspectorInstrumentationCookie& );148 static void didLayout(const InspectorInstrumentationCookie&, RenderObject*); 148 149 static void didScroll(Page*); 149 150 static InspectorInstrumentationCookie willLoadXHR(ScriptExecutionContext*, XMLHttpRequest*); … … 322 323 static void didInvalidateLayoutImpl(InstrumentingAgents*, Frame*); 323 324 static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*); 324 static void didLayoutImpl(const InspectorInstrumentationCookie& );325 static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*); 325 326 static void didScrollImpl(InstrumentingAgents*); 326 327 static InspectorInstrumentationCookie willLoadXHRImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*); … … 834 835 } 835 836 836 inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie )837 { 838 #if ENABLE(INSPECTOR) 839 FAST_RETURN_IF_NO_FRONTENDS(void()); 840 if (cookie.first) 841 didLayoutImpl(cookie );837 inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root) 838 { 839 #if ENABLE(INSPECTOR) 840 FAST_RETURN_IF_NO_FRONTENDS(void()); 841 if (cookie.first) 842 didLayoutImpl(cookie, root); 842 843 #endif 843 844 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r128057 r128184 47 47 #include "InstrumentingAgents.h" 48 48 #include "IntRect.h" 49 #include "RenderObject.h" 50 #include "RenderView.h" 49 51 #include "ResourceRequest.h" 50 52 #include "ResourceResponse.h" … … 243 245 } 244 246 245 void InspectorTimelineAgent::didLayout() 246 { 247 void InspectorTimelineAgent::didLayout(RenderObject* root) 248 { 249 if (m_recordStack.isEmpty()) 250 return; 251 LayoutRect rect = root->frame()->view()->contentsToRootView(root->absoluteBoundingBoxRect()); 252 TimelineRecordEntry entry = m_recordStack.last(); 253 ASSERT(entry.type == TimelineRecordType::Layout); 254 TimelineRecordFactory::addRectData(entry.data.get(), rect); 247 255 didCompleteCurrentRecord(TimelineRecordType::Layout); 248 256 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r128057 r128184 53 53 class InstrumentingAgents; 54 54 class IntRect; 55 class RenderObject; 55 56 class ResourceRequest; 56 57 class ResourceResponse; … … 99 100 void didInvalidateLayout(Frame*); 100 101 void willLayout(Frame*); 101 void didLayout( );102 void didLayout(RenderObject*); 102 103 103 104 void didScheduleStyleRecalculation(Frame*); -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r127752 r128184 174 174 { 175 175 RefPtr<InspectorObject> data = InspectorObject::create(); 176 addRectData(data.get(), rect); 177 return data.release(); 178 } 179 180 PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType) 181 { 182 RefPtr<InspectorObject> data = InspectorObject::create(); 183 data->setString("imageType", imageType); 184 return data.release(); 185 } 186 187 PassRefPtr<InspectorObject> TimelineRecordFactory::createResizeImageData(bool shouldCache) 188 { 189 RefPtr<InspectorObject> data = InspectorObject::create(); 190 data->setBoolean("cached", shouldCache); 191 return data.release(); 192 } 193 194 PassRefPtr<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned int length, unsigned int startLine) 195 { 196 RefPtr<InspectorObject> data = InspectorObject::create(); 197 data->setNumber("length", length); 198 data->setNumber("startLine", startLine); 199 return data.release(); 200 } 201 202 PassRefPtr<InspectorObject> TimelineRecordFactory::createAnimationFrameData(int callbackId) 203 { 204 RefPtr<InspectorObject> data = InspectorObject::create(); 205 data->setNumber("id", callbackId); 206 return data.release(); 207 } 208 209 void TimelineRecordFactory::addRectData(InspectorObject* data, const LayoutRect& rect) 210 { 176 211 data->setNumber("x", rect.x()); 177 212 data->setNumber("y", rect.y()); 178 213 data->setNumber("width", rect.width()); 179 214 data->setNumber("height", rect.height()); 180 return data.release();181 }182 183 PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType)184 {185 RefPtr<InspectorObject> data = InspectorObject::create();186 data->setString("imageType", imageType);187 return data.release();188 }189 190 PassRefPtr<InspectorObject> TimelineRecordFactory::createResizeImageData(bool shouldCache)191 {192 RefPtr<InspectorObject> data = InspectorObject::create();193 data->setBoolean("cached", shouldCache);194 return data.release();195 }196 197 PassRefPtr<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned int length, unsigned int startLine)198 {199 RefPtr<InspectorObject> data = InspectorObject::create();200 data->setNumber("length", length);201 data->setNumber("startLine", startLine);202 return data.release();203 }204 205 PassRefPtr<InspectorObject> TimelineRecordFactory::createAnimationFrameData(int callbackId)206 {207 RefPtr<InspectorObject> data = InspectorObject::create();208 data->setNumber("id", callbackId);209 return data.release();210 215 } 211 216 -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r127757 r128184 78 78 static PassRefPtr<InspectorObject> createPaintData(const LayoutRect&); 79 79 80 static void addRectData(InspectorObject*, const LayoutRect&); 81 80 82 static PassRefPtr<InspectorObject> createDecodeImageData(const String& imageType); 81 83 -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r127746 r128184 948 948 var anchor = this._getPopoverAnchor(e.target); 949 949 950 if (anchor && anchor.row && anchor.row._record.type === "Paint") 950 const recordType = WebInspector.TimelineModel.RecordType; 951 if (anchor && anchor.row && (anchor.row._record.type === recordType.Paint || anchor.row._record.type === recordType.Layout)) 951 952 this._highlightRect(anchor.row._record); 952 953 else -
trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
r128057 r128184 219 219 } 220 220 221 WebInspector.TimelinePresentationModel._hiddenRecords = { } 222 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkDOMContent] = 1; 223 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkLoad] = 1; 224 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.ScheduleStyleRecalculation] = 1; 225 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.InvalidateLayout] = 1; 226 221 227 WebInspector.TimelinePresentationModel.prototype = { 222 228 /** … … 279 285 { 280 286 const recordTypes = WebInspector.TimelineModel.RecordType; 281 const hiddenRecords = [ 282 recordTypes.MarkDOMContent, 283 recordTypes.MarkLoad, 284 recordTypes.ScheduleStyleRecalculation, 285 recordTypes.InvalidateLayout 286 ]; 287 var isHiddenRecord = hiddenRecords.indexOf(record.type) >= 0; 287 var isHiddenRecord = record.type in WebInspector.TimelinePresentationModel._hiddenRecords; 288 288 var connectedToOldRecord = false; 289 289 if (record.type === recordTypes.Time) … … 789 789 if (this.stackTrace) { 790 790 callStackLabel = WebInspector.UIString("Layout forced"); 791 contentHelper._appendTextRow(WebInspector.UIString("Note"), WebInspector.UIString("Forced synchronous layout is a possible performance bottlen ck."));791 contentHelper._appendTextRow(WebInspector.UIString("Note"), WebInspector.UIString("Forced synchronous layout is a possible performance bottleneck.")); 792 792 } 793 793 break; -
trunk/Source/WebCore/page/FrameView.cpp
r128134 r128184 1253 1253 } 1254 1254 1255 InspectorInstrumentation::didLayout(cookie );1255 InspectorInstrumentation::didLayout(cookie, root); 1256 1256 1257 1257 m_nestedLayoutCount--;
Note: See TracChangeset
for help on using the changeset viewer.