8000 Remove TreeConstructer::insertBefore as the previous commit makes thi… · Nimbleworks/html5lib-php@8f16a35 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f16a35

Browse files
committed
Remove TreeConstructer::insertBefore as the previous commit makes this needless.
1 parent f428154 commit 8f16a35

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

library/HTML5/TreeConstructer.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,19 +3084,6 @@ private function appendToRealParent($node) {
30843084
}
30853085
}
30863086

3087-
private function insertBefore($parent, $node, $marker) {
3088-
if ($node instanceof DOMText) {
3089-
if ($marker instanceof DOMText) {
3090-
$marker->data = $node->data . $marker->data;
3091-
return;
3092-
} elseif ($marker->previousSibling && $marker->previousSibling instanceof DOMText) {
3093-
$marker->previousSibling->data .= $node->data;
3094-
return;
3095-
}
3096-
}
3097-
$parent->insertBefore($node, $marker);
3098-
}
3099-
31003087
private function elementInScope($el, $table = false) {
31013088
if(is_array($el)) {
31023089
foreach($el as $element) {
@@ -3489,7 +3476,7 @@ public function fosterParent($node) {
34893476
* elements in the foster parent element; otherwise, node must be
34903477
* appended to the foster parent element. */
34913478
if ($table->tagName === 'table' && $table->parentNode->isSameNode($foster_parent)) {
3492-
$this->insertBefore($foster_parent, $node, $table);
3479+
$foster_parent->insertBefore($node, $table);
34933480
} else {
34943481
$foster_parent->appendChild($node);
34953482
}

0 commit comments

Comments
 (0)
0