Bug 136244 - Improve showRenderTree() output.
Summary: Improve showRenderTree() output.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-25 20:29 PDT by zalan
Modified: 2014-08-29 10:55 PDT (History)
11 users (show)

See Also:


Attachments
Patch (21.89 KB, patch)
2014-08-26 11:48 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-08-25 20:29:41 PDT
The current output lacks dimension and inline information. (among other things)

current output (calling showRenderTreeForThis() from an lldb session):

RenderView 0x7fbb05c0da10
  RenderBlock 0x7fbb03c654c0           	HTML	0x7fbb03f3f640 (renderer 0x7fbb03c654c0)  (child needs style recalc)
    RenderBody 0x7fbb03c66320          	BODY	0x7fbb03ffa730 (renderer 0x7fbb03c66320)  CLASS=hp vasq (child needs style recalc)
      RenderBlock (relative positioned) 0x7fbb03c663e0	DIV	0x7fbb03ffa500 (renderer 0x7fbb03c663e0)  CLASS=ctr-p (child needs style recalc)
        RenderBlock 0x7fbb03c668a0     	DIV	0x7fbb03ffad00 (renderer 0x7fbb03c668a0) 
        RenderBlock (positioned) 0x7fbb03c67300	A	0x7fbb03f819a0 (renderer 0x7fbb03c67300)  STYLE=left:-1000em;position:absolute
          RenderText 0x7fbb03c677e0    	#text	0x7fbb03fbda30 "Screen reader users, click here to turn off Google Instant."
        RenderBlock 0x7fbb058144b0     	DIV	0x7fbb03ffb3b0 (renderer 0x7fbb058144b0)  (child needs style recalc)
          RenderBlock (positioned) 0x7fbb058141c0	DIV	0x7fbb0a8036c0 (renderer 0x7fbb058141c0)  CLASS=gb_Dc gb_Lc gb_sb STYLE=min-width: 980px; (child needs style recalc)
            RenderFlexibleBox 0x7fbb05814fc0	DIV	0x7fbb03f9d4b0 (renderer 0x7fbb05814fc0)  CLASS=gb_Lb gb_Ic (child needs style recalc)
              RenderFlexibleBox 0x7fbb03c67840	DIV	0x7fbb03ff9d90 (renderer 0x7fbb03c67840)  CLASS=gb_Z gb_Ic gb_f gb_Hc gb_Lc STYLE=min-width: 295px;
                RenderFlexibleBox 0x7fbb03c6b8d0	DIV	0x7fbb03ff9e00 (renderer 0x7fbb03c6b8d0)  CLASS=gb_sc gb_f gb_Ic gb_Ac gb_h
                  RenderFlexibleBox 0x7fbb03c69ac0	DIV	0x7fbb03fcdff0 (renderer 0x7fbb03c69ac0)  CLASS=gb_e gb_f gb_g gb_Ic
                    RenderBlock 0x7fbb03c69cd0	A	0x7fbb03f84f40 (renderer 0x7fbb03c69cd0)  CLASS=gb_d gb_f
                      RenderText 0x7fbb03c6c0b0	#text	0x7fbb0a809e60 "+You"
Comment 1 zalan 2014-08-25 20:34:08 PDT
proposed output:

