Merge branch '5.3'
authorMatthias Schmidt <gravatronics@live.com>
Mon, 3 May 2021 10:34:13 +0000 (12:34 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 3 May 2021 10:34:13 +0000 (12:34 +0200)
1  2 
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeTable.class.php
wcfsetup/install/files/style/ui/tabularBox.scss

index 2c405fb23176971302501af3a24fd60a0443a922,f2befd32387e79028c4dd114bf1d5d25c0d57e33..92eca8673f3e26b5017b9b7cb874a9931f1dc7f4
@@@ -13,35 -11,60 +13,62 @@@ use wcf\system\html\node\AbstractHtmlNo
   * @package     WoltLabSuite\Core\System\Html\Output\Node
   * @since       3.0
   */
 -class HtmlOutputNodeTable extends AbstractHtmlOutputNode {
 -      /**
 -       * @inheritDoc
 -       */
 -      protected $tagName = 'table';
 -      
 -      /**
 -       * @inheritDoc
 -       */
 -      public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor) {
 -              if ($this->outputType === 'text/html' || $this->outputType === 'text/simplified-html') {
 -                      /** @var \DOMElement $element */
 -                      foreach ($elements as $element) {
 -                              // Detect cells which are visually in the last row of a table due to their
 -                              // `rowspan` property.
 -                              /** @var \DOMElement $td */
 -                              foreach ($element->getElementsByTagName('td') as $td) {
 -                                      $rowspan = $td->getAttribute('rowspan');
 -                                      if ($rowspan) {
 -                                              $nextTrCount = 0;
 -                                              $nextSibling = $td->parentNode->nextSibling;
 -                                              while ($nextSibling) {
 -                                                      if ($nextSibling->nodeType === \XML_ELEMENT_NODE && $nextSibling->tagName === "tr") {
 -                                                              $nextTrCount++;
 -                                                      }
 -                                                      $nextSibling = $nextSibling->nextSibling;
 -                                              }
 -                                              
 -                                              if ($rowspan - 1 === $nextTrCount) {
 -                                                      $class = $td->getAttribute('class');
 -                                                      if ($class) {
 -                                                              $class .= " ";
 -                                                      }
 -                                                      $class .= "lastRow";
 -                                                      
 -                                                      $td->setAttribute('class', $class);
 -                                              }
 -                                      }
 -                              }
 -                              
 -                              // check if table is not contained within another table
 -                              $parent = $element;
 -                              while ($parent = $parent->parentNode) {
 -                                      if ($parent->nodeName === 'table') {
 -                                              continue 2;
 -                                      }
 -                              }
 -                              
 -                              $div = $element->ownerDocument->createElement('div');
 -                              $div->setAttribute('class', 'messageTableOverflow');
 -                              
 -                              $element->parentNode->insertBefore($div, $element);
 -                              $div->appendChild($element);
 -                      }
 -              }
 -      }
 +class HtmlOutputNodeTable extends AbstractHtmlOutputNode
 +{
 +    /**
 +     * @inheritDoc
 +     */
 +    protected $tagName = 'table';
 +
 +    /**
 +     * @inheritDoc
 +     */
 +    public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor)
 +    {
 +        if ($this->outputType === 'text/html' || $this->outputType === 'text/simplified-html') {
 +            /** @var \DOMElement $element */
 +            foreach ($elements as $element) {
++                // Detect cells which are visually in the last row of a table due to their
++                // `rowspan` property.
++                /** @var \DOMElement $td */
++                foreach ($element->getElementsByTagName('td') as $td) {
++                    $rowspan = $td->getAttribute('rowspan');
++                    if ($rowspan) {
++                        $nextTrCount = 0;
++                        $nextSibling = $td->parentNode->nextSibling;
++                        while ($nextSibling) {
++                            if ($nextSibling->nodeType === \XML_ELEMENT_NODE && $nextSibling->tagName === "tr") {
++                                $nextTrCount++;
++                            }
++                            $nextSibling = $nextSibling->nextSibling;
++                        }
++
++                        if ($rowspan - 1 === $nextTrCount) {
++                            $class = $td->getAttribute('class');
++                            if ($class) {
++                                $class .= " ";
++                            }
++                            $class .= "lastRow";
++
++                            $td->setAttribute('class', $class);
++                        }
++                    }
++                }
++
 +                // check if table is not contained within another table
 +                $parent = $element;
 +                while ($parent = $parent->parentNode) {
 +                    if ($parent->nodeName === 'table') {
-                         continue;
++                        continue 2;
 +                    }
 +                }
 +
 +                $div = $element->ownerDocument->createElement('div');
 +                $div->setAttribute('class', 'messageTableOverflow');
 +
 +                $element->parentNode->insertBefore($div, $element);
 +                $div->appendChild($element);
 +            }
 +        }
 +    }
  }
index c41f93de88d67aea45aab1ca4c69a0035ea32a4b,9458c4b99df8415d0b698d10e4231da544b382d1..b364042660dd1f81b4f97048dfdaa16022a404d2
                &:hover > td {
                        background-color: rgb(242, 242, 242);
                }
 -              
 +
-               &:not(:last-child) > td {
+               &:not(:last-child) > td:not(.lastRow) {
                        border-bottom: 1px solid $wcfContentBorderInner;
                }
        }