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-20130329211011.patch (text/plain), 10.72 KB, created by
Andrey Kosyakov
on 2013-03-29 10:10:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andrey Kosyakov
Created:
2013-03-29 10:10:15 PDT
Size:
10.72 KB
patch
obsolete
>Subversion Revision: 147204 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b5593cd6de40d9daf5e5e8e7eaa2648d31ecfb69..9b766de21f8cae943e5d757a7449074810424970 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2013-03-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. >+ >+ * English.lproj/localizedStrings.js: >+ * inspector/InspectorTimelineAgent.cpp: >+ (WebCore::InspectorTimelineAgent::willLayout): >+ (WebCore::InspectorTimelineAgent::didLayout): >+ * inspector/TimelineRecordFactory.cpp: >+ (WebCore): >+ (WebCore::TimelineRecordFactory::createLayoutData): >+ (WebCore::TimelineRecordFactory::appendLayoutRoot): >+ * 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/English.lproj/localizedStrings.js b/Source/WebCore/English.lproj/localizedStrings.js >index 91ece212ca4978d019ee0d07e20331ae91f7491d..eece0837f22d14a2b19bb32f7307b1d72704f506 100644 >--- a/Source/WebCore/English.lproj/localizedStrings.js >+++ b/Source/WebCore/English.lproj/localizedStrings.js >@@ -918,3 +918,5 @@ localizedStrings["It is recommended to restart inspector after making these chan > localizedStrings["Limit number of captured JS stack frames"] = "Limit number of captured JS stack frames"; > localizedStrings["Frames to capture"] = "Frames to capture"; > localizedStrings["Select node to inspect"] = "Select node to inspect"; >+localizedStrings["Nodes that need layout"] = "Nodes that need layout"; >+localizedStrings["Layout tree size"] = "Layout tree size"; >diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >index ec757ee9b72f5d33de199a441e45d09bef416139..16cfb8eeb414ee1040ab3066d639d6eda8603133 100644 >--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >@@ -263,7 +263,16 @@ 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(); >+ unsigned dirtyObjects = 0, totalObjects = 0; >+ for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { >+ ++totalObjects; >+ if (o->needsLayout()) >+ ++dirtyObjects; >+ } >+ pushCurrentRecord(TimelineRecordFactory::createLayoutData(dirtyObjects, totalObjects), TimelineRecordType::Layout, true, frame); > } > > void InspectorTimelineAgent::didLayout(RenderObject* root) >@@ -275,7 +284,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..2e8cf7977511c18dbda86a06f09b2b1e08faaff5 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp >+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp >@@ -178,6 +178,14 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createReceiveResourceData(con > data->setNumber("encodedDataLength", length); > return data.release(); > } >+ >+PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(unsigned dirtyObjects, unsigned totalObjects) >+{ >+ RefPtr<InspectorObject> data = InspectorObject::create(); >+ data->setNumber("dirtyObjects", dirtyObjects); >+ data->setNumber("totalObjects", totalObjects); >+ return data.release(); >+} > > PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType) > { >@@ -235,11 +243,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..c70f6cd33198082a7b98f1020ed2bb31d3bce291 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(unsigned dirtyObjects, unsigned totalObjects); >+ >+ 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..85962a26eafd2f3864e03a8cfeee8a2898c379c8 100644 >--- a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >+++ b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >@@ -1045,6 +1045,10 @@ WebInspector.TimelinePresentationModel.Record.prototype = { > callStackLabel = WebInspector.UIString("Styles recalculation forced"); > break; > case recordTypes.Layout: >+ if (this.data["dirtyObjects"]) >+ contentHelper.appendTextRow(WebInspector.UIString("Nodes that need layout"), this.data["dirtyObjects"]); >+ if (this.data["totalObjects"]) >+ contentHelper.appendTextRow(WebInspector.UIString("Layout tree size"), this.data["totalObjects"]); > callSiteStackTraceLabel = WebInspector.UIString("Layout invalidated"); > if (this.stackTrace) { > callStackLabel = WebInspector.UIString("Layout forced"); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9437791d75c15688baf29e4cee30afa687ac86fa..ccf52061b4f0f447182b8b2f36d968961e1a6513 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2012-03-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 new properties; >+ > 2013-03-22 Andrey Kosyakov <caseq@chromium.org> > > Web Inspector: timeline paint rectangles are off for transformed layers >diff --git a/LayoutTests/inspector/timeline/timeline-layout-expected.txt b/LayoutTests/inspector/timeline/timeline-layout-expected.txt >index 82dbfdd60acbbc5d15bcb5fca6c7487184f27bb1..58991059753d03aa94a2ffadf6ba1a44e6abffe8 100644 >--- a/LayoutTests/inspector/timeline/timeline-layout-expected.txt >+++ b/LayoutTests/inspector/timeline/timeline-layout-expected.txt >@@ -1,12 +1,34 @@ > Tests the Timeline API instrumentation of a Layout event > >-Test data >+text >+text >+text >+text >+text > Layout Properties: > { > children : <object> > counters : <object> > data : { >+ dirtyObjects : 3 > root : <object> >+ totalObjects : 8 >+ } >+ endTime : <number> >+ frameId : <string> >+ stackTrace : <object> >+ startTime : <number> >+ type : "Layout" >+ usedHeapSize : <number> >+} >+Layout Properties: >+{ >+ children : <object> >+ counters : <object> >+ data : { >+ dirtyObjects : 2 >+ root : <object> >+ totalObjects : 11 > } > endTime : <number> > frameId : <string> >diff --git a/LayoutTests/inspector/timeline/timeline-layout.html b/LayoutTests/inspector/timeline/timeline-layout.html >index cb8b95368f1b5c14af7bea78cfc5143407a6167e..bf7ebbfcc68e47381f2c6ffad85c8ced76b5fbde 100644 >--- a/LayoutTests/inspector/timeline/timeline-layout.html >+++ b/LayoutTests/inspector/timeline/timeline-layout.html >@@ -2,15 +2,25 @@ > <head> > <script src="../../http/tests/inspector/inspector-test.js"></script> > <script src="../../http/tests/inspector/timeline-test.js"></script> >+<style> >+.relayout-boundary { >+ overflow: hidden; >+ width: 100px; >+ height: 100px; >+} >+</style> > <script> > >+function invalidateAndForceLayout(element) >+{ >+ element.style.marginTop = "10px"; >+ var unused = element.offsetHeight; >+} >+ > function performActions() > { >- var element = document.createElement("div"); >- element.innerHTML = "Test data"; >- document.body.appendChild(element); >- // Force layout. >- var foo = element.offsetHeight; >+ invalidateAndForceLayout(document.getElementById("invalidate1")); >+ invalidateAndForceLayout(document.getElementById("invalidate2")); > } > > function test() >@@ -25,6 +35,21 @@ function test() > <p> > Tests the Timeline API instrumentation of a Layout event > </p> >+<div class="relayout-boundary"> >+ <div>text</div> >+ <div></div> >+ <div> >+ <div id="invalidate1"><div>text</div></div> >+ </div> >+</div> >+<div class="relayout-boundary"> >+ <div></div> >+ <div>text</div> >+ <div id="invalidate2"><div>text</div></div> >+ <div></div> >+ <div></div> >+ <div>text</div> >+</div> > > </body> > </html>
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