WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-95331-20130329161622.patch (text/plain), 8.18 KB, created by
Andrey Kosyakov
on 2013-03-29 05:16:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andrey Kosyakov
Created:
2013-03-29 05:16:25 PDT
Size:
8.18 KB
patch
obsolete
>Subversion Revision: 147204 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b5593cd6de40d9daf5e5e8e7eaa2648d31ecfb69..cc702948b6411fbf996c4718feab86379fc8df32 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2012-08-29 Andrey Kosyakov <caseq@chromium.org> >+ >+ Web Inspector: display the number of dirty render objects in Layout timeline event >+ https://bugs.webkit.org/show_bug.cgi?id=95331 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Count the render objects that need layout in InspectorTimelineAgent::willLayout() >+ and display the number in popover over Layout record in Timeline panel. >+ >+ * inspector/InspectorTimelineAgent.cpp: >+ (WebCore::InspectorTimelineAgent::willLayout): >+ * inspector/TimelineRecordFactory.cpp: >+ (WebCore): >+ (WebCore::TimelineRecordFactory::createLayoutData): >+ * inspector/TimelineRecordFactory.h: >+ (TimelineRecordFactory): >+ * inspector/front-end/TimelinePresentationModel.js: >+ (WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview): >+ > 2013-03-22 Andrey Kosyakov <caseq@chromium.org> > > Web Inspector: timeline paint rectangles are off for transformed layers >diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >index ec757ee9b72f5d33de199a441e45d09bef416139..44a479956e659de451e11b4531d4b75a7e463bf9 100644 >--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >@@ -263,7 +263,19 @@ void InspectorTimelineAgent::didInvalidateLayout(Frame* frame) > > void InspectorTimelineAgent::willLayout(Frame* frame) > { >- pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true, frame); >+ RenderObject* root = frame->view()->layoutRoot(); >+ if (!root) >+ root = frame->document()->renderer(); >+ int needLayoutCount = 0; >+ for (RenderObject* o = root; o;) { >+ if (!root->needsLayout()) { >+ o = o->nextInPreOrderAfterChildren(); >+ continue; >+ } >+ ++needLayoutCount; >+ o = o->nextInPreOrder(); >+ } >+ pushCurrentRecord(TimelineRecordFactory::createLayoutData(needLayoutCount), TimelineRecordType::Layout, true, frame); > } > > void InspectorTimelineAgent::didLayout(RenderObject* root) >@@ -275,7 +287,7 @@ void InspectorTimelineAgent::didLayout(RenderObject* root) > Vector<FloatQuad> quads; > root->absoluteQuads(quads); > if (quads.size() >= 1) >- entry.data = TimelineRecordFactory::createLayoutData(quads[0]); >+ TimelineRecordFactory::appendLayoutRoot(entry.data.get(), quads[0]); > else > ASSERT_NOT_REACHED(); > didCompleteCurrentRecord(TimelineRecordType::Layout); >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.cpp b/Source/WebCore/inspector/TimelineRecordFactory.cpp >index 489ae5c64e56033ceb180db21d7963ee35780892..35fe1ae86092dbb3c61b6d3428f881bd75fb4761 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp >+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp >@@ -178,6 +178,13 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createReceiveResourceData(con > data->setNumber("encodedDataLength", length); > return data.release(); > } >+ >+PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(int nodeCount) >+{ >+ RefPtr<InspectorObject> data = InspectorObject::create(); >+ data->setNumber("nodeCount", nodeCount); >+ return data.release(); >+} > > PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType) > { >@@ -235,11 +242,9 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createPaintData(const FloatQu > return data.release(); > } > >-PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(const FloatQuad& quad) >+void TimelineRecordFactory::appendLayoutRoot(InspectorObject* data, const FloatQuad& quad) > { >- RefPtr<InspectorObject> data = InspectorObject::create(); > data->setArray("root", createQuad(quad)); >- return data.release(); > } > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.h b/Source/WebCore/inspector/TimelineRecordFactory.h >index aeb3166f2c7269b752a6e8b24ef41cb535e23d15..d24b155f90a4e9304c298f6003c6bdeaea6a588a 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.h >+++ b/Source/WebCore/inspector/TimelineRecordFactory.h >@@ -80,7 +80,9 @@ namespace WebCore { > > static PassRefPtr<InspectorObject> createResourceFinishData(const String& requestId, bool didFail, double finishTime); > >- static void addRectData(InspectorObject*, const LayoutRect&); >+ static PassRefPtr<InspectorObject> createLayoutData(int nodeCount); >+ >+ static PassRefPtr<InspectorObject> createPaintData(const LayoutRect&); > > static PassRefPtr<InspectorObject> createDecodeImageData(const String& imageType); > >@@ -94,7 +96,7 @@ namespace WebCore { > > static PassRefPtr<InspectorObject> createPaintData(const FloatQuad&); > >- static PassRefPtr<InspectorObject> createLayoutData(const FloatQuad&); >+ static void appendLayoutRoot(InspectorObject* data, const FloatQuad&); > > #if ENABLE(WEB_SOCKETS) > static inline PassRefPtr<InspectorObject> createWebSocketCreateData(unsigned long identifier, const KURL& url, const String& protocol) >diff --git a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >index 8415f3dfbf4adc218357092c209a968978647b25..44ed58cda6b86cbe17f6edf9b4b06714d7838f14 100644 >--- a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >+++ b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >@@ -1045,6 +1045,8 @@ WebInspector.TimelinePresentationModel.Record.prototype = { > callStackLabel = WebInspector.UIString("Styles recalculation forced"); > break; > case recordTypes.Layout: >+ if (this.data["nodeCount"]) >+ contentHelper.appendTextRow(WebInspector.UIString("Nodes to layout"), this.data["nodeCount"]); > callSiteStackTraceLabel = WebInspector.UIString("Layout invalidated"); > if (this.stackTrace) { > callStackLabel = WebInspector.UIString("Layout forced"); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9437791d75c15688baf29e4cee30afa687ac86fa..77810c4997b0977314dfd06c66e05579a69c449a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2012-08-29 Andrey Kosyakov <caseq@chromium.org> >+ >+ Web Inspector: display the number of dirty render objects in Layout timeline event >+ https://bugs.webkit.org/show_bug.cgi?id=95331 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/timeline/timeline-layout-expected.txt: rebaselined to include nodeCount; >+ * inspector/timeline/timeline-test.js: added nodeCount to custom formatted timeline record fields; >+ > 2013-03-22 Andrey Kosyakov <caseq@chromium.org> > > Web Inspector: timeline paint rectangles are off for transformed layers >diff --git a/LayoutTests/http/tests/inspector/timeline-test.js b/LayoutTests/http/tests/inspector/timeline-test.js >index 20f3fbaf391f13431ba2cd7c3d74688ca8e375c6..1c9063dcf37af0890209032cba2afb4c46e3c777 100644 >--- a/LayoutTests/http/tests/inspector/timeline-test.js >+++ b/LayoutTests/http/tests/inspector/timeline-test.js >@@ -22,6 +22,7 @@ InspectorTest.timelinePropertyFormatters = { > identifier: "formatAsTypeName", > clip: "formatAsTypeName", > root: "formatAsTypeName", >+ nodeCount: "formatAsTypeName", > }; > > InspectorTest.startTimeline = function(callback) >diff --git a/LayoutTests/inspector/timeline/timeline-layout-expected.txt b/LayoutTests/inspector/timeline/timeline-layout-expected.txt >index 82dbfdd60acbbc5d15bcb5fca6c7487184f27bb1..70e137be5b76b3836c068ff044cbabfc016387e0 100644 >--- a/LayoutTests/inspector/timeline/timeline-layout-expected.txt >+++ b/LayoutTests/inspector/timeline/timeline-layout-expected.txt >@@ -6,6 +6,7 @@ Layout Properties: > children : <object> > counters : <object> > data : { >+ nodeCount : <number> > root : <object> > } > endTime : <number>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 95331
:
161198
|
195725
|
195759
|
195764
|
195770
|
195781
|
195948