mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:12:45 +00:00 
			
		
		
		
	 2960bf4ec8
			
		
	
	
		2960bf4ec8
		
	
	
	
	
		
			
			The paintable tree structure more closely matches the painting order when fragments are owned by corresponding inline paintables. This change does not affect the layout tree, as it is more convenient for layout purposes to have all fragments owned by a block container in one place. Additionally, this improves performance significantly on pages with many fragments, as we no longer have to walk the ancestor chain up to the closest block container to determine if a fragment belongs to an inline paintable.
		
			
				
	
	
		
			310 lines
		
	
	
	
		
			15 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			310 lines
		
	
	
	
		
			15 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| Viewport <#document> at (0,0) content-size 800x600 children: not-inline
 | ||
|   BlockContainer <html> at (0,0) content-size 800x67 [BFC] children: not-inline
 | ||
|     BlockContainer <body> at (8,8) content-size 784x51 children: not-inline
 | ||
|       BlockContainer <div.a> at (8,8) content-size 784x17 children: inline
 | ||
|         InlineNode <span>
 | ||
|           frag 0 from TextNode start: 0, length: 1, rect: [8,8 9.34375x17] baseline: 13.296875
 | ||
|               "a"
 | ||
|           frag 1 from TextNode start: 0, length: 1, rect: [76,8 4.5625x17] baseline: 13.296875
 | ||
|               "i"
 | ||
|           InlineNode <(anonymous)>
 | ||
|             TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <span>
 | ||
|             frag 0 from TextNode start: 0, length: 1, rect: [17,8 9.46875x17] baseline: 13.296875
 | ||
|                 "b"
 | ||
|             frag 1 from TextNode start: 0, length: 1, rect: [66,8 9.296875x17] baseline: 13.296875
 | ||
|                 "h"
 | ||
|             InlineNode <(anonymous)>
 | ||
|               TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <span>
 | ||
|               frag 0 from TextNode start: 0, length: 1, rect: [27,8 8.890625x17] baseline: 13.296875
 | ||
|                   "c"
 | ||
|               frag 1 from TextNode start: 0, length: 1, rect: [59,8 7.5625x17] baseline: 13.296875
 | ||
|                   "g"
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <span>
 | ||
|                 frag 0 from TextNode start: 0, length: 1, rect: [36,8 7.859375x17] baseline: 13.296875
 | ||
|                     "d"
 | ||
|                 frag 1 from TextNode start: 0, length: 1, rect: [52,8 6.4375x17] baseline: 13.296875
 | ||
|                     "f"
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <span>
 | ||
|                   frag 0 from TextNode start: 0, length: 1, rect: [44,8 8.71875x17] baseline: 13.296875
 | ||
|                       "e"
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     TextNode <#text>
 | ||
|                   TextNode <#text>
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <(anonymous)>
 | ||
|               TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <(anonymous)>
 | ||
|             TextNode <#text>
 | ||
|       BlockContainer <(anonymous)> at (8,25) content-size 784x0 children: inline
 | ||
|         TextNode <#text>
 | ||
|       BlockContainer <div.b> at (8,25) content-size 784x17 children: inline
 | ||
|         InlineNode <span>
 | ||
|           frag 0 from TextNode start: 0, length: 1, rect: [14,25 9.34375x17] baseline: 13.296875
 | ||
|               "a"
 | ||
|           frag 1 from TextNode start: 0, length: 1, rect: [128,25 4.5625x17] baseline: 13.296875
 | ||
|               "i"
 | ||
|           InlineNode <(anonymous)>
 | ||
|             frag 0 from TextNode start: 0, length: 3, rect: [8,25 5.84375x17] baseline: 13.296875
 | ||
|                 "“"
 | ||
|             TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <span>
 | ||
|             frag 0 from TextNode start: 0, length: 1, rect: [29,25 9.46875x17] baseline: 13.296875
 | ||
|                 "b"
 | ||
|             frag 1 from TextNode start: 0, length: 1, rect: [113,25 9.296875x17] baseline: 13.296875
 | ||
|                 "h"
 | ||
|             InlineNode <(anonymous)>
 | ||
|               frag 0 from TextNode start: 0, length: 3, rect: [23,25 5.84375x17] baseline: 13.296875
 | ||
|                   "‘"
 | ||
|               TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <span>
 | ||
|               frag 0 from TextNode start: 0, length: 1, rect: [44,25 8.890625x17] baseline: 13.296875
 | ||
