| @@ 18-32 (lines=15) @@ | ||
| 15 | */ |
|
| 16 | class Dl extends OpenElement implements FlowContent |
|
| 17 | { |
|
| 18 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 19 | { |
|
| 20 | // Only "dd", "dt", and ScriptSupporting elements allowed. |
|
| 21 | foreach ($this->children as $child) { |
|
| 22 | if ($child instanceof NonParticipating || |
|
| 23 | $child instanceof Dd || |
|
| 24 | $child instanceof Dt || |
|
| 25 | $child instanceof ScriptSupporting) { |
|
| 26 | continue; |
|
| 27 | } |
|
| 28 | ||
| 29 | $logger->debug('Removing ' . $child . '. Only elements "dd", "dt", and script supporting elements allowed as children of "dl" element.'); |
|
| 30 | $this->removeChild($child); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 17-29 (lines=13) @@ | ||
| 14 | */ |
|
| 15 | class Dt extends OpenElement |
|
| 16 | { |
|
| 17 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 18 | { |
|
| 19 | // No "header", "footer", sectioning content, or heading content descendants. |
|
| 20 | foreach ($this->children as $child) { |
|
| 21 | if ($child instanceof Header || |
|
| 22 | $child instanceof Footer || |
|
| 23 | $child instanceof SectioningContent || |
|
| 24 | $child instanceof HeadingContent) { |
|
| 25 | $logger->debug('Removing ' . $child . '. No "header", "footer", and sectioning content, or heading content elements allowed as children of "dt" element.'); |
|
| 26 | $this->removeChild($child); |
|
| 27 | } |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| 31 | protected function removeInvalidSelf(LoggerInterface $logger) |
|
| 32 | { |
|
| @@ 41-54 (lines=14) @@ | ||
| 38 | ); |
|
| 39 | } |
|
| 40 | ||
| 41 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 42 | { |
|
| 43 | foreach ($this->children as $child) { |
|
| 44 | if ($child instanceof NonParticipating || |
|
| 45 | $child instanceof Option || |
|
| 46 | $child instanceof Optgroup || |
|
| 47 | $child instanceof ScriptSupporting) { |
|
| 48 | continue; |
|
| 49 | } |
|
| 50 | ||
| 51 | $logger->debug('Removing ' . $child . '. Only "option, "optgroup", and script supporting elements allowed as children of a "select" element.'); |
|
| 52 | $this->removeChild($child); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| 56 | public function isInteractiveContent() |
|
| 57 | { |
|
| @@ 17-31 (lines=15) @@ | ||
| 14 | */ |
|
| 15 | class Tr extends OpenElement |
|
| 16 | { |
|
| 17 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 18 | { |
|
| 19 | // Children can be "td", "th", and script supporting elements. |
|
| 20 | foreach ($this->children as $child) { |
|
| 21 | if ($child instanceof NonParticipating || |
|
| 22 | $child instanceof Td || |
|
| 23 | $child instanceof Th || |
|
| 24 | $child instanceof ScriptSupporting) { |
|
| 25 | continue; |
|
| 26 | } |
|
| 27 | ||
| 28 | $logger->debug('Removing ' . $child . '. Only "td", "th", and script supporting elements allowed as children of "tr" element.'); |
|
| 29 | $this->removeChild($child); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||
| 33 | protected function removeInvalidSelf(LoggerInterface $logger) |
|
| 34 | { |
|