Remove the trailing spaces in the current line, and then mark that the
        leading spaces of the next line need to be removed.

        .. seealso::
           `CSS Text Module Level 3 - The White Space Processing Rules
            <http://www.w3.org/TR/css3-text/#white-space-phase-2>`_

def _enter_newline(self):
        """
        Remove the trailing spaces in the current line, and then mark that the
        leading spaces of the next line need to be removed.

        .. seealso::
           `CSS Text Module Level 3 - The White Space Processing Rules
            <http://www.w3.org/TR/css3-text/#white-space-phase-2>`_
        """

        last_text_idx = self._last_text_idx
        if last_text_idx >= 0:
            buf = self._buffer
            buf[last_text_idx] = buf[last_text_idx].rstrip()

        self._remove_begining_ws = True