[webkit-dev] Get src and element from render object in dump tree

rikutse asuratse at hotmail.com
Fri Apr 9 11:47:59 PDT 2010


Dear everyone,
    I am new to study Webkit. In short, I used dump render tree for Google
page: http://www.google.com :
layer at (0,0) size 800x600
  RenderView at (0,0) size 800x600
layer at (0,0) size 800x371
  RenderBlock {HTML} at (0,0) size 800x371
    RenderBody {BODY} at (8,3) size 784x352 [bgcolor=#FFFFFF]
      RenderBlock {DIV} at (0,0) size 784x24
        RenderBlock (floating) {DIV} at (0,0) size 377x23
          RenderInline {NOBR} at (0,0) size 377x16
            RenderInline {B} at (0,0) size 29x16
              RenderText {#text} at (0,1) size 29x16
                text run at (0,1) width 29: "Web"
            RenderText {#text} at (35,1) size 4x16
              text run at (35,1) width 4: " "
            RenderInline {A} at (0,0) size 42x16 [color=#0000CC]
              RenderText {#text} at (39,1) size 42x16
                text run at (39,1) width 42: "Images"
            RenderText {#text} at (87,1) size 4x16
              text run at (87,1) width 4: " "
            RenderInline {A} at (0,0) size 40x16 [color=#0000CC]
              RenderText {#text} at (91,1) size 40x16
                text run at (91,1) width 40: "Videos"
            RenderText {#text} at (137,1) size 4x16
              text run at (137,1) width 4: " "
            RenderInline {A} at (0,0) size 32x16 [color=#0000CC]
              RenderText {#text} at (141,1) size 32x16
                text run at (141,1) width 32: "Maps"
            RenderText {#text} at (179,1) size 4x16
              text run at (179,1) width 4: " "
            RenderInline {A} at (0,0) size 32x16 [color=#0000CC]
              RenderText {#text} at (183,1) size 32x16
                text run at (183,1) width 32: "News"
            RenderText {#text} at (221,1) size 4x16
              text run at (221,1) width 4: " "
            RenderInline {A} at (0,0) size 54x16 [color=#0000CC]
              RenderText {#text} at (225,1) size 54x16
                text run at (225,1) width 54: "Shopping"
            RenderText {#text} at (285,1) size 4x16
              text run at (285,1) width 4: " "
            RenderInline {A} at (0,0) size 34x16 [color=#0000CC]
              RenderText {#text} at (289,1) size 34x16
                text run at (289,1) width 34: "Gmail"
            RenderText {#text} at (329,1) size 4x16
              text run at (329,1) width 4: " "
            RenderInline {A} at (0,0) size 44x16 [color=#0000CC]
              RenderInline {U} at (0,0) size 29x16
                RenderText {#text} at (333,1) size 29x16
                  text run at (333,1) width 29: "more"
              RenderText {#text} at (362,1) size 4x16
                text run at (362,1) width 4: " "
              RenderInline {SMALL} at (0,0) size 11x14
                RenderText {#text} at (366,3) size 11x14
                  text run at (366,3) width 11: "\x{25BC}"
        RenderBlock {DIV} at (0,0) size 784x24
          RenderInline {NOBR} at (0,0) size 197x16
            RenderInline {SPAN} at (0,0) size 0x0
            RenderInline {SPAN} at (0,0) size 0x0
            RenderInline {SPAN} at (0,0) size 55x16
              RenderInline {A} at (0,0) size 44x16 [color=#0000CC]
                RenderText {#text} at (587,1) size 44x16
                  text run at (587,1) width 44: "iGoogle"
              RenderText {#text} at (631,1) size 11x16
                text run at (631,1) width 11: " | "
            RenderInline {A} at (0,0) size 91x16 [color=#0000CC]
              RenderText {#text} at (642,1) size 91x16
                text run at (642,1) width 91: "Search settings"
            RenderText {#text} at (733,1) size 11x16
              text run at (733,1) width 11: " | "
            RenderInline {A} at (0,0) size 40x16 [color=#0000CC]
              RenderText {#text} at (744,1) size 40x16
                text run at (744,1) width 40: "Sign in"
      RenderBlock {CENTER} at (0,24) size 784x328
        RenderBlock (anonymous) at (0,0) size 784x152
          RenderBR {BR} at (392,0) size 0x18
          RenderImage {IMG} at (254,19) size 276x110
          RenderBR {BR} at (530,114) size 0x18
          RenderBR {BR} at (392,133) size 0x18
        RenderBlock {FORM} at (0,152) size 784x64
          RenderTable {TABLE} at (0,0) size 784x64
            RenderTableSection {TBODY} at (0,0) size 784x64
              RenderTableRow {TR} at (0,0) size 784x64
                RenderTableCell {TD} at (0,0) size 134x12 [r=0 c=0 rs=1
cs=1]
                  RenderText {#text} at (0,-3) size 4x18
                    text run at (0,-3) width 4: " "
                RenderTableCell {TD} at (134,0) size 487x64 [r=0 c=1 rs=1
cs=1]
                  RenderTextControl {INPUT} at (2,2) size 483x26
[bgcolor=#FFFFFF] [border: (2px inset #000000)]
                  RenderBR {BR} at (487,16) size 0x18
                  RenderButton {INPUT} at (112,34) size 121x27 [border: (1px
solid #999999)]
                    RenderBlock (anonymous) at (9,4) size 103x19
                      RenderText at (3,1) size 97x17
                        text run at (3,1) width 97: "Google Search"
                  RenderButton {INPUT} at (239,34) size 136x27 [border: (1px
solid #999999)]
                    RenderBlock (anonymous) at (9,4) size 118x19
                      RenderText at (3,1) size 112x17
                        text run at (3,1) width 112: "I'm Feeling Lucky"
                RenderTableCell {TD} at (621,0) size 163x28
[bgcolor=#FFFFFF] [r=0 c=2 rs=1 cs=1]
                  RenderInline {FONT} at (0,0) size 89x27
                    RenderText {#text} at (0,2) size 6x13
                      text run at (0,2) width 6: "  "
                    RenderInline {A} at (0,0) size 83x13 [color=#0000CC]
                      RenderText {#text} at (6,2) size 83x13
                        text run at (6,2) width 83: "Advanced Search"
                    RenderBR {BR} at (89,2) size 0x13
                    RenderText {#text} at (0,16) size 6x13
                      text run at (0,16) width 6: "  "
                    RenderInline {A} at (0,0) size 77x13 [color=#0000CC]
                      RenderText {#text} at (6,16) size 77x13
                        text run at (6,16) width 77: "Language Tools"
        RenderBlock (anonymous) at (0,236) size 784x19
          RenderBR {BR} at (392,0) size 0x18
          RenderInline {SPAN} at (0,0) size 0x0
        RenderBlock (anonymous) at (0,255) size 784x73
          RenderBlock {CENTER} at (0,0) size 784x73 [bgcolor=#FFFFFF]
            RenderBlock (anonymous) at (0,0) size 784x38
              RenderBR {BR} at (392,0) size 0x18
              RenderInline {FONT} at (0,0) size 338x16
                RenderInline {A} at (0,0) size 123x16 [color=#0000CC]
                  RenderText {#text} at (223,21) size 123x16
                    text run at (223,21) width 123: "Advertising Programs"
                RenderText {#text} at (346,21) size 12x16
                  text run at (346,21) width 12: " - "
                RenderInline {A} at (0,0) size 112x16 [color=#0000CC]
                  RenderText {#text} at (358,21) size 112x16
                    text run at (358,21) width 112: "Business Solutions"
                RenderText {#text} at (470,21) size 12x16
                  text run at (470,21) width 12: " - "
                RenderInline {A} at (0,0) size 79x16 [color=#0000CC]
                  RenderText {#text} at (482,21) size 79x16
                    text run at (482,21) width 79: "About Google"
            RenderBlock {P} at (0,54) size 784x19
              RenderInline {FONT} at (0,0) size 74x13
                RenderText {#text} at (355,5) size 40x13
                  text run at (355,5) width 40: "\x{A9}2010 - "
                RenderInline {A} at (0,0) size 34x13 [color=#0000CC]
                  RenderText {#text} at (395,5) size 34x13
                    text run at (395,5) width 34: "Privacy"
        RenderBlock (anonymous) at (0,344) size 784x0
          RenderInline {SPAN} at (0,0) size 0x0
          RenderText {#text} at (0,0) size 0x0
        RenderBlock {DIV} at (0,344) size 784x0
        RenderBlock {DIV} at (0,344) size 784x0
layer at (146,184) size 479x20
  RenderBlock {DIV} at (2,3) size 479x20
layer at (0,24) size 800x1
  RenderBlock (positioned) {DIV} at (0,24) size 800x1 [border: (1px solid
#C9D7F1) none]
layer at (0,24) size 800x1
  RenderBlock (positioned) {DIV} at (0,24) size 800x1 [border: (1px solid
#C9D7F1) none]
caret: position 0 of child 0 {DIV} of child 2 {INPUT} of child 1 {TD} of
child 0 {TR} of child 0 {TBODY} of child 0 {TABLE} of child 4 {FORM} of
child 4 {CENTER} of child 1 {BODY} of child 1 {HTML} of document


I would like to know how could I inspect and access the element member in
each of the render object?
Like, how can I get the image object and the src from RenderImage? What
functions I could use?

Thank you very much.

Riku
-- 
View this message in context: http://old.nabble.com/Get-src-and-element-from-render-object-in-dump-tree-tp28195933p28195933.html
Sent from the Webkit mailing list archive at Nabble.com.



More information about the webkit-dev mailing list