[webkit-changes] cvs commit: WebCore/layout-tests/fast/tokenizer script_extra_close-expected.txt

David harrison at opensource.apple.com
Wed Jun 29 18:27:48 PDT 2005


harrison    05/06/29 18:27:47

  Modified:    .        ChangeLog
               khtml/editing apply_style_command.cpp
                        delete_selection_command.cpp edit_command.cpp
                        html_interchange.h htmlediting.cpp htmlediting.h
                        insert_text_command.cpp insert_text_command.h
                        markup.cpp replace_selection_command.cpp
               khtml/html htmltokenizer.cpp htmltokenizer.h
               khtml/rendering 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      KWQFontMetrics.h KWQFontMetrics.mm KWQPainter.h
                        KWQPainter.mm WebCoreTextRenderer.h
                        WebCoreTextRendererFactory.mm
               layout-tests/editing/deleting 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 insert-tab-001-expected.txt
                        insert-tab-002-expected.txt
                        insert-tab-003-expected.txt
                        insert-tab-004-expected.txt
               layout-tests/fast/dom quadraticCurveTo-expected.txt
               layout-tests/fast/js string-replace-2-expected.txt
               layout-tests/fast/table 039-expected.txt
               layout-tests/fast/table/border-collapsing 004-expected.txt
               layout-tests/fast/tokenizer script_extra_close-expected.txt
  Log:
          Reviewed by Dave Hyatt (rendering) and Maciej (editing).
  
          Test cases added:  Coming soon.  Will include with next round of changes for this bug.
  
          This is the first checkin for...
  
          <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail)
  
          Basic strategy is to put tabs into spans with white-space:pre style, and
          render them with tabs stops every 8th space, where the space width and
          the left margin are those of the enclosing block.
  
          What's left is to switch to implement white-space:pre-wrap so
          that we can coalesce consecutive tabs while maintaining proper
          line breaking.  That will keep the markup smaller.
  
          * khtml/editing/apply_style_command.cpp:
          (khtml::createStyleSpanElement):
          (khtml::ApplyStyleCommand::removeCSSStyle):
          (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
          * khtml/editing/delete_selection_command.cpp:
          (khtml::DeleteSelectionCommand::saveTypingStyleState):
          * khtml/editing/edit_command.cpp:
          (khtml::EditCommand::styleAtPosition):
          * khtml/editing/html_interchange.h:
          * khtml/editing/htmlediting.cpp:
          (khtml::isSpecialElement):
          (khtml::isTabSpanNode):
          (khtml::isTabSpanTextNode):
          (khtml::positionBeforeTabSpan):
          (khtml::createTabSpanElement):
          * khtml/editing/htmlediting.h:
          * khtml/editing/insert_text_command.cpp:
          (khtml::InsertTextCommand::prepareForTextInsertion):
          (khtml::InsertTextCommand::input):
          (khtml::InsertTextCommand::insertTab):
          * khtml/editing/insert_text_command.h:
          * khtml/editing/markup.cpp:
          (khtml::createParagraphContentsFromString):
          (khtml::createFragmentFromText):
          * khtml/editing/replace_selection_command.cpp:
          (khtml::ReplacementFragment::removeStyleNodes):
          * khtml/html/htmltokenizer.cpp:
          (khtml::HTMLTokenizer::begin):
          (khtml::HTMLTokenizer::processListing):
          (khtml::HTMLTokenizer::parseEntity):
          (khtml::HTMLTokenizer::parseTag):
          (khtml::HTMLTokenizer::addPending):
          (khtml::HTMLTokenizer::write):
          * khtml/html/htmltokenizer.h:
          (khtml::HTMLTokenizer::):
          * khtml/rendering/bidi.cpp:
          (khtml::addRun):
          (khtml::RenderBlock::tabWidth):
          (khtml::RenderBlock::computeHorizontalPositionsForLine):
          (khtml::RenderBlock::skipWhitespace):
          (khtml::RenderBlock::findNextLineBreak):
          (khtml::RenderBlock::checkLinesForTextOverflow):
          * khtml/rendering/break_lines.cpp:
          (khtml::isBreakable):
          * khtml/rendering/font.cpp:
          (Font::drawHighlightForText):
          (Font::drawText):
          (Font::floatWidth):
          (Font::floatCharacterWidths):
          (Font::checkSelectionPoint):
          (Font::width):
          * khtml/rendering/font.h:
          * khtml/rendering/render_block.cpp:
          (khtml::stripTrailingSpace):
          (khtml::RenderBlock::calcInlineMinMaxWidth):
          * khtml/rendering/render_block.h:
          * khtml/rendering/render_br.h:
          (khtml::RenderBR::width):
          * khtml/rendering/render_flexbox.cpp:
          (khtml::RenderFlexibleBox::layoutVerticalBox):
          * khtml/rendering/render_image.cpp:
          (RenderImage::setPixmap):
          (RenderImage::paint):
          * khtml/rendering/render_line.cpp:
          (khtml::EllipsisBox::paint):
          * khtml/rendering/render_line.h:
          (khtml::InlineBox::width):
          (khtml::InlineBox::xPos):
          (khtml::InlineBox::yPos):
          (khtml::InlineBox::height):
          (khtml::InlineBox::baseline):
          * khtml/rendering/render_list.cpp:
          (RenderListMarker::paint):
          (RenderListMarker::calcMinMaxWidth):
          * khtml/rendering/render_object.cpp:
          (RenderObject::tabWidth):
          (RenderObject::recalcMinMaxWidths):
          * khtml/rendering/render_object.h:
          * khtml/rendering/render_replaced.cpp:
          * khtml/rendering/render_text.cpp:
          (InlineTextBox::selectionRect):
          (InlineTextBox::paint):
          (InlineTextBox::paintSelection):
          (InlineTextBox::paintMarkedTextBackground):
          (InlineTextBox::textPos):
          (InlineTextBox::offsetForPosition):
          (InlineTextBox::positionForOffset):
          (RenderText::cacheWidths):
          (RenderText::widthFromCache):
          (RenderText::trimmedMinMaxWidth):
          (RenderText::calcMinMaxWidth):
          (RenderText::containsOnlyWhitespace):
          (RenderText::width):
          * khtml/rendering/render_text.h:
          * kwq/KWQFontMetrics.h:
          * kwq/KWQFontMetrics.mm:
          (QFontMetrics::width):
          (QFontMetrics::charWidth):
          (QFontMetrics::floatWidth):
          (QFontMetrics::floatCharacterWidths):
          (QFontMetrics::checkSelectionPoint):
          (QFontMetrics::boundingRect):
          (QFontMetrics::size):
          * kwq/KWQPainter.h:
          * kwq/KWQPainter.mm:
          (QPainter::drawText):
          (QPainter::drawHighlightForText):
          * kwq/WebCoreTextRenderer.h:
          * kwq/WebCoreTextRendererFactory.mm:
          (WebCoreInitializeEmptyTextStyle):
          * layout-tests/editing/deleting/delete-tab-001-expected.txt:
          * layout-tests/editing/deleting/delete-tab-001.html:
          * layout-tests/editing/deleting/delete-tab-002-expected.txt:
          * layout-tests/editing/deleting/delete-tab-002.html:
          * layout-tests/editing/deleting/delete-tab-003-expected.txt:
          * layout-tests/editing/deleting/delete-tab-003.html:
          * layout-tests/editing/deleting/delete-tab-004-expected.txt:
          * layout-tests/editing/deleting/delete-tab-004.html:
          * layout-tests/editing/inserting/insert-tab-001-expected.txt:
          * layout-tests/editing/inserting/insert-tab-002-expected.txt:
          * layout-tests/editing/inserting/insert-tab-003-expected.txt:
          * layout-tests/editing/inserting/insert-tab-004-expected.txt:
          * layout-tests/fast/dom/quadraticCurveTo-expected.txt:
          * layout-tests/fast/js/string-replace-2-expected.txt:
          * layout-tests/fast/table/039-expected.txt:
          * layout-tests/fast/table/border-collapsing/004-expected.txt:
          * layout-tests/fast/tokenizer/script_extra_close-expected.txt:
  
  Revision  Changes    Path
  1.4340    +146 -0    WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4339
  retrieving revision 1.4340
  diff -u -r1.4339 -r1.4340
  --- ChangeLog	30 Jun 2005 01:19:42 -0000	1.4339
  +++ ChangeLog	30 Jun 2005 01:27:35 -0000	1.4340
  @@ -1,3 +1,149 @@
  +2005-06-29  David Harrison  <harrison at apple.com>
  +
  +        Reviewed by Dave Hyatt (rendering) and Maciej (editing).
  +
  +        Test cases added:  Coming soon.  Will include with next round of changes for this bug.
  +
  +        This is the first checkin for...
  +        
  +        <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail)
  +        
  +        Basic strategy is to put tabs into spans with white-space:pre style, and
  +        render them with tabs stops every 8th space, where the space width and
  +        the left margin are those of the enclosing block.
  +        
  +        What's left is to switch to implement white-space:pre-wrap so
  +        that we can coalesce consecutive tabs while maintaining proper
  +        line breaking.  That will keep the markup smaller.
  +
  +        * khtml/editing/apply_style_command.cpp:
  +        (khtml::createStyleSpanElement):
  +        (khtml::ApplyStyleCommand::removeCSSStyle):
  +        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
  +        * khtml/editing/delete_selection_command.cpp:
  +        (khtml::DeleteSelectionCommand::saveTypingStyleState):
  +        * khtml/editing/edit_command.cpp:
  +        (khtml::EditCommand::styleAtPosition):
  +        * khtml/editing/html_interchange.h:
  +        * khtml/editing/htmlediting.cpp:
  +        (khtml::isSpecialElement):
  +        (khtml::isTabSpanNode):
  +        (khtml::isTabSpanTextNode):
  +        (khtml::positionBeforeTabSpan):
  +        (khtml::createTabSpanElement):
  +        * khtml/editing/htmlediting.h:
  +        * khtml/editing/insert_text_command.cpp:
  +        (khtml::InsertTextCommand::prepareForTextInsertion):
  +        (khtml::InsertTextCommand::input):
  +        (khtml::InsertTextCommand::insertTab):
  +        * khtml/editing/insert_text_command.h:
  +        * khtml/editing/markup.cpp:
  +        (khtml::createParagraphContentsFromString):
  +        (khtml::createFragmentFromText):
  +        * khtml/editing/replace_selection_command.cpp:
  +        (khtml::ReplacementFragment::removeStyleNodes):
  +        * khtml/html/htmltokenizer.cpp:
  +        (khtml::HTMLTokenizer::begin):
  +        (khtml::HTMLTokenizer::processListing):
  +        (khtml::HTMLTokenizer::parseEntity):
  +        (khtml::HTMLTokenizer::parseTag):
  +        (khtml::HTMLTokenizer::addPending):
  +        (khtml::HTMLTokenizer::write):
  +        * khtml/html/htmltokenizer.h:
  +        (khtml::HTMLTokenizer::):
  +        * khtml/rendering/bidi.cpp:
  +        (khtml::addRun):
  +        (khtml::RenderBlock::tabWidth):
  +        (khtml::RenderBlock::computeHorizontalPositionsForLine):
  +        (khtml::RenderBlock::skipWhitespace):
  +        (khtml::RenderBlock::findNextLineBreak):
  +        (khtml::RenderBlock::checkLinesForTextOverflow):
  +        * khtml/rendering/break_lines.cpp:
  +        (khtml::isBreakable):
  +        * khtml/rendering/font.cpp:
  +        (Font::drawHighlightForText):
  +        (Font::drawText):
  +        (Font::floatWidth):
  +        (Font::floatCharacterWidths):
  +        (Font::checkSelectionPoint):
  +        (Font::width):
  +        * khtml/rendering/font.h:
  +        * khtml/rendering/render_block.cpp:
  +        (khtml::stripTrailingSpace):
  +        (khtml::RenderBlock::calcInlineMinMaxWidth):
  +        * khtml/rendering/render_block.h:
  +        * khtml/rendering/render_br.h:
  +        (khtml::RenderBR::width):
  +        * khtml/rendering/render_flexbox.cpp:
  +        (khtml::RenderFlexibleBox::layoutVerticalBox):
  +        * khtml/rendering/render_image.cpp:
  +        (RenderImage::setPixmap):
  +        (RenderImage::paint):
  +        * khtml/rendering/render_line.cpp:
  +        (khtml::EllipsisBox::paint):
  +        * khtml/rendering/render_line.h:
  +        (khtml::InlineBox::width):
  +        (khtml::InlineBox::xPos):
  +        (khtml::InlineBox::yPos):
  +        (khtml::InlineBox::height):
  +        (khtml::InlineBox::baseline):
  +        * khtml/rendering/render_list.cpp:
  +        (RenderListMarker::paint):
  +        (RenderListMarker::calcMinMaxWidth):
  +        * khtml/rendering/render_object.cpp:
  +        (RenderObject::tabWidth):
  +        (RenderObject::recalcMinMaxWidths):
  +        * khtml/rendering/render_object.h:
  +        * khtml/rendering/render_replaced.cpp:
  +        * khtml/rendering/render_text.cpp:
  +        (InlineTextBox::selectionRect):
  +        (InlineTextBox::paint):
  +        (InlineTextBox::paintSelection):
  +        (InlineTextBox::paintMarkedTextBackground):
  +        (InlineTextBox::textPos):
  +        (InlineTextBox::offsetForPosition):
  +        (InlineTextBox::positionForOffset):
  +        (RenderText::cacheWidths):
  +        (RenderText::widthFromCache):
  +        (RenderText::trimmedMinMaxWidth):
  +        (RenderText::calcMinMaxWidth):
  +        (RenderText::containsOnlyWhitespace):
  +        (RenderText::width):
  +        * khtml/rendering/render_text.h:
  +        * kwq/KWQFontMetrics.h:
  +        * kwq/KWQFontMetrics.mm:
  +        (QFontMetrics::width):
  +        (QFontMetrics::charWidth):
  +        (QFontMetrics::floatWidth):
  +        (QFontMetrics::floatCharacterWidths):
  +        (QFontMetrics::checkSelectionPoint):
  +        (QFontMetrics::boundingRect):
  +        (QFontMetrics::size):
  +        * kwq/KWQPainter.h:
  +        * kwq/KWQPainter.mm:
  +        (QPainter::drawText):
  +        (QPainter::drawHighlightForText):
  +        * kwq/WebCoreTextRenderer.h:
  +        * kwq/WebCoreTextRendererFactory.mm:
  +        (WebCoreInitializeEmptyTextStyle):
  +        * layout-tests/editing/deleting/delete-tab-001-expected.txt:
  +        * layout-tests/editing/deleting/delete-tab-001.html:
  +        * layout-tests/editing/deleting/delete-tab-002-expected.txt:
  +        * layout-tests/editing/deleting/delete-tab-002.html:
  +        * layout-tests/editing/deleting/delete-tab-003-expected.txt:
  +        * layout-tests/editing/deleting/delete-tab-003.html:
  +        * layout-tests/editing/deleting/delete-tab-004-expected.txt:
  +        * layout-tests/editing/deleting/delete-tab-004.html:
  +        * layout-tests/editing/inserting/insert-tab-001-expected.txt:
  +        * layout-tests/editing/inserting/insert-tab-002-expected.txt:
  +        * layout-tests/editing/inserting/insert-tab-003-expected.txt:
  +        * layout-tests/editing/inserting/insert-tab-004-expected.txt:
  +        * layout-tests/fast/dom/quadraticCurveTo-expected.txt:
  +        * layout-tests/fast/js/string-replace-2-expected.txt:
  +        * layout-tests/fast/table/039-expected.txt:
  +        * layout-tests/fast/table/border-collapsing/004-expected.txt:
  +        * layout-tests/fast/tokenizer/script_extra_close-expected.txt:
  +
   2005-06-29  Geoffrey Garen  <ggaren at apple.com>
   
   	Contributed by Francisco Tolmasky <tolmasky at gmail.com>
  
  
  
  1.3       +8 -1      WebCore/khtml/editing/apply_style_command.cpp
  
  Index: apply_style_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/apply_style_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apply_style_command.cpp	24 May 2005 07:21:47 -0000	1.2
  +++ apply_style_command.cpp	30 Jun 2005 01:27:38 -0000	1.3
  @@ -32,6 +32,7 @@
   #include "css/cssparser.h"
   #include "css/cssproperties.h"
   #include "dom/dom_string.h"
  +#include "htmlediting.h"
   #include "html/html_elementimpl.h"
   #include "misc/htmltags.h"
   #include "misc/htmlattrs.h"
  @@ -284,7 +285,7 @@
   ElementImpl *createStyleSpanElement(DocumentImpl *document)
   {
       int exceptionCode = 0;
  -    ElementImpl *styleElement = document->createHTMLElement("SPAN", exceptionCode);
  +    ElementImpl *styleElement = document->createHTMLElement("span", exceptionCode);
       ASSERT(exceptionCode == 0);
       styleElement->setAttribute(ATTR_CLASS, styleSpanClassString());
       return styleElement;
  @@ -678,6 +679,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();
  @@ -1248,6 +1251,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.
       //
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/delete_selection_command.cpp
  
  Index: delete_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/delete_selection_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- delete_selection_command.cpp	24 May 2005 07:21:47 -0000	1.2
  +++ delete_selection_command.cpp	30 Jun 2005 01:27:38 -0000	1.3
  @@ -267,7 +267,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();
  
  
  
  1.4       +2 -1      WebCore/khtml/editing/edit_command.cpp
  
  Index: edit_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/edit_command.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- edit_command.cpp	24 May 2005 07:21:47 -0000	1.3
  +++ edit_command.cpp	30 Jun 2005 01:27:38 -0000	1.4
  @@ -26,6 +26,7 @@
   #include "edit_command.h"
   #include "selection.h"
   #include "khtml_part.h"
  +#include "htmlediting.h"
   
   #include "xml/dom_position.h"
   #include "xml/dom_docimpl.h"
  @@ -389,7 +390,7 @@
   
   CSSMutableStyleDeclarationImpl *EditCommand::styleAtPosition(const Position &pos)
   {
  -    CSSComputedStyleDeclarationImpl *computedStyle = pos.computedStyle();
  +    CSSComputedStyleDeclarationImpl *computedStyle = positionBeforeTabSpan(pos).computedStyle();
       computedStyle->ref();
       CSSMutableStyleDeclarationImpl *style = computedStyle->copyInheritableProperties();
       computedStyle->deref();
  
  
  
  1.6       +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.6
  diff -u -r1.5 -r1.6
  --- html_interchange.h	10 Mar 2005 17:24:05 -0000	1.5
  +++ html_interchange.h	30 Jun 2005 01:27:38 -0000	1.6
  @@ -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.248     +55 -6     WebCore/khtml/editing/htmlediting.cpp
  
  Index: htmlediting.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.cpp,v
  retrieving revision 1.247
  retrieving revision 1.248
  diff -u -r1.247 -r1.248
  --- htmlediting.cpp	24 May 2005 07:21:47 -0000	1.247
  +++ htmlediting.cpp	30 Jun 2005 01:27:38 -0000	1.248
  @@ -126,8 +126,11 @@
       return 1;
   }
   
  -bool isSpecialElement(NodeImpl *n)
  +bool isSpecialElement(const NodeImpl *n)
   {
  +    if (!n)
  +        return false;
  +        
       if (!n->isHTMLElement())
           return false;
   
  @@ -138,16 +141,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;
   }
   
  @@ -280,6 +285,50 @@
       return breakNode;
   }
   
  +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.107     +8 -2      WebCore/khtml/editing/htmlediting.h
  
  Index: htmlediting.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.h,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- htmlediting.h	24 May 2005 07:21:47 -0000	1.106
  +++ htmlediting.h	30 Jun 2005 01:27:38 -0000	1.107
  @@ -58,15 +58,21 @@
   
   //------------------------------------------------------------------------------------------
   
  +bool isSpecialElement(const DOM::NodeImpl *n);
  +
   DOM::ElementImpl *createDefaultParagraphElement(DOM::DocumentImpl *document);
   DOM::ElementImpl *createBreakElement(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 isMailBlockquote(const DOM::NodeImpl *);
   DOM::NodeImpl *nearestMailBlockquote(const DOM::NodeImpl *);
   
  -bool isSpecialElement(DOM::NodeImpl *n);
  -
   //------------------------------------------------------------------------------------------
   
   bool isTableStructureNode(const DOM::NodeImpl *node);
  
  
  
  1.2       +108 -63   WebCore/khtml/editing/insert_text_command.cpp
  
  Index: insert_text_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- insert_text_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ insert_text_command.cpp	30 Jun 2005 01:27:38 -0000	1.2
  @@ -27,9 +27,11 @@
   
   #include "khtml_part.h"
   #include "htmlediting.h"
  +#include "html_interchange.h"
   #include "visible_position.h"
   #include "visible_text.h"
   #include "visible_units.h"
  +#include "misc/htmlattrs.h"
   #include "xml/dom_docimpl.h"
   #include "xml/dom_position.h"
   #include "xml/dom_textimpl.h"
  @@ -60,23 +62,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();
  -    else
  -        pos = pos.upstream();
  -    
  -    Selection typingStyleRange;
  -
  -    pos = positionOutsideContainingSpecialElement(pos);
  -
       if (!pos.node()->isTextNode()) {
           NodeImpl *textNode = document()->createEditingTextNode("");
           NodeImpl *nodeToInsert = textNode;
  @@ -97,14 +86,30 @@
           else
               ASSERT_NOT_REACHED();
           
  -        pos = Position(textNode, 0);
  +        return Position(textNode, 0);
  +    }
  +
  +#ifndef COALESCE_TAB_SPANS
  +    ASSERT(!isTabSpanTextNode(pos.node()));
  +#else
  +    if (isTabSpanTextNode(pos.node())) {
  +        NodeImpl *textNode = document()->createEditingTextNode("");
  +        NodeImpl *originalTabSpan = pos.node()->parent();
  +        if (pos.offset() <= pos.node()->caretMinOffset()) {
  +            insertNodeBefore(textNode, originalTabSpan);
  +        } else if (pos.offset() >= pos.node()->caretMaxOffset()) {
  +            insertNodeAfter(textNode, originalTabSpan);
  +        } else {
  +            splitTextNodeContainingElement(static_cast<TextImpl *>(pos.node()), pos.offset());
  +            insertNodeBefore(textNode, originalTabSpan);
  +        }
  +        return Position(textNode, 0);
       }
  +#endif
   
       return pos;
   }
   
  -static const int spacesPerTab = 4;
  -
   static inline bool isNBSP(const QChar &c)
   {
       return c.unicode() == 0xa0;
  @@ -125,59 +130,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();
  +    else
  +        startPosition = startPosition.upstream();
  +    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);
  +        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 += spacesPerTab;
  -    }
  -    else if (text == " ") {
  -        insertSpace(textNode, offset);
  -        endPosition = Position(textNode, offset + 1);
  -
  -        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));
  @@ -193,6 +190,54 @@
           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
  +    // 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)) {
  +        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);
  
  
  
  1.2       +2 -1      WebCore/khtml/editing/insert_text_command.h
  
  Index: insert_text_command.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- insert_text_command.h	24 May 2005 07:21:47 -0000	1.1
  +++ insert_text_command.h	30 Jun 2005 01:27:38 -0000	1.2
  @@ -45,8 +45,9 @@
   private:
       virtual bool isInsertTextCommand() const;
   
  -    DOM::Position prepareForTextInsertion(bool adjustDownstream);
  +    DOM::Position prepareForTextInsertion(const DOM::Position& pos);
       void insertSpace(DOM::TextImpl *textNode, unsigned long offset);
  +    DOM::Position insertTab(DOM::Position pos);
   
       unsigned long m_charactersAdded;
   };
  
  
  
  1.21      +47 -13    WebCore/khtml/editing/markup.cpp
  
  Index: markup.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- markup.cpp	10 May 2005 04:03:34 -0000	1.20
  +++ markup.cpp	30 Jun 2005 01:27:38 -0000	1.21
  @@ -485,6 +485,52 @@
       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
  +            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)
  @@ -496,10 +542,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();
  @@ -545,16 +587,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);
  
  
  
  1.3       +4 -2      WebCore/khtml/editing/replace_selection_command.cpp
  
  Index: replace_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/replace_selection_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- replace_selection_command.cpp	22 Jun 2005 01:15:43 -0000	1.2
  +++ replace_selection_command.cpp	30 Jun 2005 01:27:38 -0000	1.3
  @@ -500,7 +500,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) {
  @@ -522,7 +522,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) {
  
  
  
  1.94      +8 -59     WebCore/khtml/html/htmltokenizer.cpp
  
  Index: htmltokenizer.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- htmltokenizer.cpp	17 Jun 2005 20:00:10 -0000	1.93
  +++ htmltokenizer.cpp	30 Jun 2005 01:27:40 -0000	1.94
  @@ -311,8 +311,6 @@
       tag = NoTag;
       pending = NonePending;
       discard = NoneDiscard;
  -    pre = false;
  -    prePos = 0;
       plaintext = false;
       xmp = false;
       processingInstruction = false;
  @@ -349,16 +347,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' ))
           {
  @@ -391,14 +384,11 @@
               }
               ++list;
           }
  -        else if (( *list == ' ' ) || ( *list == '\t'))
  +        else if ( *list == ' ' )
           {
               if (pending)
                   addPending();
  -            if (*list == ' ')
  -                pending = SpacePending;
  -            else
  -                pending = TabPending;
  +            pending = SpacePending;
   
               ++list;
           }
  @@ -408,7 +398,6 @@
               if (pending)
                   addPending();
   
  -            prePos++;
               *dest++ = *list;
               ++list;
           }
  @@ -417,10 +406,6 @@
   
       if (pending)
           addPending();
  -
  -    prePos = 0;
  -
  -    pre = old_pre;
   }
   
   void HTMLTokenizer::parseSpecial(TokenizerString &src)
  @@ -941,8 +926,6 @@
                   for(unsigned int i = 0; i < cBufferPos; i++)
                       dest[i] = cBuffer[i];
                   dest += cBufferPos;
  -                if (pre)
  -                    prePos += cBufferPos+1;
               }
   
               Entity = NoEntity;
  @@ -1414,17 +1397,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, !parser->doc()->inCompatMode())) {
  -                kdDebug(6036) << " not allowed in <pre> " << (int)tagID << endl;
  -                pre = false;
  -            }
  -
               switch( tagID ) {
               case ID_PRE:
  -                prePos = 0;
  -                pre = beginTag;
                   discard = LFDiscard; // Discard the first LF after we open a pre.
                   break;
               case ID_SCRIPT:
  @@ -1495,40 +1469,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:
  @@ -1683,9 +1641,7 @@
               }; // end case
   
               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();
                   // just forget it
                   else
  @@ -1755,7 +1711,7 @@
               }
               ++src;
           }
  -        else if (( cc == ' ' ) || ( cc == '\t' ))
  +        else if (cc == ' ')
           {
   	    if (select && !script) {
                   if(discard == SpaceDiscard)
  @@ -1772,10 +1728,7 @@
               
                   if (pending)
                       addPending();
  -                if (cc == ' ')
  -                    pending = SpacePending;
  -                else
  -                    pending = TabPending;
  +                pending = SpacePending;
               }
               
               ++src;
  @@ -1786,10 +1739,6 @@
                   addPending();
   
               discard = NoneDiscard;
  -            if ( pre )
  -            {
  -                prePos++;
  -            }
   #if QT_VERSION < 300
               unsigned char row = src->row();
               if ( row > 0x05 && row < 0x10 || row > 0xfd )
  
  
  
  1.35      +0 -10     WebCore/khtml/html/htmltokenizer.h
  
  Index: htmltokenizer.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- htmltokenizer.h	11 May 2005 05:49:34 -0000	1.34
  +++ htmltokenizer.h	30 Jun 2005 01:27:40 -0000	1.35
  @@ -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;
   
  
  
  
  1.131     +35 -21    WebCore/khtml/rendering/bidi.cpp
  
  Index: bidi.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
  retrieving revision 1.130
  retrieving revision 1.131
  diff -u -r1.130 -r1.131
  --- bidi.cpp	25 Jun 2005 05:17:32 -0000	1.130
  +++ bidi.cpp	30 Jun 2005 01:27:40 -0000	1.131
  @@ -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,20 @@
       return lastRootBox();
   }
   
  +// usage: tw - (xpos % tw);
  +int RenderBlock::tabWidth(bool isWhitespacePre)
  +{
  +    if (!isWhitespacePre)
  +        return 0;
  +    
  +    QChar   spaceChar(' ');
  +    const Font& font = style()->htmlFont();
  +    int tw = font.width(&spaceChar, 1, 0, 0);
  +    tw *= 8;
  +        
  +    return tw;
  +}
  +
   void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, BidiState &bidi)
   {
       // First determine our total width.
  @@ -725,7 +739,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 +811,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++;
                   }
   
  @@ -1776,7 +1790,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;
  @@ -1986,12 +2000,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;
  @@ -2022,7 +2036,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;
  @@ -2035,12 +2049,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);
  @@ -2060,8 +2074,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
  @@ -2078,7 +2092,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;
  @@ -2114,7 +2128,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
  @@ -2132,7 +2146,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) {
  @@ -2204,7 +2218,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)
  @@ -2408,8 +2422,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.18      +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.18
  diff -u -r1.17 -r1.18
  --- break_lines.cpp	20 Oct 2004 20:58:12 -0000	1.17
  +++ break_lines.cpp	30 Jun 2005 01:27:40 -0000	1.18
  @@ -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.40      +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.40
  diff -u -r1.39 -r1.40
  --- font.cpp	5 Oct 2004 20:25:19 -0000	1.39
  +++ font.cpp	30 Jun 2005 01:27:40 -0000	1.40
  @@ -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.30      +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.30
  diff -u -r1.29 -r1.30
  --- font.h	5 Oct 2004 20:25:19 -0000	1.29
  +++ font.h	30 Jun 2005 01:27:40 -0000	1.30
  @@ -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.185     +3 -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.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- render_block.cpp	16 May 2005 19:19:38 -0000	1.184
  +++ render_block.cpp	30 Jun 2005 01:27:40 -0000	1.185
  @@ -2796,7 +2796,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;
  @@ -2959,8 +2959,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.66      +1 -0      WebCore/khtml/rendering/render_block.h
  
  Index: render_block.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_block.h,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- render_block.h	18 Apr 2005 11:07:34 -0000	1.65
  +++ render_block.h	30 Jun 2005 01:27:40 -0000	1.66
  @@ -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();
  
  
  
  1.29      +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.29
  diff -u -r1.28 -r1.29
  --- render_br.h	14 Feb 2005 18:19:18 -0000	1.28
  +++ render_br.h	30 Jun 2005 01:27:40 -0000	1.29
  @@ -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.23      +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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- render_flexbox.cpp	10 May 2005 22:25:04 -0000	1.22
  +++ render_flexbox.cpp	30 Jun 2005 01:27:41 -0000	1.23
  @@ -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.75      +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.75
  diff -u -r1.74 -r1.75
  --- render_image.cpp	25 Feb 2005 00:25:12 -0000	1.74
  +++ render_image.cpp	30 Jun 2005 01:27:41 -0000	1.75
  @@ -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.42      +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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- render_line.cpp	29 Jun 2005 17:18:15 -0000	1.41
  +++ render_line.cpp	30 Jun 2005 01:27:41 -0000	1.42
  @@ -1042,6 +1042,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.27      +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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- render_line.h	23 Jun 2005 19:47:49 -0000	1.26
  +++ render_line.h	30 Jun 2005 01:27:41 -0000	1.27
  @@ -118,19 +118,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.61      +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.61
  diff -u -r1.60 -r1.61
  --- render_list.cpp	25 Feb 2005 00:25:12 -0000	1.60
  +++ render_list.cpp	30 Jun 2005 01:27:41 -0000	1.61
  @@ -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.196     +5 -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.195
  retrieving revision 1.196
  diff -u -r1.195 -r1.196
  --- render_object.cpp	23 Jun 2005 19:47:49 -0000	1.195
  +++ render_object.cpp	30 Jun 2005 01:27:41 -0000	1.196
  @@ -1736,6 +1736,11 @@
       return w;
   }
   
  +int RenderObject::tabWidth() const
  +{
  +    return containingBlock()->tabWidth(style()->whiteSpace() == PRE);
  +}
  +
   RenderCanvas* RenderObject::canvas() const
   {
       return static_cast<RenderCanvas*>(document()->renderer());
  @@ -2048,9 +2053,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.150     +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.149
  retrieving revision 1.150
  diff -u -r1.149 -r1.150
  --- render_object.h	23 Jun 2005 19:47:49 -0000	1.149
  +++ render_object.h	30 Jun 2005 01:27:41 -0000	1.150
  @@ -387,6 +387,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.78      +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.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- render_replaced.cpp	11 May 2005 02:10:10 -0000	1.77
  +++ render_replaced.cpp	30 Jun 2005 01:27:41 -0000	1.78
  @@ -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.185     +97 -63    WebCore/khtml/rendering/render_text.cpp
  
  Index: render_text.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_text.cpp,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- render_text.cpp	28 Jun 2005 16:22:04 -0000	1.184
  +++ render_text.cpp	30 Jun 2005 01:27:41 -0000	1.185
  @@ -143,12 +143,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
  @@ -162,14 +162,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;
   
  @@ -383,7 +383,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 {
  @@ -392,18 +392,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);
                   }
               }
  @@ -419,8 +419,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();
  @@ -524,10 +524,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();
  @@ -549,10 +548,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();
   }
  @@ -727,11 +725,21 @@
       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();
  +}
  +
   int InlineTextBox::offsetForPosition(int _x, bool includePartialGlyphs) const
   {
       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);
   }
   
   int InlineTextBox::positionForOffset(int offset) const
  @@ -741,13 +749,13 @@
   
       int left;
       if (m_reversed) {
  -        long len = m_start + m_len - offset;
  -        QString string(text->str->s + offset, len);
  -        left = m_x + fm.boundingRect(string, len).right();
  +	long len = m_start + m_len - offset;
  +	QString string(text->str->s + offset, len);
  +	left = m_x + fm.boundingRect(string, text->tabWidth(), textPos(), len).right();
       } else {
  -        long len = offset - m_start;
  -        QString string(text->str->s + m_start, len);
  -        left = m_x + fm.boundingRect(string, len).right();
  +	long len = offset - m_start;
  +	QString string(text->str->s + m_start, len);
  +	left = m_x + fm.boundingRect(string, text->tabWidth(), textPos(), len).right();
       }
       // FIXME: Do we need to add rightBearing here?
       return left;
  @@ -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);
   }
  @@ -1659,37 +1695,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
  @@ -1700,9 +1736,7 @@
               maxx = s->m_x + s->m_width;
       }
   
  -    w = kMax(0, maxx-minx);
  -
  -    return w;
  +    return kMax(0, maxx-minx);
   }
   
   QRect RenderText::getAbsoluteRepaintRect()
  
  
  
  1.79      +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.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- render_text.h	22 Apr 2005 16:29:51 -0000	1.78
  +++ render_text.h	30 Jun 2005 01:27:41 -0000	1.79
  @@ -124,6 +124,7 @@
       virtual long caretMaxOffset() const;
       virtual unsigned long caretMaxRenderedOffset() const;
       
  +    int textPos() const;
       int offsetForPosition(int _x, bool includePartialGlyphs = true) const;
       int positionForOffset(int offset) const;
       
  @@ -190,8 +191,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;
   
  @@ -203,7 +204,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,
  @@ -248,7 +253,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;
  @@ -280,6 +285,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)
       
  
  
  
  1.38      +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.38
  diff -u -r1.37 -r1.38
  --- KWQFontMetrics.h	17 Jun 2004 01:38:29 -0000	1.37
  +++ KWQFontMetrics.h	30 Jun 2005 01:27:44 -0000	1.38
  @@ -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.86      +29 -15    WebCore/kwq/KWQFontMetrics.mm
  
  Index: KWQFontMetrics.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFontMetrics.mm,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- KWQFontMetrics.mm	6 Mar 2005 08:03:56 -0000	1.85
  +++ KWQFontMetrics.mm	30 Jun 2005 01:27:44 -0000	1.86
  @@ -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,12 +247,14 @@
       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");
  @@ -260,6 +268,8 @@
       
       WebCoreTextStyle style;
       WebCoreInitializeEmptyTextStyle(&style);
  +    style.tabWidth = tabWidth;
  +    style.xpos = xpos;
       style.letterSpacing = letterSpacing;
       style.wordSpacing = wordSpacing;
       style.smallCaps = smallCaps;
  @@ -268,7 +278,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,12 +296,14 @@
       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");
  @@ -309,23 +321,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.72      +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.72
  diff -u -r1.71 -r1.72
  --- KWQPainter.h	21 Feb 2005 19:56:06 -0000	1.71
  +++ KWQPainter.h	30 Jun 2005 01:27:44 -0000	1.72
  @@ -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.125     +9 -5      WebCore/kwq/KWQPainter.mm
  
  Index: KWQPainter.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQPainter.mm,v
  retrieving revision 1.124
  retrieving revision 1.125
  diff -u -r1.124 -r1.125
  --- KWQPainter.mm	21 Feb 2005 19:56:06 -0000	1.124
  +++ KWQPainter.mm	30 Jun 2005 01:27:44 -0000	1.125
  @@ -597,7 +597,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 +617,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 +626,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 +658,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 +697,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);
  
  
  
  1.33      +2 -0      WebCore/kwq/WebCoreTextRenderer.h
  
  Index: WebCoreTextRenderer.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreTextRenderer.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- WebCoreTextRenderer.h	21 Feb 2005 19:56:06 -0000	1.32
  +++ WebCoreTextRenderer.h	30 Jun 2005 01:27:44 -0000	1.33
  @@ -36,6 +36,8 @@
       int letterSpacing;
       int wordSpacing;
       int padding;
  +    int tabWidth;
  +    int xpos;
       NSString **families;
       unsigned smallCaps : 1;
       unsigned rtl : 1;
  
  
  
  1.22      +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.22
  diff -u -r1.21 -r1.22
  --- WebCoreTextRendererFactory.mm	5 Oct 2004 20:25:19 -0000	1.21
  +++ WebCoreTextRendererFactory.mm	30 Jun 2005 01:27:44 -0000	1.22
  @@ -42,6 +42,8 @@
   void WebCoreInitializeEmptyTextStyle(WebCoreTextStyle *style)
   {
       style->padding = 0;
  +    style->tabWidth = 0;
  +    style->xpos = 0;
       style->textColor = nil;
       style->backgroundColor = nil;
       style->rtl = false;
  
  
  
  1.5       +7 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- delete-tab-001-expected.txt	14 Jun 2005 22:36:33 -0000	1.4
  +++ delete-tab-001-expected.txt	30 Jun 2005 01:27:45 -0000	1.5
  @@ -4,8 +4,11 @@
     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
  -caret: position 4 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 0 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.2       +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.2
  diff -u -r1.1 -r1.2
  --- delete-tab-001.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-001.html	30 Jun 2005 01:27:45 -0000	1.2
  @@ -15,8 +15,7 @@
   function editingTest() {
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.4       +7 -4      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- delete-tab-002-expected.txt	14 Jun 2005 22:36:33 -0000	1.3
  +++ delete-tab-002-expected.txt	30 Jun 2005 01:27:45 -0000	1.4
  @@ -4,7 +4,10 @@
     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    "
  -caret: position 7 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +        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}"
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.2       +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.2
  diff -u -r1.1 -r1.2
  --- delete-tab-002.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-002.html	30 Jun 2005 01:27:45 -0000	1.2
  @@ -17,8 +17,7 @@
           moveSelectionForwardByCharacterCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.4       +9 -4      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- delete-tab-003-expected.txt	14 Jun 2005 22:36:33 -0000	1.3
  +++ delete-tab-003-expected.txt	30 Jun 2005 01:27:45 -0000	1.4
  @@ -4,8 +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: "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
  -caret: position 6 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.2       +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.2
  diff -u -r1.1 -r1.2
  --- delete-tab-003.html	31 Aug 2004 16:39:09 -0000	1.1
  +++ delete-tab-003.html	30 Jun 2005 01:27:45 -0000	1.2
  @@ -17,8 +17,7 @@
           moveSelectionForwardByCharacterCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.5       +7 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- delete-tab-004-expected.txt	14 Jun 2005 22:36:33 -0000	1.4
  +++ delete-tab-004-expected.txt	30 Jun 2005 01:27:45 -0000	1.5
  @@ -4,9 +4,12 @@
     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
  -caret: position 4 of child 1 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.3       +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.3
  diff -u -r1.2 -r1.3
  --- delete-tab-004.html	3 Dec 2004 17:31:30 -0000	1.2
  +++ delete-tab-004.html	30 Jun 2005 01:27:45 -0000	1.3
  @@ -16,8 +16,7 @@
       insertLineBreakCommand();
       typeCharacterCommand('\t');
       typeCharacterCommand('\t');
  -    for (i = 0; i < 4; i++)
  -        deleteCommand();
  +    deleteCommand();
   }
   
   </script>
  
  
  
  1.5       +7 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- insert-tab-001-expected.txt	14 Jun 2005 22:36:48 -0000	1.4
  +++ insert-tab-001-expected.txt	30 Jun 2005 01:27:46 -0000	1.5
  @@ -4,8 +4,11 @@
     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
  -caret: position 4 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 0 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.5       +7 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- insert-tab-002-expected.txt	14 Jun 2005 22:36:48 -0000	1.4
  +++ insert-tab-002-expected.txt	30 Jun 2005 01:27:46 -0000	1.5
  @@ -4,8 +4,11 @@
     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
  -caret: position 7 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.4       +9 -4      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- insert-tab-003-expected.txt	14 Jun 2005 22:36:48 -0000	1.3
  +++ insert-tab-003-expected.txt	30 Jun 2005 01:27:46 -0000	1.4
  @@ -4,8 +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: "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
  -caret: position 6 of child 0 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.5       +7 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- insert-tab-004-expected.txt	14 Jun 2005 22:36:48 -0000	1.4
  +++ insert-tab-004-expected.txt	30 Jun 2005 01:27:46 -0000	1.5
  @@ -4,9 +4,12 @@
     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
  -caret: position 4 of child 1 {TEXT} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  +caret: position 1 of child 0 {TEXT} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.2       +3 -4      WebCore/layout-tests/fast/dom/quadraticCurveTo-expected.txt
  
  Index: quadraticCurveTo-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/dom/quadraticCurveTo-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- quadraticCurveTo-expected.txt	29 Jun 2005 17:41:39 -0000	1.1
  +++ quadraticCurveTo-expected.txt	30 Jun 2005 01:27:46 -0000	1.2
  @@ -4,9 +4,8 @@
     RenderBlock {HTML} at (0,0) size 800x414
       RenderBody {BODY} at (8,16) size 784x18
         RenderBlock {P} at (0,0) size 784x18
  -        RenderText {TEXT} at (0,0) size 420x18
  -          text run at (0,0) width 358: "\x{9}\x{9}\x{9}This test case should produce a sine-wave stroked with 1"
  -          text run at (358,0) width 62: "px black. "
  -          text run at (420,0) width 0: "\x{9}\x{9}"
  +        RenderText {TEXT} at (0,0) size 416x18
  +          text run at (0,0) width 358: "This test case should produce a sine-wave stroked with 1"
  +          text run at (358,0) width 58: "px black."
       RenderBlock (anonymous) at (0,50) size 800x364
         RenderCanvasImage {CANVAS} at (0,0) size 480x360
  
  
  
  1.2       +3 -3      WebCore/layout-tests/fast/js/string-replace-2-expected.txt
  
  Index: string-replace-2-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/js/string-replace-2-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- string-replace-2-expected.txt	22 Jun 2005 17:29:28 -0000	1.1
  +++ string-replace-2-expected.txt	30 Jun 2005 01:27:47 -0000	1.2
  @@ -17,7 +17,7 @@
   Support for String.replace(/…/,myFunction)
   
   function Capitalize(s){
  -        return s.toUpperCase();
  +	return s.toUpperCase();
   }
   result = foo.replace(vowels,Capitalize);
   Expected result: "It's thE End Of thE wOrld As wE knOw It, And I fEEl fInE."
  @@ -26,7 +26,7 @@
   Support for String.replace(/…/,myFunction), using RegExp
   
   function Capitalize(){
  -        return RegExp.$1.toUpperCase()+RegExp.$2;
  +	return RegExp.$1.toUpperCase()+RegExp.$2;
   }
   result = foo.replace(/([aeiou])([a-z])/g,Capitalize);
   Expected result: "It's the End Of the wOrld As we knOw It, And I fEel fIne."
  @@ -35,7 +35,7 @@
   Support for String.replace(/…/,myFunction), using parameters
   
   function Capitalize(orig,re1,re2){
  -        return re1.toUpperCase()+re2;
  +	return re1.toUpperCase()+re2;
   }
   result = foo.replace(/([aeiou])([a-z])/g,Capitalize);
   Expected result: "It's the End Of the wOrld As we knOw It, And I fEel fIne."
  
  
  
  1.5       +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.5
  diff -u -r1.4 -r1.5
  --- 039-expected.txt	29 Sep 2004 18:07:43 -0000	1.4
  +++ 039-expected.txt	30 Jun 2005 01:27:47 -0000	1.5
  @@ -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
  
  
  
  1.5       +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.5
  diff -u -r1.4 -r1.5
  --- 004-expected.txt	17 Nov 2003 22:20:03 -0000	1.4
  +++ 004-expected.txt	30 Jun 2005 01:27:47 -0000	1.5
  @@ -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
  
  
  
  1.2       +1 -1      WebCore/layout-tests/fast/tokenizer/script_extra_close-expected.txt
  
  Index: script_extra_close-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/tokenizer/script_extra_close-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- script_extra_close-expected.txt	17 Jun 2005 20:00:10 -0000	1.1
  +++ script_extra_close-expected.txt	30 Jun 2005 01:27:47 -0000	1.2
  @@ -4,7 +4,7 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderText {TEXT} at (0,0) size 55x18
  -        text run at (0,0) width 55: "TEST... "
  +        text run at (0,0) width 55: "TEST...\x{9}"
         RenderText {TEXT} at (0,0) size 0x0
         RenderText {TEXT} at (0,0) size 0x0
         RenderText {TEXT} at (55,0) size 232x18
  
  
  



More information about the webkit-changes mailing list