Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–1482 unchanged (1482 lines)
1483 tb.markInsertionMode();
1484 tb.transition(Text);
1485 tb.insert(startTag);
1486 }
1487
1488 private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
1489 tb.insert(startTag);
1490 tb.tokeniser.transition(TokeniserState.Rawtext);
1491 tb.markInsertionMode();
1492 tb.transition(Text);
1493 }
1494
1495 // lists of tags to search through. A little harder to read here, but causes less GC than dynamic varargs.
…lines 1496–1521 unchanged (26 lines)

After

…lines 1–1485 unchanged (1485 lines)
1486 }
1487
1488 private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
1489 tb.tokeniser.transition(TokeniserState.Rawtext);
1490 tb.markInsertionMode();
1491 tb.transition(Text);
1492 tb.insert(startTag);
1493 }
1494
1495 // lists of tags to search through. A little harder to read here, but causes less GC than dynamic varargs.
1496 // was contributing around 10% of parse GC load.
1497 private static final class Constants {
1498 private static final String[] InBodyStartToHead = new String[]{"base", "basefont", "bgsound", "command", "link", "meta", "noframes", "script", "style", "title"};
…lines 1499–1521 unchanged (23 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "StringUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
block_comment "/**\n * The Tree Builder's current state. Each state embodies"...
enum_declaration
enum "enum"
identifier "HtmlTreeBuilderState"
enum_body
{ "{"
enum_constant (+258 nodes collapsed)
, ","
enum_constant (+342 nodes collapsed)
, ","
enum_constant (+384 nodes collapsed)
, ","
enum_constant (+729 nodes collapsed)
, ","
enum_constant (+469 nodes collapsed)
, ","
enum_constant (+593 nodes collapsed)
, ","
enum_constant (+5956 nodes collapsed)
, ","
enum_constant (+162 nodes collapsed)
, ","
enum_constant (+1162 nodes collapsed)
, ","
enum_constant (+389 nodes collapsed)
, ","
enum_constant (+494 nodes collapsed)
, ","
enum_constant (+458 nodes collapsed)
, ","
enum_constant (+670 nodes collapsed)
, ","
enum_constant (+640 nodes collapsed)
, ","
enum_constant (+634 nodes collapsed)
, ","
enum_constant (+1016 nodes collapsed)
, ","
enum_constant (+297 nodes collapsed)
, ","
enum_constant (+305 nodes collapsed)
, ","
enum_constant (+501 nodes collapsed)
, ","
enum_constant (+311 nodes collapsed)
, ","
enum_constant (+182 nodes collapsed)
, ","
enum_constant (+219 nodes collapsed)
, ","
enum_constant (+26 nodes collapsed)
enum_body_declarations
; ";"
field_declaration
modifiers
private "private"
static "static"
type_identifier "String"
variable_declarator
identifier "nullString"
= "="
method_invocation
identifier "String"
. "."
identifier "valueOf"
argument_list
( "("
character_literal "'\\u0000'"
) ")"
; ";"
method_declaration
modifiers
abstract "abstract"
boolean_type "boolean"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Token"
identifier "t"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
; ";"
method_declaration (+62 nodes collapsed)
method_declaration (+83 nodes collapsed)
method_declaration (+67 nodes collapsed)
method_declaration
modifiers
private "private"
static "static"
void_type "void"
identifier "handleRawtext"
formal_parameters
( "("
formal_parameter
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
identifier "startTag"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "insert"
argument_list
( "("
identifier "startTag"
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "tb"
. "."
identifier "tokeniser"
. "."
identifier "transition"
argument_list
( "("
field_access
identifier "TokeniserState"
. "."
identifier "Rawtext"
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "markInsertionMode"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "transition"
argument_list
( "("
identifier "Text"
) ")"
; ";"
} "}"
line_comment "// lists of tags to search through. A little harder to read "...
line_comment "// was contributing around 10% of parse GC load."
class_declaration (+1034 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "StringUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
block_comment "/**\n * The Tree Builder's current state. Each state embodies"...
enum_declaration
enum "enum"
identifier "HtmlTreeBuilderState"
enum_body
{ "{"
enum_constant (+258 nodes collapsed)
, ","
enum_constant (+342 nodes collapsed)
, ","
enum_constant (+384 nodes collapsed)
, ","
enum_constant (+729 nodes collapsed)
, ","
enum_constant (+469 nodes collapsed)
, ","
enum_constant (+593 nodes collapsed)
, ","
enum_constant (+5956 nodes collapsed)
, ","
enum_constant (+162 nodes collapsed)
, ","
enum_constant (+1162 nodes collapsed)
, ","
enum_constant (+389 nodes collapsed)
, ","
enum_constant (+494 nodes collapsed)
, ","
enum_constant (+458 nodes collapsed)
, ","
enum_constant (+670 nodes collapsed)
, ","
enum_constant (+640 nodes collapsed)
, ","
enum_constant (+634 nodes collapsed)
, ","
enum_constant (+1016 nodes collapsed)
, ","
enum_constant (+297 nodes collapsed)
, ","
enum_constant (+305 nodes collapsed)
, ","
enum_constant (+501 nodes collapsed)
, ","
enum_constant (+311 nodes collapsed)
, ","
enum_constant (+182 nodes collapsed)
, ","
enum_constant (+219 nodes collapsed)
, ","
enum_constant (+26 nodes collapsed)
enum_body_declarations
; ";"
field_declaration
modifiers
private "private"
static "static"
type_identifier "String"
variable_declarator
identifier "nullString"
= "="
method_invocation
identifier "String"
. "."
identifier "valueOf"
argument_list
( "("
character_literal "'\\u0000'"
) ")"
; ";"
method_declaration
modifiers
abstract "abstract"
boolean_type "boolean"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Token"
identifier "t"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
; ";"
method_declaration (+62 nodes collapsed)
method_declaration (+83 nodes collapsed)
method_declaration (+67 nodes collapsed)
method_declaration
modifiers
private "private"
static "static"
void_type "void"
identifier "handleRawtext"
formal_parameters
( "("
formal_parameter
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
identifier "startTag"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
block
{ "{"
expression_statement
method_invocation
field_access
identifier "tb"
. "."
identifier "tokeniser"
. "."
identifier "transition"
argument_list
( "("
field_access
identifier "TokeniserState"
. "."
identifier "Rawtext"
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "markInsertionMode"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "transition"
argument_list
( "("
identifier "Text"
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "insert"
argument_list
( "("
identifier "startTag"
) ")"
; ";"
} "}"
line_comment "// lists of tags to search through. A little harder to read "...
line_comment "// was contributing around 10% of parse GC load."
class_declaration (+1034 nodes collapsed)
} "}"