1. 12 May, 2011 1 commit
    • tonyg@chromium.org's avatar
      2011-05-10 Tony Gentilcore <tonyg@chromium.org> · 4b0a55f4
      tonyg@chromium.org authored
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * accessibility/AccessibilityObject.cpp:
              * accessibility/AccessibilityRenderObject.cpp:
              * accessibility/mac/AccessibilityObjectWrapper.mm:
              * dom/DocumentMarkerController.cpp:
              * dom/Position.cpp:
              * dom/PositionIterator.cpp:
              * dom/Range.cpp:
              * editing/ApplyBlockElementCommand.cpp:
              * editing/ApplyStyleCommand.cpp:
              * editing/Editor.cpp:
              * editing/EditorCommand.cpp:
              * editing/FrameSelection.cpp:
              * editing/HTMLInterchange.cpp:
              * editing/IndentOutdentCommand.cpp:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SpellChecker.h:
              * editing/SpellingCorrectionCommand.cpp:
              * editing/SpellingCorrectionController.h:
              * editing/TextCheckingHelper.cpp:
              * editing/TextIterator.h:
              * editing/htmlediting.h:
              * editing/markup.cpp:
              * editing/visible_units.cpp:
              * editing/visible_units.h:
              * fileapi/DOMFileSystem.cpp:
              * fileapi/DirectoryReaderSync.cpp:
              * fileapi/DirectoryReaderSync.h:
              * fileapi/FileEntry.h:
              * fileapi/FileWriter.h:
              * fileapi/FileWriterBase.h:
              * fileapi/FileWriterSync.h:
              * history/CachedFrame.cpp:
              * history/CachedPage.cpp:
              * history/HistoryItem.cpp:
              * history/HistoryItem.h:
              * history/PageCache.h:
              * loader/HistoryController.h:
              * loader/PingLoader.h:
              * loader/ResourceLoader.h:
              * loader/appcache/DOMApplicationCache.h:
              * loader/cache/CachedCSSStyleSheet.h:
              * loader/cache/CachedFont.cpp:
              * loader/cache/CachedFont.h:
              * loader/cache/CachedResourceRequest.cpp:
              * loader/cache/CachedResourceRequest.h:
              * loader/cache/MemoryCache.h:
              * notifications/Notification.cpp:
              * notifications/Notification.h:
              * notifications/NotificationCenter.cpp:
              * notifications/NotificationCenter.h:
              * page/Chrome.cpp:
              * page/Chrome.h:
              * page/DOMSelection.cpp:
              * page/DOMTimer.h:
              * page/DOMWindow.cpp:
              * page/EventHandler.cpp:
              * page/FocusController.h:
              * page/Geolocation.cpp:
              * page/Geolocation.h:
              * page/History.cpp:
              * rendering/RenderListBox.cpp:
              * workers/WorkerContext.cpp:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * src/WebHistoryItem.cpp:
              * src/WebNotification.cpp:
              * src/WebTextCheckingCompletionImpl.cpp:
              * src/mac/WebSubstringUtil.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * Plugins/Hosted/WebHostedNetscapePluginView.mm:
              * WebView/WebFrame.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * WebProcess/WebPage/mac/WebPageMac.mm:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b0a55f4
  2. 25 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-25 Chang Shu <cshu@webkit.org> · 595681f4
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              Code refactoring. No new tests.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::isReadOnly):
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * dom/Document.cpp:
              (WebCore::acceptsEditingFocus):
              * dom/Node.cpp:
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::shouldUseInputMethod):
              (WebCore::Node::canStartSelection):
              (WebCore::Node::rootEditableElement):
              * dom/Node.h:
              (WebCore::Node::isContentEditable):
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::rendererIsRichlyEditable):
              * dom/Position.cpp:
              (WebCore::nextRenderedEditable):
              (WebCore::previousRenderedEditable):
              (WebCore::Position::atEditingBoundary):
              (WebCore::Position::parentEditingBoundary):
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              (WebCore::Position::isCandidate):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
              * editing/AppendNodeCommand.cpp:
              (WebCore::AppendNodeCommand::AppendNodeCommand):
              (WebCore::AppendNodeCommand::doApply):
              (WebCore::AppendNodeCommand::doUnapply):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::containsNonEditableRegion):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              (WebCore::enclosingDeletableElement):
              * editing/DeleteFromTextNodeCommand.cpp:
              (WebCore::DeleteFromTextNodeCommand::doApply):
              (WebCore::DeleteFromTextNodeCommand::doUnapply):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              (WebCore::Editor::markMisspellingsOrBadGrammar):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              * editing/EditorCommand.cpp:
              (WebCore::verticalScrollDistance):
              * editing/FormatBlockCommand.cpp:
              (WebCore::enclosingBlockToSplitTreeTo):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertIntoTextNodeCommand.cpp:
              (WebCore::InsertIntoTextNodeCommand::doApply):
              (WebCore::InsertIntoTextNodeCommand::doUnapply):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
              (WebCore::InsertNodeBeforeCommand::doApply):
              (WebCore::InsertNodeBeforeCommand::doUnapply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doApply):
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectionFromNone):
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              (WebCore::SplitElementCommand::doUnapply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doUnapply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/SplitTextNodeContainingElementCommand.cpp:
              (WebCore::SplitTextNodeContainingElementCommand::doApply):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::canonicalPosition):
              * editing/WrapContentsInDummySpanCommand.cpp:
              (WebCore::WrapContentsInDummySpanCommand::doUnapply):
              (WebCore::WrapContentsInDummySpanCommand::doReapply):
              * editing/htmlediting.cpp:
              (WebCore::highestEditableRoot):
              (WebCore::lowestEditableAncestor):
              (WebCore::isEditablePosition):
              (WebCore::isRichlyEditablePosition):
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::extendRangeToWrappingNodes):
              (WebCore::enclosingNodeWithTag):
              (WebCore::enclosingNodeOfType):
              (WebCore::highestEnclosingNodeOfType):
              (WebCore::canMergeLists):
              * editing/visible_units.cpp:
              (WebCore::previousLeafWithSameEditability):
              (WebCore::previousLinePosition):
              (WebCore::nextLeafWithSameEditability):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              * html/HTMLAnchorElement.cpp:
              (WebCore::HTMLAnchorElement::supportsFocus):
              (WebCore::HTMLAnchorElement::defaultEventHandler):
              (WebCore::HTMLAnchorElement::setActive):
              (WebCore::HTMLAnchorElement::canStartSelection):
              (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
              * html/HTMLBodyElement.cpp:
              (WebCore::HTMLBodyElement::supportsFocus):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::supportsFocus):
              (WebCore::HTMLElement::isContentEditable):
              (WebCore::HTMLElement::contentEditable):
              * html/HTMLElement.h:
              * page/DragController.cpp:
              (WebCore::DragController::operationForLoad):
              (WebCore::DragController::canProcessDrag):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseReleaseEvent):
              (WebCore::EventHandler::selectCursor):
              * page/FocusController.cpp:
              (WebCore::relinquishesEditingFocus):
              * rendering/HitTestResult.cpp:
              (WebCore::HitTestResult::isContentEditable):
              * rendering/RenderBlock.cpp:
              (WebCore::positionForPointRespectingEditingBoundaries):
              (WebCore::RenderBlock::hasLineIfEmpty):
              * rendering/RenderBlockLineLayout.cpp:
              (WebCore::RenderBlock::addOverflowFromInlineChildren):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::canBeProgramaticallyScrolled):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RootInlineBox.cpp:
              (WebCore::isEditableLeaf):
              * svg/SVGAElement.cpp:
              (WebCore::SVGAElement::supportsFocus):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * src/WebNode.cpp:
              (WebKit::WebNode::isContentEditable):
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setFocus):
              (WebKit::WebViewImpl::setComposition):
              (WebKit::WebViewImpl::confirmComposition):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      595681f4
  3. 21 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-17 Ryosuke Niwa <rniwa@webkit.org> · 62b16970
      rniwa@webkit.org authored
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setComposition): Check the nullity of startContainer() instead of startPosition()->node().
              (WebKit::WebViewImpl::confirmComposition): Ditto.
              (WebKit::WebViewImpl::textInputType):
              (WebKit::WebViewImpl::caretOrSelectionBounds):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * webkit/webkitwebview.cpp:
              (webkit_web_view_popup_menu_handler):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode() except when
              calls were of the form node()->document() and node()->inDocument() in which case they were
              replaced by anchorNode()->document() and anchorNode()->inDocument() respectively.
      
              * WebCore.exp.in: Added Position::containerNode.
      
              The rest abbreviated for simplicity. Please see svn log.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62b16970
  4. 18 Jan, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-01-18 Ryosuke Niwa <rniwa@webkit.org> · 186f5bb6
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Stop instantiating legacy editing positions in DeleteSelectionCommand, IndentOudentCommand,
              InsertLineBreakCommand, InsertListCOmmand.cpp, InsertParagraphSeparatorCommand, and htmlediting.cpp
              https://bugs.webkit.org/show_bug.cgi?id=52644
      
              This is a cleanup to stop instantiating legacy editing positions in the following tests.
              firstDeepEditingPositionForNode and lastDeepEditingPositionForNode in htmlediting.h are not updated
              because doing so requires significant code changes. They are tracked on the bug 52642.
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializeStartEnd):
              (WebCore::updatePositionForNodeRemoval):
              (WebCore::DeleteSelectionCommand::removeNode):
              (WebCore::updatePositionForTextRemoval):
              (WebCore::DeleteSelectionCommand::handleGeneralDelete):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApplyForSingleParagraph):
              (WebCore::InsertListCommand::unlistifyParagraph):
              (WebCore::InsertListCommand::listifyParagraph):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/htmlediting.cpp:
              (WebCore::enclosingBlock):
              (WebCore::enclosingList):
              (WebCore::enclosingListChild):
              (WebCore::indexForVisiblePosition):
              (WebCore::isNodeVisiblyContainedWithin):
              (WebCore::avoidIntersectionWithNode):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      186f5bb6
  5. 08 Jan, 2011 1 commit
  6. 20 Dec, 2010 1 commit
    • enrica@apple.com's avatar
      Crash at WebCore::SplitElementCommand::SplitElementCommand · ca1c95ff
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=51278
      <rdar://problem/7347139> 
      
      Reviewed by Darin Adler.
      
      WebCore: 
      
      Executing outdent command on an inline blockquote that is
      not the first element in a block causes a crash.
      The fix consists in chaging the was the start of block is
      calculated in case of the inline blockquote.
              
      Test: editing/execCommand/outdent-inline-blockquote.html
            editing/execCommand/outdent-inline-list.html
      
      * editing/IndentOutdentCommand.cpp:
      (WebCore::IndentOutdentCommand::outdentParagraph):
      
      LayoutTests: 
      
      * editing/execCommand/outdent-inline-blockquote-expected.txt: Added.
      * editing/execCommand/outdent-inline-blockquote.html: Added.
      * editing/execCommand/outdent-inline-list-expected.txt: Added.
      * editing/execCommand/outdent-inline-list.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca1c95ff
  7. 06 Dec, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-12-05 Ryosuke Niwa <rniwa@webkit.org> · d87f2f64
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              Executing FormatBlock on multiple paragraphs inside pre does not remove the outer pre
              https://bugs.webkit.org/show_bug.cgi?id=47300
      
              The bug was caused by FormatBlockCommand::formatRange's not removing refNode when the refNode
              contains more than one paragraphs even when the refNode is fully selected.
      
              Fixed the bug by modifying FormatBlockCommand::formatRange to correctly remove the node in
              such a situation.
      
              Also fixed a bug in ApplyBlockElementCommand::formatSelection that the end of selection
              is not properly updated when the end of selection resides in the node split by
              rangeForParagraphSplittingTextNodesIfNeeded or endOfNextParagrahSplittingTextNodesIfNeeded.
      
              Test: editing/execCommand/format-block-multiple-paragraphs-in-pre.html
      
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::formatSelection): Calls formatRange with m_endOfLastParagraph.
              (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): Updates
              m_endOfLastParagraph when the position points to the node split by this function.
              (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded): Ditto.
              * editing/ApplyBlockElementCommand.h: Added m_endOfLastParagraph as a member variable.
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): See above.
              * editing/FormatBlockCommand.h:
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::formatRange): Ignores the end of selection.
              * editing/IndentOutdentCommand.h:
      2010-12-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              Executing FormatBlock on multiple paragraphs inside pre does not remove the outer pre
              https://bugs.webkit.org/show_bug.cgi?id=47300
      
              Added a test to ensure execCommand('FormatBlock') correctly removes pre when formatting paragraphs within.
              Also rebaselined several tests because WebKit no longer erroneously format the paragraphs immediately
              after the selection.
      
              * editing/execCommand/format-block-multiple-paragraphs-in-pre-expected.txt: Added.
              * editing/execCommand/format-block-multiple-paragraphs-in-pre.html: Added.
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: No longer erroneously format
              the last paragraph in a pre by a blockquote when formatting all but the last paragraph in the pre.
              * editing/execCommand/indent-pre-expected.txt: No longer erroneously format the last paragraph in
              the pre-list by a blockquote.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d87f2f64
  8. 26 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      Crash in CompositeEditCommand::splitTreeToNode · 2bed6dcb
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=48349
      
      Reviewed by Kent Tamura.
      
      WebCore: 
      
      The bug was caused by indentIntoBlockquote's passing null pointer to splitTreeToNode.
      Fixed the crash by adding early exits.
      
      Test: editing/execCommand/indent-node-to-split-to-crash.html
      
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::splitTreeToNode):
      * editing/IndentOutdentCommand.cpp:
      (WebCore::IndentOutdentCommand::indentIntoBlockquote):
      
      LayoutTests: 
      
      Added a test to ensure WebKit does not crash when indenting.
      
      * editing/execCommand/indent-node-to-split-to-crash-expected.txt: Added.
      * editing/execCommand/indent-node-to-split-to-crash.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2bed6dcb
  9. 15 Oct, 2010 1 commit
    • darin@apple.com's avatar
      2010-10-14 Darin Adler <darin@apple.com> · 601d44bd
      darin@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              Use more specific types for node pointers, especially when calling node insertion and removal functions
              https://bugs.webkit.org/show_bug.cgi?id=47702
      
              Refactoring. No new tests.
      
              While developing this patch I temporarily removed the node insertion and
              removal member functions from the Node class and fixed almost all call sites
              so they call it directly on the ContainerNode class, which will be important
              once we make the functions non-virtual.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::insertBefore):
              (WebCore::ContainerNode::replaceChild):
              (WebCore::ContainerNode::appendChild):
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/DynamicNodeList.cpp:
              (WebCore::DynamicNodeList::itemWithName):
              * dom/Position.cpp:
              (WebCore::Position::previous):
              (WebCore::Position::next):
              * dom/Text.cpp:
              (WebCore::Text::replaceWholeText):
              * dom/TreeWalker.cpp:
              (WebCore::TreeWalker::firstChild):
              (WebCore::TreeWalker::lastChild):
              (WebCore::TreeWalker::previousNode):
              * dom/XMLDocumentParserLibxml2.cpp:
              (WebCore::XMLDocumentParser::XMLDocumentParser):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * editing/CompositeEditCommand.h:
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::doApply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/RemoveNodeCommand.h:
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/TextIterator.cpp:
              (WebCore::parentCrossingShadowBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              * editing/markup.cpp:
              (WebCore::serializeNodes):
              (WebCore::ancestorToRetainStructureAndAppearance):
              (WebCore::createMarkup):
              * html/HTMLAreaElement.cpp:
              (WebCore::HTMLAreaElement::updateFocusAppearance):
              * html/HTMLEmbedElement.cpp:
              (WebCore::HTMLEmbedElement::rendererIsNeeded):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::rendererIsNeeded):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::attach):
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::insertedIntoTree):
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::associatedControl):
              * html/HTMLOptGroupElement.cpp:
              (WebCore::HTMLOptGroupElement::recalcSelectOptions):
              (WebCore::HTMLOptGroupElement::ownerSelectElement):
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::ownerSelectElement):
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::additionalAttributeStyleDecls):
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::additionalAttributeStyleDecls):
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::insertRow):
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::rowIndex):
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::additionalAttributeStyleDecls):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::getRangeAt):
              (WebCore::DOMSelection::containsNode):
              * rendering/RenderSVGGradientStop.cpp:
              (WebCore::RenderSVGGradientStop::gradientElement):
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::ownerSVGElement):
              (WebCore::SVGElement::viewportElement):
              * svg/SVGFELightElement.cpp:
              (WebCore::SVGFELightElement::svgAttributeChanged):
              (WebCore::SVGFELightElement::childrenChanged):
              * svg/SVGFEMergeNodeElement.cpp:
              (WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
              * svg/SVGFontFaceFormatElement.cpp:
              (WebCore::SVGFontFaceFormatElement::childrenChanged):
              * svg/SVGFontFaceUriElement.cpp:
              (WebCore::SVGFontFaceUriElement::childrenChanged):
              * svg/SVGGlyphElement.cpp:
              (WebCore::SVGGlyphElement::invalidateGlyphCache):
              * svg/SVGHKernElement.cpp:
              (WebCore::SVGHKernElement::insertedIntoDocument):
              (WebCore::SVGHKernElement::removedFromDocument):
              * svg/SVGLocatable.cpp:
              (WebCore::SVGLocatable::nearestViewportElement):
              (WebCore::SVGLocatable::farthestViewportElement):
              * svg/SVGUseElement.cpp:
              (WebCore::SVGUseElement::updateContainerOffsets):
              * svg/SVGVKernElement.cpp:
              (WebCore::SVGVKernElement::insertedIntoDocument):
              (WebCore::SVGVKernElement::removedFromDocument):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::SVGSMILElement::targetElement):
              * wml/WMLDoElement.cpp:
              (WebCore::WMLDoElement::insertedIntoDocument):
              (WebCore::WMLDoElement::removedFromDocument):
              * wml/WMLNoopElement.cpp:
              (WebCore::WMLNoopElement::insertedIntoDocument):
              * wml/WMLOptionElement.cpp:
              (WebCore::ownerSelectElement):
              * wml/WMLPostfieldElement.cpp:
              (WebCore::WMLPostfieldElement::insertedIntoDocument):
              (WebCore::WMLPostfieldElement::removedFromDocument):
              * wml/WMLSetvarElement.cpp:
              (WebCore::WMLSetvarElement::insertedIntoDocument):
              (WebCore::WMLSetvarElement::removedFromDocument):
              * wml/WMLTaskElement.cpp:
              (WebCore::WMLTaskElement::insertedIntoDocument):
              (WebCore::WMLTaskElement::removedFromDocument):
              * wml/WMLTimerElement.cpp:
              (WebCore::WMLTimerElement::insertedIntoDocument):
              (WebCore::WMLTimerElement::removedFromDocument):
              * xml/XPathStep.cpp:
              (WebCore::XPath::Step::nodesInAxis):
              Use ContainerNode* for the result of the parentNode function now that
              it returns a ContainerNode*. In the past it used to return just Node*.
      
              * dom/ContainerNode.h: Added toContainerNode.
      
              * dom/Element.h: Use ContainerNode*. Added toElement.
      
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment): Explcitly
              cast to HTMLElement* in the case that handles <html> and <body>
              elements.
              (WebCore::Element::baseURI): Use ContainerNode*.
      
              * dom/Node.cpp:
              (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc): Use ContainerNode*.
              (WebCore::Node::isDescendantOf): Ditto.
              (WebCore::Node::createRendererIfNeeded): Ditto.
              (WebCore::Node::setTextContent): Use already-typecast pointer in a call to
              appendChild.
              (WebCore::Node::ancestorElement): Use ContainerNode*.
      
              * dom/Range.cpp:
              (WebCore::Range::compareNode): Use ContainerNode*.
              (WebCore::Range::intersectsNode): Ditto.
              (WebCore::Range::processContents): Cast to ContainerNode* in a couple cases
              where we previously checked that the node in question has a child. Any node
              that returns a non-zero value for firstChild is a ContainerNode.
              (WebCore::Range::checkNodeBA): Ditto.
              (WebCore::Range::selectNode): Ditto.
              (WebCore::Range::surroundContents): Ditto.
      
              * dom/XMLDocumentParser.cpp:
              (WebCore::XMLDocumentParser::insertErrorMessageBlock): Rewrote code to use
              more specific types, document instead of doc, and paragraph instead of par.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              Use ContainerNode*.
              (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
              Use replaceElementWithSpanPreservingChildrenAndAttributes; the old function
              took a Node argument and had Node in its name.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Use ContainerNode.
              (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
              Renamed and changed to take HTMLElement. Also use ContainerNode.
              (WebCore::CompositeEditCommand::prune): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): Ditto.
      
              * editing/ReplaceNodeWithSpanCommand.cpp:
              (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand): Take an
              HTMLElement instead of a Node. Call it m_elementToReplace instead of m_node.
              (WebCore::swapInNodePreservingAttributesAndChildren): Take HTMLElement.
              (WebCore::ReplaceNodeWithSpanCommand::doApply): Updated for name changes.
              (WebCore::ReplaceNodeWithSpanCommand::doUnapply): Ditto.
              * editing/ReplaceNodeWithSpanCommand.h: Ditto.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment): Use StyledElement for result
              of insertFragmentForTestRendering since that's what it returns.
              (WebCore::ReplacementFragment::removeNode): Use ContainerNode.
              (WebCore::ReplacementFragment::insertNodeBefore): Ditto.
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): Return StyledElement.
              Use HTMLElement for body.
              (WebCore::ReplacementFragment::restoreTestRenderingNodesToFragment): Take
              StyledElement.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Use ContainerNode.
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren): Use HTMLElement for
              the cloned span, since the clone will be a sspan too.
              (WebCore::ReplaceSelectionCommand::insertAsListItems): Use ContainerNode since
              the list item has a child, and that proves it is a ContainerNode.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              Use ContainerNode and also removed an unnneded local variable.
      
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterText): Use ContainerNode.
              (WebCore::HTMLElement::insertAdjacent): Use ContainerNode and also use && to make
              the logic a little simpler.
              (WebCore::contextElementForInsertion): Use ContainerNode.
              (WebCore::HTMLElement::findFormAncestor): Ditto.
      
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::removeNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::changeTagName): Ditto.
              (WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
              (WebCore::InspectorDOMAgent::innerParentNode): Use isDocumentNode instead of
              nodeType. We should almost never use nodeType inside the engine.
              (WebCore::InspectorDOMAgent::didInsertDOMNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
      
              * wml/WMLOptGroupElement.cpp: Removed unneeded overrides of insertBefore,
              replaceChild, removeChild, appendChild, and removeChildren functions.
              Ths already overrides childrenChanged, that is called by all of the above,
              and it does the same thing these functions did.
              (WebCore::ownerSelectElement): Use ContainerNode.
              * wml/WMLOptGroupElement.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      601d44bd
  10. 07 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-07 Ryosuke Niwa <rniwa@webkit.org> · 148eaf51
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              REGRESSION: Indenting pre duplicates content
              https://bugs.webkit.org/show_bug.cgi?id=47233
      
              The bug was caused by our not splitting text nodes properly.
      
              In new approach, we split text nodes in each iteration. Added rangeForParagraphSplitingTextNodesIfNeeded
              to split text nodes at the start and at the end of paragraph, which also adjusts start and end positions
              for moveParagraphWithClones. Added endOfNextParagrahSplittingTextNodesIfNeeded to adjust endOfNextParagraph,
              start, and end to work-around moveParagraphWithClones's removing a line feed.
      
              Tests: editing/execCommand/indent-pre-list.html
                     editing/execCommand/indent-pre-paragraphs.html
      
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::formatSelection): See above.
              (WebCore::isNewLineAtPosition):
              (WebCore::renderStyleOfEnclosingTextNode): Added.
              (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): Added.
              (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded): Added.
              * editing/ApplyBlockElementCommand.h:
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): Takes two Positions instead of one VisiblePosition.
              * editing/FormatBlockCommand.h:
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Ditto.
              (WebCore::IndentOutdentCommand::indentIntoBlockquote): Ditto.
              (WebCore::IndentOutdentCommand::formatRange): Ditto.
              * editing/IndentOutdentCommand.h:
      2010-10-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              REGRESSION: Indenting pre duplicates content
              https://bugs.webkit.org/show_bug.cgi?id=47233
      
              Added tests to ensure WebKit indents texts inside pre correctly.
      
              * editing/execCommand/indent-pre-expected.txt: This test passes if WebKit does not crash.
              * editing/execCommand/indent-pre-list-expected.txt: Added.
              * editing/execCommand/indent-pre-list.html: Added.
              * editing/execCommand/indent-pre-paragraphs-expected.txt: Added.
              * editing/execCommand/indent-pre-paragraphs.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      148eaf51
  11. 01 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-01 Ryosuke Niwa <rniwa@webkit.org> · 850699fa
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              FormatBlockCommand and IndentOutdentCommand should use the same code to iterate paragraphs
              https://bugs.webkit.org/show_bug.cgi?id=46840
      
              Added ApplyBlockElementCommand, which is an abstract class inherited by FormatBlockCommand
              and IndentOutdentCommand.  It is intended to be inherited by InsertListCommand as well.
      
              ApplyBlockElementCommand's doApply verifies the current selection and exits early
              if it's invalid or orphaned or if the current selection is outside editable region.
              It then calls formatSelection to apply the block element after which doApply restores the selection.
              formatSelection iterates through paragraphs and calls formatParagraph, a pure virtual function
              implemented by FormatBlockCommand and IndentOutdentCommand, on each paragraph.
      
              No new tests are added since this is a refactoring.
      
              * Android.mk: Added ApplyBlockElementCommand.cpp.
              * CMakeLists.txt: Ditto.
              * GNUmakefile.am: Added ApplyBlockElementCommand.cpp and ApplyBlockElementCommand.h.
              * WebCore.gypi: Ditto.
              * WebCore.pro: Ditto.
              * WebCore.xcodeproj/project.pbxproj: Ditto.
              * editing/ApplyBlockElementCommand.cpp: Added.
              (WebCore::countParagraphs): Moved from IndentOutdentCommand.cpp
              (WebCore::ApplyBlockElementCommand::ApplyBlockElementCommand): Added.
              (WebCore::ApplyBlockElementCommand::doApply): Moved from IndentOutdentCommand::doApply.
              (WebCore::ApplyBlockElementCommand::formatSelection): Moved from IndentOutdentCommand::indentRegion.
              (WebCore::ApplyBlockElementCommand::createBlockElement): Added.
              (WebCore::ApplyBlockElementCommand::splitTextNodes): Moved from IndentOutdentCommand::splitTextNodes.
              * editing/ApplyBlockElementCommand.h: Added.
              * editing/EditingAllInOne.cpp:
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp: Removed doApply.
              (WebCore::FormatBlockCommand::FormatBlockCommand): Calls ApplyBlockElementCommand's constructor.
              (WebCore::FormatBlockCommand::formatParagraph): Renamed from doApplyForSingleParagraph.
              * editing/FormatBlockCommand.h: FormatBlockCommand inherits from ApplyBlockElementCommand.
              (WebCore::FormatBlockCommand::create): Uses QualifiedName for the tag name instead of AtomicString.
              * editing/IndentOutdentCommand.cpp: Removed doApply, indentIntoBlockquote, and splitTextNodes.
              (WebCore::IndentOutdentCommand::IndentOutdentCommand): Calls ApplyBlockElementCommand's constructor.
              (WebCore::IndentOutdentCommand::indentIntoBlockquote): The code to nullify targetBlockquote
              when the next paragraph is in a different table cell is moved to ApplyBlockElementCommand::formatSelection.
              (WebCore::IndentOutdentCommand::formatSelection): Added. Calls outdentRegion when outdenting.
              (WebCore::IndentOutdentCommand::formatParagraph): Added. Calls tryIndentingAsListItem and indentIntoBlockquote.
              * editing/IndentOutdentCommand.h: IndentOutdentCommand inherits from ApplyBlockElementCommand.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      850699fa
  12. 25 Aug, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-08-25 Ryosuke Niwa <rniwa@webkit.org> · d39a1e73
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Various designmode=&quot;on&quot;/&quot;off&quot; &amp; execCommand(&quot;Undo&quot;) NULL pointer crashes
              https://bugs.webkit.org/show_bug.cgi?id=32823
      
              The bug was caused by changeSelectionAfterCommand which updates the selection
              without checking the whether new selection is valid or not.
      
              Fixed changeSelectionAfterCommand so that it won't update the selection
              when either end of the new selection is orphaned. Also fixed various editing commands
              to exit early if either end of the selection is orphaned.
      
              Tests: editing/undo/orphaned-selection-crash-bug32823-1.html
                     editing/undo/orphaned-selection-crash-bug32823-2.html
                     editing/undo/orphaned-selection-crash-bug32823-3.html
                     editing/undo/orphaned-selection-crash-bug32823-4.html
      
              * editing/Editor.cpp:
              (WebCore::Editor::changeSelectionAfterCommand): No longer sets orphaned selection.
              * editing/VisibleSelection.h:
              (WebCore::VisibleSelection::isNonOrphanedRange): Added.
              (WebCore::VisibleSelection::isNonOrphanedCaretOrRange): Added.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::doApply): Added an early exist. See above.
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::doApply): Ditto.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::doApply): Ditto.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Ditto.
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply): Ditto.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input): Ditto.
              * editing/MoveSelectionCommand.cpp:
              (WebCore::MoveSelectionCommand::doApply): Ditto.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Ditto.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Ditto.
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::doApply): Ditto.
              * editing/UnlinkCommand.cpp:
              (WebCore::UnlinkCommand::doApply): Ditto.
      2010-08-25  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Various designmode="on"/"off" & execCommand("Undo") NULL pointer crashes
              https://bugs.webkit.org/show_bug.cgi?id=32823
      
              These tests ensure WebKit doesn't crash when undoing some editing commands failed
              and either end of endingSelection() became orphaned.
              All tests are copied from the bug to prevent regression.
      
              * editing/undo/orphaned-selection-crash-bug32823-1-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-1.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-2-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-2.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-3-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-3.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-4-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-4.html: Added.
              * editing/undo/redo-split-text-with-removal-expected.txt: Caret is restored.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d39a1e73
  13. 09 Jul, 2010 1 commit
  14. 27 May, 2010 1 commit
    • darin@apple.com's avatar
      2010-05-27 Darin Adler <darin@apple.com> · 8faae44c
      darin@apple.com authored
              Reviewed by David Levin.
      
              Make more HTML DOM members private, especially constructors
              https://bugs.webkit.org/show_bug.cgi?id=39697
      
              Refactoring, so no new tests needed.
      
              Working my way through HTMLTagNames.in from top to bottom, skipping any
              that are non-trivial for some reason.
      
              * html/HTMLTagNames.in: Removed createWithNew from audio, base, basefont,
              blockquote, body, br, button, canvas, caption, col, colgroup, datagrid,
              datalist, dcell, dcol, drow, del, dir, dl, and fieldset.
      
              * mathml/mathtags.in: Removed createWithNew from msub, and msup.
      
              * dom/Document.cpp:
              (WebCore::Document::implicitClose): Use create function instead of new.
              (WebCore::Document::getCSSCanvasElement): Ditto.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::createIndentBlockquoteElement): Ditto.
              * editing/htmlediting.cpp:
              (WebCore::createBreakElement): Ditto.
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::createCaption): Ditto.
              * html/HTMLViewSourceDocument.cpp:
              (WebCore::HTMLViewSourceDocument::createContainingTable): Ditto.
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::setInnerTextValue): Ditto.
      
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::handleError): Use create function instead of new.
              Required reordering the code slightly, but the new order works fine.
      
              * html/HTMLAudioElement.cpp:
              (WebCore::HTMLAudioElement::create):
              * html/HTMLAudioElement.h:
              * html/HTMLBRElement.cpp:
              (WebCore::HTMLBRElement::create):
              * html/HTMLBRElement.h:
              * html/HTMLBaseElement.cpp:
              (WebCore::HTMLBaseElement::create):
              * html/HTMLBaseElement.h:
              * html/HTMLBaseFontElement.cpp:
              (WebCore::HTMLBaseFontElement::create):
              * html/HTMLBaseFontElement.h:
              * html/HTMLBlockquoteElement.cpp:
              (WebCore::HTMLBlockquoteElement::create):
              * html/HTMLBlockquoteElement.h:
              * html/HTMLBodyElement.cpp:
              (WebCore::HTMLBodyElement::create):
              * html/HTMLBodyElement.h:
              * html/HTMLButtonElement.cpp:
              (WebCore::HTMLButtonElement::create):
              * html/HTMLButtonElement.h:
              * html/HTMLCanvasElement.cpp:
              (WebCore::HTMLCanvasElement::create):
              * html/HTMLCanvasElement.h:
              * html/HTMLDListElement.cpp:
              (WebCore::HTMLDListElement::create):
              * html/HTMLDListElement.h:
              * html/HTMLDataGridCellElement.cpp:
              (WebCore::HTMLDataGridCellElement::create):
              * html/HTMLDataGridCellElement.h:
              * html/HTMLDataGridColElement.cpp:
              (WebCore::HTMLDataGridColElement::create):
              * html/HTMLDataGridColElement.h:
              * html/HTMLDataGridElement.cpp:
              (WebCore::HTMLDataGridElement::create):
              * html/HTMLDataGridElement.h:
              * html/HTMLDataGridRowElement.cpp:
              (WebCore::HTMLDataGridRowElement::create):
              * html/HTMLDataGridRowElement.h:
              * html/HTMLDataListElement.cpp:
              (WebCore::HTMLDataListElement::create):
              * html/HTMLDataListElement.h:
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setInnerText):
              * html/HTMLFieldSetElement.cpp:
              (WebCore::HTMLFieldSetElement::create):
              * html/HTMLFieldSetElement.h:
              * html/HTMLModElement.cpp:
              (WebCore::HTMLModElement::HTMLModElement):
              (WebCore::HTMLModElement::create):
              * html/HTMLModElement.h:
              * html/HTMLTableCaptionElement.cpp:
              (WebCore::HTMLTableCaptionElement::create):
              * html/HTMLTableCaptionElement.h:
              Made constructors and virtual function overrides private, added create functions.
              Made constructors inline in cases where they were called in only one place.
      
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::HTMLTableColElement): Changed data member name
              from _span to m_span.
              (WebCore::HTMLTableColElement::create): Added.
              (WebCore::HTMLTableColElement::parseMappedAttribute): Updated to use m_span.
              * html/HTMLTableColElement.h:
              Made constructor and virtual function overrides private, added create function.
              Renamed _span to m_span.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8faae44c
  15. 18 May, 2010 1 commit
  16. 27 Jan, 2010 1 commit
    • eric@webkit.org's avatar
      2010-01-27 Tony Chang <tony@chromium.org> · 1d23c496
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              Fix a crash when trying to indent a block element that was contained
              in a list.  This was happening because enclosingBlock() in
              htmlediting.cpp can return the current the same Node when a block
              element (like an <hr> or a <table>) is passed in.  This causes
              the indent command to think that it is not in a list item.
      
              Work around this by checking to see if enclosingBlock returned the
              same Node.
      
              https://bugs.webkit.org/show_bug.cgi?id=32390
      
              * editing/execCommand/indent-block-in-list-expected.txt: Added.
              * editing/execCommand/indent-block-in-list.html: Added.
      2010-01-27  Tony Chang  <tony@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Fix a crash when trying to indent a block element that was contained
              in a list.  This was happening because enclosingBlock() in
              htmlediting.cpp can return the current the same Node when a block
              element (like an <hr> or a <table>) is passed in.  This causes
              the indent command to think that it is not in a list item.
      
              Work around this by checking to see if enclosingBlock returned the
              same Node.
      
              https://bugs.webkit.org/show_bug.cgi?id=32390
      
              Test: editing/execCommand/indent-block-in-list.html
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1d23c496
  17. 04 Dec, 2009 1 commit
  18. 04 Nov, 2009 1 commit
    • enrica@apple.com's avatar
      WebCore: Hang in Mail on attempting to change indent level. · e2bfdba3
      enrica@apple.com authored
      <rdar://problem/7131805>
      https://bugs.webkit.org/show_bug.cgi?id=31127
      
      Reviewed by Adele Peterson.
      
      The hang was caused by an infinite loop inside outdentRegion.
      The code did not account for the fact that, when a list item
      cointains multiple paragraphs, outdent moves all paragraphs at
      once, invalidating some of the position we keep track of in the loop.
      Some code refactoring has also been done to minimize duplicate code.
              
      Test: editing/execCommand/outdent-multiparagraph-list.html
      
      * editing/IndentOutdentCommand.cpp:
      (WebCore::IndentOutdentCommand::indentRegion): Moved code in common with
      outdentRegion to doApply.
      (WebCore::IndentOutdentCommand::outdentRegion): Fixed endless loop.
      (WebCore::IndentOutdentCommand::doApply): Some code refactoring.
      * editing/IndentOutdentCommand.h: Added VisiblePosition parameters to
      indentRegion and outdentRegion.
      
      LayoutTests: Hang in Mail on attempting to change indent level
      <rdar://problem/7131805>
      https://bugs.webkit.org/show_bug.cgi?id=31127
              
      Reviewed by Adele Peterson.
      
      Added test to cover all the different code paths.
      
      * editing/execCommand/outdent-multiparagraph-list-expected.txt: Added.
      * editing/execCommand/outdent-multiparagraph-list.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2bfdba3
  19. 23 Oct, 2009 1 commit
    • adele@apple.com's avatar
      REGRESSION: Copy is copying incorrect background-color · 4e6db62c
      adele@apple.com authored
      <rdar://problem/7248529>
      https://bugs.webkit.org/show_bug.cgi?id=29697
      
      Patch by Enrica Casucci <enrica@apple.com> on 2009-10-23
      Reviewed by Adele Peterson.
      
      WebCore: 
      
      Test: editing/execCommand/indent-paragraphs.html
      
      This change removes the BackgroundColor from the list 
      of inheritable CSS properties and changes significantly
      the way we perform indentation.
      The new implementation of IndentOutdentCommand uses a new method
      defined in CompositeEditCommand called moveParagraphWithClones.
      This is an improved version of the original moveParagraph that
      is aimed at preserving the original markup of the paragraph being
      moved.
      
      * editing/ApplyStyleCommand.cpp:
      (WebCore::): removed CSSPropertyBackgroundColor from editingStyleProperties.
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::CompositeEditCommand): Removed trailing blanks.
      (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Removed trailing blanks.
      (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): Added.
      (WebCore::CompositeEditCommand::cleanupAfterDeletion): Added.
      (WebCore::CompositeEditCommand::moveParagraphWithClones): Added.
      (WebCore::CompositeEditCommand::moveParagraphs): Modified to use cleanupAfterDeletion.
      (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Removed trailing blanks.
      (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): Removed trailing blanks.
      (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary): Removed trailing blanks.
      * editing/CompositeEditCommand.h: Added three new methods.
      * editing/IndentOutdentCommand.cpp:
      (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Changed to use moveParagraphWithClones.
      (WebCore::IndentOutdentCommand::indentIntoBlockquote): Changed to use moveParagraphWithClones.
      (WebCore::IndentOutdentCommand::indentRegion): Removed comment.
      * editing/IndentOutdentCommand.h: Removed prepareBlockquoteLevelForInsertion method.
      
      LayoutTests: 
      
      All the following tests have been re-baselined because
      the indent command now preserves the original markup.
      A new test (indent-paragraph.html) has been added to test
      several indent combinations not covered by the existing tests.
              
      * editing/execCommand/19087-expected.txt:
      * editing/execCommand/19653-1-expected.txt:
      * editing/execCommand/indent-div-inside-list-expected.txt:
      * editing/execCommand/indent-nested-blockquotes-expected.txt:
      * editing/execCommand/indent-nested-div-expected.txt:
      * editing/execCommand/indent-paragraphs.html: Added.
      * editing/execCommand/indent-second-paragraph-in-blockquote-expected.txt:
      * editing/execCommand/indent-with-style-expected.txt:
      * editing/inserting/5994480-2-expected.txt:
      * platform/mac/editing/execCommand/4641880-2-expected.txt:
      * platform/mac/editing/execCommand/4916541-expected.txt:
      * platform/mac/editing/execCommand/5138441-expected.txt:
      * platform/mac/editing/execCommand/5481523-expected.txt:
      * platform/mac/editing/execCommand/indent-paragraphs-expected.txt: Added.
      * platform/mac/editing/execCommand/indent-selection-expected.txt:
      * platform/mac/editing/pasteboard/select-element-1-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4e6db62c
  20. 09 Oct, 2009 1 commit
    • eric@webkit.org's avatar
      2009-10-09 Enrica Casucci <enrica@apple.com> · bdccb1c7
      eric@webkit.org authored
              Reviewed by Adele Peterson.
      
              Undoing a indent removes text instead of it's formatting.
              <rdar://problem/7169206>
              https://bugs.webkit.org/show_bug.cgi?id=28722
              Added test case for https://bugs.webkit.org/show_bug.cgi?id=23995
      
              * editing/execCommand/19653-1-expected.txt: Re-baselined.
              * editing/execCommand/indent-div-inside-list-expected.txt: Re-baselined.
              * editing/execCommand/indent-nested-blockquotes-expected.txt: Re-baselined.
              * editing/execCommand/indent-nested-div-expected.txt: Re-baselined.
              * editing/execCommand/indent-second-paragraph-in-blockquote-expected.txt: Re-baselined.
              * editing/execCommand/indent-with-style-expected.txt: Added.
              * editing/execCommand/indent-with-style.html: Added.
              * editing/undo/undo-indent-expected.txt: Added.
              * editing/undo/undo-indent.html: Added.
              * platform/mac/editing/execCommand/4641880-2-expected.txt: Re-baselined.
              * platform/mac/editing/execCommand/4916541-expected.txt: Re-baselined.
              * platform/mac/editing/execCommand/5138441-expected.txt: Re-baselined.
              * platform/mac/editing/execCommand/5481523-expected.txt: Re-baselined.
              * platform/mac/editing/execCommand/indent-selection-expected.txt: Re-baselined.
      2009-10-09  Enrica Casucci  <enrica@apple.com>
      
              Reviewed by Adele Peterson.
      
              Undoing a indent removes text instead of it's formatting.
              <rdar://problem/7169206>
              https://bugs.webkit.org/show_bug.cgi?id=28722
              Restored the behavior prior to http://trac.webkit.org/changeset/46143. This change implemented the
              indent command making simple DOM operation, without using moveParagraph which cause undo to be broken.
      
              Added editing/undo/undo-indent.html test.
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion): Restored.
              (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Merged changes.
              (WebCore::IndentOutdentCommand::indentIntoBlockquote): Restored.
              (WebCore::IndentOutdentCommand::indentRegion): Restored and added call to updateLayout to
              ensure TextIterator could correctly calculate the position starting from the index.
              * editing/IndentOutdentCommand.h: Restored.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bdccb1c7
  21. 16 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-16 Enrica Casucci <enrica@apple.com> · 0772608c
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              Reorganizing helper functions in htmlediting.h to group them by type of object they return/operate upon.
              https://bugs.webkit.org/show_bug.cgi?id=29319
      
              * editing/IndentOutdentCommand.cpp:
              Removed implementation of isAtUnsplittableElement.
      
              * editing/IndentOutdentCommand.h:
              Removed member function isAtUnsplittableElement, because it was not class specific and belonged logically among the helper functions.
      
              * editing/htmlediting.cpp:
              (WebCore::isAtUnsplittableElement): added. The code was taken from IndentOutdentCommand.
      
              * editing/htmlediting.h:
              Reordered functions to group them by type of object returned or operate upon.
              Added comments.
              Added isAtUnsplittableElement declaration.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0772608c
  22. 09 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-07-30 Eric Seidel <eric@webkit.org> · f74ae5cf
      eric@webkit.org authored
              Reviewed by Adam Barth.
      
              Rename positionBeforeNode to positionInParentBeforeNode
              and positionAfterNode to positionInParentAfterNode
              in preparation for adding a positionBeforeNode
              which returns a neighbor-anchored position.
              https://bugs.webkit.org/show_bug.cgi?id=25494
      
              No functional changes, thus no tests.
      
              * dom/PositionConstructors.h:
              (WebCore::positionInParentBeforeNode):
              (WebCore::positionInParentAfterNode):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionOutsideTabSpan):
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/CreateLinkCommand.cpp:
              (WebCore::CreateLinkCommand::doApply):
              * editing/DeleteButtonController.cpp:
              (WebCore::DeleteButtonController::deleteTarget):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializeStartEnd):
              (WebCore::updatePositionForNodeRemoval):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::rangeCompliantEquivalent):
              (WebCore::positionBeforeContainingSpecialElement):
              (WebCore::positionAfterContainingSpecialElement):
              (WebCore::positionBeforeTabSpan):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f74ae5cf
  23. 20 Aug, 2009 1 commit
    • eric@webkit.org's avatar
      2009-08-20 Ryosuke Niwa <rniwa@webkit.org> · c36cc498
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              REGESSION(r45316), Crash: WebKit crashes in Google Sites when indenting a table
              https://bugs.webkit.org/show_bug.cgi?id=28474
      
              This patch adds a test to make sure WebKit does not crash when indenting immediately right to a table.
      
              * editing/execCommand/indent-right-after-table-expected.txt: Added.
              * editing/execCommand/indent-right-after-table.html: Added.
      2009-08-20  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              REGESSION(r45316), Crash: WebKit crashes in Google Sites when indenting a table
              https://bugs.webkit.org/show_bug.cgi?id=28474
      
              This patch fixes a crash when indenting at right after a table.
              The bug was caused by Node* blockNode = enclosingBlock(endOfCurrentParagraph.deepEquivalent().node());
              where node() is equal to blockNode. Because blockNode is the enclosing block node, this patch changes it to
              enclosingBlock(endOfCurrentParagraph.deepEquivalent().node()->parentNode());
      
              Test: editing/execCommand/indent-right-after-table.html
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion): Fixed so that blockNode != endOfCurrentParagraph.deepEquivalent().node()
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c36cc498
  24. 01 Aug, 2009 1 commit
    • rniwa@webkit.org's avatar
      2009-08-01 Ryosuke Niwa <rniwa@webkit.org> · 6d9518c1
      rniwa@webkit.org authored
              Reviewed by Adele Peterson.
      
              isContentEditable function in htmlediting.* must be removed
              https://bugs.webkit.org/show_bug.cgi?id=27870
      
              This patch removes isContentEditable function in htmlediting.cpp and
              replaces all usage by calling Node::isContentEditable or its derivatives.
      
              * editing/AppendNodeCommand.cpp: ditto
              (WebCore::AppendNodeCommand::AppendNodeCommand): ditto
              * editing/IndentOutdentCommand.cpp: ditto
              (WebCore::IndentOutdentCommand::outdentParagraph): ditto
              * editing/InsertNodeBeforeCommand.cpp: ditto
              (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand): ditto
              * editing/htmlediting.cpp: ditto
              (WebCore::enclosingNodeWithTag): ditto
              (WebCore::enclosingNodeOfType): ditto
              (WebCore::canMergeLists): ditto
              * editing/htmlediting.h: Updated prototype
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6d9518c1
  25. 20 Jul, 2009 2 commits
    • rniwa@webkit.org's avatar
      2009-07-20 Ryosuke Niwa <rniwa@webkit.org> · 63b12e13
      rniwa@webkit.org authored
              Reviewed by Simon Fraser.
      
              REGRESSION (r46142): Need to remove showTreeThisForThis
              https://bugs.webkit.org/show_bug.cgi?id=27475
      
              Removes showTreeThisForThis
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::appendParagraphIntoNode):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      63b12e13
    • rniwa@webkit.org's avatar
      WebCore: · d96f5b41
      rniwa@webkit.org authored
      2009-07-19  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Refactoring of indentRegion to fix bugs 26816 and 25317
              https://bugs.webkit.org/show_bug.cgi?id=26816
              https://bugs.webkit.org/show_bug.cgi?id=25317
              https://bugs.webkit.org/show_bug.cgi?id=23995 (partially)
      
              This patch implements appendParagraphIntoNode, a simpler specialized version of moveParagraph
              and replaces all calls inside indentRegion. The following is the new behavior of indentRegion.
      
              1. We try to indent as many wrapping nodes as possible.
                 e.g. when indenting "hello" in <div>hello</div>, we try to indent div as well.
              2. We do not delete any wrapping elements
                 With moveParagraph, we used to remove all wrapping nodes, and replaced with a blockquote.
                 This was causing https://bugs.webkit.org/show_bug.cgi?id=23995 for indentation.
                 With appendParagraphIntoNode, we can preserve all wrapping nodes.
              3. We only split the tree until the closest block node instead of until the root editable node.
                 This behavioral change fixes the bug 25317.
              4. When multiple paragraphs are indented, we indent the highest common ancestor within the selection.
                 e.g. when a list is a child node of a div, and the entire div is intended,
                      we enclose the div by a single blockquote.
      
              Note that new behavior is more consistent with that of Internet Explorer and Firefox.
              To demonstrate this, the following tests are added.
      
              Tests: editing/execCommand/indent-div-inside-list.html
                     editing/execCommand/indent-nested-blockquotes.html
                     editing/execCommand/indent-nested-div.html
                     editing/execCommand/indent-second-paragraph-in-blockquote.html
      
              * editing/IndentOutdentCommand.cpp: prepareBlockquoteLevelForInsertion is removed
              (WebCore::IndentOutdentCommand::tryIndentingAsListItem): uses appendParagraphIntoNode now
              (WebCore::IndentOutdentCommand::indentIntoBlockquote): uses appendParagraphIntoNode now
              (WebCore::IndentOutdentCommand::appendParagraphIntoNode): removes a paragraph and appends it to a new node
              (WebCore::IndentOutdentCommand::removeUnnecessaryLineBreakAt): removes a break element at the specified position
              (WebCore::IndentOutdentCommand::indentRegion): exhibits the described behavior
              * editing/IndentOutdentCommand.h: updated prototype
              * editing/execCommand/19653-1-expected.txt: rebaselined (no longer removes wrapping div)
              * editing/execCommand/indent-div-inside-list-expected.txt: Added.
              * editing/execCommand/indent-div-inside-list.html: Added.
              * editing/execCommand/indent-nested-blockquotes-expected.txt: Added.
              * editing/execCommand/indent-nested-blockquotes.html: Added.
              * editing/execCommand/indent-nested-div-expected.txt: Added.
              * editing/execCommand/indent-nested-div.html: Added.
              * editing/execCommand/indent-nested-lists-2-expected.txt: rebaselined (selection corrected)
              * editing/execCommand/indent-nested-lists-3-expected.txt: rebaselined (selection corrected)
              * editing/execCommand/indent-nested-lists-4-expected.txt: rebaselined (selection corrected)
              * editing/execCommand/indent-nested-lists-5-expected.txt: rebaselined (selection corrected)
              * editing/execCommand/indent-second-paragraph-in-blockquote-expected.txt: Added.
              * editing/execCommand/indent-second-paragraph-in-blockquote.html: Added.
              * platform/mac/editing/execCommand/4641880-2-expected.txt: rebaselined
              * platform/mac/editing/execCommand/4916541-expected.txt: rebaselined (no longer removes wrapping span)
              * platform/mac/editing/execCommand/5138441-expected.txt: rebaselined
              * platform/mac/editing/execCommand/5481523-expected.txt: rebaselined
              * platform/mac/editing/execCommand/indent-selection-expected.txt: rebaselined
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d96f5b41
  26. 14 Jul, 2009 1 commit
    • jparent@chromium.org's avatar
      WebCore: · 17a316eb
      jparent@chromium.org authored
      2009-07-14  Ryosuke Niwa  <rniwa@google.com>
      
              Reviewed by Eric Seidel.
      
              Outdenting a line inside a blockquote tag does nothing
              https://bugs.webkit.org/show_bug.cgi?id=25316
      
              The bug was caused by the code checking whether the blockquote is created by WebKit or not.
              We simply remove this code to be consistent with Firefox and Internet Explorer.
              Also, enclosingBlockFlow == enclosingNode in outdentParagraph isn't a sufficient condition to insert
              the placeholder before the enclosingNode because there could be contents before the current paragraph.
              Instead, we should split the enclosingNode (which is a blockquote) at the starting position of outdentation.
              It turned out that this solves the bug 25315 also: https://bugs.webkit.org/show_bug.cgi?id=25315
      
              Test: editing/execCommand/outdent-regular-blockquote.html
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::isIndentBlockquote): no longer checks whether a blockquote is created by WebKit or not.
              (WebCore::IndentOutdentCommand::outdentParagraph): takes care of the case enclosingBlockFlow == enclosingNode
      
      LayoutTests:
      
      2009-07-14  Ryosuke Niwa  <rniwa@google.com>
      
              Reviewed by Eric Seidel.
      
              Outdenting a line inside a blockquote tag does nothing
              https://bugs.webkit.org/show_bug.cgi?id=25315
              https://bugs.webkit.org/show_bug.cgi?id=25316
      
              The expected result for /editing/execCommand/outdent-selection-expected.html
              was rebaselined since the original expected result was wrong (Bug 25315).
              Namely, "ipsum" moved to the same paragraph as "more Lorem!"
              ("ipsum" was in the blockblock immediately below "more Lorem!")
              and "Dolor" was moved above the list items "Foo", "Bar", and "Baz".
      
              * editing/execCommand/outdent-regular-blockquote-expected.txt: Added.
              * editing/execCommand/outdent-regular-blockquote.html: Added.
              * platform/mac/editing/execCommand/outdent-selection-expected.checksum:
              * platform/mac/editing/execCommand/outdent-selection-expected.png:
              * platform/mac/editing/execCommand/outdent-selection-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      17a316eb
  27. 06 Jul, 2009 1 commit
    • ojan@chromium.org's avatar
      WebCore: · 9e3e7f0e
      ojan@chromium.org authored
      2009-07-06  Ojan Vafai  <ojan@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Fix crash when indenting in an empty table cell.
              https://bugs.webkit.org/show_bug.cgi?id=26872
      
              The crash is that we would call splitTreeToNode where the node
              and the nodeToSplitTo were the same node.
      
              Test: editing/execCommand/indent-empty-table-cell.html
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode):
              Added an assert in that node and nodeToSplitTo
              are different nodes to make this assumption explicit.
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::isAtUnsplittableElement):
              (WebCore::IndentOutdentCommand::indentRegion):
              * editing/IndentOutdentCommand.h:
      
      LayoutTests:
      
      2009-07-06  Ojan Vafai  <ojan@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Fix crash when indenting in an empty table cell.
              https://bugs.webkit.org/show_bug.cgi?id=26872
      
              The crash is that we would call splitTreeToNode where the node
              and the nodeToSplitTo were the same node.
      
              * editing/execCommand/indent-empty-table-cell-expected.txt: Added.
              * editing/execCommand/indent-empty-table-cell.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9e3e7f0e
  28. 27 Jun, 2009 1 commit
    • bfulgham@webkit.org's avatar
      WebCore: · bb35f878
      bfulgham@webkit.org authored
      2009-06-27  Ryosuke Niwa  <rniwa@google.com>
      
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=26762
      
              Clean up for IndentOutdentCommand::indentRegion, and solved most of problems related to the bug 21712.
              https://bugs.webkit.org/show_bug.cgi?id=21712
      
              Added few utility functions to htmlediting.h/cpp
      
              isVisibilyAdjacent checks whether the first position is visibly next to the second position.
              i.e. there is no visible node between the first and second positions
      
              canMergeLists checks whether two lists can be merged.
              It checks the type of list, the editing boundary, and adjacency of the lists.
      
              Tests: editing/execCommand/indent-nested-lists-1.html
                     editing/execCommand/indent-nested-lists-2.html
                     editing/execCommand/indent-nested-lists-3.html
                     editing/execCommand/indent-nested-lists-4.html
                     editing/execCommand/indent-nested-lists-5.html
                     editing/execCommand/indent-nested-lists-6.html
                     editing/execCommand/indent-nested-lists-7.html
                     editing/execCommand/outdent-nested-lists-1.html
                     editing/execCommand/outdent-nested-lists-2.html
                     editing/execCommand/outdent-nested-lists-3.html
                     editing/execCommand/outdent-nested-lists-4.html
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
              (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
              (WebCore::IndentOutdentCommand::indentIntoBlockquote):
              (WebCore::IndentOutdentCommand::indentRegion):
              * editing/IndentOutdentCommand.h:
              * editing/htmlediting.cpp:
              (WebCore::enclosingListChild):
              (WebCore::canMergeLists):
              (WebCore::isVisibilyAdjacent):
              * editing/htmlediting.h:
      
      LayoutTests:
      
      2009-06-27  Ryosuke Niwa  <set EMAIL_ADDRESS environment variable>
      
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=26762
      
              Clean up for IndentOutdentCommand::indentRegion, and solved most of problems related to the bug 21712.
              https://bugs.webkit.org/show_bug.cgi?id=21712
              
              The following test cases are intended for 21712, but included here
              since this patch already solved a lot of problems.
      
              * editing/execCommand/indent-nested-lists-1-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-1.html: Added.
              * editing/execCommand/indent-nested-lists-2-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-2.html: Added.
              * editing/execCommand/indent-nested-lists-3-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-3.html: Added.
              * editing/execCommand/indent-nested-lists-4-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-4.html: Added.
              * editing/execCommand/indent-nested-lists-5-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-5.html: Added.
              * editing/execCommand/indent-nested-lists-6-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-6.html: Added.
              * editing/execCommand/indent-nested-lists-7-expected.txt: Added.
              * editing/execCommand/indent-nested-lists-7.html: Added.
              * editing/execCommand/outdent-nested-lists-1-expected.txt: Added.
              * editing/execCommand/outdent-nested-lists-1.html: Added.
              * editing/execCommand/outdent-nested-lists-2-expected.txt: Added.
              * editing/execCommand/outdent-nested-lists-2.html: Added.
              * editing/execCommand/outdent-nested-lists-3-expected.txt: Added.
              * editing/execCommand/outdent-nested-lists-3.html: Added.
              * editing/execCommand/outdent-nested-lists-4-expected.txt: Added.
              * editing/execCommand/outdent-nested-lists-4.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb35f878
  29. 14 May, 2009 3 commits
    • kmccullough@apple.com's avatar
      WebCore: · ed0a7b9c
      kmccullough@apple.com authored
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              - Resubmitting previous patch, correctly this time.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
      
      LayoutTests:
      
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              - Resubmitting previous patch, correctly this time.
      
              * editing/execCommand/outdent-blockquote-test1.html: Copied from editing/execCommand/outdent-blockquote-test1.html.
              * editing/execCommand/outdent-blockquote-test2.html: Copied from editing/execCommand/outdent-blockquote-test2.html.
              * editing/execCommand/outdent-blockquote-test3.html: Copied from editing/execCommand/outdent-blockquote-test3.html.
              * editing/execCommand/outdent-blockquote-test4.html: Copied from editing/execCommand/outdent-blockquote-test4.html.
              * platform/mac/editing/execCommand/outdent-blockquote-test1-expected.txt: Copied from platform/mac/editing/execCommand/outdent-blockquote-test1-expected.txt.
              * platform/mac/editing/execCommand/outdent-blockquote-test2-expected.txt: Copied from platform/mac/editing/execCommand/outdent-blockquote-test2-expected.txt.
              * platform/mac/editing/execCommand/outdent-blockquote-test3-expected.txt: Copied from platform/mac/editing/execCommand/outdent-blockquote-test3-expected.txt.
              * platform/mac/editing/execCommand/outdent-blockquote-test4-expected.txt: Copied from platform/mac/editing/execCommand/outdent-blockquote-test4-expected.txt.
              * platform/mac/editing/execCommand/outdent-blockquote-test5-expected.txt: Copied from platform/mac/editing/execCommand/outdent-blockquote-test5-expected.txt.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ed0a7b9c
    • kmccullough@apple.com's avatar
      WebCore: · 4840508b
      kmccullough@apple.com authored
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              - Rolling out to fix a bug and the build
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
      
      LayoutTests:
      
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              - Rolled out for bug and build fix.
      
              * editing/execCommand/outdent-blockquote-test1.html: Removed.
              * editing/execCommand/outdent-blockquote-test2.html: Removed.
              * editing/execCommand/outdent-blockquote-test3.html: Removed.
              * editing/execCommand/outdent-blockquote-test4.html: Removed.
              * platform/mac/editing/execCommand/outdent-blockquote-test1-expected.txt: Removed.
              * platform/mac/editing/execCommand/outdent-blockquote-test2-expected.txt: Removed.
              * platform/mac/editing/execCommand/outdent-blockquote-test3-expected.txt: Removed.
              * platform/mac/editing/execCommand/outdent-blockquote-test4-expected.txt: Removed.
              * platform/mac/editing/execCommand/outdent-blockquote-test5-expected.txt: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4840508b
    • kmccullough@apple.com's avatar
      WebCore: · 78c43699
      kmccullough@apple.com authored
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Dan Bernstein.
      
              <rdar://problem/6510362> In some situations message content is messed up
              when indentation is decreased
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode): Calling recursively
              here served to do nothing because this function will return if the
              second argument is the parent of the first.  Not only does this now work
              as intended, but is necessary for the rest of this fix.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph): To determine if we 
              are the last node in a <blockquote>, and can therefore remove the
              <blockquote> we need the endOfEnclosingBlock to extend to the end of
              the <blockquote> not just the next block, which could be a <div>, for
              example. 
              - Also If a <blockquote> is removed, but it's the child of another
              <blockquote> then its children are now children of the top <blockquote>.
              In this case we want to split the parent <blockquote> because the next
              paragraph assumes that it is the first node in its <blockquote> and if
              that is not true, various bugs arise.
      
      LayoutTests:
      
      2009-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Dan Bernstein.
      
              <rdar://problem/6510362> In some situations message content is messed up
              when indentation is decreased
      
              - These tests are the various combinations of <blockquote>s that
              revealed bugs in our old logic.
      
              * editing/execCommand/outdent-blockquote-test1.html: Added.
              * editing/execCommand/outdent-blockquote-test2.html: Added.
              * editing/execCommand/outdent-blockquote-test3.html: Added.
              * editing/execCommand/outdent-blockquote-test4.html: Added.
              * platform/mac/editing/execCommand/outdent-blockquote-test1-expected.txt: Added.
              * platform/mac/editing/execCommand/outdent-blockquote-test2-expected.txt: Added.
              * platform/mac/editing/execCommand/outdent-blockquote-test3-expected.txt: Added.
              * platform/mac/editing/execCommand/outdent-blockquote-test4-expected.txt: Added.
              * platform/mac/editing/execCommand/outdent-blockquote-test5-expected.txt: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      78c43699
  30. 12 Mar, 2009 1 commit
    • jchaffraix@webkit.org's avatar
      2009-03-12 Julien Chaffraix <jchaffraix@webkit.org> · ba7c01d7
      jchaffraix@webkit.org authored
              Reviewed by Darin Adler.
      
              Bug 24110: cloneNode should call cloneElement and not the reverse
      
              - Splitted the code from cloneNode into cloneElementWithChildren and cloneElementWithChildren.
                Now cloneNode calls one of the 2 previous methods.
      
              - Renamed cloneElement to cloneElementWithoutChildren as it was the previous behaviour.
      
              - Moved cloneNode to the Element private section so that WebCore callers cannot use it.
      
              - Removed Element::cloneNode usage through WebCore.
      
              * dom/Element.cpp:
              (WebCore::Element::cloneNode): Moved to Element's private section and it
              now calls the two next methods.
              (WebCore::Element::cloneElementWithChildren): Added.
              (WebCore::Element::cloneElementWithoutChildren): Renamed from cloneElement
              to avoid ambiguity.
              * dom/Element.h:
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Changed call to cloneElement
              to call to cloneElementWithoutChildren.
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply): Ditto.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion): Ditto.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
              * editing/ModifySelectionListLevel.cpp:
              (WebCore::IncreaseSelectionListLevelCommand::doApply): Ditto.
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::doApply): Ditto.
              * editing/markup.cpp:
              (WebCore::createFragmentFromText): Ditto.
              * svg/SVGUseElement.cpp:
              (WebCore::SVGUseElement::buildShadowTree): Ditto.
              (WebCore::SVGUseElement::expandUseElementsInShadowTree): Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba7c01d7
  31. 16 Feb, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 66fb4b04
      justin.garcia@apple.com authored
      2009-02-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Mark Rowe.
      
              https://bugs.webkit.org/show_bug.cgi?id=16309
              HTML5: The third execCommand argument for insert{un}orderedlist should be ignored
              
              When we originally implemented this command, MSDN documentation said that IE set the
              id attribute of inserted lists to the third argument to execCommand, but IE doesn't
              do this nor do any other browsers.
      
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertOrderedList):
              (WebCore::executeInsertUnorderedList):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::insertList):
              (WebCore::InsertListCommand::InsertListCommand):
              (WebCore::InsertListCommand::doApply):
              * editing/InsertListCommand.h:
              (WebCore::InsertListCommand::create):
      
      LayoutTests:
      
      2009-02-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Mark Rowe.
              
              https://bugs.webkit.org/show_bug.cgi?id=16309
              HTML5: The third execCommand argument for insert{un}orderedlist should be ignored
      
              * editing/execCommand/insert-list-with-id-expected.txt: Added.
              * editing/execCommand/insert-list-with-id.html:
              * platform/mac/editing/execCommand/insert-list-with-id-expected.checksum: Removed.
              * platform/mac/editing/execCommand/insert-list-with-id-expected.png: Removed.
              * platform/mac/editing/execCommand/insert-list-with-id-expected.txt: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66fb4b04
  32. 09 Feb, 2009 1 commit
  33. 16 Jan, 2009 1 commit
    • eric@webkit.org's avatar
      Reviewed by Justin Garcia. · b7f55f3a
      eric@webkit.org authored
              Make surroundNodeRangeWithElement call insertNodeBefore implicitly
              Make insertNodeBefore take PassRefPtr
              Clean up the use of PassRefPtr vs. raw pointers a few places in the editing code.
              https://bugs.webkit.org/show_bug.cgi?id=23389
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::applyTextDecorationStyle):
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/ApplyStyleCommand.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::insertTab):
              * editing/ModifySelectionListLevel.cpp:
              (WebCore::IncreaseSelectionListLevelCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::removeNodePreservingChildren):
              (WebCore::ReplacementFragment::insertNodeBefore):
              (WebCore::ReplacementFragment::removeInterchangeNodes):
              (WebCore::ReplaceSelectionCommand::doApply):
              (WebCore::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted):
              (WebCore::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted):
              (WebCore::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted):
              * editing/ReplaceSelectionCommand.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b7f55f3a
  34. 23 Dec, 2008 1 commit
    • darin@apple.com's avatar
      2008-12-23 Darin Adler <darin@apple.com> · e95b53db
      darin@apple.com authored
              Reviewed by John Sullivan.
      
              - improve robustness of undo/redo in HTML editing to fix the following bugs
                <https://bugs.webkit.org/show_bug.cgi?id=19703> Crash in WebCore::InsertNodeBeforeCommand::doUnapply()
                <rdar://problem/4059423> DOM operations performed on editable HTML can cause a crash later during Undo
      
              Major categories of improvements:
      
                  1) Added null checks.
                  2) Eliminated type casts without corresponding type checks.
                  3) Avoided possible infinite loops by building up lists of nodes to operate on
                     before starting to make DOM changes.
                  4) Use more RefPtr.
      
              No test at this time, but test cases should follow in separate patches.
      
              * WebCore.xcodeproj/project.pbxproj: Set the role of CSSPropertyNames.h to Private so it
              can be used in other Private headers, specifically editing ones.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::locateCousinList): Adopt parentElement.
              (WebCore::CSSStyleSelector::locateSharedStyle): Ditto.
              (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Ditto.
      
              * dom/Element.cpp: (WebCore::Element::cloneElement): Added.
              * dom/Element.h: Added cloneElement and an implementation of parentElement.
              * dom/Node.h: Moved parentElement from here to Element.h and changed its
              implementation so it will return 0 when the parent is not an element
              (document, document fragment, etc.).
      
              * editing/AppendNodeCommand.cpp:
              (WebCore::AppendNodeCommand::AppendNodeCommand): Made parent be an Element.
              Moved assertions from doApply in here.
              (WebCore::AppendNodeCommand::doApply): Simplified to just a single unchecked
              appendChild call.
              (WebCore::AppendNodeCommand::doUnapply): Simplified to just a single remove call.
              * editing/AppendNodeCommand.h: Updated.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::createStyleSpanElement): Eliminate casting by creating an element in a more
              direct way with new instead of createElementNS.
              (WebCore::ApplyStyleCommand::ApplyStyleCommand): Use PassRefPtr.
              (WebCore::ApplyStyleCommand::removeCSSStyle): Use CSSPropertyID.
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Use cloneElement.
              * editing/ApplyStyleCommand.h:
      
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply): Use Element* and cloneElement.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::applyStyledElement): Use PassRefPtr and unsigned.
              (WebCore::CompositeEditCommand::removeStyledElement): Ditto.
              (WebCore::CompositeEditCommand::insertNodeBefore): Ditto.
              (WebCore::CompositeEditCommand::insertNodeAfter): Ditto.
              (WebCore::CompositeEditCommand::insertNodeAt): Ditto.
              (WebCore::CompositeEditCommand::appendNode): Ditto.
              (WebCore::CompositeEditCommand::removeChildrenInRange): Ditto. Also use a vector to
              make the list of children in case removing them has side effects.
              (WebCore::CompositeEditCommand::removeNode): Ditto.
              (WebCore::CompositeEditCommand::removeNodePreservingChildren): Ditto.
              (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Ditto.
              (WebCore::CompositeEditCommand::splitTextNode): Ditto.
              (WebCore::CompositeEditCommand::splitElement): Ditto.
              (WebCore::CompositeEditCommand::mergeIdenticalElements): Ditto.
              (WebCore::CompositeEditCommand::wrapContentsInDummySpan): Ditto.
              (WebCore::CompositeEditCommand::splitTextNodeContainingElement): Ditto.
              (WebCore::CompositeEditCommand::joinTextNodes): Ditto.
              (WebCore::CompositeEditCommand::inputText): Ditto.
              (WebCore::CompositeEditCommand::insertTextIntoNode): Ditto.
              (WebCore::CompositeEditCommand::deleteTextFromNode): Ditto.
              (WebCore::CompositeEditCommand::replaceTextInNode): Ditto.
              (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition): Ditto.
              (WebCore::CompositeEditCommand::removeCSSProperty): Ditto.
              (WebCore::CompositeEditCommand::removeNodeAttribute): Ditto. Implement by calling
              setNodeAttribute instead of with its own SimpleEditCommand.
              (WebCore::CompositeEditCommand::setNodeAttribute): Ditto.
              (WebCore::CompositeEditCommand::deleteInsignificantText): Ditto.
              (WebCore::CompositeEditCommand::appendBlockPlaceholder): Ditto.
              (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
              (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto. Don't
              bother using an undoable operation to put the break element into the paragraph
              element because there's no need to split them and redo this when doing undo/redo.
              (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              * editing/CompositeEditCommand.h: Ditto.
      
              * editing/DeleteFromTextNodeCommand.cpp:
              (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Use unsigned.
              (WebCore::DeleteFromTextNodeCommand::doApply): Eliminated inappropriate assertions.
              (WebCore::DeleteFromTextNodeCommand::doUnapply): Ditto.
              * editing/DeleteFromTextNodeCommand.h:
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode): Use PassRefPtr.
              (WebCore::DeleteSelectionCommand::deleteTextFromNode): Ditto.
              * editing/DeleteSelectionCommand.h:
      
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::FormatBlockCommand): Use AtomicString.
              (WebCore::FormatBlockCommand::doApply): Use Element.
              * editing/FormatBlockCommand.h:
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::createIndentBlockquoteElement): Use new to create the element
              instead of calling a function so we have a more specific type.
              (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
              Use RefPtr and Element.
              (WebCore::IndentOutdentCommand::indentRegion): Ditto.
              (WebCore::IndentOutdentCommand::outdentParagraph): Ditto.
              * editing/IndentOutdentCommand.h:
      
              * editing/InsertIntoTextNodeCommand.cpp:
              (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
              Use unsigned. Added an assertion.
              (WebCore::InsertIntoTextNodeCommand::doApply): Eliminated inappropriate assertions.
              (WebCore::InsertIntoTextNodeCommand::doUnapply): Ditto.
              * editing/InsertIntoTextNodeCommand.h:
      
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::insertNodeAfterPosition): Use Element.
              (WebCore::InsertLineBreakCommand::insertNodeBeforePosition): Ditto.
      
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply): Use Element.
      
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Moved assertions
              here from doApply.
              (WebCore::InsertNodeBeforeCommand::doApply): Eliminated inappropriate assertions.
              Added a null check.
              (WebCore::InsertNodeBeforeCommand::doUnapply): Simplified to just a single remove call.
      
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Use Element and cloneElement.
      
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply): Eliminated inappropriate assertions.
              Added some runtime checks. Don't store anything in m_offset.
              (WebCore::JoinTextNodesCommand::doUnapply): Ditto.
              * editing/JoinTextNodesCommand.h:
      
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand): Moved
              an assertion here from doApply.
              (WebCore::MergeIdenticalElementsCommand::doApply): Eliminated inappropriate assertions.
              Added a null check. Changed implementation to use remove to avoid null parent issue.
              Use a vector of nodes to avoid possible infinite loop if mutation happens while iterating.
              (WebCore::MergeIdenticalElementsCommand::doUnapply): Ditto.
      
              * editing/ModifySelectionListLevel.cpp:
              (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange): Use Element*.
              (WebCore::IncreaseSelectionListLevelCommand::doApply): Ditto.
              * editing/ModifySelectionListLevel.h:
      
              * editing/RemoveCSSPropertyCommand.cpp:
              (WebCore::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Use PassRefPtr and
              CSSPropertyID. Also renamed m_decl to m_style.
              (WebCore::RemoveCSSPropertyCommand::doApply): Eliminated inappropriate assertions.
              (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
      
              * editing/RemoveNodeAttributeCommand.cpp: Removed contents of this file. To be deleted.
              Use SetNodeAttributeCommand instead.
              * editing/RemoveNodeAttributeCommand.h: Ditto.
      
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::RemoveNodeCommand): Moved assertions here from doApply.
              Don't initialize m_refChild here; rather do it in doApply.
              (WebCore::RemoveNodeCommand::doApply): Eliminated inappropriate assertions. Added
              checks and streamlined implementation.
              (WebCore::RemoveNodeCommand::doUnapply): Ditto.
              * editing/RemoveNodeCommand.h:
      
              * editing/RemoveNodePreservingChildrenCommand.cpp:
              (WebCore::RemoveNodePreservingChildrenCommand::doApply): Use a vector.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): Removed now-unneeded cast.
      
              * editing/SetNodeAttributeCommand.cpp:
              (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand): Use AtomicString.
              Removed assertion that prevents us from using this to remove an attribute.
              (WebCore::SetNodeAttributeCommand::doApply): Eliminated inappropriate assertions.
              (WebCore::SetNodeAttributeCommand::doUnapply): Ditto.
              * editing/SetNodeAttributeCommand.h:
      
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::SplitElementCommand): Moved assertion here from doApply.
              (WebCore::SplitElementCommand::doApply): Check some more invariants and use a vector
              to avoid possible infinite loops.
              (WebCore::SplitElementCommand::doUnapply): Ditto.
      
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::SplitTextNodeCommand): Moved assertions and comment
              here from doApply.
              (WebCore::SplitTextNodeCommand::doApply): Check for null and failures when applying.
              (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
      
              * editing/SplitTextNodeContainingElementCommand.cpp:
              (WebCore::SplitTextNodeContainingElementCommand::doApply): Use Element.
      
              * editing/WrapContentsInDummySpanCommand.cpp:
              (WebCore::WrapContentsInDummySpanCommand::doApply): Check for null and ignore failures.
              Don't reuse the dummy span. Simplified logic.
              (WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
      
              * editing/htmlediting.cpp:
              (WebCore::isBlock): Make sure this returns true only for elements.
              (WebCore::enclosingBlock): Return an Element*.
              (WebCore::enclosingTableCell): Ditto.
              (WebCore::enclosingList): Return an HTMLElement*.
              (WebCore::outermostEnclosingList): Return an HTMLElement*.
              (WebCore::createDefaultParagraphElement): Return an HTMLElement*.
              (WebCore::createBreakElement): Return an HTMLElement*.
              (WebCore::createOrderedListElement): Return an HTMLElement*.
              (WebCore::createUnorderedListElement): Return an HTMLElement*.
              (WebCore::createListItemElement): Return an HTMLElement*.
              (WebCore::createHTMLElement): Return an HTMLElement*.
              * editing/htmlediting.h:
      
              * editing/markup.cpp:
              (WebCore::createFragmentFromText): Use createBreakElement and use Element*.
      
              * page/MouseEventWithHitTestResults.cpp:
              (WebCore::MouseEventWithHitTestResults::targetNode): Use parentElement.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e95b53db
  35. 14 Nov, 2008 1 commit
    • bolsinga@apple.com's avatar
      Reviewed by Darin Adler. · 97e42c46
      bolsinga@apple.com authored
              https://bugs.webkit.org/show_bug.cgi?id=21810
              Remove use of static C++ objects that are destroyed at exit time (destructors)
      
              Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid 
              exit-time destructor. Update code that was changed to fix this issue that ran 
              into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference 
              in gcc build 5465). Also typdefs for template types needed to be added in some 
              cases so the type could make it through the macro successfully.
      
              Basically code of the form:
              static T m;
              becomes:
              DEFINE_STATIC_LOCAL(T, m, ());
      
              Also any code of the form:
              static T& m = *new T;
              also becomes:
              DEFINE_STATIC_LOCAL(T, m, ());
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      97e42c46
  36. 06 Nov, 2008 2 commits
    • ddkilzer@apple.com's avatar
      BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0. · 58912bd4
      ddkilzer@apple.com authored
      WebCore:
      
              BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0.
      
              Apparently older versions of gcc have issues with this patch.
              Backing out a second time until the issues are resolved.
      
      WebKit/mac:
      
              BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0.
      
              Apparently older versions of gcc have issues with this patch.
              Backing out a second time until the issues are resolved.
      
      WebKitTools:
      
              BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0.
      
              Apparently older versions of gcc have issues with this patch.
              Backing out a second time until the issues are resolved.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      58912bd4
    • ddkilzer@apple.com's avatar
      BUILD WAS NOT BROKEN: Rolling r38189 back in. · a8062f58
      ddkilzer@apple.com authored
      WebCore:
      
              BUILD WAS NOT BROKEN: Rolling r38189 back in.
      
              Please perform a clean build if you see crashes.
      
      WebKit/mac:
      
              BUILD WAS NOT BROKEN: Rolling r38189 back in.
      
              Please perform a clean build if you see crashes.
      
      WebKitTools:
      
              BUILD WAS NOT BROKEN: Rolling r38189 back in.
      
              Please perform a clean build if you see crashes.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a8062f58