Browse Source

Remove or suppress coverage for unreachable lines

serialize
J. King 3 years ago
parent
commit
29f2611c53
  1. 13
      lib/Parser/TreeConstructor.php

13
lib/Parser/TreeConstructor.php

@ -3679,14 +3679,8 @@ class TreeConstructor {
// NOTE: The "entry above" refers to the "in body" insertion mode // NOTE: The "entry above" refers to the "in body" insertion mode
// Changes here should be mirrored there // Changes here should be mirrored there
foreach ($this->stack as $node) { foreach ($this->stack as $node) {
if ($node->nodeName === $token->name && $node->namespaceURI === $this->htmlNamespace) { // NOTE: Only the "is special" case is possible here
$this->stack->generateImpliedEndTags($token->name); if ($this->isElementSpecial($node)) {
if (!$node->isSameNode($this->stack->currentNode)) {
$this->error($errorCode, $token->name);
}
$this->stack->popUntilSame($node);
return;
} elseif ($this->isElementSpecial($node)) {
$this->error($errorCode, $token->name); $this->error($errorCode, $token->name);
return; return;
} }
@ -3896,12 +3890,15 @@ class TreeConstructor {
// Abort! // Abort!
} }
else { else {
// NOTE: This is an edge case only possible via scripting
// @codeCoverageIgnoreStart
# 6. Let previous element be the element immediately above last table in the # 6. Let previous element be the element immediately above last table in the
# stack of open elements. # stack of open elements.
$previousElement = $this->stack[$lastTableIndex - 1]; $previousElement = $this->stack[$lastTableIndex - 1];
# 7. Let adjusted insertion location be inside previous element, after its last # 7. Let adjusted insertion location be inside previous element, after its last
# child (if any). # child (if any).
$insertionLocation = $previousElement; $insertionLocation = $previousElement;
// @codeCoverageIgnoreEnd
} }
} }
# Otherwise let adjusted insertion location be inside target, after its last # Otherwise let adjusted insertion location be inside target, after its last

Loading…
Cancel
Save