Reviewed by Dave Hyatt (rendering) and Maciej (editing).
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2005 01:27:47 +0000 (01:27 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2005 01:27:47 +0000 (01:27 +0000)
commit7cf2bd9244e5f3b65d032d61af505df32a82a38c
tree2f336bbb35c76d69f7d0280d46ee1dd5ab9ab2f6
parent8e1ec229fec65ea1c72c8b06332997517ff41fb3
    Reviewed by Dave Hyatt (rendering) and Maciej (editing).

        Test cases added:  Coming soon.  Will include with next round of changes for this bug.

        This is the first checkin for...

        <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail)

        Basic strategy is to put tabs into spans with white-space:pre style, and
        render them with tabs stops every 8th space, where the space width and
        the left margin are those of the enclosing block.

        What's left is to switch to implement white-space:pre-wrap so
        that we can coalesce consecutive tabs while maintaining proper
        line breaking.  That will keep the markup smaller.

        * khtml/editing/apply_style_command.cpp:
        (khtml::createStyleSpanElement):
        (khtml::ApplyStyleCommand::removeCSSStyle):
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
        * khtml/editing/delete_selection_command.cpp:
        (khtml::DeleteSelectionCommand::saveTypingStyleState):
        * khtml/editing/edit_command.cpp:
        (khtml::EditCommand::styleAtPosition):
        * khtml/editing/html_interchange.h:
        * khtml/editing/htmlediting.cpp:
        (khtml::isSpecialElement):
        (khtml::isTabSpanNode):
        (khtml::isTabSpanTextNode):
        (khtml::positionBeforeTabSpan):
        (khtml::createTabSpanElement):
        * khtml/editing/htmlediting.h:
        * khtml/editing/insert_text_command.cpp:
        (khtml::InsertTextCommand::prepareForTextInsertion):
        (khtml::InsertTextCommand::input):
        (khtml::InsertTextCommand::insertTab):
        * khtml/editing/insert_text_command.h:
        * khtml/editing/markup.cpp:
        (khtml::createParagraphContentsFromString):
        (khtml::createFragmentFromText):
        * khtml/editing/replace_selection_command.cpp:
        (khtml::ReplacementFragment::removeStyleNodes):
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::begin):
        (khtml::HTMLTokenizer::processListing):
        (khtml::HTMLTokenizer::parseEntity):
        (khtml::HTMLTokenizer::parseTag):
        (khtml::HTMLTokenizer::addPending):
        (khtml::HTMLTokenizer::write):
        * khtml/html/htmltokenizer.h:
        (khtml::HTMLTokenizer::):
        * khtml/rendering/bidi.cpp:
        (khtml::addRun):
        (khtml::RenderBlock::tabWidth):
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        (khtml::RenderBlock::skipWhitespace):
        (khtml::RenderBlock::findNextLineBreak):
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/break_lines.cpp:
        (khtml::isBreakable):
        * khtml/rendering/font.cpp:
        (Font::drawHighlightForText):
        (Font::drawText):
        (Font::floatWidth):
        (Font::floatCharacterWidths):
        (Font::checkSelectionPoint):
        (Font::width):
        * khtml/rendering/font.h:
        * khtml/rendering/render_block.cpp:
        (khtml::stripTrailingSpace):
        (khtml::RenderBlock::calcInlineMinMaxWidth):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_br.h:
        (khtml::RenderBR::width):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutVerticalBox):
        * khtml/rendering/render_image.cpp:
        (RenderImage::setPixmap):
        (RenderImage::paint):
        * khtml/rendering/render_line.cpp:
        (khtml::EllipsisBox::paint):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::width):
        (khtml::InlineBox::xPos):
        (khtml::InlineBox::yPos):
        (khtml::InlineBox::height):
        (khtml::InlineBox::baseline):
        * khtml/rendering/render_list.cpp:
        (RenderListMarker::paint):
        (RenderListMarker::calcMinMaxWidth):
        * khtml/rendering/render_object.cpp:
        (RenderObject::tabWidth):
        (RenderObject::recalcMinMaxWidths):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::selectionRect):
        (InlineTextBox::paint):
        (InlineTextBox::paintSelection):
        (InlineTextBox::paintMarkedTextBackground):
        (InlineTextBox::textPos):
        (InlineTextBox::offsetForPosition):
        (InlineTextBox::positionForOffset):
        (RenderText::cacheWidths):
        (RenderText::widthFromCache):
        (RenderText::trimmedMinMaxWidth):
        (RenderText::calcMinMaxWidth):
        (RenderText::containsOnlyWhitespace):
        (RenderText::width):
        * khtml/rendering/render_text.h:
        * kwq/KWQFontMetrics.h:
        * kwq/KWQFontMetrics.mm:
        (QFontMetrics::width):
        (QFontMetrics::charWidth):
        (QFontMetrics::floatWidth):
        (QFontMetrics::floatCharacterWidths):
        (QFontMetrics::checkSelectionPoint):
        (QFontMetrics::boundingRect):
        (QFontMetrics::size):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawText):
        (QPainter::drawHighlightForText):
        * kwq/WebCoreTextRenderer.h:
        * kwq/WebCoreTextRendererFactory.mm:
        (WebCoreInitializeEmptyTextStyle):
        * layout-tests/editing/deleting/delete-tab-001-expected.txt:
        * layout-tests/editing/deleting/delete-tab-001.html:
        * layout-tests/editing/deleting/delete-tab-002-expected.txt:
        * layout-tests/editing/deleting/delete-tab-002.html:
        * layout-tests/editing/deleting/delete-tab-003-expected.txt:
        * layout-tests/editing/deleting/delete-tab-003.html:
        * layout-tests/editing/deleting/delete-tab-004-expected.txt:
        * layout-tests/editing/deleting/delete-tab-004.html:
        * layout-tests/editing/inserting/insert-tab-001-expected.txt:
        * layout-tests/editing/inserting/insert-tab-002-expected.txt:
        * layout-tests/editing/inserting/insert-tab-003-expected.txt:
        * layout-tests/editing/inserting/insert-tab-004-expected.txt:
        * layout-tests/fast/dom/quadraticCurveTo-expected.txt:
        * layout-tests/fast/js/string-replace-2-expected.txt:
        * layout-tests/fast/table/039-expected.txt:
        * layout-tests/fast/table/border-collapsing/004-expected.txt:
        * layout-tests/fast/tokenizer/script_extra_close-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