|                   "c"
 | ||
|               frag 1 from TextNode start: 0, length: 1, rect: [100,25 7.5625x17] baseline: 13.296875
 | ||
|                   "g"
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 frag 0 from TextNode start: 0, length: 3, rect: [39,25 5.84375x17] baseline: 13.296875
 | ||
|                     "‘"
 | ||
|                 TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <span>
 | ||
|                 frag 0 from TextNode start: 0, length: 1, rect: [59,25 7.859375x17] baseline: 13.296875
 | ||
|                     "d"
 | ||
|                 frag 1 from TextNode start: 0, length: 1, rect: [87,25 6.4375x17] baseline: 13.296875
 | ||
|                     "f"
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   frag 0 from TextNode start: 0, length: 3, rect: [53,25 5.84375x17] baseline: 13.296875
 | ||
|                       "‘"
 | ||
|                   TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <span>
 | ||
|                   frag 0 from TextNode start: 0, length: 1, rect: [73,25 8.71875x17] baseline: 13.296875
 | ||
|                       "e"
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     frag 0 from TextNode start: 0, length: 3, rect: [67,25 5.84375x17] baseline: 13.296875
 | ||
|                         "‘"
 | ||
|                     TextNode <#text>
 | ||
|                   TextNode <#text>
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     frag 0 from TextNode start: 0, length: 3, rect: [82,25 5.84375x17] baseline: 13.296875
 | ||
|                         "’"
 | ||
|                     TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   frag 0 from TextNode start: 0, length: 3, rect: [94,25 5.84375x17] baseline: 13.296875
 | ||
|                       "’"
 | ||
|                   TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 frag 0 from TextNode start: 0, length: 3, rect: [107,25 5.84375x17] baseline: 13.296875
 | ||
|                     "’"
 | ||
|                 TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <(anonymous)>
 | ||
|               frag 0 from TextNode start: 0, length: 3, rect: [122,25 5.84375x17] baseline: 13.296875
 | ||
|                   "’"
 | ||
|               TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <(anonymous)>
 | ||
|             frag 0 from TextNode start: 0, length: 3, rect: [133,25 5.84375x17] baseline: 13.296875
 | ||
|                 "”"
 | ||
|             TextNode <#text>
 | ||
|       BlockContainer <(anonymous)> at (8,42) content-size 784x0 children: inline
 | ||
|         TextNode <#text>
 | ||
|       BlockContainer <div.c> at (8,42) content-size 784x17 children: inline
 | ||
|         InlineNode <span>
 | ||
|           frag 0 from TextNode start: 0, length: 1, rect: [13,42 9.34375x17] baseline: 13.296875
 | ||
|               "a"
 | ||
|           frag 1 from TextNode start: 0, length: 1, rect: [139,42 4.5625x17] baseline: 13.296875
 | ||
|               "i"
 | ||
|           InlineNode <(anonymous)>
 | ||
|             frag 0 from TextNode start: 0, length: 1, rect: [8,42 5.484375x17] baseline: 13.296875
 | ||
|                 "("
 | ||
|             TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <span>
 | ||
|             frag 0 from TextNode start: 0, length: 1, rect: [30,42 9.46875x17] baseline: 13.296875
 | ||
|                 "b"
 | ||
|             frag 1 from TextNode start: 0, length: 1, rect: [122,42 9.296875x17] baseline: 13.296875
 | ||
|                 "h"
 | ||
|             InlineNode <(anonymous)>
 | ||
|               frag 0 from TextNode start: 0, length: 1, rect: [23,42 7.625x17] baseline: 13.296875
 | ||
|                   "{"
 | ||
|               TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <span>
 | ||
|               frag 0 from TextNode start: 0, length: 1, rect: [47,42 8.890625x17] baseline: 13.296875
 | ||
|                   "c"
 | ||
|               frag 1 from TextNode start: 0, length: 1, rect: [107,42 7.5625x17] baseline: 13.296875
 | ||
|                   "g"
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 frag 0 from TextNode start: 0, length: 1, rect: [40,42 6.953125x17] baseline: 13.296875
 | ||
|                     "["
 | ||
|                 TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <span>
 | ||
|                 frag 0 from TextNode start: 0, length: 1, rect: [63,42 7.859375x17] baseline: 13.296875
 | ||
|                     "d"
 | ||
|                 frag 1 from TextNode start: 0, length: 1, rect: [93,42 6.4375x17] baseline: 13.296875
 | ||
