File tree 1 file changed +3
-3
lines changed
src/test/java/org/jsoup/nodes 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ public void testFastReparentExistingContent() {
85
85
Document doc = new Document ("https://example.com/" );
86
86
Element el = doc .body ();
87
87
for (int i = 0 ; i <= 50000 ; i ++) {
88
- el = el .appendElement ( "p" );
88
+ el = el .appendChild ( doc . createElement ( "p" )). firstElementChild ( );
89
89
}
90
90
assertFalse (doc .hasText ());
91
91
el .text ("Hello" );
@@ -98,7 +98,7 @@ public void testFastReparentExistingContent() {
98
98
Document doc = new Document ("https://example.com/" );
99
99
Element el = doc .body ();
100
100
for (int i = 0 ; i <= 50000 ; i ++) {
101
- el = el .appendElement ( "p" );
101
+ el = el .appendChild ( doc . createElement ( "p" )). firstElementChild ( );
102
102
}
103
103
Element script = el .appendElement ("script" );
104
104
script .text ("script" ); // holds data nodes, so inserts as data, not text
@@ -113,7 +113,7 @@ public void testFastReparentExistingContent() {
113
113
Element el = doc .body ();
114
114
int num = 50000 ;
115
115
for (int i = 0 ; i <= num ; i ++) {
116
- el = el .appendElement ( "p" );
116
+ el = el .appendChild ( doc . createElement ( "p" )). firstElementChild ( );
117
117
}
118
118
Elements parents = el .parents ();
119
119
assertEquals (num +2 , parents .size ()); // +2 for html and body
You can’t perform that action at this time.
0 commit comments