53 files changed:
LayoutTests/editing/deleting/delete-tab-001-expected.txt
LayoutTests/editing/deleting/delete-tab-001.html
LayoutTests/editing/deleting/delete-tab-002-expected.txt
LayoutTests/editing/deleting/delete-tab-002.html
LayoutTests/editing/deleting/delete-tab-003-expected.txt
LayoutTests/editing/deleting/delete-tab-003.html
LayoutTests/editing/deleting/delete-tab-004-expected.txt
LayoutTests/editing/deleting/delete-tab-004.html
LayoutTests/editing/inserting/insert-tab-001-expected.txt
LayoutTests/editing/inserting/insert-tab-002-expected.txt
LayoutTests/editing/inserting/insert-tab-003-expected.txt
LayoutTests/editing/inserting/insert-tab-004-expected.txt
LayoutTests/fast/dom/quadraticCurveTo-expected.txt
LayoutTests/fast/js/string-replace-2-expected.txt
LayoutTests/fast/table/039-expected.txt
LayoutTests/fast/table/border-collapsing/004-expected.txt
LayoutTests/fast/tokenizer/script_extra_close-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/apply_style_command.cpp
WebCore/khtml/editing/delete_selection_command.cpp
WebCore/khtml/editing/edit_command.cpp
WebCore/khtml/editing/html_interchange.h
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h
WebCore/khtml/editing/insert_text_command.cpp
WebCore/khtml/editing/insert_text_command.h
WebCore/khtml/editing/markup.cpp
WebCore/khtml/editing/replace_selection_command.cpp
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/html/htmltokenizer.h
WebCore/khtml/rendering/bidi.cpp
WebCore/khtml/rendering/break_lines.cpp
WebCore/khtml/rendering/font.cpp
WebCore/khtml/rendering/font.h
WebCore/khtml/rendering/render_block.cpp
WebCore/khtml/rendering/render_block.h
WebCore/khtml/rendering/render_br.h
WebCore/khtml/rendering/render_flexbox.cpp
WebCore/khtml/rendering/render_image.cpp
WebCore/khtml/rendering/render_line.cpp
WebCore/khtml/rendering/render_line.h
WebCore/khtml/rendering/render_list.cpp
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/rendering/render_object.h
WebCore/khtml/rendering/render_replaced.cpp
WebCore/khtml/rendering/render_text.cpp
WebCore/khtml/rendering/render_text.h
WebCore/kwq/KWQFontMetrics.h
WebCore/kwq/KWQFontMetrics.mm
WebCore/kwq/KWQPainter.h
WebCore/kwq/KWQPainter.mm
WebCore/kwq/WebCoreTextRenderer.h
WebCore/kwq/WebCoreTextRendererFactory.mm