|                     "f"
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   frag 0 from TextNode start: 0, length: 1, rect: [56,42 6.953125x17] baseline: 13.296875
 | ||
|                       "["
 | ||
|                   TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <span>
 | ||
|                   frag 0 from TextNode start: 0, length: 1, rect: [78,42 8.71875x17] baseline: 13.296875
 | ||
|                       "e"
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     frag 0 from TextNode start: 0, length: 1, rect: [71,42 6.953125x17] baseline: 13.296875
 | ||
|                         "["
 | ||
|                     TextNode <#text>
 | ||
|                   TextNode <#text>
 | ||
|                   InlineNode <(anonymous)>
 | ||
|                     frag 0 from TextNode start: 0, length: 1, rect: [86,42 7.21875x17] baseline: 13.296875
 | ||
|                         "]"
 | ||
|                     TextNode <#text>
 | ||
|                 TextNode <#text>
 | ||
|                 InlineNode <(anonymous)>
 | ||
|                   frag 0 from TextNode start: 0, length: 1, rect: [100,42 7.21875x17] baseline: 13.296875
 | ||
|                       "]"
 | ||
|                   TextNode <#text>
 | ||
|               TextNode <#text>
 | ||
|               InlineNode <(anonymous)>
 | ||
|                 frag 0 from TextNode start: 0, length: 1, rect: [115,42 7.21875x17] baseline: 13.296875
 | ||
|                     "]"
 | ||
|                 TextNode <#text>
 | ||
|             TextNode <#text>
 | ||
|             InlineNode <(anonymous)>
 | ||
|               frag 0 from TextNode start: 0, length: 1, rect: [131,42 7.65625x17] baseline: 13.296875
 | ||
|                   "}"
 | ||
|               TextNode <#text>
 | ||
|           TextNode <#text>
 | ||
|           InlineNode <(anonymous)>
 | ||
|             frag 0 from TextNode start: 0, length: 1, rect: [143,42 4.8125x17] baseline: 13.296875
 | ||
|                 ")"
 | ||
|             TextNode <#text>
 | ||
|       BlockContainer <(anonymous)> at (8,59) content-size 784x0 children: inline
 | ||
|         TextNode <#text>
 | ||
| 
 | ||
| ViewportPaintable (Viewport<#document>) [0,0 800x600]
 | ||
|   PaintableWithLines (BlockContainer<HTML>) [0,0 800x67]
 | ||
|     PaintableWithLines (BlockContainer<BODY>) [8,8 784x51]
 | ||
|       PaintableWithLines (BlockContainer<DIV>.a) [8,8 784x17]
 | ||
|         InlinePaintable (InlineNode<SPAN>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode<SPAN>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode<SPAN>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode<SPAN>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode<SPAN>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|       PaintableWithLines (BlockContainer(anonymous)) [8,25 784x0]
 | ||
|       PaintableWithLines (BlockContainer<DIV>.b) [8,25 784x17]
 | ||
|         InlinePaintable (InlineNode<SPAN>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode<SPAN>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode<SPAN>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode<SPAN>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode<SPAN>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                     TextPaintable (TextNode<#text>)
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                     TextPaintable (TextNode<#text>)
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|       PaintableWithLines (BlockContainer(anonymous)) [8,42 784x0]
 | ||
|       PaintableWithLines (BlockContainer<DIV>.c) [8,42 784x17]
 | ||
|         InlinePaintable (InlineNode<SPAN>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode<SPAN>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode<SPAN>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode<SPAN>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode<SPAN>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                     TextPaintable (TextNode<#text>)
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|                   InlinePaintable (InlineNode(anonymous))
 | ||
|                     TextPaintable (TextNode<#text>)
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|                 InlinePaintable (InlineNode(anonymous))
 | ||
|                   TextPaintable (TextNode<#text>)
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|               InlinePaintable (InlineNode(anonymous))
 | ||
|                 TextPaintable (TextNode<#text>)
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|             InlinePaintable (InlineNode(anonymous))
 | ||
|               TextPaintable (TextNode<#text>)
 | ||
|           TextPaintable (TextNode<#text>)
 | ||
|           InlinePaintable (InlineNode(anonymous))
 | ||
|             TextPaintable (TextNode<#text>)
 | ||
|       PaintableWithLines (BlockContainer(anonymous)) [8,59 784x0]
 |