has(L)ayer, (C)omposited, (D)irty layout, Dirty (S)tyle, (R)elative/Stick(Y)/A(B)solute/Fi(X)ed positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating
LCD----G-  RenderView  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa782225b30)
L-D------    HTML RenderBlock  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa780450630) node->(0x7fa78044af30)
--D------      BODY RenderBody  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa780659110) node->(0x7fa780716450)
L-D-R----        DIV RenderBlock  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa7806566c0) node->(0x7fa780716800)
--D------          DIV RenderBlock  (0.00, 0.00) (1391.00, 0.00) renderer->(0x7fa78064b010) node->(0x7fa780717bb0)
L-D-B----          A RenderBlock  (-13000.00, 0.00) (330.00, 15.00) renderer->(0x7fa780641220) node->(0x7fa78071ec80)
--D------            #text RenderText renderer->(0x7fa7806574a0) node->(0x7fa78071e560) "Screen reader users, click here to turn off Google Instant."
--D------          DIV RenderBlock  (0.00, 0.00) (1391.00, 60.00) renderer->(0x7fa780654d40) node->(0x7fa780659940)
L-D-B----            DIV RenderBlock  (0.00, 0.00) (1391.00, 60.00) renderer->(0x7fa780648a00) node->(0x7fa780643970)
L-D-R----              DIV RenderFlexibleBox  (0.00, 0.00) (1391.00, 60.00) renderer->(0x7fa7806431e0) node->(0x7fa780641820)
L-D-R----                DIV RenderFlexibleBox  (0.00, 0.00) (1391.00, 60.00) renderer->(0x7fa78064a8b0) node->(0x7fa780642bc0)
--D------                  DIV RenderFlexibleBox  (1065.06, 18.00) (181.59, 24.00) renderer->(0x7fa780649f60) node->(0x7fa78064b440)
--D------                    DIV RenderFlexibleBox  (0.00, 0.00) (60.00, 24.00) renderer->(0x7fa7806576a0) node->(0x7fa7806474f0)
L-D--O---                      A RenderBlock  (0.00, 0.00) (60.00, 24.00) renderer->(0x7fa780647db0) node->(0x7fa780643510)
---------                         RootInlineBox  (30.47, 4.00) (29.53, 15.00) (0x7fa78226b4d0)
---------                           InlineTextBox  (30.47, 4.00) (29.53, 15.00) (0x7fa78226b470) run(0, 4) "+You"
--D------                        #text RenderText renderer->(0x7fa780654750) node->(0x7fa7806436a0) "+You"
Comment 2 Simon Fraser (smfr) 2014-08-25 20:58:43 PDT
(In reply to comment #1)
> proposed output:
> 
> has(L)ayer, (C)omposited, (D)irty layout, Dirty (S)tyle, (R)elative/Stick(Y)/A(B)solute/Fi(X)ed positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating
> LCD----G-  RenderView  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa782225b30)
> L-D------    HTML RenderBlock  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa780450630) node->(0x7fa78044af30)

I think it would be useful to separate the dirty flags from the rest, and order things differently. How about:

(R)elative/Stick(Y)/A(B)solute/Fi(X)ed positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating has(L)ayer, (C)omposited [space] Dirty (S)tyle, (D)irty layout
Comment 3 zalan 2014-08-25 21:32:53 PDT
(In reply to comment #2)
> (In reply to comment #1)
> > proposed output:
> > 
> > has(L)ayer, (C)omposited, (D)irty layout, Dirty (S)tyle, (R)elative/Stick(Y)/A(B)solute/Fi(X)ed positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating
> > LCD----G-  RenderView  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa782225b30)
> > L-D------    HTML RenderBlock  (0.00, 0.00) (1391.00, 711.00) renderer->(0x7fa780450630) node->(0x7fa78044af30)
> 
> I think it would be useful to separate the dirty flags from the rest, and order things differently. How about:
> 
> (R)elative/Stick(Y)/A(B)solute/Fi(X)ed positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating has(L)ayer, (C)omposited [space] Dirty (S)tyle, (D)irty layout

Good idea! I completely forgot about proper ordering.
Comment 4 zalan 2014-08-26 11:48:23 PDT
Created attachment 237162 [details]
Patch
Comment 5 Bem Jones-Bey 2014-08-26 18:03:40 PDT
I looks like the class and style information is missing from the new dump. I have often found that information useful. Did you remove it deliberately?
Comment 6 zalan 2014-08-26 18:42:30 PDT
(In reply to comment #5)
> I looks like the class and style information is missing from the new dump. I have often found that information useful. Did you remove it deliberately?
Yes, I did. While I also find that info useful in certain scenarios, I think we should be using showNodeTree()/showNodeTreeForThis() to collect node related information instead.

There's also a showLineTree()/showLineTreeForThis() helper to display inline content. I decided to include that in the showRenderTree() printout as I believe inlines should be part of the render tree output.
Comment 7 Daniel Bates 2014-08-27 21:20:18 PDT
I am also saddened by the removal of style and class information from the output of showRenderTreeForThis().
Comment 8 Daniel Bates 2014-08-28 14:03:14 PDT
(In reply to comment #7)
> I am also saddened by the removal of style and class information from the output of showRenderTreeForThis().

Disregard this comment. It's seems sufficient to use showNodeTreeForThis() to see this information.

For some reason, I misread "showNodeTreeForThis()" as referring to Node::showTreeForThis() in comment 6 and thought it would be inconvenient in a debug session to have to explicitly call Node::showTreeForThis() on the renderer's node (RenderObject::m_node) as opposed to calling a function directly on a RenderObject to see a tree diagram with id and style information.
Comment 9 WebKit Commit Bot 2014-08-29 10:55:51 PDT
Comment on attachment 237162 [details]
Patch

Clearing flags on attachment: 237162

Committed r173114: <http://trac.webkit.org/changeset/173114>
Comment 10 WebKit Commit Bot 2014-08-29 10:55:56 PDT
All reviewed patches have been landed.  Closing bug.