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–81 unchanged (81 lines)
82 for (Element el: elements) {
83 if (!el.tag().isFormSubmittable()) continue; // contents are form listable, superset of submitable
84 if (el.hasAttr("disabled")) continue; // skip disabled form inputs
85 String name = el.attr("name");
86 if (name.length() == 0) continue;
87 String type = el.attr("type");
88
89
90 if ("select".equals(el.normalName())) {
91 Elements options = el.select("option[selected]");
92 boolean set = false;
93 for (Element option: options) {
94 data.add(HttpConnection.KeyVal.create(name, option.val()));
…lines 95–115 unchanged (21 lines)

After

…lines 1–82 unchanged (82 lines)
83 if (!el.tag().isFormSubmittable()) continue; // contents are form listable, superset of submitable
84 if (el.hasAttr("disabled")) continue; // skip disabled form inputs
85 String name = el.attr("name");
86 if (name.length() == 0) continue;
87 String type = el.attr("type");
88
89 if (type.equalsIgnoreCase("button")) continue; // browsers don't submit these
90
91 if ("select".equals(el.normalName())) {
92 Elements options = el.select("option[selected]");
93 boolean set = false;
94 for (Element option: options) {
95 data.add(HttpConnection.KeyVal.create(name, option.val()));
…lines 96–116 unchanged (21 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "Connection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "Jsoup"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "HttpConnection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Tag"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "select"
. "."
identifier "Elements"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * A HTML Form Element provides ready access to the form"...
class_declaration
modifiers
public "public"
class "class"
identifier "FormElement"
superclass
extends "extends"
type_identifier "Element"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Elements"
variable_declarator
identifier "elements"
= "="
object_creation_expression
new "new"
type_identifier "Elements"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Create a new, standalone form element.\n *\n "...
constructor_declaration (+32 nodes collapsed)
block_comment "/**\n * Get the list of form control elements associated "...
method_declaration
modifiers
public "public"
type_identifier "Elements"
identifier "elements"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "elements"
; ";"
} "}"
block_comment "/**\n * Add a form control element to this form.\n * @"...
method_declaration (+28 nodes collapsed)
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Prepare to submit this form. A Connection object "...
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Get the data that this form submits. The returned"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
scoped_type_identifier
type_identifier "Connection"
. "."
type_identifier "KeyVal"
> ">"
identifier "formData"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration (+24 nodes collapsed)
line_comment "// iterate the form control elements and accumulate their va"...
enhanced_for_statement
for "for"
( "("
type_identifier "Element"
identifier "el"
: ":"
identifier "elements"
) ")"
block
{ "{"
if_statement (+23 nodes collapsed)
line_comment "// contents are form listable, superset of submitable"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "el"
. "."
identifier "hasAttr"
argument_list
( "("
string_literal
" "\""
string_fragment "disabled"
" "\""
) ")"
) ")"
continue_statement
continue "continue"
; ";"
line_comment "// skip disabled form inputs"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "el"
. "."
identifier "attr"
argument_list
( "("
string_literal
" "\""
string_fragment "name"
" "\""
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "name"
. "."
identifier "length"
argument_list
( "("
) ")"
== "=="
decimal_integer_literal "0"
) ")"
continue_statement
continue "continue"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "type"
= "="
method_invocation
identifier "el"
. "."
identifier "attr"
argument_list
( "("
string_literal
" "\""
string_fragment "type"
" "\""
) ")"
; ";"
if_statement (+310 nodes collapsed)
} "}"
return_statement
return "return"
identifier "data"
; ";"
} "}"
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "Connection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "Jsoup"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "HttpConnection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Tag"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "select"
. "."
identifier "Elements"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * A HTML Form Element provides ready access to the form"...
class_declaration
modifiers
public "public"
class "class"
identifier "FormElement"
superclass
extends "extends"
type_identifier "Element"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Elements"
variable_declarator
identifier "elements"
= "="
object_creation_expression
new "new"
type_identifier "Elements"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Create a new, standalone form element.\n *\n "...
constructor_declaration (+32 nodes collapsed)
block_comment "/**\n * Get the list of form control elements associated "...
method_declaration
modifiers
public "public"
type_identifier "Elements"
identifier "elements"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "elements"
; ";"
} "}"
block_comment "/**\n * Add a form control element to this form.\n * @"...
method_declaration (+28 nodes collapsed)
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Prepare to submit this form. A Connection object "...
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Get the data that this form submits. The returned"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
scoped_type_identifier
type_identifier "Connection"
. "."
type_identifier "KeyVal"
> ">"
identifier "formData"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration (+24 nodes collapsed)
line_comment "// iterate the form control elements and accumulate their va"...
enhanced_for_statement
for "for"
( "("
type_identifier "Element"
identifier "el"
: ":"
identifier "elements"
) ")"
block
{ "{"
if_statement (+23 nodes collapsed)
line_comment "// contents are form listable, superset of submitable"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "el"
. "."
identifier "hasAttr"
argument_list
( "("
string_literal
" "\""
string_fragment "disabled"
" "\""
) ")"
) ")"
continue_statement
continue "continue"
; ";"
line_comment "// skip disabled form inputs"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "el"
. "."
identifier "attr"
argument_list
( "("
string_literal
" "\""
string_fragment "name"
" "\""
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "name"
. "."
identifier "length"
argument_list
( "("
) ")"
== "=="
decimal_integer_literal "0"
) ")"
continue_statement
continue "continue"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "type"
= "="
method_invocation
identifier "el"
. "."
identifier "attr"
argument_list
( "("
string_literal
" "\""
string_fragment "type"
" "\""
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "type"
. "."
identifier "equalsIgnoreCase"
argument_list
( "("
string_literal
" "\""
string_fragment "button"
" "\""
) ")"
) ")"
continue_statement
continue "continue"
; ";"
line_comment "// browsers don't submit these"
if_statement (+310 nodes collapsed)
} "}"
return_statement
return "return"
identifier "data"
; ";"
} "}"
} "}"