[webkit-changes] cvs commit: WebCore/layout-tests/fast/table/border-collapsing 004-expected.txt

David harrison at opensource.apple.com
Fri Aug 5 11:01:33 PDT 2005


harrison    05/08/05 11:01:32

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               khtml/editing Tag: Safari-2-0-branch html_interchange.h
                        htmlediting.cpp htmlediting.h markup.cpp
               khtml/html Tag: Safari-2-0-branch htmltokenizer.cpp
                        htmltokenizer.h
               khtml/rendering Tag: Safari-2-0-branch bidi.cpp
                        break_lines.cpp font.cpp font.h render_block.cpp
                        render_block.h render_br.h render_flexbox.cpp
                        render_image.cpp render_line.cpp render_line.h
                        render_list.cpp render_object.cpp render_object.h
                        render_replaced.cpp render_text.cpp render_text.h
               kwq      Tag: Safari-2-0-branch KWQFontMetrics.h
                        KWQFontMetrics.mm KWQPainter.h KWQPainter.mm
                        WebCoreTextRenderer.h WebCoreTextRendererFactory.mm
               layout-tests/editing/deleting Tag: Safari-2-0-branch
                        delete-tab-001-expected.txt delete-tab-001.html
                        delete-tab-002-expected.txt delete-tab-002.html
                        delete-tab-003-expected.txt delete-tab-003.html
                        delete-tab-004-expected.txt delete-tab-004.html
               layout-tests/editing/inserting Tag: Safari-2-0-branch
                        insert-tab-001-expected.txt
                        insert-tab-002-expected.txt
                        insert-tab-003-expected.txt
                        insert-tab-004-expected.txt
               layout-tests/fast/table Tag: Safari-2-0-branch
                        039-expected.txt
               layout-tests/fast/table/border-collapsing Tag:
                        Safari-2-0-branch 004-expected.txt
  Log:
          Merged fix from TOT
  
          <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.
  
          * khtml/editing/html_interchange.h:
          * khtml/editing/htmlediting.cpp:
          (khtml::EditCommand::styleAtPosition):
          (khtml::isSpecialElement):
          (khtml::ApplyStyleCommand::removeCSSStyle):
          (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
          (khtml::DeleteSelectionCommand::saveTypingStyleState):
          (khtml::InsertTextCommand::prepareForTextInsertion):
          (khtml::InsertTextCommand::input):
          (khtml::InsertTextCommand::insertTab):
          (khtml::ReplacementFragment::removeStyleNodes):
          (khtml::createStyleSpanElement):
          (khtml::isTabSpanNode):
          (khtml::isTabSpanTextNode):
          (khtml::positionBeforeTabSpan):
          (khtml::createTabSpanElement):
          * khtml/editing/htmlediting.h:
          * khtml/editing/markup.cpp:
          (khtml::createParagraphContentsFromString):
          (khtml::createFragmentFromText):
          * khtml/html/htmltokenizer.cpp:
          (khtml::HTMLTokenizer::begin):
          (khtml::HTMLTokenizer::processListing):
          (khtml::HTMLTokenizer::parseSpecial):
          (khtml::HTMLTokenizer::parseText):
          (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::layoutInlineChildren):
          (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:::RenderFlow):
          (khtml::RenderBlock::setStyle):
          (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):
          (RenderText::caretRect):
          (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::drawRect):
          (QPainter::drawLine):
          (QPainter::drawText):
          (QPainter::drawHighlightForText):
          (_fillRectXX):
          (QPainter::fillRect):
          * 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/table/039-expected.txt:
          * layout-tests/fast/table/border-collapsing/004-expected.txt:
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4104.2.94 +138 -0    WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4104.2.93
  retrieving revision 1.4104.2.94
  diff -u -r1.4104.2.93 -r1.4104.2.94
  --- ChangeLog	4 Aug 2005 21:34:31 -0000	1.4104.2.93
  +++ ChangeLog	5 Aug 2005 18:01:02 -0000	1.4104.2.94
  @@ -1,3 +1,141 @@
  +2005-08-05  David Harrison  <harrison at apple.com>
  +
  +        Merged fix from TOT
  +
  +        <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.
  +
  +        * khtml/editing/html_interchange.h:
  +        * khtml/editing/htmlediting.cpp:
  +        (khtml::EditCommand::styleAtPosition):
  +        (khtml::isSpecialElement):
  +        (khtml::ApplyStyleCommand::removeCSSStyle):
  +        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
  +        (khtml::DeleteSelectionCommand::saveTypingStyleState):
  +        (khtml::InsertTextCommand::prepareForTextInsertion):
  +        (khtml::InsertTextCommand::input):
  +        (khtml::InsertTextCommand::insertTab):
  +        (khtml::ReplacementFragment::removeStyleNodes):
  +        (khtml::createStyleSpanElement):
  +        (khtml::isTabSpanNode):
  +        (khtml::isTabSpanTextNode):
  +        (khtml::positionBeforeTabSpan):
  +        (khtml::createTabSpanElement):
  +        * khtml/editing/htmlediting.h:
  +        * khtml/editing/markup.cpp:
  +        (khtml::createParagraphContentsFromString):
  +        (khtml::createFragmentFromText):
  +        * khtml/html/htmltokenizer.cpp:
  +        (khtml::HTMLTokenizer::begin):
  +        (khtml::HTMLTokenizer::processListing):
  +        (khtml::HTMLTokenizer::parseSpecial):
  +        (khtml::HTMLTokenizer::parseText):
  +        (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::layoutInlineChildren):
  +        (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:::RenderFlow):
  +        (khtml::RenderBlock::setStyle):
  +        (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):
  +        (RenderText::caretRect):
  +        (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::drawRect):
  +        (QPainter::drawLine):
  +        (QPainter::drawText):
  +        (QPainter::drawHighlightForText):
  +        (_fillRectXX):
  +        (QPainter::fillRect):
  +        * 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/table/039-expected.txt:
  +        * layout-tests/fast/table/border-collapsing/004-expected.txt:
  +
   2005-08-04  Adele Peterson  <adele at apple.com>
   
           Merged fix from TOT to Safari-2-0-branch
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.8.1   +1 -0      WebCore/khtml/editing/html_interchange.h
  
  Index: html_interchange.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/html_interchange.h,v
  retrieving revision 1.5
  retrieving revision 1.5.8.1
  diff -u -r1.5 -r1.5.8.1
  --- html_interchange.h	10 Mar 2005 17:24:05 -0000	1.5
  +++ html_interchange.h	5 Aug 2005 18:01:19 -0000	1.5.8.1
  @@ -32,6 +32,7 @@
   #define AppleConvertedSpace       "Apple-converted-space"
   #define ApplePasteAsQuotation     "Apple-paste-as-quotation"
   #define AppleStyleSpanClass       "Apple-style-span"
  +#define AppleTabSpanClass         "Apple-tab-span"
   
   enum EAnnotateForInterchange { DoNotAnnotateForInterchange, AnnotateForInterchange };
   
  
  
  
  1.228.8.7 +181 -74   WebCore/khtml/editing/htmlediting.cpp
  
  Index: htmlediting.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.cpp,v
  retrieving revision 1.228.8.6
  retrieving revision 1.228.8.7
  diff -u -r1.228.8.6 -r1.228.8.7
  --- htmlediting.cpp	4 Aug 2005 02:37:35 -0000	1.228.8.6
  +++ htmlediting.cpp	5 Aug 2005 18:01:19 -0000	1.228.8.7
  @@ -132,8 +132,6 @@
       return isCollapsibleWhitespace(static_cast<TextImpl *>(pos.node())->data()[pos.offset()]);
   }
   
  -static const int spacesPerTab = 4;
  -
   static bool isTableStructureNode(const NodeImpl *node)
   {
       RenderObject *r = node->renderer();
  @@ -732,7 +730,7 @@
   
   CSSMutableStyleDeclarationImpl *EditCommand::styleAtPosition(const Position &pos)
   {
  -    CSSComputedStyleDeclarationImpl *computedStyle = pos.computedStyle();
  +    CSSComputedStyleDeclarationImpl *computedStyle = positionBeforeTabSpan(pos).computedStyle();
       computedStyle->ref();
       CSSMutableStyleDeclarationImpl *style = computedStyle->copyInheritableProperties();
       computedStyle->deref();
  @@ -1260,8 +1258,11 @@
       }
   }
   
  -static bool isSpecialElement(NodeImpl *n)
  +bool isSpecialElement(const NodeImpl *n)
   {
  +    if (!n)
  +        return false;
  +       
       if (!n->isHTMLElement())
           return false;
   
  @@ -1272,16 +1273,18 @@
           return true;
   
       RenderObject *renderer = n->renderer();
  -
  -    if (renderer && (renderer->style()->display() == TABLE || renderer->style()->display() == INLINE_TABLE))
  +    if (!renderer)
  +        return false;
  +        
  +    if (renderer->style()->display() == TABLE || renderer->style()->display() == INLINE_TABLE)
           return true;
   
  -    if (renderer && renderer->style()->isFloating())
  +    if (renderer->style()->isFloating())
           return true;
   
  -    if (renderer && renderer->style()->position() != STATIC)
  +    if (renderer->style()->position() != STATIC)
           return true;
  -
  +        
       return false;
   }
   
  @@ -1870,6 +1873,8 @@
           int propertyID = (*it).id();
           CSSValueImpl *value = decl->getPropertyCSSValue(propertyID);
           if (value) {
  +            if (propertyID == CSS_PROP_WHITE_SPACE && isTabSpanNode(elem))
  +                continue;
               value->ref();
               removeCSSProperty(decl, propertyID);
               value->deref();
  @@ -2432,6 +2437,10 @@
       StyleChange styleChange(style, Position(startNode, 0), StyleChange::styleModeForParseMode(document()->inCompatMode()));
       int exceptionCode = 0;
       
  +    // Prevent style changes to our tab spans, because it might remove the whitespace:pre we are after
  +    if (isTabSpanTextNode(startNode))
  +        return;
  +    
       //
       // Font tags need to go outside of CSS so that CSS font sizes override leagcy font sizes.
       //
  @@ -2725,7 +2734,7 @@
       // Figure out the typing style in effect before the delete is done.
       // FIXME: Improve typing style.
       // See this bug: <rdar://problem/3769899> Implementation of typing style needs improvement
  -    CSSComputedStyleDeclarationImpl *computedStyle = m_selectionToDelete.start().computedStyle();
  +    CSSComputedStyleDeclarationImpl *computedStyle = positionBeforeTabSpan(m_selectionToDelete.start()).computedStyle();
       computedStyle->ref();
       m_typingStyle = computedStyle->copyInheritableProperties();
       m_typingStyle->ref();
  @@ -3903,23 +3912,10 @@
   {
   }
   
  -Position InsertTextCommand::prepareForTextInsertion(bool adjustDownstream)
  +Position InsertTextCommand::prepareForTextInsertion(const Position& pos)
   {
  -    // Prepare for text input by looking at the current position.
  +    // Prepare for text input by looking at the specified position.
       // It may be necessary to insert a text node to receive characters.
  -    Selection selection = endingSelection();
  -    ASSERT(selection.isCaret());
  -    
  -    Position pos = selection.start();
  -    if (adjustDownstream)
  -        pos = pos.downstream(StayInBlock);
  -    else
  -        pos = pos.upstream(StayInBlock);
  -    
  -    Selection typingStyleRange;
  -
  -    pos = positionOutsideContainingSpecialElement(pos);
  -
       if (!pos.node()->isTextNode()) {
           NodeImpl *textNode = document()->createEditingTextNode("");
           NodeImpl *nodeToInsert = textNode;
  @@ -3940,7 +3936,30 @@
           else
               ASSERT_NOT_REACHED();
           
  -        pos = Position(textNode, 0);
  +        return Position(textNode, 0);
  +    }
  +
  +    if (isTabSpanTextNode(pos.node())) {
  +        Position tempPos = pos;
  +//#ifndef COALESCE_TAB_SPANS
  +#if 0
  +        NodeImpl *node = pos.node()->parentNode();
  +        if (pos.offset() > pos.node()->caretMinOffset())
  +            tempPos = Position(node->parentNode(), node->nodeIndex() + 1);
  +        else
  +            tempPos = Position(node->parentNode(), node->nodeIndex());
  +#endif        
  +        NodeImpl *textNode = document()->createEditingTextNode("");
  +        NodeImpl *originalTabSpan = tempPos.node()->parent();
  +        if (tempPos.offset() <= tempPos.node()->caretMinOffset()) {
  +            insertNodeBefore(textNode, originalTabSpan);
  +        } else if (tempPos.offset() >= tempPos.node()->caretMaxOffset()) {
  +            insertNodeAfter(textNode, originalTabSpan);
  +        } else {
  +            splitTextNodeContainingElement(static_cast<TextImpl *>(tempPos.node()), tempPos.offset());
  +            insertNodeBefore(textNode, originalTabSpan);
  +        }
  +        return Position(textNode, 0);
       }
   
       return pos;
  @@ -3961,59 +3980,51 @@
       // out correctly after the insertion.
       selection = endingSelection();
       deleteInsignificantTextDownstream(selection.end().trailingWhitespacePosition(selection.endAffinity()));
  -    
  -    // Make sure the document is set up to receive text
  -    Position startPosition = prepareForTextInsertion(adjustDownstream);
  -    
  -    Position endPosition;
  -
  -    TextImpl *textNode = static_cast<TextImpl *>(startPosition.node());
  -    long offset = startPosition.offset();
   
  -    // Now that we are about to add content, check to see if a placeholder element
  -    // can be removed.
  -    removeBlockPlaceholder(textNode->enclosingBlockFlowElement());
  +    // Figure out the startPosition
  +    Position startPosition = selection.start();
  +    Position endPosition;
  +    if (adjustDownstream)
  +        startPosition = startPosition.downstream(StayInBlock);
  +    else
  +        startPosition = startPosition.upstream(StayInBlock);
  +    startPosition = positionOutsideContainingSpecialElement(startPosition);
       
  -    // These are temporary implementations for inserting adjoining spaces
  -    // into a document. We are working on a CSS-related whitespace solution
  -    // that will replace this some day. We hope.
       if (text == "\t") {
  -        // Treat a tab like a number of spaces. This seems to be the HTML editing convention,
  -        // although the number of spaces varies (we choose four spaces). 
  -        // Note that there is no attempt to make this work like a real tab stop, it is merely 
  -        // a set number of spaces. This also seems to be the HTML editing convention.
  -        for (int i = 0; i < spacesPerTab; i++) {
  +        endPosition = insertTab(startPosition);
  +        startPosition = endPosition.previous();
  +        removeBlockPlaceholder(startPosition.node()->enclosingBlockFlowElement());
  +        m_charactersAdded += 1;
  +    } else {
  +        // Make sure the document is set up to receive text
  +        startPosition = prepareForTextInsertion(startPosition);
  +        removeBlockPlaceholder(startPosition.node()->enclosingBlockFlowElement());
  +        TextImpl *textNode = static_cast<TextImpl *>(startPosition.node());
  +        long offset = startPosition.offset();
  +
  +        if (text == " ") {
               insertSpace(textNode, offset);
  +            endPosition = Position(textNode, offset + 1);
  +
  +            m_charactersAdded++;
               rebalanceWhitespace();
  -            document()->updateLayout();
           }
  -        
  -        endPosition = Position(textNode, offset + spacesPerTab);
  -
  -        m_charactersAdded += spacesPerTab;
  -    }
  -    else if (text == " ") {
  -        insertSpace(textNode, offset);
  -        endPosition = Position(textNode, offset + 1);
  +        else {
  +            const DOMString &existingText = textNode->data();
  +            if (textNode->length() >= 2 && offset >= 2 && isNBSP(existingText[offset - 1]) && !isCollapsibleWhitespace(existingText[offset - 2])) {
  +                // DOM looks like this:
  +                // character nbsp caret
  +                // As we are about to insert a non-whitespace character at the caret
  +                // convert the nbsp to a regular space.
  +                // EDIT FIXME: This needs to be improved some day to convert back only
  +                // those nbsp's added by the editor to make rendering come out right.
  +                replaceTextInNode(textNode, offset - 1, 1, " ");
  +            }
  +            insertTextIntoNode(textNode, offset, text);
  +            endPosition = Position(textNode, offset + text.length());
   
  -        m_charactersAdded++;
  -        rebalanceWhitespace();
  -    }
  -    else {
  -        const DOMString &existingText = textNode->data();
  -        if (textNode->length() >= 2 && offset >= 2 && isNBSP(existingText[offset - 1]) && !isCollapsibleWhitespace(existingText[offset - 2])) {
  -            // DOM looks like this:
  -            // character nbsp caret
  -            // As we are about to insert a non-whitespace character at the caret
  -            // convert the nbsp to a regular space.
  -            // EDIT FIXME: This needs to be improved some day to convert back only
  -            // those nbsp's added by the editor to make rendering come out right.
  -            replaceTextInNode(textNode, offset - 1, 1, " ");
  +            m_charactersAdded += text.length();
           }
  -        insertTextIntoNode(textNode, offset, text);
  -        endPosition = Position(textNode, offset + text.length());
  -
  -        m_charactersAdded += text.length();
       }
   
       setEndingSelection(Selection(startPosition, DOWNSTREAM, endPosition, SEL_DEFAULT_AFFINITY));
  @@ -4029,6 +4040,56 @@
           setEndingSelection(endingSelection().end(), endingSelection().endAffinity());
   }
   
  +DOM::Position InsertTextCommand::insertTab(Position pos)
  +{
  +    Position insertPos = VisiblePosition(pos, DOWNSTREAM).deepEquivalent();
  +    NodeImpl *node = insertPos.node();
  +    unsigned int offset = insertPos.offset();
  +
  +//#ifdef COALESCE_TAB_SPANS
  +#if 1
  +    // keep tabs coalesced in tab span
  +    if (isTabSpanTextNode(node)) {
  +        insertTextIntoNode(static_cast<TextImpl *>(node), offset, "\t");
  +        return Position(node, offset + 1);
  +    }
  +#else
  +    if (isTabSpanTextNode(node)) {
  +        node = node->parentNode();
  +        if (offset > (unsigned int) node->caretMinOffset())
  +            insertPos = Position(node->parentNode(), node->nodeIndex() + 1);
  +        else
  +            insertPos = Position(node->parentNode(), node->nodeIndex());
  +        node = insertPos.node();
  +        offset = insertPos.offset();
  +    }
  +#endif
  +    
  +    // create new tab span
  +    DOM::ElementImpl * spanNode = createTabSpanElement(document());
  +    
  +    // place it
  +    if (!node->isTextNode()) {
  +        insertNodeAt(spanNode, node, offset);
  +    } else {
  +        TextImpl *textNode = static_cast<TextImpl *>(node);
  +        if (offset >= textNode->length()) {
  +            insertNodeAfter(spanNode, textNode);
  +        } else {
  +            // split node to make room for the span
  +            // NOTE: splitTextNode uses textNode for the
  +            // second node in the split, so we need to
  +            // insert the span before it.
  +            if (offset > 0)
  +                splitTextNode(textNode, offset);
  +            insertNodeBefore(spanNode, textNode);
  +        }
  +    }
  +    
  +    // return the position following the new tab
  +    return Position(spanNode->lastChild(), spanNode->lastChild()->caretMaxOffset());
  +}
  +
   void InsertTextCommand::insertSpace(TextImpl *textNode, unsigned long offset)
   {
       ASSERT(textNode);
  @@ -4732,7 +4793,7 @@
   void ReplacementFragment::removeStyleNodes()
   {
       // Since style information has been computed and cached away in
  -    // computeStylesForNodes(), these style nodes can be removed, since
  +    // computeStylesUsingTestRendering(), these style nodes can be removed, since
       // the correct styles will be added back in fixupNodeStyles().
       NodeImpl *node = m_fragment->firstChild();
       while (node) {
  @@ -4754,7 +4815,9 @@
               isStyleSpan(node)) {
               removeNodePreservingChildren(node);
           }
  -        else if (node->isHTMLElement()) {
  +        // need to skip tab span because fixupNodeStyles() is not called
  +        // when replace is matching style
  +        else if (node->isHTMLElement() && !isTabSpanNode(node)) {
               HTMLElementImpl *elem = static_cast<HTMLElementImpl *>(node);
               CSSMutableStyleDeclarationImpl *inlineStyleDecl = elem->inlineStyleDecl();
               if (inlineStyleDecl) {
  @@ -6132,13 +6195,57 @@
   ElementImpl *createStyleSpanElement(DocumentImpl *document)
   {
       int exceptionCode = 0;
  -    ElementImpl *styleElement = document->createHTMLElement("SPAN", exceptionCode);
  +    ElementImpl *styleElement = document->createHTMLElement("span", exceptionCode);
       ASSERT(exceptionCode == 0);
       styleElement->ref();
       styleElement->setAttribute(ATTR_CLASS, styleSpanClassString());
       return floatRefdElement(styleElement);
   }
   
  +bool isTabSpanNode(const NodeImpl *node)
  +{
  +    return (node && node->isElementNode() && static_cast<const ElementImpl *>(node)->getAttribute("class") == AppleTabSpanClass);
  +}
  +
  +bool isTabSpanTextNode(const NodeImpl *node)
  +{
  +    return (node && node->parentNode() && isTabSpanNode(node->parentNode()));
  +}
  +
  +Position positionBeforeTabSpan(const Position& pos)
  +{
  +    NodeImpl *node = pos.node();
  +    if (isTabSpanTextNode(node))
  +        node = node->parent();
  +    else if (!isTabSpanNode(node))
  +        return pos;
  +    
  +    return Position(node->parentNode(), node->nodeIndex());
  +}
  +
  +ElementImpl *createTabSpanElement(DocumentImpl *document, NodeImpl *tabTextNode)
  +{
  +    // make the span to hold the tab
  +    int exceptionCode = 0;
  +    ElementImpl *spanElement = document->createHTMLElement("span", exceptionCode);
  +    assert(exceptionCode == 0);
  +    spanElement->setAttribute(ATTR_CLASS, AppleTabSpanClass);
  +    spanElement->setAttribute(ATTR_STYLE, "white-space:pre");
  +
  +    // add tab text to that span
  +    if (!tabTextNode)
  +        tabTextNode = document->createEditingTextNode("\t");
  +    spanElement->appendChild(tabTextNode, exceptionCode);
  +    assert(exceptionCode == 0);
  +
  +    return spanElement;
  +}
  +
  +ElementImpl *createTabSpanElement(DocumentImpl *document, QString *tabText)
  +{
  +    return createTabSpanElement(document, document->createTextNode(*tabText));
  +}
  +
   bool isNodeRendered(const NodeImpl *node)
   {
       if (!node)
  
  
  
  1.101.8.3 +10 -1     WebCore/khtml/editing/htmlediting.h
  
  Index: htmlediting.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.h,v
  retrieving revision 1.101.8.2
  retrieving revision 1.101.8.3
  diff -u -r1.101.8.2 -r1.101.8.3
  --- htmlediting.h	4 Aug 2005 02:04:16 -0000	1.101.8.2
  +++ htmlediting.h	5 Aug 2005 18:01:20 -0000	1.101.8.3
  @@ -521,7 +521,8 @@
   private:
       virtual bool isInsertTextCommand() const;
   
  -    DOM::Position prepareForTextInsertion(bool adjustDownstream);
  +    DOM::Position prepareForTextInsertion(const DOM::Position& pos);
  +    DOM::Position insertTab(DOM::Position pos);
       void insertSpace(DOM::TextImpl *textNode, unsigned long offset);
   
       unsigned long m_charactersAdded;
  @@ -958,6 +959,8 @@
   
   //------------------------------------------------------------------------------------------
   
  +bool isSpecialElement(const DOM::NodeImpl *n);
  +
   DOM::ElementImpl *floatRefdElement(DOM::ElementImpl *element);
   DOM::ElementImpl *createDefaultParagraphElement(DOM::DocumentImpl *document);
   DOM::ElementImpl *createBlockPlaceholderElement(DOM::DocumentImpl *document);
  @@ -965,6 +968,12 @@
   DOM::ElementImpl *createFontElement(DOM::DocumentImpl *document);
   DOM::ElementImpl *createStyleSpanElement(DOM::DocumentImpl *document);
   
  +bool isTabSpanNode(const DOM::NodeImpl *node);
  +bool isTabSpanTextNode(const DOM::NodeImpl *node);
  +DOM::Position positionBeforeTabSpan(const DOM::Position& pos);
  +DOM::ElementImpl *createTabSpanElement(DOM::DocumentImpl *document, DOM::NodeImpl *tabTextNode=0);
  +DOM::ElementImpl *createTabSpanElement(DOM::DocumentImpl *document, QString *tabText);
  +
   bool isNodeRendered(const DOM::NodeImpl *);
   bool isProbablyBlock(const DOM::NodeImpl *);
   bool isProbablyTableStructureNode(const DOM::NodeImpl *);
  
  
  
  1.17.8.1  +48 -13    WebCore/khtml/editing/markup.cpp
  
  Index: markup.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
  retrieving revision 1.17
  retrieving revision 1.17.8.1
  diff -u -r1.17 -r1.17.8.1
  --- markup.cpp	11 Mar 2005 16:30:13 -0000	1.17
  +++ markup.cpp	5 Aug 2005 18:01:20 -0000	1.17.8.1
  @@ -489,6 +489,53 @@
       return markup(node, includeChildren, false, nodes);
   }
   
  +static void createParagraphContentsFromString(DOM::DocumentImpl *document, ElementImpl *paragraph, const QString &string)
  +{
  +    int exceptionCode = 0;
  +    if (string.isEmpty()) {
  +        NodeImpl *placeHolder = createBlockPlaceholderElement(document);
  +        paragraph->appendChild(placeHolder, exceptionCode);
  +        ASSERT(exceptionCode == 0);
  +        return;
  +    }
  +
  +    assert(string.find('\n') == -1);
  +
  +    QStringList tabList = QStringList::split('\t', string, true);
  +    QString tabText = "";
  +    while (!tabList.isEmpty()) {
  +        QString s = tabList.first();
  +        tabList.pop_front();
  +
  +        // append the non-tab textual part
  +        if (!s.isEmpty()) {
  +            if (tabText != "") {
  +                paragraph->appendChild(createTabSpanElement(document, &tabText), exceptionCode);
  +                ASSERT(exceptionCode == 0);
  +                tabText = "";
  +            }
  +            NodeImpl *textNode = document->createTextNode(s);
  +            paragraph->appendChild(textNode, exceptionCode);
  +            ASSERT(exceptionCode == 0);
  +        }
  +
  +        // there is a tab after every entry, except the last entry
  +        // (if the last character is a tab, the list gets an extra empty entry)
  +        if (!tabList.isEmpty()) {
  +//#ifdef COALESCE_TAB_SPANS
  +#if 1
  +            tabText += '\t';
  +#else
  +            paragraph->appendChild(createTabSpanElement(document), exceptionCode);
  +            ASSERT(exceptionCode == 0);
  +#endif
  +        } else if (tabText != "") {
  +            paragraph->appendChild(createTabSpanElement(document, &tabText), exceptionCode);
  +            ASSERT(exceptionCode == 0);
  +        }
  +    }
  +}
  +
   DOM::DocumentFragmentImpl *createFragmentFromText(DOM::DocumentImpl *document, const QString &text)
   {
       if (!document)
  @@ -500,10 +547,6 @@
       if (!text.isEmpty()) {
           QString string = text;
   
  -        // Replace tabs with four plain spaces.
  -        // These spaces will get converted along with the other existing spaces below.
  -        string.replace('\t', "    ");
  -
           // FIXME: Wrap the NBSP's in a span that says "converted space".
           int offset = 0;
           int stringLength = string.length();
  @@ -549,16 +592,8 @@
                   element->setAttribute(ATTR_CLASS, AppleInterchangeNewline);            
               } else {
                   element = createDefaultParagraphElement(document);
  -                NodeImpl *paragraphContents;
  -                if (s.isEmpty()) {
  -                    paragraphContents = createBlockPlaceholderElement(document);
  -                } else {
  -                    paragraphContents = document->createTextNode(s);
  -                    ASSERT(exceptionCode == 0);
  -                }
  +                createParagraphContentsFromString(document, element, s);
                   element->ref();
  -                element->appendChild(paragraphContents, exceptionCode);
  -                ASSERT(exceptionCode == 0);
               }
               fragment->appendChild(element, exceptionCode);
               ASSERT(exceptionCode == 0);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.84.6.2  +48 -94    WebCore/khtml/html/htmltokenizer.cpp
  
  Index: htmltokenizer.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
  retrieving revision 1.84.6.1
  retrieving revision 1.84.6.2
  diff -u -r1.84.6.1 -r1.84.6.2
  --- htmltokenizer.cpp	12 Jul 2005 22:05:19 -0000	1.84.6.1
  +++ htmltokenizer.cpp	5 Aug 2005 18:01:21 -0000	1.84.6.2
  @@ -313,8 +313,6 @@
       tag = NoTag;
       pending = NonePending;
       discard = NoneDiscard;
  -    pre = false;
  -    prePos = 0;
       plaintext = false;
       xmp = false;
       processingInstruction = false;
  @@ -351,16 +349,11 @@
   
   void HTMLTokenizer::processListing(TokenizerString list)
   {
  -    bool old_pre = pre;
       // This function adds the listing 'list' as
       // preformatted text-tokens to the token-collection
  -    // thereby converting TABs.
  -    if(!style) pre = true;
  -    prePos = 0;
  -
       while ( !list.isEmpty() )
       {
  -        checkBuffer(3*TAB_SIZE);
  +        checkBuffer();
   
           if (skipLF && ( *list != '\n' ))
           {
  @@ -393,14 +386,11 @@
               }
               ++list;
           }
  -        else if (( *list == ' ' ) || ( *list == '\t'))
  +        else if ( *list == ' ' )
           {
               if (pending)
                   addPending();
  -            if (*list == ' ')
  -                pending = SpacePending;
  -            else
  -                pending = TabPending;
  +            pending = SpacePending;
   
               ++list;
           }
  @@ -410,7 +400,6 @@
               if (pending)
                   addPending();
   
  -            prePos++;
               *dest++ = *list;
               ++list;
           }
  @@ -419,10 +408,6 @@
   
       if (pending)
           addPending();
  -
  -    prePos = 0;
  -
  -    pre = old_pre;
   }
   
   void HTMLTokenizer::parseSpecial(TokenizerString &src)
  @@ -489,7 +474,8 @@
           }
           else {
               scriptCode[scriptCodeSize] = *src;
  -            fixUpChar(scriptCode[scriptCodeSize]);
  +            if (src->unicode() >= 0x0080)
  +                fixUpChar(scriptCode[scriptCodeSize]);
               ++scriptCodeSize;
               ++src;
           }
  @@ -773,7 +759,8 @@
           }
           else {
               *dest = *src;
  -            fixUpChar(*dest);
  +            if (src->unicode() >= 0x0080)
  +                fixUpChar(*dest);
               ++dest;
               ++src;
           }
  @@ -901,7 +888,8 @@
   
                   if (EntityUnicodeValue <= 0xFFFF) {
                       QChar c(EntityUnicodeValue);
  -                    fixUpChar(c);
  +                    if (c.unicode() >= 0x0080)
  +                        fixUpChar(c);
                       checkBuffer();
                       src.push(c);
                   } else {
  @@ -923,8 +911,6 @@
                   for(unsigned int i = 0; i < cBufferPos; i++)
                       dest[i] = cBuffer[i];
                   dest += cBufferPos;
  -                if (pre)
  -                    prePos += cBufferPos+1;
               }
   
               Entity = NoEntity;
  @@ -1090,39 +1076,37 @@
   
               while(ll--) {
                   curchar = *src;
  -                if(curchar <= '>') {
  -                    if(curchar <= ' ' || curchar == '=' || curchar == '>') {
  -                        unsigned int a;
  -                        cBuffer[cBufferPos] = '\0';
  -                        a = getAttrID(cBuffer, cBufferPos);
  -                        if (a)
  -                            attrNamePresent = true;
  -                        else {
  -                            attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
  -                            attrNamePresent = !attrName.isEmpty();
  -
  -                            // This is a deliberate quirk to match Mozilla and Opera.  We have to do this
  -                            // since sites that use the "standards-compliant" path sometimes send
  -                            // <script src="foo.js"/>.  Both Moz and Opera will honor this, despite it
  -                            // being bogus HTML.  They do not honor the "/" for other tags.  This behavior
  -                            // also deviates from WinIE, but in this case we'll just copy Moz and Opera.
  -                            if (currToken.id == ID_SCRIPT && curchar == '>' &&
  -                                attrName == "/")
  -                                currToken.flat = true;
  -                        }
  -                        
  -                        dest = buffer;
  -                        *dest++ = a;
  +                if (curchar <= '>' && (curchar >= '=' || curchar <= ' ')) {
  +                    unsigned int a;
  +                    cBuffer[cBufferPos] = '\0';
  +                    a = getAttrID(cBuffer, cBufferPos);
  +                    if (a)
  +                        attrNamePresent = true;
  +                    else {
  +                        attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data());
  +                        attrNamePresent = !attrName.isEmpty();
  +
  +                        // This is a deliberate quirk to match Mozilla and Opera.  We have to do this
  +                        // since sites that use the "standards-compliant" path sometimes send
  +                        // <script src="foo.js"/>.  Both Moz and Opera will honor this, despite it
  +                        // being bogus HTML.  They do not honor the "/" for other tags.  This behavior
  +                        // also deviates from WinIE, but in this case we'll just copy Moz and Opera.
  +                        if (currToken.id == ID_SCRIPT && curchar == '>' &&
  +                            attrName == "/")
  +                            currToken.flat = true;
  +                    }
  +                    
  +                    dest = buffer;
  +                    *dest++ = a;
   #ifdef TOKEN_DEBUG
  -                        if (!a || (cBufferPos && *cBuffer == '!'))
  -                            kdDebug( 6036 ) << "Unknown attribute: *" << QCString(cBuffer, cBufferPos+1).data() << "*" << endl;
  -                        else
  -                            kdDebug( 6036 ) << "Known attribute: " << QCString(cBuffer, cBufferPos+1).data() << endl;
  +                    if (!a || (cBufferPos && *cBuffer == '!'))
  +                        kdDebug( 6036 ) << "Unknown attribute: *" << QCString(cBuffer, cBufferPos+1).data() << "*" << endl;
  +                    else
  +                        kdDebug( 6036 ) << "Known attribute: " << QCString(cBuffer, cBufferPos+1).data() << endl;
   #endif
   
  -                        tag = SearchEqual;
  -                        break;
  -                    }
  +                    tag = SearchEqual;
  +                    break;
                   }
                   // Use tolower() instead of | 0x20 to lowercase the char because there is no 
                   // performance gain in using | 0x20 since tolower() is optimized and 
  @@ -1245,7 +1229,8 @@
                       }
                   }
                   *dest = *src;
  -                fixUpChar(*dest);
  +                if (dest->unicode() >= 0x0080)
  +                    fixUpChar(*dest);
                   ++dest;
                   ++src;
               }
  @@ -1281,7 +1266,8 @@
                   }
   
                   *dest = *src;
  -                fixUpChar(*dest);
  +                if (dest->unicode() >= 0x0080)
  +                    fixUpChar(*dest);
                   ++dest;
                   ++src;
               }
  @@ -1396,17 +1382,8 @@
   
               processToken();
   
  -            // we have to take care to close the pre block in
  -            // case we encounter an unallowed element....
  -            if(pre && beginTag && !DOM::checkChild(ID_PRE, tagID)) {
  -                kdDebug(6036) << " not allowed in <pre> " << (int)tagID << endl;
  -                pre = false;
  -            }
  -
               switch( tagID ) {
               case ID_PRE:
  -                prePos = 0;
  -                pre = beginTag;
                   break;
               case ID_SCRIPT:
                   if (beginTag) {
  @@ -1480,40 +1457,24 @@
       else if ( textarea || script )
       {
           switch(pending) {
  -        case LFPending:  *dest++ = '\n'; prePos = 0; break;
  -        case SpacePending: *dest++ = ' '; ++prePos; break;
  -        case TabPending: *dest++ = '\t'; prePos += TAB_SIZE - (prePos % TAB_SIZE); break;
  +        case LFPending:  *dest++ = '\n'; break;
  +        case SpacePending: *dest++ = ' '; break;
           case NonePending:
               assert(0);
           }
       }
       else
       {
  -        int p;
  -
           switch (pending)
           {
           case SpacePending:
               // Insert a breaking space
               *dest++ = QChar(' ');
  -            prePos++;
               break;
   
           case LFPending:
               *dest = '\n';
               dest++;
  -            prePos = 0;
  -            break;
  -
  -        case TabPending:
  -            p = TAB_SIZE - ( prePos % TAB_SIZE );
  -#ifdef TOKEN_DEBUG
  -            qDebug("tab pending, prePos: %d, toadd: %d", prePos, p);
  -#endif
  -
  -            for ( int x = 0; x < p; x++ )
  -                *dest++ = QChar(' ');
  -            prePos += p;
               break;
   
           case NonePending:
  @@ -1669,8 +1630,7 @@
   
               if ( pending ) {
                   // pre context always gets its spaces/linefeeds
  -                if ( pre || script || (!parser->selectMode() &&
  -                             (!parser->noSpaces() || dest > buffer ))) {
  +                if (script || (!parser->selectMode() && (!parser->noSpaces() || dest > buffer ))) {
                       addPending();
                       discard = AllDiscard; // So we discard the first LF after the open tag.
                   }
  @@ -1742,7 +1702,7 @@
               }
               ++src;
           }
  -        else if (( cc == ' ' ) || ( cc == '\t' ))
  +        else if (cc == ' ')
           {
   	    if (select && !script) {
                   if(discard == SpaceDiscard)
  @@ -1759,10 +1719,7 @@
               
                   if (pending)
                       addPending();
  -                if (cc == ' ')
  -                    pending = SpacePending;
  -                else
  -                    pending = TabPending;
  +                pending = SpacePending;
               }
               
               ++src;
  @@ -1773,17 +1730,14 @@
                   addPending();
   
               discard = NoneDiscard;
  -            if ( pre )
  -            {
  -                prePos++;
  -            }
   #if QT_VERSION < 300
               unsigned char row = src->row();
               if ( row > 0x05 && row < 0x10 || row > 0xfd )
                       currToken.complexText = true;
   #endif
               *dest = *src;
  -            fixUpChar( *dest );
  +            if (dest->unicode() >= 0x0080)
  +                fixUpChar( *dest );
               ++dest;
               ++src;
           }
  
  
  
  1.33.8.1  +0 -10     WebCore/khtml/html/htmltokenizer.h
  
  Index: htmltokenizer.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.h,v
  retrieving revision 1.33
  retrieving revision 1.33.8.1
  diff -u -r1.33 -r1.33.8.1
  --- htmltokenizer.h	17 Mar 2005 02:46:53 -0000	1.33
  +++ htmltokenizer.h	5 Aug 2005 18:01:21 -0000	1.33.8.1
  @@ -116,9 +116,6 @@
       bool flat;
   };
   
  -// The count of spaces used for each tab.
  -#define TAB_SIZE 8
  -
   //-----------------------------------------------------------------------------
   
   class HTMLTokenizer : public Tokenizer, public CachedObjectClient
  @@ -207,7 +204,6 @@
           NonePending = 0,
           SpacePending,
           LFPending,
  -        TabPending
       } pending;
   
       // Discard line breaks immediately after start-tags
  @@ -255,12 +251,6 @@
       // are we in a <script> ... </script block
       bool script;
   
  -    // Are we in a <pre> ... </pre> block
  -    bool pre;
  -
  -    // if 'pre == true' we track in which column we are
  -    int prePos;
  -
       // Are we in a <style> ... </style> block
       bool style;
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.125.8.2 +40 -22    WebCore/khtml/rendering/bidi.cpp
  
  Index: bidi.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
  retrieving revision 1.125.8.1
  retrieving revision 1.125.8.2
  diff -u -r1.125.8.1 -r1.125.8.2
  --- bidi.cpp	27 Apr 2005 16:58:40 -0000	1.125.8.1
  +++ bidi.cpp	5 Aug 2005 18:01:22 -0000	1.125.8.2
  @@ -386,7 +386,7 @@
           if (text->text()) {
               for (int i = bidiRun->start; i < bidiRun->stop; i++) {
                   const QChar c = text->text()[i];
  -                if (c == ' ' || c == '\n')
  +                if (c == ' ' || c == '\n' || c == '\t')
                       numSpaces++;
               }
           }
  @@ -714,6 +714,23 @@
       return lastRootBox();
   }
   
  +// usage: tw - (xpos % tw);
  +int RenderBlock::tabWidth(bool isWhitespacePre)
  +{
  +    if (!isWhitespacePre)
  +        return 0;
  +
  +    if (!m_tabWidth) {
  +        QChar   spaceChar(' ');
  +        const Font& font = style()->htmlFont();
  +        int spaceWidth = font.width(&spaceChar, 1, 0, 0);
  +        m_tabWidth = spaceWidth * 8;
  +        assert(m_tabWidth != 0);
  +    }
  +
  +    return m_tabWidth;
  +}
  +
   void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, BidiState &bidi)
   {
       // First determine our total width.
  @@ -725,7 +742,7 @@
               continue; // Positioned objects are only participating to figure out their
                         // correct static x position.  They have no effect on the width.
           if (r->obj->isText()) {
  -            int textWidth = static_cast<RenderText *>(r->obj)->width(r->start, r->stop-r->start, m_firstLine);
  +            int textWidth = static_cast<RenderText *>(r->obj)->width(r->start, r->stop-r->start, totWidth, m_firstLine);
               if (!r->compact) {
                   RenderStyle *style = r->obj->style();
                   if (style->whiteSpace() == NORMAL && style->khtmlLineBreak() == AFTER_WHITE_SPACE) {
  @@ -797,7 +814,7 @@
                   int spaces = 0;
                   for ( int i = r->start; i < r->stop; i++ ) {
                       const QChar c = static_cast<RenderText *>(r->obj)->text()[i];
  -                    if (c == ' ' || c == '\n')
  +                    if (c == ' ' || c == '\n' || c == '\t')
                           spaces++;
                   }
   
  @@ -1559,9 +1576,10 @@
                   
                   // Now apply the offset to each line if needed.
                   int delta = m_height - endLineYPos;
  -                if (delta)
  +                if (delta) {
                       for (RootInlineBox* line = endLine; line; line = line->nextRootBox())
                           line->adjustPosition(0, delta);
  +                }
                   m_height = lastRootBox()->blockHeight();
                   m_overflowHeight = kMax(m_height, m_overflowHeight);
                   int bottomOfLine = lastRootBox()->bottomOverflow();
  @@ -1782,7 +1800,7 @@
       // object iteration process.
       int w = lineWidth(m_height);
       while (!it.atEnd() && (it.obj->isInlineFlow() || (it.obj->style()->whiteSpace() != PRE && !it.obj->isBR() &&
  -          (it.current() == ' ' || it.current() == '\n' || 
  +          (it.current() == ' ' || it.current() == '\t' || it.current() == '\n' || 
              skipNonBreakingSpace(it) || it.obj->isFloatingOrPositioned())))) {
           if (it.obj->isFloatingOrPositioned()) {
               RenderObject *o = it.obj;
  @@ -1992,12 +2010,12 @@
                   // item, then this is all moot. -dwh
                   RenderObject* next = Bidinext( start.par, o, bidi );
                   if (!m_pre && next && next->isText() && static_cast<RenderText*>(next)->stringLength() > 0) {
  -                    if (static_cast<RenderText*>(next)->text()[0].unicode() == nonBreakingSpace &&
  -                        o->style()->whiteSpace() == NORMAL && o->style()->nbspMode() == SPACE) {
  -                        currentCharacterIsWS = true;
  -                    }
  -                    if (static_cast<RenderText*>(next)->text()[0].unicode() == ' ' ||
  -                        static_cast<RenderText*>(next)->text()[0] == '\n') {
  +                    RenderText *nextText = static_cast<RenderText*>(next);
  +                    QChar nextChar = nextText->text()[0];
  +
  +                    if (nextText->style()->whiteSpace() != PRE && 
  +                        (nextChar == ' ' || nextChar == '\n' || nextChar == '\t' ||
  +                        nextChar.unicode() == nonBreakingSpace && next->style()->nbspMode() == SPACE)) {
                           currentCharacterIsSpace = true;
                           currentCharacterIsWS = true;
                           ignoringSpaces = true;
  @@ -2028,7 +2046,7 @@
                   bool previousCharacterIsSpace = currentCharacterIsSpace;
                   bool previousCharacterIsWS = currentCharacterIsWS;
                   const QChar c = str[pos];
  -                currentCharacterIsSpace = c == ' ' || (!isPre && c == '\n');
  +                currentCharacterIsSpace = c == ' ' || (!isPre && (c == '\n' || c == '\t'));
                   
                   if (isPre || !currentCharacterIsSpace)
                       isLineEmpty = false;
  @@ -2041,12 +2059,12 @@
                           addMidpoint(endMid);
                           
                           // Add the width up to but not including the hyphen.
  -                        tmpW += t->width(lastSpace, pos - lastSpace, f);
  +                        tmpW += t->width(lastSpace, pos - lastSpace, f, w+tmpW);
                           
                           // For whitespace normal only, include the hyphen.  We need to ensure it will fit
                           // on the line if it shows when we break.
                           if (o->style()->whiteSpace() == NORMAL)
  -                            tmpW += t->width(pos, 1, f);
  +                            tmpW += t->width(pos, 1, f, w+tmpW);
                           
                           BidiIterator startMid(0, o, pos+1);
                           addMidpoint(startMid);
  @@ -2066,8 +2084,8 @@
                   currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c.unicode() == nonBreakingSpace);
   
                   if (breakWords)
  -                    wrapW += t->width(pos, 1, f);
  -                if ((isPre && c == '\n') || (!isPre && isBreakable(str, pos, strlen, breakNBSP)) || (breakWords && wrapW > width)) {
  +                    wrapW += t->width(pos, 1, f, w+wrapW);
  +                if (c == '\n' || (!isPre && isBreakable(str, pos, strlen, breakNBSP)) || (breakWords && wrapW > width)) {
                       if (ignoringSpaces) {
                           if (!currentCharacterIsSpace) {
                               // Stop ignoring spaces and begin at this
  @@ -2084,7 +2102,7 @@
                           }
                       }
   
  -                    tmpW += t->width(lastSpace, pos - lastSpace, f);
  +                    tmpW += t->width(lastSpace, pos - lastSpace, f, w+tmpW);
                       if (!appliedStartWidth) {
                           tmpW += inlineWidth(o, true, false);
                           appliedStartWidth = true;
  @@ -2120,7 +2138,7 @@
                       if (o->style()->whiteSpace() == NORMAL) {
                           // In AFTER_WHITE_SPACE mode, consider the current character
                           // as candidate width for this line.
  -                        int charWidth = o->style()->khtmlLineBreak() == AFTER_WHITE_SPACE ? t->width(pos, 1, f) : 0;
  +                        int charWidth = o->style()->khtmlLineBreak() == AFTER_WHITE_SPACE ? t->width(pos, 1, f, w+tmpW) : 0;
                           if (w + tmpW + charWidth > width) {
                               if (o->style()->khtmlLineBreak() == AFTER_WHITE_SPACE) {
                                   // Check if line is too big even without the extra space
  @@ -2138,7 +2156,7 @@
                           }
                           else if (pos > 1 && str[pos-1].unicode() == SOFT_HYPHEN)
                               // Subtract the width of the soft hyphen out since we fit on a line.
  -                            tmpW -= t->width(pos-1, 1, f);
  +                            tmpW -= t->width(pos-1, 1, f, w+tmpW);
                       }
   
                       if( *(str+pos) == '\n' && isPre) {
  @@ -2210,7 +2228,7 @@
               
               // IMPORTANT: pos is > length here!
               if (!ignoringSpaces)
  -                tmpW += t->width(lastSpace, pos - lastSpace, f);
  +                tmpW += t->width(lastSpace, pos - lastSpace, f, w+tmpW);
               if (!appliedStartWidth)
                   tmpW += inlineWidth(o, true, false);
               if (!appliedEndWidth)
  @@ -2414,8 +2432,8 @@
       static AtomicString ellipsisStr(ellipsis);
       const Font& firstLineFont = style(true)->htmlFont();
       const Font& font = style()->htmlFont();
  -    int firstLineEllipsisWidth = firstLineFont.width(&ellipsis, 1, 0);
  -    int ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(&ellipsis, 1, 0);
  +    int firstLineEllipsisWidth = firstLineFont.width(&ellipsis, 1, 0, 0);
  +    int ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(&ellipsis, 1, 0, 0);
   
       // For LTR text truncation, we want to get the right edge of our padding box, and then we want to see
       // if the right edge of a line box exceeds that.  For RTL, we use the left edge of the padding box and
  
  
  
  1.17.10.1 +2 -2      WebCore/khtml/rendering/break_lines.cpp
  
  Index: break_lines.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/break_lines.cpp,v
  retrieving revision 1.17
  retrieving revision 1.17.10.1
  diff -u -r1.17 -r1.17.10.1
  --- break_lines.cpp	20 Oct 2004 20:58:12 -0000	1.17
  +++ break_lines.cpp	5 Aug 2005 18:01:22 -0000	1.17.10.1
  @@ -73,7 +73,7 @@
   	else // no asian font
   	    return c->isSpace();
       } else {
  -	if ( ch == ' ' || ch == '\n' )
  +	if ( ch == ' ' || ch == '\t' || ch == '\n' )
   	    return true;
       }
       return false;
  @@ -89,7 +89,7 @@
       // at the moment whether this behavior is correct or not.  Since Tiger is also not allowing breaks on spaces
       // after hyphen-like characters, this does not seem ideal for the Web.  Therefore for now we override space
       // characters up front and bypass the Unicode line breaking routines.
  -    if (ch == '\n' || ch == ' ' || (breakNBSP && ch == 0xa0))
  +    if (ch == ' ' || ch == '\n' || ch == '\t' || (breakNBSP && ch == 0xa0))
           return true;
   
       // If current character, or the previous character aren't simple latin1 then
  
  
  
  1.39.10.1 +18 -18    WebCore/khtml/rendering/font.cpp
  
  Index: font.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/font.cpp,v
  retrieving revision 1.39
  retrieving revision 1.39.10.1
  diff -u -r1.39 -r1.39.10.1
  --- font.cpp	5 Oct 2004 20:25:19 -0000	1.39
  +++ font.cpp	5 Aug 2005 18:01:22 -0000	1.39.10.1
  @@ -40,20 +40,20 @@
   using namespace khtml;
   
   #if APPLE_CHANGES
  -void Font::drawHighlightForText( QPainter *p, int x, int y, int h, 
  +void Font::drawHighlightForText( QPainter *p, int x, int y, int h, int tabWidth, int xpos, 
                        QChar *str, int slen, int pos, int len,
                        int toAdd, QPainter::TextDirection d, bool visuallyOrdered, int from, int to, QColor bg) const
   {
  -    p->drawHighlightForText(x, y, h, str + pos, std::min(slen - pos, len), from, to, toAdd, bg, d, visuallyOrdered,
  +    p->drawHighlightForText(x, y, h, tabWidth, xpos, str + pos, std::min(slen - pos, len), from, to, toAdd, bg, d, visuallyOrdered,
                   letterSpacing, wordSpacing, fontDef.smallCaps);
   }
   #endif
                        
  -void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len,
  +void Font::drawText( QPainter *p, int x, int y, int tabWidth, int xpos, QChar *str, int slen, int pos, int len,
                        int toAdd, QPainter::TextDirection d, bool visuallyOrdered, int from, int to, QColor bg ) const
   {
   #if APPLE_CHANGES
  -    p->drawText(x, y, str + pos, std::min(slen - pos, len), from, to, toAdd, bg, d, visuallyOrdered,
  +    p->drawText(x, y, tabWidth, xpos, str + pos, std::min(slen - pos, len), from, to, toAdd, bg, d, visuallyOrdered,
                   letterSpacing, wordSpacing, fontDef.smallCaps);
   #else
       QString qstr = QConstString(str, slen).string();
  @@ -72,7 +72,7 @@
       // ### fixme for RTL
       if ( !letterSpacing && !wordSpacing && !toAdd && from==-1 ) {
           // simply draw it
  -        p->drawText( x, y, qstr, pos, len, d );
  +        p->drawText( x, y, tabWidth, xpos, qstr, pos, len, d );
       } else {
           int numSpaces = 0;
           if ( toAdd ) {
  @@ -104,7 +104,7 @@
                   if ( bg.isValid() )
                       p->fillRect( x, y-fm.ascent(), chw, fm.height(), bg );
   
  -                p->drawText( x, y, qstr, pos+i, 1, d );
  +                p->drawText( x, y, tabWidth, xpos, qstr, pos+i, 1, d );
               }
               if ( d != QPainter::RTL )
                   x += chw;
  @@ -115,31 +115,31 @@
   
   #if APPLE_CHANGES
   
  -float Font::floatWidth( QChar *chs, int slen, int pos, int len ) const
  +float Font::floatWidth( QChar *chs, int slen, int pos, int len, int tabWidth, int xpos ) const
   {
  -    return fm.floatWidth(chs, slen, pos, len, letterSpacing, wordSpacing, fontDef.smallCaps);
  +    return fm.floatWidth(chs, slen, pos, len, tabWidth, xpos, letterSpacing, wordSpacing, fontDef.smallCaps);
   }
   
   
  -void Font::floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, float *buffer) const
  +void Font::floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, float *buffer) const
   {
  -    fm.floatCharacterWidths(str, slen, pos, len, toAdd, buffer, letterSpacing, wordSpacing, fontDef.smallCaps);
  +    fm.floatCharacterWidths(str, slen, pos, len, toAdd, tabWidth, xpos, buffer, letterSpacing, wordSpacing, fontDef.smallCaps);
   }
   
  -int Font::checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int x, bool reversed, bool includePartialGlyphs) const
  +int Font::checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, int x, bool reversed, bool includePartialGlyphs) const
   {
  -    return fm.checkSelectionPoint (s, slen, pos, len, toAdd, letterSpacing, wordSpacing, fontDef.smallCaps, x, reversed, includePartialGlyphs);
  +    return fm.checkSelectionPoint (s, slen, pos, len, toAdd, tabWidth, xpos, letterSpacing, wordSpacing, fontDef.smallCaps, x, reversed, includePartialGlyphs);
   }
   
   #endif
   
  -int Font::width( QChar *chs, int slen, int pos, int len ) const
  +int Font::width( QChar *chs, int slen, int pos, int len, int tabWidth, int xpos ) const
   {
   #if APPLE_CHANGES
   #ifndef ROUND_TO_INT
   #define ROUND_TO_INT(x) (unsigned int)((x)+.5)
   #endif
  -    return ROUND_TO_INT(fm.floatWidth(chs+pos, slen-pos, 0, len, letterSpacing, wordSpacing, fontDef.smallCaps));
  +    return ROUND_TO_INT(fm.floatWidth(chs+pos, slen-pos, 0, len, tabWidth, xpos, letterSpacing, wordSpacing, fontDef.smallCaps));
   //    return fm.width(chs + pos, len);
   #else
       QString qstr = QConstString(chs+pos, len).string();
  @@ -170,11 +170,11 @@
   #endif
   }
   
  -int Font::width( QChar *chs, int slen, int pos ) const
  +int Font::width( QChar *chs, int slen, int tabWidth, int xpos ) const
   {
   #if APPLE_CHANGES
  -//    return ROUND_TO_INT(fm.floatWidth(chs, slen, pos, 1, letterSpacing, wordSpacing));
  -    return width(chs, slen, pos, 1);
  +//    return ROUND_TO_INT(fm.floatWidth(chs, slen, pos, 1, tabWidth, xpos, letterSpacing, wordSpacing));
  +    return width(chs, slen, 0, 1, tabWidth, xpos);
   #else
       int w;
       if ( !fontDef.hasNbsp && (chs+pos)->unicode() == 0xa0 )
  @@ -186,7 +186,7 @@
   	w += letterSpacing;
   
       if ( wordSpacing && (chs+pos)->isSpace() )
  -		w += wordSpacing;
  +        w += wordSpacing;
       return w;
   #endif
   }
  
  
  
  1.29.10.1 +8 -8      WebCore/khtml/rendering/font.h
  
  Index: font.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/font.h,v
  retrieving revision 1.29
  retrieving revision 1.29.10.1
  diff -u -r1.29 -r1.29.10.1
  --- font.h	5 Oct 2004 20:25:19 -0000	1.29
  +++ font.h	5 Aug 2005 18:01:22 -0000	1.29.10.1
  @@ -120,22 +120,22 @@
   
                      
   #if !APPLE_CHANGES
  -    void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int width,
  +    void drawText( QPainter *p, int x, int y, int tabWidth, int xpos, QChar *str, int slen, int pos, int len, int width,
                      QPainter::TextDirection d, int from=-1, int to=-1, QColor bg=QColor() ) const;
   
   #else
  -    void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int width,
  +    void drawText( QPainter *p, int x, int y, int tabWidth, int xpos, QChar *str, int slen, int pos, int len, int width,
                      QPainter::TextDirection d, bool visuallyOrdered = false, int from=-1, int to=-1, QColor bg=QColor() ) const;
  -    float floatWidth( QChar *str, int slen, int pos, int len ) const;
  -    void floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, float *buffer) const;
  +    float floatWidth( QChar *str, int slen, int pos, int len, int tabWidth, int xpos ) const;
  +    void floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, float *buffer) const;
       bool isFixedPitch() const;
  -    int checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int x, bool reversed, bool includePartialGlyphs) const;
  -    void drawHighlightForText( QPainter *p, int x, int y, int h, 
  +    int checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, int x, bool reversed, bool includePartialGlyphs) const;
  +    void drawHighlightForText( QPainter *p, int x, int y, int h, int tabWidth, int xpos, 
                      QChar *str, int slen, int pos, int len, int width,
                      QPainter::TextDirection d, bool visuallyOrdered = false, int from=-1, int to=-1, QColor bg=QColor()) const;
   #endif
  -    int width( QChar *str, int slen, int pos, int len ) const;
  -    int width( QChar *str, int slen, int pos ) const;
  +    int width( QChar *str, int slen, int pos, int len, int tabWidth, int xpos ) const;
  +    int width( QChar *str, int slen, int tabWidth, int xpos ) const;
   
       bool isSmallCaps() const { return fontDef.smallCaps; }
       
  
  
  
  1.179.8.3 +5 -3      WebCore/khtml/rendering/render_block.cpp
  
  Index: render_block.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_block.cpp,v
  retrieving revision 1.179.8.2
  retrieving revision 1.179.8.3
  diff -u -r1.179.8.2 -r1.179.8.3
  --- render_block.cpp	22 Jul 2005 01:18:33 -0000	1.179.8.2
  +++ render_block.cpp	5 Aug 2005 18:01:22 -0000	1.179.8.3
  @@ -97,6 +97,7 @@
       m_topMarginQuirk = m_bottomMarginQuirk = false;
       m_overflowHeight = m_overflowWidth = 0;
       m_overflowLeft = m_overflowTop = 0;
  +    m_tabWidth = 0;
   }
   
   RenderBlock::~RenderBlock()
  @@ -131,6 +132,7 @@
       }
   
       m_lineHeight = -1;
  +    m_tabWidth = 0;
   
       // Update pseudos for :before and :after now.
       updatePseudoChild(RenderStyle::BEFORE, firstChild());
  @@ -2788,7 +2790,7 @@
           RenderText* t = static_cast<RenderText *>(trailingSpaceChild);
           const Font *f = t->htmlFont( false );
           QChar space[1]; space[0] = ' ';
  -        int spaceWidth = f->width(space, 1, 0);
  +        int spaceWidth = f->width(space, 1, 0, 0);
           inlineMax -= spaceWidth;
           if (inlineMin > inlineMax)
               inlineMin = inlineMax;
  @@ -2951,8 +2953,8 @@
                   int beginMin, endMin;
                   bool beginWS, endWS;
                   int beginMax, endMax;
  -                t->trimmedMinMaxWidth(beginMin, beginWS, endMin, endWS, hasBreakableChar,
  -                                      hasBreak, beginMax, endMax,
  +                t->trimmedMinMaxWidth(inlineMax, beginMin, beginWS, endMin, endWS,
  +                                      hasBreakableChar, hasBreak, beginMax, endMax,
                                         childMin, childMax, stripFrontSpaces);
   
                   // This text object is insignificant and will not be rendered.  Just
  
  
  
  1.64.8.1  +4 -1      WebCore/khtml/rendering/render_block.h
  
  Index: render_block.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_block.h,v
  retrieving revision 1.64
  retrieving revision 1.64.8.1
  diff -u -r1.64 -r1.64.8.1
  --- render_block.h	14 Feb 2005 18:19:18 -0000	1.64
  +++ render_block.h	5 Aug 2005 18:01:23 -0000	1.64.8.1
  @@ -131,6 +131,7 @@
       BidiIterator findNextLineBreak(BidiIterator &start, BidiState &info );
       RootInlineBox* constructLine(const BidiIterator& start, const BidiIterator& end);
       InlineFlowBox* createLineBoxes(RenderObject* obj);
  +    int tabWidth(bool isWhitespacePre);
       void computeHorizontalPositionsForLine(RootInlineBox* lineBox, BidiState &bidi);
       void computeVerticalPositionsForLine(RootInlineBox* lineBox);
       void checkLinesForOverflow();
  @@ -425,9 +426,11 @@
       // when dirty rect checking and hit testing.
       int m_overflowLeft;
       int m_overflowTop;
  +    
  +    // full width of a tab character
  +    int m_tabWidth;
   };
   
   }; // namespace
   
   #endif // RENDER_BLOCK_H
  -
  
  
  
  1.28.8.1  +2 -2      WebCore/khtml/rendering/render_br.h
  
  Index: render_br.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_br.h,v
  retrieving revision 1.28
  retrieving revision 1.28.8.1
  diff -u -r1.28 -r1.28.8.1
  --- render_br.h	14 Feb 2005 18:19:18 -0000	1.28
  +++ render_br.h	5 Aug 2005 18:01:23 -0000	1.28.8.1
  @@ -44,8 +44,8 @@
    
       virtual QRect selectionRect() { return QRect(); }
   
  -    virtual unsigned int width(unsigned int, unsigned int, const Font *) const { return 0; }
  -    virtual unsigned int width( unsigned int, unsigned int, bool) const { return 0; }
  +    virtual unsigned int width(unsigned int from, unsigned int len, const Font *f, int xpos) const { return 0; }
  +    virtual unsigned int width(unsigned int from, unsigned int len, int xpos, bool firstLine = false) const { return 0; }
   
       virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
       virtual short baselinePosition( bool firstLine, bool isRootLineBox=false) const;
  
  
  
  1.21.12.1 +1 -1      WebCore/khtml/rendering/render_flexbox.cpp
  
  Index: render_flexbox.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_flexbox.cpp,v
  retrieving revision 1.21
  retrieving revision 1.21.12.1
  diff -u -r1.21 -r1.21.12.1
  --- render_flexbox.cpp	17 Aug 2004 22:03:28 -0000	1.21
  +++ render_flexbox.cpp	5 Aug 2005 18:01:23 -0000	1.21.12.1
  @@ -755,7 +755,7 @@
                   const unsigned short ellipsisAndSpace[2] = { 0x2026, ' ' };
                   static AtomicString ellipsisAndSpaceStr(ellipsisAndSpace, 2);
                   const Font& font = style(numVisibleLines == 1)->htmlFont();
  -                int ellipsisAndSpaceWidth = font.width(const_cast<QChar*>(ellipsisAndSpaceStr.unicode()), 2, 0, 2);
  +                int ellipsisAndSpaceWidth = font.width(const_cast<QChar*>(ellipsisAndSpaceStr.unicode()), 2, 0, 2, 0, 0);
   
                   // Get ellipsis width + " " + anchor width
                   int totalWidth = ellipsisAndSpaceWidth + anchorBox->width();
  
  
  
  1.74.8.1  +6 -7      WebCore/khtml/rendering/render_image.cpp
  
  Index: render_image.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_image.cpp,v
  retrieving revision 1.74
  retrieving revision 1.74.8.1
  diff -u -r1.74 -r1.74.8.1
  --- render_image.cpp	25 Feb 2005 00:25:12 -0000	1.74
  +++ render_image.cpp	5 Aug 2005 18:01:23 -0000	1.74.8.1
  @@ -113,7 +113,7 @@
           // we have an alt and the user meant it (its not a text we invented)
           if (!alt.isEmpty()) {
               const QFontMetrics &fm = style()->fontMetrics();
  -            QRect br = fm.boundingRect (  0, 0, 1024, 256, Qt::AlignAuto|Qt::WordBreak, alt.string() );
  +            QRect br = fm.boundingRect (  0, 0, 1024, 256, Qt::AlignAuto|Qt::WordBreak, alt.string(), 0, 0);  // FIX: correct tabwidth?
               if ( br.width() > iw )
                   iw = br.width();
               if ( br.height() > ih )
  @@ -308,13 +308,12 @@
                   
                   // Only draw the alt text if it'll fit within the content box,
                   // and only if it fits above the error image.
  -                int textWidth = fm.width (text, text.length());
  +                int textWidth = fm.width (text, 0, 0, text.length());
                   if (errorPictureDrawn) {
                       if (usableWidth >= textWidth && fm.height() <= imageY)
  -                        p->drawText(ax, ay+ascent, 0 /* ignored */, 0 /* ignored */, Qt::WordBreak  /* not supported */, text );
  -                }
  -                else if (usableWidth >= textWidth && cHeight >= fm.height())
  -                    p->drawText(ax, ay+ascent, 0 /* ignored */, 0 /* ignored */, Qt::WordBreak  /* not supported */, text );
  +                        p->drawText(ax, ay+ascent, tabWidth(), 0, 0 /* ignored */, 0 /* ignored */, Qt::WordBreak  /* not supported */, text );
  +                } else if (usableWidth >= textWidth && cHeight >= fm.height())
  +                    p->drawText(ax, ay+ascent, tabWidth(), 0, 0 /* ignored */, 0 /* ignored */, Qt::WordBreak  /* not supported */, text );
               }
   #else /* not APPLE_CHANGES */
               if ( !berrorPic ) {
  @@ -337,7 +336,7 @@
                   int ay = _ty + topBorder + topPad + 2;
                   const QFontMetrics &fm = style()->fontMetrics();
                   if (cWidth>5 && cHeight>=fm.height())
  -                    p->drawText(ax, ay+1, cWidth - 4, cHeight - 4, Qt::WordBreak, text );
  +                    p->drawText(ax, ay+1, tabWidth(), 0, cWidth - 4, cHeight - 4, Qt::WordBreak, text );
               }
   #endif /* APPLE_CHANGES not defined */
           }
  
  
  
  1.39.8.1  +1 -0      WebCore/khtml/rendering/render_line.cpp
  
  Index: render_line.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_line.cpp,v
  retrieving revision 1.39
  retrieving revision 1.39.8.1
  diff -u -r1.39 -r1.39.8.1
  --- render_line.cpp	19 Mar 2005 22:36:50 -0000	1.39
  +++ render_line.cpp	5 Aug 2005 18:01:23 -0000	1.39.8.1
  @@ -1034,6 +1034,7 @@
       const DOMString& str = m_str.string();
       font->drawText(p, m_x + _tx, 
                         m_y + _ty + m_baseline,
  +                      0, 0,
                         (str.implementation())->s,
                         str.length(), 0, str.length(),
                         0, 
  
  
  
  1.25.8.1  +5 -5      WebCore/khtml/rendering/render_line.h
  
  Index: render_line.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_line.h,v
  retrieving revision 1.25
  retrieving revision 1.25.8.1
  diff -u -r1.25 -r1.25.8.1
  --- render_line.h	27 Jan 2005 16:02:21 -0000	1.25
  +++ render_line.h	5 Aug 2005 18:01:23 -0000	1.25.8.1
  @@ -115,19 +115,19 @@
       RootInlineBox* root();
       
       void setWidth(int w) { m_width = w; }
  -    int width() { return m_width; }
  +    int width() const { return m_width; }
   
       void setXPos(int x) { m_x = x; }
  -    int xPos() { return m_x; }
  +    int xPos() const { return m_x; }
   
       void setYPos(int y) { m_y = y; }
  -    int yPos() { return m_y; }
  +    int yPos() const { return m_y; }
   
       void setHeight(int h) { m_height = h; }
  -    int height() { return m_height; }
  +    int height() const { return m_height; }
       
       void setBaseline(int b) { m_baseline = b; }
  -    int baseline() { return m_baseline; }
  +    int baseline() const { return m_baseline; }
   
       virtual bool hasTextChildren() { return true; }
   
  
  
  
  1.60.8.1  +12 -11    WebCore/khtml/rendering/render_list.cpp
  
  Index: render_list.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_list.cpp,v
  retrieving revision 1.60
  retrieving revision 1.60.8.1
  diff -u -r1.60 -r1.60.8.1
  --- render_list.cpp	25 Feb 2005 00:25:12 -0000	1.60
  +++ render_list.cpp	5 Aug 2005 18:01:23 -0000	1.60.8.1
  @@ -479,25 +479,25 @@
   
               if (isInside()) {
               	if( style()->direction() == LTR) {
  -                    p->drawText(_tx, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
  -                    p->drawText(_tx + fm.width(m_item), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, 
  -                                QString::fromLatin1(". "));
  +                    p->drawText(_tx, _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
  +                    p->drawText(_tx + fm.width(m_item, 0, 0), _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, 
  +                            QString::fromLatin1(". "));
                   }
               	else {
                       const QString& punct(QString::fromLatin1(" ."));
  -                    p->drawText(_tx, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, punct);
  -            	    p->drawText(_tx + fm.width(punct), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
  +                    p->drawText(_tx, _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, punct);
  +            	    p->drawText(_tx + fm.width(punct, 0, 0), _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
                   }
               } else {
                   if (style()->direction() == LTR) {
                       const QString& punct(QString::fromLatin1(". "));
  -                    p->drawText(_tx-offset/2, _ty, 0, 0, Qt::AlignRight|Qt::DontClip, punct);
  -                    p->drawText(_tx-offset/2-fm.width(punct), _ty, 0, 0, Qt::AlignRight|Qt::DontClip, m_item);
  +                    p->drawText(_tx-offset/2, _ty, 0, 0, 0, 0, Qt::AlignRight|Qt::DontClip, punct);
  +                    p->drawText(_tx-offset/2-fm.width(punct, 0, 0), _ty, 0, 0, 0, 0, Qt::AlignRight|Qt::DontClip, m_item);
                   }
               	else {
                       const QString& punct(QString::fromLatin1(" ."));
  -            	    p->drawText(_tx+offset/2, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, punct);
  -                    p->drawText(_tx+offset/2+fm.width(punct), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
  +            	    p->drawText(_tx+offset/2, _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, punct);
  +                    p->drawText(_tx+offset/2+fm.width(punct, 0, 0), _ty, 0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item);
                   }
               }
           }
  @@ -601,8 +601,9 @@
           break;
       }
   
  -    if (isInside())
  -        m_width = fm.width(m_item) + fm.width(QString::fromLatin1(". "));
  +    if (isInside()) {
  +        m_width = fm.width(m_item, 0, 0) + fm.width(QString::fromLatin1(". "), 0, 0);
  +    }
   
   end:
   
  
  
  
  1.191.8.1 +8 -3      WebCore/khtml/rendering/render_object.cpp
  
  Index: render_object.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_object.cpp,v
  retrieving revision 1.191
  retrieving revision 1.191.8.1
  diff -u -r1.191 -r1.191.8.1
  --- render_object.cpp	2 Mar 2005 04:33:49 -0000	1.191
  +++ render_object.cpp	5 Aug 2005 18:01:23 -0000	1.191.8.1
  @@ -1730,6 +1730,14 @@
       return w;
   }
   
  +int RenderObject::tabWidth() const
  +{
  +    if (style()->whiteSpace() != PRE)
  +        return 0;
  +        
  +    return containingBlock()->tabWidth(true);
  +}
  +
   RenderCanvas* RenderObject::canvas() const
   {
       return static_cast<RenderCanvas*>(document()->renderer());
  @@ -2042,9 +2050,6 @@
       
       RenderObject *child = firstChild();
       while( child ) {
  -        // gcc sucks. if anybody knows a trick to get rid of the
  -        // warning without adding an extra (unneeded) initialisation,
  -        // go ahead
   	int cmin = 0;
   	int cmax = 0;
   	bool test = false;
  
  
  
  1.147.8.1 +2 -0      WebCore/khtml/rendering/render_object.h
  
  Index: render_object.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_object.h,v
  retrieving revision 1.147
  retrieving revision 1.147.8.1
  diff -u -r1.147 -r1.147.8.1
  --- render_object.h	14 Feb 2005 18:19:18 -0000	1.147
  +++ render_object.h	5 Aug 2005 18:01:24 -0000	1.147.8.1
  @@ -386,6 +386,8 @@
       virtual short verticalPositionHint( bool firstLine ) const;
       // the offset of baseline from the top of the object.
       virtual short baselinePosition( bool firstLine, bool isRootLineBox=false ) const;
  +    // width of tab character
  +    int tabWidth() const;
   
       /*
        * Paint the object and its children, clipped by (x|y|w|h).
  
  
  
  1.75.8.1  +2 -0      WebCore/khtml/rendering/render_replaced.cpp
  
  Index: render_replaced.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_replaced.cpp,v
  retrieving revision 1.75
  retrieving revision 1.75.8.1
  diff -u -r1.75 -r1.75.8.1
  --- render_replaced.cpp	13 Mar 2005 17:29:34 -0000	1.75
  +++ render_replaced.cpp	5 Aug 2005 18:01:24 -0000	1.75.8.1
  @@ -125,6 +125,8 @@
   
   // Returns 1 since a replaced element can have the caret positioned 
   // at its beginning (0), or at its end (1).
  +// NOTE: Yet, "select" elements can have any number of "option" elements
  +// as children, so this "0 or 1" idea does not really hold up.
   long RenderReplaced::caretMaxOffset() const 
   { 
       return 1; 
  
  
  
  1.177.8.3 +93 -59    WebCore/khtml/rendering/render_text.cpp
  
  Index: render_text.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_text.cpp,v
  retrieving revision 1.177.8.2
  retrieving revision 1.177.8.3
  diff -u -r1.177.8.2 -r1.177.8.3
  --- render_text.cpp	26 Jul 2005 21:44:15 -0000	1.177.8.2
  +++ render_text.cpp	5 Aug 2005 18:01:24 -0000	1.177.8.3
  @@ -147,12 +147,12 @@
       int selEnd = selStart;
       int selTop = rootBox->selectionTop();
       int selHeight = rootBox->selectionHeight();
  -    
  +
       // FIXME: For justified text, just return the entire text box's rect.  At the moment there's still no easy
       // way to get the width of a run including the justification padding.
       if (sPos > 0 && !m_toAdd) {
           // The selection begins in the middle of our run.
  -        int w = textObject()->width(m_start, sPos, m_firstLine);
  +        int w = textObject()->width(m_start, sPos, m_firstLine, m_x);
           if (m_reversed)
               selStart -= w;
           else
  @@ -166,14 +166,14 @@
               selEnd = m_x + m_width;
       }
       else {
  -        // Our run is partially selected, and so we have to actually do a measurement.
  +        // Our run is partially selected, and so we need to measure.
           int w = textObject()->width(sPos + m_start, ePos - sPos, m_firstLine);
           if (m_reversed)
               selEnd = selStart - w;
           else
               selEnd = selStart + w;
       }
  -
  +    
       int selLeft = m_reversed ? selEnd : selStart;
       int selRight = m_reversed ? selStart : selEnd;
   
  @@ -387,7 +387,7 @@
           int endPoint = m_len;
           if (m_truncation != cNoTruncation)
               endPoint = m_truncation - m_start;
  -        font->drawText(i.p, m_x + tx, m_y + ty + m_baseline,
  +        font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->tabWidth(), textPos(),
                          textObject()->string()->s, textObject()->string()->l, m_start, endPoint,
                          m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, styleToUse->visuallyOrdered());
       } else {
  @@ -396,18 +396,18 @@
           if (paintSelectedTextSeparately) {
               // paint only the text that is not selected
               if (sPos >= ePos) {
  -                font->drawText(i.p, m_x + tx, m_y + ty + m_baseline,
  +                font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->tabWidth(), textPos(),
                                  textObject()->string()->s, textObject()->string()->l, m_start, m_len,
                                  m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, styleToUse->visuallyOrdered());
               } else {
                   if (sPos - 1 >= 0) {
  -                    font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->string()->s,
  -                                   textObject()->string()->l, m_start, m_len,
  +                    font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->tabWidth(), textPos(),
  +                                   textObject()->string()->s, textObject()->string()->l, m_start, m_len,
                                      m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, styleToUse->visuallyOrdered(), 0, sPos);
                   }
                   if (ePos < m_start + m_len) {
  -                    font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->string()->s,
  -                                   textObject()->string()->l, m_start, m_len,
  +                    font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->tabWidth(), textPos(),
  +                                   textObject()->string()->s, textObject()->string()->l, m_start, m_len,
                                      m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, styleToUse->visuallyOrdered(), ePos, -1);
                   }
               }
  @@ -423,8 +423,8 @@
                                  selectionTextShadow->y,
                                  selectionTextShadow->blur,
                                  selectionTextShadow->color);
  -            font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->string()->s,
  -                           textObject()->string()->l, m_start, m_len,
  +            font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, textObject()->tabWidth(), textPos(),
  +                           textObject()->string()->s, textObject()->string()->l, m_start, m_len,
                              m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, styleToUse->visuallyOrdered(), sPos, ePos);
               if (selectionTextShadow)
                   i.p->clearShadow();
  @@ -528,10 +528,9 @@
       p->save();
       p->setPen(c); // Don't draw text at all!
       RootInlineBox* r = root();
  -    int x = m_x + tx;
       int y = r->selectionTop();
       int h = r->selectionHeight();
  -    f->drawHighlightForText(p, x, y + ty, h,
  +    f->drawHighlightForText(p, m_x + tx, y + ty, h, textObject()->tabWidth(), textPos(), 
                               textObject()->str->s, textObject()->str->l, m_start, m_len,
                               m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, style->visuallyOrdered(), sPos, ePos, c);
       p->restore();
  @@ -553,10 +552,9 @@
       p->setPen(c); // Don't draw text at all!
   
       RootInlineBox* r = root();
  -    int x = m_x + tx;
       int y = r->selectionTop();
       int h = r->selectionHeight();
  -    f->drawHighlightForText(p, x, y + ty, h, textObject()->str->s, textObject()->str->l, m_start, m_len,
  +    f->drawHighlightForText(p, m_x + tx, y + ty, h, textObject()->tabWidth(), textPos(), textObject()->str->s, textObject()->str->l, m_start, m_len,
   		m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, style->visuallyOrdered(), sPos, ePos, c);
       p->restore();
   }
  @@ -739,13 +737,23 @@
       return current + 1;
   }
   
  +int InlineTextBox::textPos() const
  +{
  +    if (xPos() == 0)
  +        return 0;
  +        
  +    RenderBlock *blockElement = object()->containingBlock();
  +    return m_reversed ? xPos() - blockElement->borderRight() - blockElement->paddingRight()
  +                      : xPos() - blockElement->borderLeft() - blockElement->paddingLeft();
  +}
  +
   #define LOCAL_WIDTH_BUF_SIZE	1024
   
   int InlineTextBox::offsetForPosition(int _x, bool includePartialGlyphs)
   {
       RenderText* text = static_cast<RenderText*>(m_object);
       const Font* f = text->htmlFont(m_firstLine);
  -    return f->checkSelectionPoint(text->str->s, text->str->l, m_start, m_len, m_toAdd, _x - m_x, m_reversed, includePartialGlyphs);
  +    return f->checkSelectionPoint(text->str->s, text->str->l, m_start, m_len, m_toAdd, text->tabWidth(), textPos(), _x - m_x, m_reversed, includePartialGlyphs);
   }
   
   // -------------------------------------------------------------------------------------
  @@ -1068,11 +1076,11 @@
       if (box->m_reversed) {
   	long len = box->m_start+box->m_len-offset;
   	QString string(str->s +offset,len);
  -	left = box->m_x + fm.boundingRect(string,len).right();
  +	left = box->m_x + fm.boundingRect(string, box->textObject()->tabWidth(), box->textPos(), len).right();
       } else {
   	long len = offset - box->m_start; // the number of characters we are into the string
   	QString string(str->s + box->m_start,len);
  -	left = box->m_x + fm.boundingRect(string,len).right();
  +	left = box->m_x + fm.boundingRect(string, box->textObject()->tabWidth(), box->textPos(), len).right();
       }
   
       // FIXME: should we use the width of the root inline box or the
  @@ -1141,7 +1149,7 @@
       return (f && f->isFixedPitch() && allAscii() && !style()->htmlFont().isSmallCaps());
   }
   
  -// We cache the width of the ' ' character for <pre> text.  We could go futher
  +// We cache the width of the ' ' character for <pre> text.  We could go further
   // and cache a widths array for all styles, at the expense of increasing the size of the
   // RenderText.
   void RenderText::cacheWidths()
  @@ -1151,7 +1159,7 @@
       if (shouldUseMonospaceCache(f)){	
           float fw;
           QChar c(' ');
  -        f->floatCharacterWidths( &c, 1, 0, 1, 0, &fw);
  +        f->floatCharacterWidths( &c, 1, 0, 1, 0, 0, 0, &fw);
           m_monospaceCharacterWidth = (int)fw;
       }
       else
  @@ -1159,20 +1167,27 @@
   }
   
   
  -inline int RenderText::widthFromCache(const Font *f, int start, int len) const
  +inline int RenderText::widthFromCache(const Font *f, int start, int len, int tabWidth, int xpos) const
   {
       if (m_monospaceCharacterWidth != 0){
           int i, w = 0;
           for (i = start; i < start+len; i++){
  -            int dir = str->s[i].direction();
  -            if (dir != QChar::DirNSM && dir != QChar::DirBN)
  -                w += m_monospaceCharacterWidth;
  +            QChar c = str->s[i];
  +            int dir = c.direction();
  +            if (dir != QChar::DirNSM && dir != QChar::DirBN) {
  +                if (c == '\t' && tabWidth != 0) {
  +                    w += tabWidth - ((xpos + w) % tabWidth);
  +                } else
  +                    w += m_monospaceCharacterWidth;
  +            }
           }
  +
           return w;
       }
       
  -    return f->width(str->s, str->l, start, len);
  +    return f->width(str->s, str->l, start, len, tabWidth, xpos);
   }
  +
   #ifdef XXX
   inline int RenderText::widthFromCache(const Font *f, int start, int len) const
   {
  @@ -1186,7 +1201,8 @@
   
   #endif
   
  -void RenderText::trimmedMinMaxWidth(int& beginMinW, bool& beginWS, 
  +void RenderText::trimmedMinMaxWidth(int leadWidth,
  +                                    int& beginMinW, bool& beginWS, 
                                       int& endMinW, bool& endWS,
                                       bool& hasBreakableChar, bool& hasBreak,
                                       int& beginMaxW, int& endMaxW,
  @@ -1203,6 +1219,10 @@
           return;
       }
       
  +    // if the text has a variable width tab, we need to call 
  +    if (m_hasTab)
  +        calcMinMaxWidth(leadWidth);
  +    
       minW = m_minWidth;
       maxW = m_maxWidth;
       beginWS = stripFrontSpaces ? false : m_hasBeginWS;
  @@ -1214,10 +1234,10 @@
       hasBreakableChar = m_hasBreakableChar;
       hasBreak = m_hasBreak;
   
  -    if (stripFrontSpaces && (str->s[0] == ' ' || (!isPre && str->s[0] == '\n'))) {
  +    if (stripFrontSpaces && (str->s[0] == ' ' || (!isPre && (str->s[0] == '\n' || str->s[0] == '\t')))) {
           const Font *f = htmlFont( false );
           QChar space[1]; space[0] = ' ';
  -        int spaceWidth = f->width(space, 1, 0);
  +        int spaceWidth = f->width(space, 1, 0, 0);
           maxW -= spaceWidth;
       }
       
  @@ -1242,12 +1262,13 @@
               if (linelen)
               {
   #if !APPLE_CHANGES
  -                endMaxW = f->width(str->s, str->l, i, linelen);
  +                endMaxW = f->width(str->s, str->l, i, linelen, tabWidth(), leadWidth + endMaxW); 
   #else
  -                endMaxW = widthFromCache(f, i, linelen);
  +                endMaxW = widthFromCache(f, i, linelen, tabWidth(), leadWidth + endMaxW);
   #endif
                   if (firstLine) {
                       firstLine = false;
  +                    leadWidth = 0;
                       beginMaxW = endMaxW;
                   }
                   i += linelen;
  @@ -1255,6 +1276,7 @@
               else if (firstLine) {
                   beginMaxW = 0;
                   firstLine = false;
  +                leadWidth = 0;
               }
   	    
   	    if (i == len-1)
  @@ -1267,8 +1289,14 @@
   
   void RenderText::calcMinMaxWidth()
   {
  +    // Use 0 for the leadWidth.   If the text contains a variable width tab, the real width
  +    // will get measured when trimmedMinMaxWidth calls again with the real leadWidth.
       KHTMLAssert( !minMaxKnown() );
  +    calcMinMaxWidth(0);
  +}
   
  +void RenderText::calcMinMaxWidth(int leadWidth)
  +{
       // ### calc Min and Max width...
       m_minWidth = m_beginMinWidth = m_endMinWidth = 0;
       m_maxWidth = 0;
  @@ -1278,7 +1306,7 @@
           
       int currMinWidth = 0;
       int currMaxWidth = 0;
  -    m_hasBreakableChar = m_hasBreak = m_hasBeginWS = m_hasEndWS = false;
  +    m_hasBreakableChar = m_hasBreak = m_hasTab = m_hasBeginWS = m_hasEndWS = false;
       
       // ### not 100% correct for first-line
       const Font *f = htmlFont( false );
  @@ -1301,8 +1329,13 @@
                   m_hasBreak = true;
                   isNewline = true;
                   isSpace = false;
  -            }
  -            else
  +            } else
  +                isSpace = true;
  +        } else if (c == '\t') {
  +            if (isPre) {
  +                m_hasTab = true;
  +                isSpace = false;
  +            } else
                   isSpace = true;
           } else {
               isSpace = c == ' ';
  @@ -1318,12 +1351,14 @@
           
           if (ignoringSpaces && !isSpace)
               ignoringSpaces = false;
  -            
  -        if (ignoringSpaces || (i > 0 && c.unicode() == SOFT_HYPHEN)) // Ignore spaces and soft hyphens
  +        
  +        // Ignore spaces and soft hyphens
  +        if (ignoringSpaces || (i > 0 && c.unicode() == SOFT_HYPHEN)) {
               continue;
  +        }
           
           int wordlen = 0;
  -        while (i+wordlen < len && str->s[i+wordlen] != '\n' && str->s[i+wordlen] != ' ' &&
  +        while (i+wordlen < len && str->s[i+wordlen] != '\n' && str->s[i+wordlen] != ' ' && str->s[i+wordlen] != '\t' &&
                  (i+wordlen == 0 || str->s[i+wordlen].unicode() != SOFT_HYPHEN) && // Skip soft hyphens
                  (wordlen == 0 || !isBreakable( str->s, i+wordlen, str->l)))
               wordlen++;
  @@ -1331,20 +1366,20 @@
           if (wordlen)
           {
   #if !APPLE_CHANGES
  -            int w = f->width(str->s, str->l, i, wordlen);
  +            int w = f->width(str->s, str->l, i, wordlen, tabWidth(), leadWidth + currMaxWidth);
   #else
  -            int w = widthFromCache(f, i, wordlen);
  +            int w = widthFromCache(f, i, wordlen, tabWidth(), leadWidth + currMaxWidth);
   #endif
               currMinWidth += w;
               currMaxWidth += w;
               
  -            bool isBreakableCharSpace = (i+wordlen < len) ? ((!isPre && str->s[i+wordlen] == '\n') || 
  +            bool isBreakableCharSpace = (i+wordlen < len) ? ((!isPre && (str->s[i+wordlen] == '\n' || str->s[i+wordlen] == '\t')) || 
                                                                str->s[i+wordlen] == ' ') : false;
   
               if (i+wordlen < len && style()->whiteSpace() == NORMAL)
                   m_hasBreakableChar = true;
               
  -            // Add in wordspacing to our maxwidth, but not if this is the last word on a line or the
  +            // Add in wordSpacing to our currMaxWidth, but not if this is the last word on a line or the
               // last word in the run.
               if (wordSpacing && isBreakableCharSpace && !containsOnlyWhitespace(i+wordlen, len-(i+wordlen)))
                   currMaxWidth += wordSpacing;
  @@ -1368,7 +1403,7 @@
           }
           else {
               // Nowrap can never be broken, so don't bother setting the
  -            // breakable character boolean. Pre can only be broken if we encounter a newline.
  +            // breakable character boolean. Pre can only be broken if we encounter a newline.     
               if (style()->whiteSpace() == NORMAL || isNewline)
                   m_hasBreakableChar = true;
   
  @@ -1379,6 +1414,7 @@
               {
                   if (firstLine) {
                       firstLine = false;
  +                    leadWidth = 0;
                       m_beginMinWidth = currMaxWidth;
                   }
                   
  @@ -1387,14 +1423,14 @@
               }
               else
               {
  -                currMaxWidth += f->width( str->s, str->l, i + wordlen );
  +                currMaxWidth += f->width(str->s, str->l, i + wordlen, 1, tabWidth(), leadWidth + currMaxWidth);
               }
           }
       }
  -    
  +
       if(currMinWidth > m_minWidth) m_minWidth = currMinWidth;
       if(currMaxWidth > m_maxWidth) m_maxWidth = currMaxWidth;
  -
  +        
       if (style()->whiteSpace() != NORMAL)
           m_minWidth = m_maxWidth;
   
  @@ -1412,7 +1448,7 @@
   {
       unsigned int currPos;
       for (currPos = from; 
  -         currPos < from+len && (str->s[currPos] == '\n' || str->s[currPos].unicode() == ' '); 
  +         currPos < from+len && (str->s[currPos] == '\n' || str->s[currPos].unicode() == ' ' || str->s[currPos] == '\t'); 
            currPos++);
       return currPos >= (from+len);
   }
  @@ -1660,37 +1696,37 @@
       s->m_len = len;
   }
   
  -unsigned int RenderText::width(unsigned int from, unsigned int len, bool firstLine) const
  +unsigned int RenderText::width(unsigned int from, unsigned int len, int xpos, bool firstLine) const
   {
       if(!str->s || from > str->l ) return 0;
       if ( from + len > str->l ) len = str->l - from;
   
       const Font *f = htmlFont( firstLine );
  -    return width( from, len, f );
  +    return width( from, len, f, xpos );
   }
   
  -unsigned int RenderText::width(unsigned int from, unsigned int len, const Font *f) const
  +unsigned int RenderText::width(unsigned int from, unsigned int len, const Font *f, int xpos) const
   {
       if(!str->s || from > str->l ) return 0;
       if ( from + len > str->l ) len = str->l - from;
   
       int w;
  -    if ( f == &style()->htmlFont() && from == 0 && len == str->l )
  +    if ( style()->whiteSpace() != PRE && f == &style()->htmlFont() && from == 0 && len == str->l ) {
    	 w = m_maxWidth;
   #if APPLE_CHANGES
  -    else if (f == &style()->htmlFont())
  -        w = widthFromCache (f, from, len);
  +    } else if (f == &style()->htmlFont()) {
  +        w = widthFromCache (f, from, len, tabWidth(), xpos);
   #endif
  -    else
  -	w = f->width(str->s, str->l, from, len );
  -
  +    } else {
  +	w = f->width(str->s, str->l, from, len, tabWidth(), xpos );
  +    }
  +    
       //kdDebug( 6040 ) << "RenderText::width(" << from << ", " << len << ") = " << w << endl;
       return w;
   }
   
   int RenderText::width() const
   {
  -    int w;
       int minx = 100000000;
       int maxx = 0;
       // slooow
  @@ -1701,9 +1737,7 @@
               maxx = s->m_x + s->m_width;
       }
   
  -    w = kMax(0, maxx-minx);
  -
  -    return w;
  +    return kMax(0, maxx-minx);
   }
   
   QRect RenderText::getAbsoluteRepaintRect()
  
  
  
  1.77.8.2  +10 -4     WebCore/khtml/rendering/render_text.h
  
  Index: render_text.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_text.h,v
  retrieving revision 1.77.8.1
  retrieving revision 1.77.8.2
  diff -u -r1.77.8.1 -r1.77.8.2
  --- render_text.h	26 Jul 2005 21:44:15 -0000	1.77.8.1
  +++ render_text.h	5 Aug 2005 18:01:24 -0000	1.77.8.2
  @@ -128,6 +128,7 @@
       virtual long caretMaxOffset() const;
       virtual unsigned long caretMaxRenderedOffset() const;
       
  +    int textPos() const;
       int offsetForPosition(int _x, bool includePartialGlyphs = true);
       
       /**
  @@ -193,8 +194,8 @@
       unsigned int stringLength() const { return str->l; } // non virtual implementation of length()
       virtual void position(InlineBox* box, int from, int len, bool reverse);
   
  -    virtual unsigned int width(unsigned int from, unsigned int len, const Font *f) const;
  -    virtual unsigned int width(unsigned int from, unsigned int len, bool firstLine = false) const;
  +    virtual unsigned int width(unsigned int from, unsigned int len, const Font *f, int xpos) const;
  +    virtual unsigned int width(unsigned int from, unsigned int len, int xpos, bool firstLine = false) const;
       virtual int width() const;
       virtual int height() const;
   
  @@ -206,7 +207,11 @@
       virtual void calcMinMaxWidth();
       virtual int minWidth() const { return m_minWidth; }
       virtual int maxWidth() const { return m_maxWidth; }
  -    virtual void trimmedMinMaxWidth(int& beginMinW, bool& beginWS, 
  +
  +    // widths
  +    void calcMinMaxWidth(int leadWidth);
  +    virtual void trimmedMinMaxWidth(int leadWidth,
  +                                    int& beginMinW, bool& beginWS, 
                                       int& endMinW, bool& endWS,
                                       bool& hasBreakableChar, bool& hasBreak,
                                       int& beginMaxW, int& endMaxW,
  @@ -251,7 +256,7 @@
       virtual InlineBox *inlineBox(long offset, EAffinity affinity = UPSTREAM);
   
   #if APPLE_CHANGES
  -    int widthFromCache(const Font *, int start, int len) const;
  +    int widthFromCache(const Font *, int start, int len, int tabWidth, int xpos) const;
       bool shouldUseMonospaceCache(const Font *) const;
       void cacheWidths();
       bool allAscii() const;
  @@ -285,6 +290,7 @@
       SelectionState m_selectionState : 3 ;
       bool m_hasBreakableChar : 1; // Whether or not we can be broken into multiple lines.
       bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., <pre> with '\n').
  +    bool m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., <pre> with '\t').
       bool m_hasBeginWS : 1; // Whether or not we begin with WS (only true if we aren't pre)
       bool m_hasEndWS : 1; // Whether or not we end with WS (only true if we aren't pre)
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.37.16.1 +11 -11    WebCore/kwq/KWQFontMetrics.h
  
  Index: KWQFontMetrics.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFontMetrics.h,v
  retrieving revision 1.37
  retrieving revision 1.37.16.1
  diff -u -r1.37 -r1.37.16.1
  --- KWQFontMetrics.h	17 Jun 2004 01:38:29 -0000	1.37
  +++ KWQFontMetrics.h	5 Aug 2005 18:01:27 -0000	1.37.16.1
  @@ -51,21 +51,21 @@
       int lineSpacing() const;
       float xHeight() const;
       
  -    int width(QChar) const;
  -    int width(char) const;
  -    int width(const QString &, int len=-1) const;
  -    int charWidth(const QString &, int pos) const;
  -    int width(const QChar *, int len) const;
  +    int width(QChar, int tabWidth, int xpos) const;
  +    int width(char, int tabWidth, int xpos) const;
  +    int width(const QString &, int tabWidth, int xpos, int len=-1) const;
  +    int charWidth(const QString &, int pos, int tabWidth, int xpos) const;
  +    int width(const QChar *, int len, int tabWidth, int xpos) const;
       float floatWidth(const QChar *, int slen, int pos, int len,
  -                     int letterSpacing, int wordSpacing, bool smallCaps) const;
  -    float floatCharacterWidths(const QChar *, int slen, int pos, int len, int toAdd, float *buffer,
  +                     int tabWidth, int xpos, int letterSpacing, int wordSpacing, bool smallCaps) const;
  +    float floatCharacterWidths(const QChar *, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, float *buffer,
                                  int letterSpacing, int wordSpacing, bool smallCaps) const;
  -    int checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int letterSpacing, int wordSpacing, bool smallCaps, int x, bool reversed, bool includePartialGlyphs) const;
  +    int checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, int letterSpacing, int wordSpacing, bool smallCaps, int x, bool reversed, bool includePartialGlyphs) const;
   
  -    QRect boundingRect(const QString &, int len=-1) const;
  -    QRect boundingRect(int, int, int, int, int, const QString &) const;
  +    QRect boundingRect(const QString &, int tabWidth, int xpos, int len=-1) const;
  +    QRect boundingRect(int, int, int, int, int, const QString &, int tabWidth, int xpos) const;
   
  -    QSize size(int, const QString &) const;
  +    QSize size(int, const QString &, int tabWidth, int xpos) const;
   
       int baselineOffset() const { return ascent(); }
       
  
  
  
  1.85.8.1  +31 -18    WebCore/kwq/KWQFontMetrics.mm
  
  Index: KWQFontMetrics.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFontMetrics.mm,v
  retrieving revision 1.85
  retrieving revision 1.85.8.1
  diff -u -r1.85 -r1.85.8.1
  --- KWQFontMetrics.mm	6 Mar 2005 08:03:56 -0000	1.85
  +++ KWQFontMetrics.mm	5 Aug 2005 18:01:27 -0000	1.85.8.1
  @@ -158,7 +158,7 @@
       return [data->getRenderer() xHeight];
   }
   
  -int QFontMetrics::width(QChar qc) const
  +int QFontMetrics::width(QChar qc, int tabWidth, int xpos) const
   {
       if (data.isNull()) {
           ERROR("called width on an empty QFontMetrics");
  @@ -175,16 +175,18 @@
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
       style.families = families;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
   
       return ROUND_TO_INT([data->getRenderer() floatWidthForRun:&run style:&style widths:0]);
   }
   
  -int QFontMetrics::charWidth(const QString &s, int pos) const
  +int QFontMetrics::charWidth(const QString &s, int pos, int tabWidth, int xpos) const
   {
  -    return width(s[pos]);
  +    return width(s[pos], tabWidth, xpos);
   }
   
  -int QFontMetrics::width(char c) const
  +int QFontMetrics::width(char c, int tabWidth, int xpos) const
   {
       if (data.isNull()) {
           ERROR("called width on an empty QFontMetrics");
  @@ -201,11 +203,13 @@
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
       style.families = families;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
   
       return ROUND_TO_INT([data->getRenderer() floatWidthForRun:&run style:&style widths:0]);
   }
   
  -int QFontMetrics::width(const QString &qstring, int len) const
  +int QFontMetrics::width(const QString &qstring, int tabWidth, int xpos, int len) const
   {
       if (data.isNull()) {
           ERROR("called width on an empty QFontMetrics");
  @@ -222,11 +226,13 @@
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
       style.families = families;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
   
       return ROUND_TO_INT([data->getRenderer() floatWidthForRun:&run style:&style widths:0]);
   }
   
  -int QFontMetrics::width(const QChar *uchars, int len) const
  +int QFontMetrics::width(const QChar *uchars, int len, int tabWidth, int xpos) const
   {
       if (data.isNull()) {
           ERROR("called width on an empty QFontMetrics");
  @@ -241,25 +247,28 @@
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
       style.families = families;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
   
       return ROUND_TO_INT([data->getRenderer() floatWidthForRun:&run style:&style widths:0]);
   }
   
   float QFontMetrics::floatWidth(const QChar *uchars, int slen, int pos, int len,
  -                               int letterSpacing, int wordSpacing, bool smallCaps) const
  +                               int tabWidth, int xpos, int letterSpacing, int wordSpacing, bool smallCaps) const
   {
       if (data.isNull()) {
           ERROR("called floatWidth on an empty QFontMetrics");
           return 0;
       }
  -    
  -    CREATE_FAMILY_ARRAY(data->font(), families);
   
  +    CREATE_FAMILY_ARRAY(data->font(), families);
       WebCoreTextRun run;
       WebCoreInitializeTextRun(&run, (const UniChar *)uchars, slen, pos, pos+len);
       
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       style.letterSpacing = letterSpacing;
       style.wordSpacing = wordSpacing;
       style.smallCaps = smallCaps;
  @@ -268,7 +277,7 @@
       return ROUND_TO_INT([data->getRenderer() floatWidthForRun:&run style:&style widths:0]);
   }
   
  -float QFontMetrics::floatCharacterWidths(const QChar *uchars, int slen, int pos, int len, int toAdd, float *buffer, int letterSpacing, int wordSpacing, bool smallCaps) const
  +float QFontMetrics::floatCharacterWidths(const QChar *uchars, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, float *buffer, int letterSpacing, int wordSpacing, bool smallCaps) const
   {
       if (data.isNull()) {
           ERROR("called floatCharacterWidths on an empty QFontMetrics");
  @@ -286,15 +295,17 @@
       style.wordSpacing = wordSpacing;
       style.smallCaps = smallCaps;
       style.padding = toAdd;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       style.families = families;
   
       return [data->getRenderer() floatWidthForRun:&run style:&style widths:buffer];
   }
   
  -int QFontMetrics::checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int letterSpacing, int wordSpacing, bool smallCaps, int x, bool reversed, bool includePartialGlyphs) const
  +int QFontMetrics::checkSelectionPoint (QChar *s, int slen, int pos, int len, int toAdd, int tabWidth, int xpos, int letterSpacing, int wordSpacing, bool smallCaps, int x, bool reversed, bool includePartialGlyphs) const
   {
       if (data.isNull()) {
  -        ERROR("called floatWidth on an empty QFontMetrics");
  +        ERROR("called checkSelectionPoint on an empty QFontMetrics");
           return 0;
       }
       
  @@ -309,23 +320,25 @@
       style.smallCaps = smallCaps;
       style.families = families;
       style.padding = toAdd;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       style.rtl = reversed;
   
       return [data->getRenderer() pointToOffset:&run style:&style position:x reversed:reversed includePartialGlyphs:includePartialGlyphs];
   }
   
  -QRect QFontMetrics::boundingRect(const QString &qstring, int len) const
  +QRect QFontMetrics::boundingRect(const QString &qstring, int tabWidth, int xpos, int len) const
   {
  -    return QRect(0, 0, width(qstring, len), height());
  +    return QRect(0, 0, width(qstring, tabWidth, xpos, len), height());
   }
   
  -QRect QFontMetrics::boundingRect(int x, int y, int width, int height, int flags, const QString &str) const
  +QRect QFontMetrics::boundingRect(int x, int y, int width, int height, int flags, const QString &str, int tabWidth, int xpos) const
   {
       // FIXME: need to support word wrapping?
  -    return QRect(x, y, width, height).intersect(boundingRect(str));
  +    return QRect(x, y, width, height).intersect(boundingRect(str, tabWidth, xpos));
   }
   
  -QSize QFontMetrics::size(int, const QString &qstring) const
  +QSize QFontMetrics::size(int, const QString &qstring, int tabWidth, int xpos) const
   {
  -    return QSize(width(qstring), height());
  +    return QSize(width(qstring, tabWidth, xpos), height());
   }
  
  
  
  1.71.8.1  +3 -3      WebCore/kwq/KWQPainter.h
  
  Index: KWQPainter.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQPainter.h,v
  retrieving revision 1.71
  retrieving revision 1.71.8.1
  diff -u -r1.71 -r1.71.8.1
  --- KWQPainter.h	21 Feb 2005 19:56:06 -0000	1.71
  +++ KWQPainter.h	5 Aug 2005 18:01:28 -0000	1.71.8.1
  @@ -101,12 +101,12 @@
       RasterOp rasterOp() const;
       void setRasterOp(RasterOp);
   
  -    void drawText(int x, int y, int, int, int alignmentFlags, const QString &);
  -    void drawHighlightForText(int x, int y, int h, 
  +    void drawText(int x, int y, int tabWidth, int xpos, int, int, int alignmentFlags, const QString &);
  +    void drawHighlightForText(int x, int y, int h, int tabWidth, int xpos,
                     const QChar *, int length, int from, int to, int toAdd,
                     const QColor& backgroundColor, QPainter::TextDirection d, bool visuallyOrdered,
                     int letterSpacing, int wordSpacing, bool smallCaps);
  -    void drawText(int x, int y, const QChar *, int length, int from, int to, int toAdd,
  +    void drawText(int x, int y, int tabWidth, int xpos, const QChar *, int length, int from, int to, int toAdd,
                     const QColor& backgroundColor, QPainter::TextDirection d, bool visuallyOrdered,
                     int letterSpacing, int wordSpacing, bool smallCaps);
       void drawLineForText(int x, int y, int yOffset, int width);
  
  
  
  1.124.8.1 +17 -12    WebCore/kwq/KWQPainter.mm
  
  Index: KWQPainter.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQPainter.mm,v
  retrieving revision 1.124
  retrieving revision 1.124.8.1
  diff -u -r1.124 -r1.124.8.1
  --- KWQPainter.mm	21 Feb 2005 19:56:06 -0000	1.124
  +++ KWQPainter.mm	5 Aug 2005 18:01:28 -0000	1.124.8.1
  @@ -70,6 +70,7 @@
       QColor focusRingColor;
   };
   
  +static inline void _fillRectXX(float x, float y, float w, float h, const QColor& col);
   
   static CGColorRef CGColorFromNSColor(NSColor *color)
   {
  @@ -202,7 +203,7 @@
           return;
           
       if (data->state.brush.style() != NoBrush)
  -        _fillRect(x, y, w, h, data->state.brush.color());
  +        _fillRectXX(x, y, w, h, data->state.brush.color());
   
       if (data->state.pen.style() != NoPen) {
           _setColorFromPen();
  @@ -290,12 +291,12 @@
           // Do a rect fill of our endpoints.  This ensures we always have the
           // appearance of being a border.  We then draw the actual dotted/dashed line.
           if (x1 == x2) {
  -            _fillRect(p1.x-width/2, p1.y-width, width, width, data->state.pen.color());
  -            _fillRect(p2.x-width/2, p2.y, width, width, data->state.pen.color());
  +            _fillRectXX(p1.x-width/2, p1.y-width, width, width, data->state.pen.color());
  +            _fillRectXX(p2.x-width/2, p2.y, width, width, data->state.pen.color());
           }
           else {
  -            _fillRect(p1.x-width, p1.y-width/2, width, width, data->state.pen.color());
  -            _fillRect(p2.x, p2.y-width/2, width, width, data->state.pen.color());
  +            _fillRectXX(p1.x-width, p1.y-width/2, width, width, data->state.pen.color());
  +            _fillRectXX(p2.x, p2.y-width/2, width, width, data->state.pen.color());
           }
           
           // Example: 80 pixels with a width of 30 pixels.
  @@ -597,7 +598,7 @@
       }
   }
       
  -void QPainter::drawText(int x, int y, int, int, int alignmentFlags, const QString &qstring)
  +void QPainter::drawText(int x, int y, int tabWidth, int xpos, int, int, int alignmentFlags, const QString &qstring)
   {
       if (data->state.paintingDisabled)
           return;
  @@ -617,6 +618,8 @@
       WebCoreInitializeEmptyTextStyle(&style);
       style.textColor = data->state.pen.color().getNSColor();
       style.families = families;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       
       if (alignmentFlags & Qt::AlignRight)
           x -= ROUND_TO_INT([data->textRenderer floatWidthForRun:&run style:&style widths:0]);
  @@ -624,11 +627,10 @@
       WebCoreTextGeometry geometry;
       WebCoreInitializeEmptyTextGeometry(&geometry);
       geometry.point = NSMakePoint(x, y);
  -     
       [data->textRenderer drawRun:&run style:&style geometry:&geometry];
   }
   
  -void QPainter::drawText(int x, int y, const QChar *str, int len, int from, int to, int toAdd, const QColor &backgroundColor, QPainter::TextDirection d, bool visuallyOrdered, int letterSpacing, int wordSpacing, bool smallCaps)
  +void QPainter::drawText(int x, int y, int tabWidth, int xpos, const QChar *str, int len, int from, int to, int toAdd, const QColor &backgroundColor, QPainter::TextDirection d, bool visuallyOrdered, int letterSpacing, int wordSpacing, bool smallCaps)
   {
       if (data->state.paintingDisabled || len <= 0)
           return;
  @@ -657,14 +659,15 @@
       style.smallCaps = smallCaps;
       style.families = families;
       style.padding = toAdd;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       WebCoreTextGeometry geometry;
       WebCoreInitializeEmptyTextGeometry(&geometry);
       geometry.point = NSMakePoint(x, y);
  -    
       [data->textRenderer drawRun:&run style:&style geometry:&geometry];
   }
   
  -void QPainter::drawHighlightForText(int x, int y, int h, 
  +void QPainter::drawHighlightForText(int x, int y, int h, int tabWidth, int xpos,
       const QChar *str, int len, int from, int to, int toAdd, const QColor &backgroundColor, 
       QPainter::TextDirection d, bool visuallyOrdered, int letterSpacing, int wordSpacing, bool smallCaps)
   {
  @@ -695,6 +698,8 @@
       style.smallCaps = smallCaps;
       style.families = families;    
       style.padding = toAdd;
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       WebCoreTextGeometry geometry;
       WebCoreInitializeEmptyTextGeometry(&geometry);
       geometry.point = NSMakePoint(x, y);
  @@ -760,7 +765,7 @@
   }
   
   // A fillRect designed to work around buggy behavior in NSRectFill.
  -void QPainter::_fillRect(float x, float y, float w, float h, const QColor& col)
  +static inline void _fillRectXX(float x, float y, float w, float h, const QColor& col)
   {
       [col.getNSColor() set];
       NSRectFillUsingOperation(NSMakeRect(x,y,w,h), NSCompositeSourceOver);
  @@ -772,7 +777,7 @@
           return;
   
       if (brush.style() == SolidPattern)
  -        _fillRect(x, y, w, h, brush.color());
  +        _fillRectXX(x, y, w, h, brush.color());
   }
   
   void QPainter::fillRect(const QRect &rect, const QBrush &brush)
  
  
  
  1.32.8.1  +5 -3      WebCore/kwq/WebCoreTextRenderer.h
  
  Index: WebCoreTextRenderer.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreTextRenderer.h,v
  retrieving revision 1.32
  retrieving revision 1.32.8.1
  diff -u -r1.32 -r1.32.8.1
  --- WebCoreTextRenderer.h	21 Feb 2005 19:56:06 -0000	1.32
  +++ WebCoreTextRenderer.h	5 Aug 2005 18:01:28 -0000	1.32.8.1
  @@ -33,9 +33,11 @@
   {
       NSColor *textColor;
       NSColor *backgroundColor;
  -    int letterSpacing;
  -    int wordSpacing;
  -    int padding;
  +    float letterSpacing;
  +    float wordSpacing;
  +    float padding;
  +    float tabWidth;
  +    float xpos;
       NSString **families;
       unsigned smallCaps : 1;
       unsigned rtl : 1;
  
  
  
  1.21.10.1 +2 -0      WebCore/kwq/WebCoreTextRendererFactory.mm
  
  Index: WebCoreTextRendererFactory.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreTextRendererFactory.mm,v
  retrieving revision 1.21
  retrieving revision 1.21.10.1
  diff -u -r1.21 -r1.21.10.1
  --- WebCoreTextRendererFactory.mm	5 Oct 2004 20:25:19 -0000	1.21
  +++ WebCoreTextRendererFactory.mm	5 Aug 2005 18:01:28 -0000	1.21.10.1
  @@ -42,6 +42,8 @@
   void WebCoreInitializeEmptyTextStyle(WebCoreTextStyle *style)
   {
       style->padding = 0;
  +//    style->tabWidth = 0.0F;
  +//    style->xpos = 0.0F;
       style->textColor = nil;
       style->backgroundColor = nil;
       style->rtl = false;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.10.1  +9 -6      WebCore/layout-tests/editing/deleting/delete-tab-001-expected.txt
  
  Index: delete-tab-001-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-001-expected.txt,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- delete-tab-001-expected.txt	21 Oct 2004 21:19:35 -0000	1.2
  +++ delete-tab-001-expected.txt	5 Aug 2005 18:01:29 -0000	1.2.10.1
  @@ -4,11 +4,14 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "    foo"
  +        RenderInline {SPAN} at (0,0) size 80x28
  +          RenderInline {SPAN} at (0,0) size 48x28
  +            RenderText {TEXT} at (14,14) size 48x28
  +              text run at (14,14) width 48: "\x{9}"
  +          RenderText {TEXT} at (62,14) size 32x28
  +            text run at (62,14) width 32: "foo"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 1 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 1 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  1.1.10.1  +1 -2      WebCore/layout-tests/editing/deleting/delete-tab-001.html
  
  Index: delete-tab-001.html
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-001.html,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- delete-tab-001.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-001.html	5 Aug 2005 18:01:29 -0000	1.1.10.1
  @@ -15,8 +15,7 @@
   function editingTest() {
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.1.10.1  +9 -6      WebCore/layout-tests/editing/deleting/delete-tab-002-expected.txt
  
  Index: delete-tab-002-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-002-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- delete-tab-002-expected.txt	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-002-expected.txt	5 Aug 2005 18:01:29 -0000	1.1.10.1
  @@ -4,10 +4,13 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "foo    "
  +        RenderInline {SPAN} at (0,0) size 48x28
  +          RenderText {TEXT} at (14,14) size 32x28
  +            text run at (14,14) width 32: "foo"
  +          RenderInline {SPAN} at (0,0) size 16x28
  +            RenderText {TEXT} at (46,14) size 16x28
  +              text run at (46,14) width 16: "\x{9}"
   selection is CARET:
  -start:      position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  
  
  
  1.1.10.1  +1 -2      WebCore/layout-tests/editing/deleting/delete-tab-002.html
  
  Index: delete-tab-002.html
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-002.html,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- delete-tab-002.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-002.html	5 Aug 2005 18:01:29 -0000	1.1.10.1
  @@ -17,8 +17,7 @@
           moveSelectionForwardByCharacterCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.1.10.1  +11 -6     WebCore/layout-tests/editing/deleting/delete-tab-003-expected.txt
  
  Index: delete-tab-003-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-003-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- delete-tab-003-expected.txt	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-003-expected.txt	5 Aug 2005 18:01:29 -0000	1.1.10.1
  @@ -4,11 +4,16 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "fo    o"
  +        RenderInline {SPAN} at (0,0) size 60x28
  +          RenderText {TEXT} at (14,14) size 20x28
  +            text run at (14,14) width 20: "fo"
  +          RenderInline {SPAN} at (0,0) size 28x28
  +            RenderText {TEXT} at (34,14) size 28x28
  +              text run at (34,14) width 28: "\x{9}"
  +          RenderText {TEXT} at (62,14) size 12x28
  +            text run at (62,14) width 12: "o"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  1.1.10.1  +1 -2      WebCore/layout-tests/editing/deleting/delete-tab-003.html
  
  Index: delete-tab-003.html
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-003.html,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- delete-tab-003.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-003.html	5 Aug 2005 18:01:29 -0000	1.1.10.1
  @@ -17,8 +17,7 @@
           moveSelectionForwardByCharacterCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.2.10.1  +9 -6      WebCore/layout-tests/editing/deleting/delete-tab-004-expected.txt
  
  Index: delete-tab-004-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-004-expected.txt,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- delete-tab-004-expected.txt	21 Oct 2004 21:19:35 -0000	1.2
  +++ delete-tab-004-expected.txt	5 Aug 2005 18:01:29 -0000	1.2.10.1
  @@ -4,12 +4,15 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x56
  +        RenderInline {SPAN} at (0,0) size 80x56
             RenderBR {BR} at (14,14) size 0x28
  -          RenderText {TEXT} at (14,42) size 56x28
  -            text run at (14,42) width 56: "    foo"
  +          RenderInline {SPAN} at (0,0) size 48x28
  +            RenderText {TEXT} at (14,42) size 48x28
  +              text run at (14,42) width 48: "\x{9}"
  +          RenderText {TEXT} at (62,42) size 32x28
  +            text run at (62,42) width 32: "foo"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  1.2.10.1  +1 -2      WebCore/layout-tests/editing/deleting/delete-tab-004.html
  
  Index: delete-tab-004.html
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/deleting/delete-tab-004.html,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- delete-tab-004.html	3 Dec 2004 17:31:30 -0000	1.2
  +++ delete-tab-004.html	5 Aug 2005 18:01:29 -0000	1.2.10.1
  @@ -16,8 +16,7 @@
       insertLineBreakCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.10.1  +9 -6      WebCore/layout-tests/editing/inserting/insert-tab-001-expected.txt
  
  Index: insert-tab-001-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/inserting/insert-tab-001-expected.txt,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- insert-tab-001-expected.txt	21 Oct 2004 21:19:35 -0000	1.2
  +++ insert-tab-001-expected.txt	5 Aug 2005 18:01:30 -0000	1.2.10.1
  @@ -4,11 +4,14 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "    foo"
  +        RenderInline {SPAN} at (0,0) size 80x28
  +          RenderInline {SPAN} at (0,0) size 48x28
  +            RenderText {TEXT} at (14,14) size 48x28
  +              text run at (14,14) width 48: "\x{9}"
  +          RenderText {TEXT} at (62,14) size 32x28
  +            text run at (62,14) width 32: "foo"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 1 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 1 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  1.2.10.1  +8 -5      WebCore/layout-tests/editing/inserting/insert-tab-002-expected.txt
  
  Index: insert-tab-002-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/inserting/insert-tab-002-expected.txt,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- insert-tab-002-expected.txt	21 Oct 2004 21:19:35 -0000	1.2
  +++ insert-tab-002-expected.txt	5 Aug 2005 18:01:30 -0000	1.2.10.1
  @@ -4,11 +4,14 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "foo    "
  +        RenderInline {SPAN} at (0,0) size 48x28
  +          RenderText {TEXT} at (14,14) size 32x28
  +            text run at (14,14) width 32: "foo"
  +          RenderInline {SPAN} at (0,0) size 16x28
  +            RenderText {TEXT} at (46,14) size 16x28
  +              text run at (46,14) width 16: "\x{9}"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
   downstream: position 1 of child 3 {TEXT} of root {DIV}
  
  
  
  1.1.10.1  +11 -6     WebCore/layout-tests/editing/inserting/insert-tab-003-expected.txt
  
  Index: insert-tab-003-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/inserting/insert-tab-003-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- insert-tab-003-expected.txt	31 Aug 2004 16:39:10 -0000	1.1
  +++ insert-tab-003-expected.txt	5 Aug 2005 18:01:30 -0000	1.1.10.1
  @@ -4,11 +4,16 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x28
  -          RenderText {TEXT} at (14,14) size 56x28
  -            text run at (14,14) width 56: "fo    o"
  +        RenderInline {SPAN} at (0,0) size 60x28
  +          RenderText {TEXT} at (14,14) size 20x28
  +            text run at (14,14) width 20: "fo"
  +          RenderInline {SPAN} at (0,0) size 28x28
  +            RenderText {TEXT} at (34,14) size 28x28
  +              text run at (34,14) width 28: "\x{9}"
  +          RenderText {TEXT} at (62,14) size 12x28
  +            text run at (62,14) width 12: "o"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 6 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  1.2.10.1  +9 -6      WebCore/layout-tests/editing/inserting/insert-tab-004-expected.txt
  
  Index: insert-tab-004-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/editing/inserting/insert-tab-004-expected.txt,v
  retrieving revision 1.2
  retrieving revision 1.2.10.1
  diff -u -r1.2 -r1.2.10.1
  --- insert-tab-004-expected.txt	21 Oct 2004 21:19:35 -0000	1.2
  +++ insert-tab-004-expected.txt	5 Aug 2005 18:01:30 -0000	1.2.10.1
  @@ -4,12 +4,15 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
  -        RenderInline {SPAN} at (0,0) size 56x56
  +        RenderInline {SPAN} at (0,0) size 80x56
             RenderBR {BR} at (14,14) size 0x28
  -          RenderText {TEXT} at (14,42) size 56x28
  -            text run at (14,42) width 56: "    foo"
  +          RenderInline {SPAN} at (0,0) size 48x28
  +            RenderText {TEXT} at (14,42) size 48x28
  +              text run at (14,42) width 48: "\x{9}"
  +          RenderText {TEXT} at (62,42) size 32x28
  +            text run at (62,42) width 32: "foo"
           RenderText {TEXT} at (0,0) size 0x0
   selection is CARET:
  -start:      position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  -upstream:   position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  -downstream: position 4 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
  +start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of root {DIV}
  +downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.10.1  +2 -10     WebCore/layout-tests/fast/table/039-expected.txt
  
  Index: 039-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/table/039-expected.txt,v
  retrieving revision 1.4
  retrieving revision 1.4.10.1
  diff -u -r1.4 -r1.4.10.1
  --- 039-expected.txt	29 Sep 2004 18:07:43 -0000	1.4
  +++ 039-expected.txt	5 Aug 2005 18:01:31 -0000	1.4.10.1
  @@ -42,19 +42,11 @@
             RenderText {TEXT} at (0,0) size 49x18
               text run at (0,0) width 49: "Row 0:"
           RenderText {TEXT} at (49,0) size 170x18
  -          text run at (49,0) width 38: " (1,1) "
  -          text run at (87,0) width 34: "(1,2) "
  -          text run at (121,0) width 34: "(1,3) "
  -          text run at (155,0) width 34: "(1,4) "
  -          text run at (189,0) width 30: "(1,5)"
  +          text run at (49,0) width 170: " (1,1)\x{9}(1,2)\x{9}(1,3)\x{9}(1,4)\x{9}(1,5)"
           RenderBR {BR} at (0,0) size 0x0
           RenderInline {B} at (0,0) size 49x18
             RenderText {TEXT} at (0,18) size 49x18
               text run at (0,18) width 49: "Row 1:"
           RenderText {TEXT} at (49,18) size 170x18
  -          text run at (49,18) width 38: " (2,1) "
  -          text run at (87,18) width 34: "(2,2) "
  -          text run at (121,18) width 34: "(2,3) "
  -          text run at (155,18) width 34: "(2,4) "
  -          text run at (189,18) width 30: "(2,5)"
  +          text run at (49,18) width 170: " (2,1)\x{9}(2,2)\x{9}(2,3)\x{9}(2,4)\x{9}(2,5)"
           RenderBR {BR} at (0,0) size 0x0
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.28.1  +3 -3      WebCore/layout-tests/fast/table/border-collapsing/004-expected.txt
  
  Index: 004-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/table/border-collapsing/004-expected.txt,v
  retrieving revision 1.4
  retrieving revision 1.4.28.1
  diff -u -r1.4 -r1.4.28.1
  --- 004-expected.txt	17 Nov 2003 22:20:03 -0000	1.4
  +++ 004-expected.txt	5 Aug 2005 18:01:31 -0000	1.4.28.1
  @@ -17,9 +17,9 @@
             text run at (333,0) width 172: "The styles applied here are:"
         RenderBlock {PRE} at (0,92) size 784x180
           RenderText {TEXT} at (0,0) size 688x180
  -          text run at (0,0) width 152: "TABLE   { margin: 1"
  +          text run at (0,0) width 152: "TABLE\x{9}{ margin: 1"
             text run at (152,0) width 256: "em; border: medium solid blue; }"
  -          text run at (0,15) width 368: "TD      { border: thin solid green; padding: 5"
  +          text run at (0,15) width 368: "TD\x{9}{ border: thin solid green; padding: 5"
             text run at (368,15) width 40: "px; }"
             text run at (0,30) width 352: "TH { border: medium solid purple; padding: 5"
             text run at (352,30) width 40: "px; }"
  @@ -34,7 +34,7 @@
             text run at (0,120) width 328: "TABLE.five { border-collapse: separate; }"
             text run at (0,135) width 464: "TABLE.five, TABLE.five TD, TABLE.five TH { border: none; }"
             text run at (0,150) width 688: "TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD"
  -          text run at (0,165) width 296: "        { border: medium solid red; }"
  +          text run at (0,165) width 296: "\x{9}{ border: medium solid red; }"
         RenderTable {TABLE} at (16,288) size 752x163
           RenderTableSection {TBODY} at (0,0) size 0x163
             RenderTableRow {TR} at (0,0) size 0x0
  
  
  



More information about the webkit-changes mailing list