[webkit-changes] cvs commit: WebCore/kwq WebCoreBridge.mm

Darin darin at opensource.apple.com
Wed Dec 21 20:11:41 PST 2005


darin       05/12/21 20:11:41

  Modified:    .        ChangeLog
               khtml/editing apply_style_command.cpp
                        composite_edit_command.cpp
                        delete_selection_command.cpp edit_command.cpp
                        edit_command.h insert_line_break_command.cpp
                        insert_paragraph_separator_command.cpp
                        jsediting.cpp markup.cpp
                        replace_selection_command.cpp visible_units.cpp
               khtml/html html_elementimpl.cpp
               kwq      WebCoreBridge.mm
  Log:
          Reviewed by Justin.
  
          - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6142
            intermittent failures in some paste tests
  
          * khtml/editing/apply_style_command.cpp:
          (khtml::ApplyStyleCommand::applyBlockStyle): Call new updateLayout member function.
          (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
          (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): Ditto.
          * khtml/editing/composite_edit_command.cpp:
          (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
          (khtml::CompositeEditCommand::findBlockPlaceholder): Ditto.
          (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
          * khtml/editing/delete_selection_command.cpp:
          (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
          (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
          * khtml/editing/edit_command.cpp:
          (khtml::EditCommand::apply): Ditto.
          (khtml::EditCommand::unapply): Ditto.
          (khtml::EditCommand::reapply): Ditto.
          (khtml::EditCommand::updateLayout): Added. Calls updateLayoutIgnorePendingStylesheets
          on the document.
          * khtml/editing/edit_command.h: Added updateLayout member function.
          * khtml/editing/insert_line_break_command.cpp:
          (khtml::InsertLineBreakCommand::doApply): Call new updateLayout member function.
          * khtml/editing/insert_paragraph_separator_command.cpp:
          (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
          * khtml/editing/jsediting.cpp:
          (DOM::JSEditor::execCommand): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
          (DOM::JSEditor::queryCommandEnabled): Ditto.
          (DOM::JSEditor::queryCommandIndeterm): Ditto.
          (DOM::JSEditor::queryCommandState): Ditto.
          (DOM::JSEditor::queryCommandValue): Ditto.
          * khtml/editing/markup.cpp: (khtml::createMarkup): Ditto.
          * khtml/editing/replace_selection_command.cpp:
          (khtml::ReplacementFragment::insertFragmentForTestRendering): Ditto.
          (khtml::ReplaceSelectionCommand::fixupNodeStyles): Call new updateLayout member function.
          (khtml::ReplacementFragment::computeStylesUsingTestRendering): Call
          updateLayoutIgnorePendingStylesheets instead of updateLayout.
          (khtml::ReplaceSelectionCommand::doApply): Call new updateLayout member function.
          (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.
          (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
          * khtml/editing/visible_units.cpp:
          (khtml::previousLinePosition): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
          (khtml::nextLinePosition): Ditto.
          * khtml/html/html_elementimpl.cpp:
          (HTMLElementImpl::innerText): Ditto.
          * kwq/WebCoreBridge.mm:
          (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Ditto.
          (-[WebCoreBridge smartDeleteRangeForProposedRange:]): Ditto.
  
  Revision  Changes    Path
  1.23      +54 -1     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ChangeLog	22 Dec 2005 04:06:44 -0000	1.22
  +++ ChangeLog	22 Dec 2005 04:11:35 -0000	1.23
  @@ -1,5 +1,58 @@
   2005-12-21  Darin Adler  <darin at apple.com>
   
  +        Reviewed by Justin.
  +
  +        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6142
  +          intermittent failures in some paste tests
  +
  +        * khtml/editing/apply_style_command.cpp:
  +        (khtml::ApplyStyleCommand::applyBlockStyle): Call new updateLayout member function.
  +        (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
  +        (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): Ditto.
  +        * khtml/editing/composite_edit_command.cpp:
  +        (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
  +        (khtml::CompositeEditCommand::findBlockPlaceholder): Ditto.
  +        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
  +        * khtml/editing/delete_selection_command.cpp:
  +        (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
  +        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
  +        * khtml/editing/edit_command.cpp:
  +        (khtml::EditCommand::apply): Ditto.
  +        (khtml::EditCommand::unapply): Ditto.
  +        (khtml::EditCommand::reapply): Ditto.
  +        (khtml::EditCommand::updateLayout): Added. Calls updateLayoutIgnorePendingStylesheets
  +        on the document.
  +        * khtml/editing/edit_command.h: Added updateLayout member function.
  +        * khtml/editing/insert_line_break_command.cpp:
  +        (khtml::InsertLineBreakCommand::doApply): Call new updateLayout member function.
  +        * khtml/editing/insert_paragraph_separator_command.cpp:
  +        (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
  +        * khtml/editing/jsediting.cpp:
  +        (DOM::JSEditor::execCommand): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
  +        (DOM::JSEditor::queryCommandEnabled): Ditto.
  +        (DOM::JSEditor::queryCommandIndeterm): Ditto.
  +        (DOM::JSEditor::queryCommandState): Ditto.
  +        (DOM::JSEditor::queryCommandValue): Ditto.
  +        * khtml/editing/markup.cpp: (khtml::createMarkup): Ditto.
  +        * khtml/editing/replace_selection_command.cpp:
  +        (khtml::ReplacementFragment::insertFragmentForTestRendering): Ditto.
  +        (khtml::ReplaceSelectionCommand::fixupNodeStyles): Call new updateLayout member function.
  +        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Call
  +        updateLayoutIgnorePendingStylesheets instead of updateLayout.
  +        (khtml::ReplaceSelectionCommand::doApply): Call new updateLayout member function.
  +        (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.
  +        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
  +        * khtml/editing/visible_units.cpp:
  +        (khtml::previousLinePosition): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
  +        (khtml::nextLinePosition): Ditto.
  +        * khtml/html/html_elementimpl.cpp:
  +        (HTMLElementImpl::innerText): Ditto.
  +        * kwq/WebCoreBridge.mm:
  +        (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Ditto.
  +        (-[WebCoreBridge smartDeleteRangeForProposedRange:]): Ditto.
  +
  +2005-12-21  Darin Adler  <darin at apple.com>
  +
           Reviewed by Geoff.
   
           - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6177
  @@ -45,7 +98,7 @@
   
   2005-12-21  David Harrison  <harrison at apple.com>
   
  -        Reviewed by Justin).
  +        Reviewed by Justin.
   
           <rdar://problem/4039777> Pasting particular snippet of HTML containing list items and a link creates too many list items
           - Fixed paste crash by making calling RenderBox::deleteLineBoxWrapper() from RenderObject::remove(),
  
  
  
  1.22      +5 -5      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- apply_style_command.cpp	21 Dec 2005 22:51:10 -0000	1.21
  +++ apply_style_command.cpp	22 Dec 2005 04:11:36 -0000	1.22
  @@ -366,7 +366,7 @@
       // update document layout once before removing styles
       // so that we avoid the expense of updating before each and every call
       // to check a computed style
  -    document()->updateLayout();
  +    updateLayout();
   
       // get positions we want to use for applying style
       Position start = startPosition();
  @@ -539,7 +539,7 @@
       // update document layout once before removing styles
       // so that we avoid the expense of updating before each and every call
       // to check a computed style
  -    document()->updateLayout();
  +    updateLayout();
       
       // adjust to the positions we want to use for applying style
       Position start = startPosition();
  @@ -590,7 +590,7 @@
       // update document layout once before running the rest of the function
       // so that we avoid the expense of updating before each and every call
       // to check a computed style
  -    document()->updateLayout();
  +    updateLayout();
       
       NodeImpl *node = start.node();
       if (start.offset() >= start.node()->caretMaxOffset())
  @@ -857,11 +857,11 @@
       // decoration while pushing down.
   
       pushDownTextDecorationStyleAroundNode(start.node(), start, end, false);
  -    document()->updateLayout();
  +    updateLayout();
       pushDownTextDecorationStyleAroundNode(start.node(), start, end, true);
   
       pushDownTextDecorationStyleAroundNode(end.node(), start, end, false);
  -    document()->updateLayout();
  +    updateLayout();
       pushDownTextDecorationStyleAroundNode(end.node(), start, end, true);
   }
   
  
  
  
  1.22      +3 -3      WebCore/khtml/editing/composite_edit_command.cpp
  
  Index: composite_edit_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- composite_edit_command.cpp	21 Dec 2005 22:51:10 -0000	1.21
  +++ composite_edit_command.cpp	22 Dec 2005 04:11:36 -0000	1.22
  @@ -490,7 +490,7 @@
       if (!node)
           return false;
   
  -    document()->updateLayout();
  +    updateLayout();
   
       RenderObject *renderer = node->renderer();
       if (!renderer || !renderer->isBlockFlow())
  @@ -520,7 +520,7 @@
       if (!node)
           return 0;
   
  -    document()->updateLayout();
  +    updateLayout();
   
       RenderObject *renderer = node->renderer();
       if (!renderer || !renderer->isBlockFlow())
  @@ -544,7 +544,7 @@
       if (pos.isNull())
           return;
       
  -    document()->updateLayout();
  +    updateLayout();
       
       VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY);
       VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos));
  
  
  
  1.24      +3 -3      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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- delete_selection_command.cpp	21 Nov 2005 01:20:02 -0000	1.23
  +++ delete_selection_command.cpp	22 Dec 2005 04:11:36 -0000	1.24
  @@ -491,7 +491,7 @@
   
   void DeleteSelectionCommand::fixupWhitespace()
   {
  -    document()->updateLayout();
  +    updateLayout();
       if (m_leadingWhitespace.isNotNull() && (m_trailingWhitespace.isNotNull() || !m_leadingWhitespace.isRenderedCharacter())) {
           LOG(Editing, "replace leading");
           TextImpl *textNode = static_cast<TextImpl *>(m_leadingWhitespace.node());
  @@ -591,10 +591,10 @@
       // This will have the side effect of moving 'Three' on to the same line as 'One'
       // and 'Two'. This is undesirable. We fix this up by adding a BR before the 'Three'.
       // This may not be ideal, but it is better than nothing.
  -    document()->updateLayout();
  +    updateLayout();
       if (!startBlock->renderer() || !startBlock->renderer()->firstChild()) {
           removeNode(startBlock);
  -        document()->updateLayout();
  +        updateLayout();
           if (refNode->renderer() && refNode->renderer()->inlineBox() && refNode->renderer()->inlineBox()->nextOnLineExists()) {
               insertNodeAfter(createBreakElement(document()), refNode);
           }
  
  
  
  1.14      +8 -3      WebCore/khtml/editing/edit_command.cpp
  
  Index: edit_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/edit_command.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- edit_command.cpp	2 Dec 2005 03:48:07 -0000	1.13
  +++ edit_command.cpp	22 Dec 2005 04:11:36 -0000	1.14
  @@ -237,7 +237,7 @@
           setTypingStyle(0);
   
       if (!isCompositeStep()) {
  -        document()->updateLayout();
  +        updateLayout();
           EditCommandPtr cmd(this);
           part->appliedEditing(cmd);
       }
  @@ -258,7 +258,7 @@
       m_state = NotApplied;
   
       if (topLevel) {
  -        document()->updateLayout();
  +        updateLayout();
           EditCommandPtr cmd(this);
           part->unappliedEditing(cmd);
       }
  @@ -279,7 +279,7 @@
       m_state = Applied;
   
       if (topLevel) {
  -        document()->updateLayout();
  +        updateLayout();
           EditCommandPtr cmd(this);
           part->reappliedEditing(cmd);
       }
  @@ -387,4 +387,9 @@
       return style;
   }
   
  +void EditCommand::updateLayout() const
  +{
  +    document()->updateLayoutIgnorePendingStylesheets();
  +}
  +
   } // namespace khtml
  
  
  
  1.5       +2 -0      WebCore/khtml/editing/edit_command.h
  
  Index: edit_command.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/edit_command.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- edit_command.h	1 Dec 2005 10:32:14 -0000	1.4
  +++ edit_command.h	22 Dec 2005 04:11:36 -0000	1.5
  @@ -86,6 +86,8 @@
       
       virtual bool isInsertTextCommand() const;
       virtual bool isTypingCommand() const;
  +
  +    void updateLayout() const;
       
   private:
       void assignTypingStyle(DOM::CSSMutableStyleDeclarationImpl *);
  
  
  
  1.12      +1 -1      WebCore/khtml/editing/insert_line_break_command.cpp
  
  Index: insert_line_break_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_line_break_command.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- insert_line_break_command.cpp	21 Dec 2005 22:51:10 -0000	1.11
  +++ insert_line_break_command.cpp	22 Dec 2005 04:11:36 -0000	1.12
  @@ -153,7 +153,7 @@
           Position endingPosition = Position(textNode, 0);
           
           // Handle whitespace that occurs after the split
  -        document()->updateLayout();
  +        updateLayout();
           if (!endingPosition.isRenderedCharacter()) {
               // Clear out all whitespace and insert one non-breaking space
               deleteInsignificantTextDownstream(endingPosition);
  
  
  
  1.11      +1 -1      WebCore/khtml/editing/insert_paragraph_separator_command.cpp
  
  Index: insert_paragraph_separator_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_paragraph_separator_command.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- insert_paragraph_separator_command.cpp	21 Nov 2005 01:20:03 -0000	1.10
  +++ insert_paragraph_separator_command.cpp	22 Dec 2005 04:11:36 -0000	1.11
  @@ -299,7 +299,7 @@
   
       // Handle whitespace that occurs after the split
       if (splitText) {
  -        document()->updateLayout();
  +        updateLayout();
           pos = Position(startNode, 0);
           if (!pos.isRenderedCharacter()) {
               // Clear out all whitespace and insert one non-breaking space
  
  
  
  1.36      +5 -5      WebCore/khtml/editing/jsediting.cpp
  
  Index: jsediting.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/jsediting.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jsediting.cpp	21 Nov 2005 01:20:03 -0000	1.35
  +++ jsediting.cpp	22 Dec 2005 04:11:37 -0000	1.36
  @@ -73,7 +73,7 @@
       KHTMLPart *part = m_doc->part();
       if (!part)
           return false;
  -    m_doc->updateLayout();
  +    m_doc->updateLayoutIgnorePendingStylesheets();
       return cmd->enabledFn(part) && cmd->execFn(part, userInterface, value);
   }
   
  @@ -85,7 +85,7 @@
       KHTMLPart *part = m_doc->part();
       if (!part)
           return false;
  -    m_doc->updateLayout();
  +    m_doc->updateLayoutIgnorePendingStylesheets();
       return cmd->enabledFn(part);
   }
   
  @@ -97,7 +97,7 @@
       KHTMLPart *part = m_doc->part();
       if (!part)
           return false;
  -    m_doc->updateLayout();
  +    m_doc->updateLayoutIgnorePendingStylesheets();
       return cmd->stateFn(part) == KHTMLPart::mixedTriState;
   }
   
  @@ -109,7 +109,7 @@
       KHTMLPart *part = m_doc->part();
       if (!part)
           return false;
  -    m_doc->updateLayout();
  +    m_doc->updateLayoutIgnorePendingStylesheets();
       return cmd->stateFn(part) != KHTMLPart::falseTriState;
   }
   
  @@ -128,7 +128,7 @@
       KHTMLPart *part = m_doc->part();
       if (!part)
           return DOMString();
  -    m_doc->updateLayout();
  +    m_doc->updateLayoutIgnorePendingStylesheets();
       return cmd->valueFn(part);
   }
   
  
  
  
  1.43      +2 -2      WebCore/khtml/editing/markup.cpp
  
  Index: markup.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- markup.cpp	1 Dec 2005 10:32:14 -0000	1.42
  +++ markup.cpp	22 Dec 2005 04:11:37 -0000	1.43
  @@ -337,7 +337,7 @@
       ASSERT(exceptionCode == 0);
   
       DocumentImpl *doc = commonAncestor->getDocument();
  -    doc->updateLayout();
  +    doc->updateLayoutIgnorePendingStylesheets();
   
       NodeImpl *commonAncestorBlock = 0;
       if (commonAncestor != 0) {
  @@ -507,7 +507,7 @@
       QPtrList<DOM::NodeImpl> *nodes, EAnnotateForInterchange annotate)
   {
       ASSERT(annotate == DoNotAnnotateForInterchange); // annotation not yet implemented for this code path
  -    node->getDocument()->updateLayout();
  +    node->getDocument()->updateLayoutIgnorePendingStylesheets();
       return markup(node, includeChildren, false, nodes);
   }
   
  
  
  
  1.22      +17 -17    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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- replace_selection_command.cpp	21 Dec 2005 22:51:10 -0000	1.21
  +++ replace_selection_command.cpp	22 Dec 2005 04:11:37 -0000	1.22
  @@ -273,7 +273,7 @@
       ASSERT(exceptionCode == 0);
       holder->deref();
       
  -    m_document->updateLayout();
  +    m_document->updateLayoutIgnorePendingStylesheets();
       
       return holder;
   }
  @@ -305,7 +305,7 @@
       // This function uses the mapped "desired style" to apply the additional style needed, if any,
       // to make the node have the desired style.
   
  -    document()->updateLayout();
  +    updateLayout();
   
       QValueListConstIterator<NodeDesiredStyle> it;
       for (it = list.begin(); it != list.end(); ++it) {
  @@ -395,7 +395,7 @@
       if (!holder)
           return;
   
  -    m_document->updateLayout();
  +    m_document->updateLayoutIgnorePendingStylesheets();
   
       for (NodeImpl *node = holder->firstChild(); node; node = node->traverseNextNode(holder))
           computeAndStoreNodeDesiredStyle(node, m_styles);
  @@ -636,7 +636,7 @@
       // delete the current range selection, or insert paragraph for caret selection, as needed
       if (selection.isRange()) {
           deleteSelection(false, !(m_fragment.hasInterchangeNewlineAtStart() || m_fragment.hasInterchangeNewlineAtEnd() || m_fragment.hasMoreThanOneBlock()));
  -        document()->updateLayout();
  +        updateLayout();
           visibleStart = VisiblePosition(endingSelection().start(), VP_DEFAULT_AFFINITY);
           if (m_fragment.hasInterchangeNewlineAtStart()) {
               if (isEndOfParagraph(visibleStart) && !isStartOfParagraph(visibleStart)) {
  @@ -731,7 +731,7 @@
       // add "smart replace" space, handle trailing newline, clean up.
       
       // initially, we say the insertion point is the start of selection
  -    document()->updateLayout();
  +    updateLayout();
       Position insertionPos = startPos;
   
       // step 1: merge content into the start block, if that is needed
  @@ -758,7 +758,7 @@
           
           // update insertion point to be at the end of the last block inserted
           if (m_lastNodeInserted) {
  -            document()->updateLayout();
  +            updateLayout();
               insertionPos = Position(m_lastNodeInserted, m_lastNodeInserted->caretMaxOffset());
           }
       }
  @@ -788,13 +788,13 @@
               refNode = node;
               node = next;
           }
  -        document()->updateLayout();
  +        updateLayout();
           insertionPos = Position(m_lastNodeInserted, m_lastNodeInserted->caretMaxOffset());
       }
   
       // step 3 : handle "smart replace" whitespace
       if (addTrailingSpace && m_lastNodeInserted) {
  -        document()->updateLayout();
  +        updateLayout();
           Position pos(m_lastNodeInserted, m_lastNodeInserted->caretMaxOffset());
           bool needsTrailingSpace = pos.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull();
           if (needsTrailingSpace) {
  @@ -812,7 +812,7 @@
       }
   
       if (addLeadingSpace && m_firstNodeInserted) {
  -        document()->updateLayout();
  +        updateLayout();
           Position pos(m_firstNodeInserted, 0);
           bool needsLeadingSpace = pos.leadingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull();
           if (needsLeadingSpace) {
  @@ -843,7 +843,7 @@
                   insertParagraph = true;
               } else {
                   // Handle end-of-document case.
  -                document()->updateLayout();
  +                updateLayout();
                   if (isEndOfDocument(pos))
                       insertParagraph = true;
               }
  @@ -864,7 +864,7 @@
       } 
       else {
           if (m_lastNodeInserted && m_lastNodeInserted->hasTagName(brTag) && !document()->inStrictMode()) {
  -            document()->updateLayout();
  +            updateLayout();
               VisiblePosition pos(Position(m_lastNodeInserted, 1), DOWNSTREAM);
               if (isEndOfBlock(pos)) {
                   NodeImpl *next = m_lastNodeInserted->traverseNextNode();
  @@ -877,7 +877,7 @@
           }
   
           if (moveNodesAfterEnd && !isLastVisiblePositionInSpecialElement(Position(m_lastNodeInserted, maxRangeOffset(m_lastNodeInserted)))) {
  -            document()->updateLayout();
  +            updateLayout();
               QValueList<NodeDesiredStyle> styles;
               QPtrList<NodeImpl> blocks;
               NodeImpl *node = beyondEndNode;
  @@ -899,7 +899,7 @@
                       break;
                   node = next;
               }
  -            document()->updateLayout();
  +            updateLayout();
               for (QPtrListIterator<NodeImpl> it(blocks); it.current(); ++it) {
                   NodeImpl *blockToRemove = it.current();
                   if (!blockToRemove->inDocument())
  @@ -908,7 +908,7 @@
                       if (blockToRemove->parentNode())
                           blocks.append(blockToRemove->parentNode()->enclosingBlockFlowElement());
                       removeNode(blockToRemove);
  -                    document()->updateLayout();
  +                    updateLayout();
                   }
               }
   
  @@ -929,14 +929,14 @@
       if (!linePlaceholder)
           return;
           
  -    document()->updateLayout();
  +    updateLayout();
       if (linePlaceholder->inDocument()) {
           VisiblePosition placeholderPos(linePlaceholder, linePlaceholder->renderer()->caretMinOffset(), DOWNSTREAM);
           if (placeholderPos.next().isNull() ||
               !(isStartOfLine(placeholderPos) && isEndOfLine(placeholderPos))) {
               NodeImpl *block = linePlaceholder->enclosingBlockFlowElement();
               removeNode(linePlaceholder);
  -            document()->updateLayout();
  +            updateLayout();
               if (!block->renderer() || block->renderer()->height() == 0)
                   removeNode(block);
           }
  @@ -970,7 +970,7 @@
           }
           
           // Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
  -        document()->updateLayout();
  +        updateLayout();
           start = Position(firstLeaf, firstLeaf->caretMinOffset());
           end = Position(lastLeaf, lastLeaf->caretMaxOffset());
   
  
  
  
  1.47      +2 -2      WebCore/khtml/editing/visible_units.cpp
  
  Index: visible_units.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_units.cpp,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- visible_units.cpp	13 Dec 2005 01:50:27 -0000	1.46
  +++ visible_units.cpp	22 Dec 2005 04:11:37 -0000	1.47
  @@ -366,7 +366,7 @@
       if (!node || !node->getDocument())
           return VisiblePosition();
       
  -    node->getDocument()->updateLayout();
  +    node->getDocument()->updateLayoutIgnorePendingStylesheets();
       
       RenderObject *renderer = node->renderer();
       if (!renderer)
  @@ -429,7 +429,7 @@
       if (!node || !node->getDocument())
           return VisiblePosition();
       
  -    node->getDocument()->updateLayout();
  +    node->getDocument()->updateLayoutIgnorePendingStylesheets();
   
       RenderObject *renderer = node->renderer();
       if (!renderer)
  
  
  
  1.114     +1 -1      WebCore/khtml/html/html_elementimpl.cpp
  
  Index: html_elementimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_elementimpl.cpp,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- html_elementimpl.cpp	16 Dec 2005 08:08:17 -0000	1.113
  +++ html_elementimpl.cpp	22 Dec 2005 04:11:39 -0000	1.114
  @@ -233,7 +233,7 @@
   DOMString HTMLElementImpl::innerText() const
   {
       // We need to update layout, since plainText uses line boxes in the render tree.
  -    getDocument()->updateLayout();
  +    getDocument()->updateLayoutIgnorePendingStylesheets();
       return plainText(rangeOfContents(const_cast<HTMLElementImpl *>(this)).get());
   }
   
  
  
  
  1.445     +2 -2      WebCore/kwq/WebCoreBridge.mm
  
  Index: WebCoreBridge.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
  retrieving revision 1.444
  retrieving revision 1.445
  diff -u -r1.444 -r1.445
  --- WebCoreBridge.mm	21 Dec 2005 02:05:12 -0000	1.444
  +++ WebCoreBridge.mm	22 Dec 2005 04:11:39 -0000	1.445
  @@ -1638,7 +1638,7 @@
       ASSERT(startContainer->getDocument());
       ASSERT(startContainer->getDocument() == endContainer->getDocument());
       
  -    _part->xmlDocImpl()->updateLayout();
  +    _part->xmlDocImpl()->updateLayoutIgnorePendingStylesheets();
   
       EAffinity affinity = static_cast<EAffinity>(selectionAffinity);
       
  @@ -1786,7 +1786,7 @@
       ASSERT(startContainer->getDocument());
       ASSERT(startContainer->getDocument() == endContainer->getDocument());
       
  -    _part->xmlDocImpl()->updateLayout();
  +    _part->xmlDocImpl()->updateLayoutIgnorePendingStylesheets();
   
       Position start(startContainer, [proposedRange startOffset]);
       Position end(endContainer, [proposedRange endOffset]);
  
  
  



More information about the webkit-changes mailing list