1. 07 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-04-07 Ryosuke Niwa <rniwa@webkit.org> · 5614540c
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              REGRESSION (r46914, r48764): When typing in Mail, line wrapping frequently occurs in the middle of words
              https://bugs.webkit.org/show_bug.cgi?id=57872
      
              Added tests to ensure WebKit inserts a paragraph separator properly around tab span.
      
              * editing/inserting/insert-div-021-expected.txt: No longer duplicates span[id="test"] incorrectly.
              * editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt: Added.
              * editing/inserting/insert-paragraph-after-tab-span-and-text.html: Added.
              * editing/inserting/insert-paragraph-separator-tab-span-expected.txt: Added.
              * editing/inserting/insert-paragraph-separator-tab-span.html: Added.
              * editing/inserting/insert-paragraph-at-end-of-line-expected.txt: No longer duplicates a[id="anchor"] incorrectly.
      2011-04-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              REGRESSION (r46914, r48764): When typing in Mail, line wrapping frequently occurs in the middle of words
              https://bugs.webkit.org/show_bug.cgi?id=57872
      
              r46914 initially introduced a regression by replacing calls to styleAtPosition by editingStyleAtPosition
              because editingStyleAtPosition did not avoid tab span to obtain the computed style unlike styleAtPosition.
      
              r46914 also introduced a regression by cloning hierarchy under new block at the insertion position without
              avoiding the tab span.
      
              Fixed the both regressions by avoiding tab spans when computing the editing style and when cloning hierarchy.
              Also reverted r46914 for the general code path because re-creating node hierarchy duplicates nodes when
              we're moving nodes after the paragraph separator. Instead, we now split the tree up until the start block
              before moving the nodes.
      
              Tests: editing/inserting/insert-paragraph-after-tab-span-and-text.html
                     editing/inserting/insert-paragraph-separator-tab-span.html
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Since EditingStyle's constructor avoids a tab span,
              no longer calls positionBeforeTabSpan on the position passed to EditingStyle's constructor.
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::init): Always avoid a tab span when computing the editing style.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Avoid cloning tab spans and inserting a paragraph
              separator into a paragraph separator.
              * editing/htmlediting.cpp:
              (WebCore::positionOutsideTabSpan): Renamed from positionBeforeTabSpan. Also returns the position in the parent
              node after the tab span if the position was at the end of the tab span.
              * editing/htmlediting.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5614540c
  2. 28 Mar, 2011 1 commit
    • xji@chromium.org's avatar
      2011-03-28 Xiaomei Ji <xji@chromium.org> · d815a1f2
      xji@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              move directionOfEnclosingBlock() to be global so that it could be reused.
              https://bugs.webkit.org/show_bug.cgi?id=57233.
      
              Provide global function directionOfEnclosingBlock(Node*) so that it could be
              reused in SelectionController and other functionalities that need enclosing
              block's direcionality, such as moving caret by word in visual order.
            
              No new functionality, so no new tests.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::directionOfEnclosingBlock):
              * editing/htmlediting.cpp:
              (WebCore::directionOfEnclosingBlock):
              * editing/htmlediting.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d815a1f2
  3. 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
  4. 18 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-16 Ryosuke Niwa <rniwa@webkit.org> · 6a651ffa
      rniwa@webkit.org authored
              Reviewed by Ojan Vafai.
      
              Add a test for r81266 and fix HTML Editing for fallback contents in object element
              https://bugs.webkit.org/show_bug.cgi?id=56505
      
              Added a test to edit contents of hr and datagrid and object's fallback content.
      
              * editing/editability/ignored-content-expected.txt: Added.
              * editing/editability/ignored-content.html: Added.
      2011-03-16  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Ojan Vafai.
      
              Add a test for r81266 and fix HTML Editing for fallback contents in object element
              https://bugs.webkit.org/show_bug.cgi?id=56505
      
              The bug was caused by canHaveChildrenForEditing's always returning false even when
              object element used fallback content. Fixed the bug by adding a check.
      
              Test: editing/editability/ignored-content.html
      
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6a651ffa
  5. 17 Mar, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-03-17 Ryosuke Niwa <rniwa@webkit.org> · b369662c
      rniwa@webkit.org authored
              Reviewed by Adele Peterson and Enrica Casucci.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Debug build fix.
      
              * dom/Element.cpp:
              (WebCore::Element::updateFocusAppearance): "this" can be an input element so can't always instantiate
              a position inside the node. Call firstPositionInOrBeforeNode instead.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::positionAvoidingPrecedingNodes): Exit early when a node's content is ignored by editing instead
              of just when the node is br.
              * editing/htmlediting.cpp:
              (WebCore::lastEditablePositionBeforePositionInRoot): The shadow ancestor node is usually an input element
              so don't instantiate a position inside it. Call firstPositionInOrBeforeNode instead.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b369662c
    • rniwa@webkit.org's avatar
      2011-03-17 Ryosuke Niwa <rniwa@webkit.org> · c986a805
      rniwa@webkit.org authored
              Reviewed by Justin Garcia.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Added a test to ensure WebKit lets users edit contents inside a button element properly.
      
              * editing/execCommand/button-expected.txt: Added.
              * editing/execCommand/button.html: Added.
      2011-03-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Justin Garcia.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Added the assertion in Position::Position and Position::moveToPosition. This assertion catches
              places where we instantiate positions inside a node on which editingIgnoresContent returns true.
      
              Test: editing/execCommand/button.html
      
              * dom/Position.cpp:
              (WebCore::Position::Position): Added an assertion.
              (WebCore::Position::moveToPosition): Ditto.
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position): Avoid creating a position immediately below
              a node whose content is ignored by editing. While this does not avoid creation of positions
              inside ignored contents completely, it works in most cases. Filed the bug 56027 to resolve
              the underlying problem. Without this change, the assertion hits in existing layout tests.
              cannot be tested directly.
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Call firstPositionInOrBeforeNode
              instead of firstPositionInNode because startNode may as well be a br element. Without this change,
              the assertion hits in existing layout tests.
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing): button is editable so content is not ignored. Added a test
              for this.
              * editing/visible_units.cpp:
              (WebCore::previousBoundary): Added a FIXME.
              (WebCore::startPositionForLine): Because br can also have an inline text box, checking that
              startBox is an inline text box isn't an adequate to instantiate a position inside startNode.
              Call startNode->isTextNode() instead. Without this change, the assertion hits in existing layout
              tests.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c986a805
  6. 16 Mar, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-03-16 Ryosuke Niwa <rniwa@webkit.org> · 24bd1d35
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              Get rid of nearestMailBlockquote
              https://bugs.webkit.org/show_bug.cgi?id=56439
      
              Removed nearestMailBlockquote and replaced the calls to the function by calls
              to enclosingNodeOfType and highestEnclosingNodeOfType.
              
              Also fixed a bug in BreakBlockquoteCommand and DeleteSelectionCommand not to
              respect editing boundaries.  Added a test for the former command.
      
              Test: editing/execCommand/break-non-editable-blockquote.html
      
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply): No longer crosses editing boundary
              when looking for a Mail blockquote.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Ditto.
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::hasMatchingQuoteLevel):
              (WebCore::handleStyleSpansBeforeInsertion):
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/htmlediting.cpp:
              (WebCore::enclosingNodeOfType): Check rule upfront to improve the performance.
              (WebCore::highestEnclosingNodeOfType): Ditto; also add the missing check.
              * editing/htmlediting.h:
              (WebCore::firstPositionInOrBeforeNode): Added a null pointer check.
              (WebCore::lastPositionInOrAfterNode): Ditto.
              * editing/markup.cpp:
              (WebCore::highestAncestorToWrapMarkup):
              (WebCore::createMarkup):
      2011-03-16  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              Get rid of nearestMailBlockquote
              https://bugs.webkit.org/show_bug.cgi?id=56439
      
              Added a test to ensure WebKi doesn't crash when inserting newline in quoted contents,
              which is enclosed by a non-editable blockquote.
      
              * editing/execCommand/break-non-editable-blockquote-expected.txt: Added.
              * editing/execCommand/break-non-editable-blockquote.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      24bd1d35
    • leviw@chromium.org's avatar
      2011-03-16 Levi Weintraub <leviw@chromium.org> · 14f546d2
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              REGRESSION (r81165): Assert running editing/style/iframe-onload-crash.html with non-Mac editing behavior
              https://bugs.webkit.org/show_bug.cgi?id=56407
      
              Creating three versions of the iframe-onload-crash test to cover all editing behaviors.
      
              * editing/style/iframe-onload-crash-expected-mac.txt: Copied from LayoutTests/editing/style/iframe-onload-crash-expected.txt.
              * editing/style/iframe-onload-crash-expected-unix.txt: Copied from LayoutTests/editing/style/iframe-onload-crash-expected.txt.
              * editing/style/iframe-onload-crash-expected-win.txt: Copied from LayoutTests/editing/style/iframe-onload-crash-expected.txt.
              * editing/style/iframe-onload-crash-expected.txt: Removed.
              * editing/style/iframe-onload-crash-mac.html: Copied from LayoutTests/editing/style/iframe-onload-crash.html.
              * editing/style/iframe-onload-crash-unix.html: Copied from LayoutTests/editing/style/iframe-onload-crash.html.
              * editing/style/iframe-onload-crash-win.html: Copied from LayoutTests/editing/style/iframe-onload-crash.html.
              * editing/style/iframe-onload-crash.html: Removed.
              * platform/chromium/test_expectations.txt:
              * platform/gtk/Skipped:
              * platform/win/Skipped:
      2011-03-15  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              REGRESSION (r81165): Assert running editing/style/iframe-onload-crash.html with non-Mac editing behavior
              https://bugs.webkit.org/show_bug.cgi?id=56407
      
              Fixing the creation of incorrect ranges from TextIterator due to passing node/offset pairs that
              weren't parent-anchored. Also changing canHaveChildrenForEditing to properly handle nodes that
              have had children appended to them that editing wouldn't normally allow.
      
              Tests: editing/style/iframe-onload-crash-mac.html
                     editing/style/iframe-onload-crash-unix.html
                     editing/style/iframe-onload-crash-win.html
      
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::rangeFromLocationAndLength): Passing parent-anchored values to range.
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing): Adding a condition that the nodes don't already have children
              for hr and datagrid, as you can append any node to another using javascript.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      14f546d2
  7. 15 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-08 Levi Weintraub <leviw@chromium.org> · 1f95362b
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Get rid of firstDeepEditingPositionForNode and lastDeepEditingPositionForNode
              https://bugs.webkit.org/show_bug.cgi?id=52642
      
              Replacing calls to first/lastDeepEditingPositionForNode with calls to their analogous
              functions that create new positions. Also fixing various parts of editing code that
              incorrectly handled the new positions now being created.
      
              No new tests as this is refactoring/cleanup.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRange):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              (WebCore::Position::previous):
              (WebCore::Position::next):
              (WebCore::Position::atFirstEditingPositionForNode):
              (WebCore::Position::atLastEditingPositionForNode):
              (WebCore::Position::upstream):
              (WebCore::Position::isCandidate):
              (WebCore::Position::getInlineBoxAndOffset):
              * dom/Position.h:
              (WebCore::operator==):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::isTableCellEmpty):
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::unlistifyParagraph):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::selectionFromContentsOfNode):
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::enclosingEmptyListItem):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::startOfEditableContent):
              (WebCore::endOfEditableContent):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::positionForPoint):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f95362b
  8. 10 Mar, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-03-10 Ryosuke Niwa <rniwa@webkit.org> · 45ecbafb
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              startOfBlock and endOfBlock may return a position inside hr
              https://bugs.webkit.org/show_bug.cgi?id=56025
      
              Replaced calls to enclosingBlockFlowElement in startOfBlock and endOfBlock by
              calls to enclosingBlock. Added EditingBoundaryCrossingRule to the argument lists
              of startOfBlock, endOfBlock, and enclosingBlock. Also replaced the last boolean
              argument variable of enclosingNodeOfType by EditingBoundaryCrossingRule.
      
              Also replaced calls to enclosingBlockFlowElement in inSameBlock by calls to
              enclosingBlock to be consitent with startOfBlock and endOfBlock.
      
              This patch also replaced calls to deprecatedNode in startOfBlock, endOfBlock,
              and inSameBlock by calls to containerNode because the enclosing block of a position
              should never be before or after the position.
      
              No tests are added because this change only affects WebCore internally.
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData): Calls enclosingNodeOfType.
              Pass CanCrossEditingBoundary instead of false.
              * editing/htmlediting.cpp:
              (WebCore::unsplittableElementForPosition): Ditto.
              (WebCore::enclosingBlock): Takes EditingBoundaryCrossingRule and passes it to
              enclosingNodeOfType.
              (WebCore::enclosingNodeOfType): Takes EditingBoundaryCrossingRule instead of boolean.
              Fixed a bug that it stops walking the tree when it reached the root editable node
              even when the editing boundary crossing rule is CanCrossEditingBoundary.
              * editing/htmlediting.h: Prototype changes.
              * editing/visible_units.cpp:
              (WebCore::startOfBlock): Calls enclosingBlock instead of enclosingBlockFlowElement.
              Also added an early exit when there's no enclosing block.
              (WebCore::endOfBlock): Ditto. The early exist in this case prevents crash in
              lastPositionInNode.
              (WebCore::inSameBlock): Calls enclosingBlock instead of enclosingBlockFlowElement.
              (WebCore::isStartOfBlock): Calls startOfBlock with CanCrossEditingBoundary because
              we don't care where the start of block is when we're comparing against the given position.
              (WebCore::isEndOfBlock): Ditto.
              * editing/visible_units.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      45ecbafb
    • rniwa@webkit.org's avatar
      2011-03-10 Ryosuke Niwa <rniwa@webkit.org> · ea702bae
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              VisiblePosition's next and previous should take an enum instead of a boolean
              https://bugs.webkit.org/show_bug.cgi?id=56135
      
              SelectionController::isAll now takes EditingBoundaryCrossingRule instead of
              StayInEditableContent.
      
              * WebView/WebView.mm:
              (-[WebView _selectionIsAll]):
      2011-03-10  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              VisiblePosition's next and previous should take an enum instead of a boolean
              https://bugs.webkit.org/show_bug.cgi?id=56135
      
              Changed the argument type of VisiblePosition::next and VisiblePosition::previous
              from bool to EditingBoundaryCrossingRule. Also got rid of StayInEditableContent enum
              in VisibleSelection and replaced it by EditingBoundaryCrossingRule because the enum
              was only used in VisiblePosition::isAll and subsequently in SelectionController::isAll
              to call VisiblePosition::next and VisiblePosition::previous.
      
              * WebCore.exp.in:
              * dom/Position.cpp:
              (WebCore::Position::trailingWhitespacePosition):
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::doApply):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply):
              (WebCore::InsertListCommand::listifyParagraph):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::shouldMergeStart):
              (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRight):
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingLeft):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/SelectionController.h:
              (WebCore::SelectionController::isAll):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::next):
              (WebCore::VisiblePosition::previous):
              * editing/VisiblePosition.h:
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::isAll):
              (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
              * editing/VisibleSelection.h:
              * editing/htmlediting.cpp:
              (WebCore::selectionForParagraphIteration):
              * editing/visible_units.cpp:
              (WebCore::startOfNextParagraph):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ea702bae
  9. 01 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-01 Levi Weintraub <leviw@chromium.org> · ca40abff
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-03-01  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::document): Added this inline function to avoid the necessity
              of calling anchorNode to assure a document from a Position.
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca40abff
  10. 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
  11. 10 Feb, 2011 2 commits
    • philn@webkit.org's avatar
      2011-02-10 Sheriff Bot <webkit.review.bot@gmail.com> · 1bb885b2
      philn@webkit.org authored
              Unreviewed, rolling out r78219.
              http://trac.webkit.org/changeset/78219
              https://bugs.webkit.org/show_bug.cgi?id=54215
      
              breaks editing/style/iframe-onload-crash.html on GTK 64-bit
              Debug (Requested by philn-tp on #webkit).
      
              * dom/Document.h:
              * dom/DocumentFragment.h:
              * dom/Element.h:
              * dom/Node.h:
              * dom/Text.h:
              * editing/htmlediting.cpp:
              (WebCore::editingIgnoresContent):
              (WebCore::canHaveChildrenForEditing):
              * editing/htmlediting.h:
              * html/HTMLBRElement.h:
              * html/HTMLButtonElement.h:
              * html/HTMLDataGridElement.h:
              * html/HTMLFormControlElement.h:
              * html/HTMLFrameElementBase.h:
              * html/HTMLHRElement.h:
              * html/HTMLImageElement.h:
              * html/HTMLMeterElement.h:
              * html/HTMLOutputElement.h:
              * html/HTMLPlugInElement.h:
              * html/HTMLProgressElement.h:
              * wml/WMLBRElement.h:
              * wml/WMLDoElement.h:
              * wml/WMLImageElement.h:
              * wml/WMLInputElement.h:
              * wml/WMLSelectElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1bb885b2
    • rniwa@webkit.org's avatar
      2011-02-10 Ryosuke Niwa <rniwa@webkit.org> · c8c02a62
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Make canHaveChildrenForEditing more efficient
              https://bugs.webkit.org/show_bug.cgi?id=53564
      
              Improved the performance (1-2% in release and 20% in debug) by adding virtual member function
              canContainRangeEndPoint to Node. It returns true whenever the associated node can have be a container
              node for a position.
      
              As of this revision, canContainRangeEndPoint returns true on Document, DocumentFragment, Text nodes
              and any elements except:
      
              HTML: applet, br, button, datagrid, embed, frame, frameset, hr, img, input,
                    meter, object, output, progress, and select.
      
              WML: br, do, img, input, and select.
      
              No new tests are added since this change cannot be tested directly.
      
              * dom/Document.h:
              (WebCore::Document::canContainRangeEndPoint): Added; returns false.
              * dom/DocumentFragment.h:
              (WebCore::DocumentFragment::canContainRangeEndPoint): Added; returns true.
              * dom/Element.h:
              (WebCore::Element::canContainRangeEndPoint): Ditto.
              * dom/Node.h:
              (WebCore::Node::canContainRangeEndPoint): Added; returns false.
              * dom/Text.h:
              (WebCore::Text::canContainRangeEndPoint): Added; returns true.
              * editing/htmlediting.cpp: Removed editingIgnoresContent and canHaveChildrenForEditing.
              * editing/htmlediting.h:
              (WebCore::editingIgnoresContent): Moved from htmlediting.cpp; made it inline.
              (WebCore::canHaveChildrenForEditing): Ditto.
              * html/HTMLBRElement.h:
              (WebCore::HTMLBRElement::canContainRangeEndPoint): Added; returns false.
              * html/HTMLButtonElement.h:
              (WebCore::HTMLButtonElement::canContainRangeEndPoint): Ditto.
              * html/HTMLDataGridElement.h:
              (WebCore::HTMLDataGridElement::canContainRangeEndPoint): Ditto.
              * html/HTMLFormControlElement.h:
              (WebCore::HTMLFormControlElementWithState::canContainRangeEndPoint): Ditto.
              * html/HTMLFrameElementBase.h:
              (WebCore::HTMLFrameElementBase::canContainRangeEndPoint): Ditto.
              * html/HTMLHRElement.h:
              (WebCore::HTMLHRElement::canContainRangeEndPoint): Ditto.
              * html/HTMLImageElement.h:
              (WebCore::HTMLImageElement::canContainRangeEndPoint): Ditto.
              * html/HTMLMeterElement.h:
              (WebCore::HTMLMeterElement::canContainRangeEndPoint): Ditto.
              * html/HTMLOutputElement.h:
              (WebCore::HTMLOutputElement::canContainRangeEndPoint): Ditto.
              * html/HTMLPlugInElement.h:
              (WebCore::HTMLPlugInElement::canContainRangeEndPoint): Ditto.
              * html/HTMLProgressElement.h:
              (WebCore::HTMLProgressElement::canContainRangeEndPoint): Ditto.
              * wml/WMLBRElement.h:
              (WebCore::WMLBRElement::canContainRangeEndPoint): Ditto.
              * wml/WMLDoElement.h:
              (WebCore::WMLDoElement::canContainRangeEndPoint): Ditto.
              * wml/WMLImageElement.h:
              (WebCore::WMLImageElement::canContainRangeEndPoint): Ditto.
              * wml/WMLInputElement.h:
              (WebCore::WMLInputElement::canContainRangeEndPoint): Ditto.
              * wml/WMLSelectElement.h:
              (WebCore::WMLSelectElement::canContainRangeEndPoint): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c8c02a62
  12. 09 Feb, 2011 1 commit
    • yael.aharon@nokia.com's avatar
      2011-02-09 Yael Aharon <yael.aharon@nokia.com> · 3be82c17
      yael.aharon@nokia.com authored
              Reviewed by Darin Adler.
      
              Replace static_cast<HTMLElement*> with toHTMLElement
              https://bugs.webkit.org/show_bug.cgi?id=54117
      
              No new tests since no new functionality was introduced.
      
              * accessibility/AccessibilityListBox.cpp:
              (WebCore::AccessibilityListBox::addChildren):
              * accessibility/AccessibilityMenuListPopup.cpp:
              (WebCore::AccessibilityMenuListPopup::addChildren):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::accessibleNameForNode):
              (WebCore::AccessibilityRenderObject::accessibilityDescription):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (webkit_accessible_get_name):
              (webkit_accessible_get_description):
              * bindings/gobject/WebKitDOMBinding.cpp:
              (WebKit::createWrapper):
              (WebKit::kit):
              * bindings/js/JSElementCustom.cpp:
              (WebCore::toJSNewlyCreated):
              * bindings/js/JSHTMLFrameSetElementCustom.cpp:
              (WebCore::JSHTMLFrameSetElement::nameGetter):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::createWrapperInline):
              * bindings/v8/custom/V8ElementCustom.cpp:
              (WebCore::toV8):
              * dom/Document.cpp:
              (WebCore::Document::body):
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment):
              * dom/Range.cpp:
              (WebCore::Range::createContextualFragment):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
              (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::shouldSplitTextElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/DeleteButtonController.cpp:
              (WebCore::enclosingDeletableElement):
              (WebCore::DeleteButtonController::show):
              * editing/Editor.cpp:
              (WebCore::Editor::setBaseWritingDirection):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::mergeWithNeighboringLists):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren):
              * editing/SelectionController.cpp:
              (WebCore::scanForForm):
              (WebCore::SelectionController::currentForm):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              (WebCore::enclosingListChild):
              (WebCore::embeddedSublist):
              (WebCore::appendedSublist):
              * editing/markup.cpp:
              (WebCore::StyledMarkupAccumulator::appendElement):
              * html/HTMLCollection.cpp:
              (WebCore::HTMLCollection::checkForNameMatch):
              (WebCore::HTMLCollection::updateNameCache):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterHTML):
              (WebCore::HTMLElement::shadowAncestorOwnerForm):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::formElementIndex):
              * html/HTMLSelectElement.cpp:
              (WebCore::HTMLSelectElement::setOption):
              (WebCore::HTMLSelectElement::setLength):
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::getOuterHTML):
              (WebCore::InspectorDOMAgent::setOuterHTML):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseMoveEvent):
              * rendering/RenderMeter.cpp:
              (WebCore::RenderMeter::createPart):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::createSubtreeIfNeeded):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3be82c17
  13. 08 Feb, 2011 2 commits
    • leviw@chromium.org's avatar
      2011-02-08 Sheriff Bot <webkit.review.bot@gmail.com> · 0f9d6132
      leviw@chromium.org authored
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtNode:offset:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebCore.exp.in:
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::VisiblePosition):
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f9d6132
    • leviw@chromium.org's avatar
      2011-02-08 Levi Weintraub <leviw@chromium.org> · ddcb501f
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ddcb501f
  14. 29 Jan, 2011 1 commit
    • paroga@webkit.org's avatar
      2011-01-29 Patrick Gansterer <paroga@webkit.org> · 10c9e1b0
      paroga@webkit.org authored
              Reviewed by David Kilzer.
      
              Move CharacterNames.h into WTF directory
              https://bugs.webkit.org/show_bug.cgi?id=49618
      
              * GNUmakefile.am:
              * JavaScriptCore.gypi:
              * JavaScriptCore.vcproj/WTF/WTF.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * wtf/CMakeLists.txt:
              * wtf/unicode/CharacterNames.h: Renamed from WebCore/platform/text/CharacterNames.h.
              * wtf/unicode/UTF8.cpp:
      2011-01-29  Patrick Gansterer  <paroga@webkit.org>
      
              Reviewed by David Kilzer.
      
              Move CharacterNames.h into WTF directory
              https://bugs.webkit.org/show_bug.cgi?id=49618
      
              * ForwardingHeaders/wtf/unicode/CharacterNames.h: Added.
              * GNUmakefile.am:
              * WebCore.gypi:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * accessibility/AccessibilityObject.cpp:
              * accessibility/AccessibilityRenderObject.cpp:
              * bindings/cpp/WebDOMHTMLDocumentCustom.cpp:
              * bindings/js/JSHTMLDocumentCustom.cpp:
              * dom/Position.cpp:
              * dom/SelectElement.cpp:
              * editing/CompositeEditCommand.cpp:
              * editing/Editor.cpp:
              * editing/HTMLInterchange.cpp:
              * editing/InsertTextCommand.cpp:
              * editing/MarkupAccumulator.cpp:
              * editing/TextIterator.cpp:
              * editing/VisibleSelection.cpp:
              * editing/htmlediting.cpp:
              * editing/htmlediting.h:
              * editing/markup.cpp:
              * html/FTPDirectoryDocument.cpp:
              * html/HTMLFormControlElement.cpp:
              * html/parser/HTMLTreeBuilder.cpp:
              * loader/appcache/ManifestParser.cpp:
              * platform/chromium/PopupMenuChromium.cpp:
              * platform/graphics/Font.h:
              * platform/graphics/FontFastPath.cpp:
              * platform/graphics/GlyphPageTreeNode.cpp:
              * platform/graphics/StringTruncator.cpp:
              * platform/graphics/mac/ComplexTextController.cpp:
              * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
              * platform/graphics/wince/GraphicsContextWinCE.cpp:
              * platform/mac/PasteboardMac.mm:
              * platform/text/TextCodecICU.cpp:
              * platform/text/mac/TextCodecMac.cpp:
              * platform/text/transcoder/FontTranscoder.cpp:
              * rendering/RenderBlockLineLayout.cpp:
              * rendering/RenderFlexibleBox.cpp:
              * rendering/RenderListMarker.cpp:
              * rendering/RenderText.cpp:
              * rendering/RenderTextControl.cpp:
              * rendering/RenderTreeAsText.cpp:
              * rendering/break_lines.cpp:
              * rendering/mathml/RenderMathMLOperator.h:
              * websockets/WebSocketHandshake.cpp:
              * wml/WMLTableElement.cpp:
      2011-01-29  Patrick Gansterer  <paroga@webkit.org>
      
              Reviewed by David Kilzer.
      
              Move CharacterNames.h into WTF directory
              https://bugs.webkit.org/show_bug.cgi?id=49618
      
              * src/ChromeClientImpl.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      10c9e1b0
  15. 24 Jan, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-01-24 Ryosuke Niwa <rniwa@webkit.org> · 920c61a5
      rniwa@webkit.org authored
              Reviewed by Ojan Vafai.
      
              Inserting multiple whitespace using text composition (IME) should insert interleaved nbsp and whitespace.
              https://bugs.webkit.org/show_bug.cgi?id=52781
      
              The test was rebaselined to have interleaved space and non-breaking space.
      
              * editing/inserting/insert-composition-whitespace-expected.txt:
              * editing/inserting/insert-composition-whitespace.html:
      2011-01-24  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Ojan Vafai.
      
              Inserting multiple whitespace using text composition (IME) should insert interleaved nbsp and whitespace.
              https://bugs.webkit.org/show_bug.cgi?id=52781
      
              The bug was caused by stringWithRebalancedWhitespace's replacing the space at the beginning of a paragraph
              and the end of a paragraph by a non-breaking space after it replaced two consecutive spaces by a space and
              non-breaking space pattern, thereby replacing more spaces by non-breaking spaces than needed.
      
              Rewrote the function using Vector<UChar> to fix the bug. New function no longer calls String::replace
              multiple times but instead it traverses through the string and replaces a space that immediately follows
              another space or appears at the beginning of a paragraph or at the end of a paragraph by a non-break space.
      
              * editing/CompositeEditCommand.cpp:
              * editing/htmlediting.cpp:
              (WebCore::stringWithRebalancedWhitespace): Written.
              * editing/htmlediting.h:
              (WebCore::isWhitespace): Removed from CompositeEditCommand.cpp
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      920c61a5
  16. 19 Jan, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-01-19 Levi Weintraub <leviw@google.com> · c56f5de7
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              Replaced rangeCompliantEquivalent with Position::parentAnchoredEquivalent
              and simplified the logic a bit. Unfortunately, Tables and some legacy
              editing positions still need to be handled specifically.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              No new tests as this is a refactor that doesn't change behavior.
      
              * WebCore.exp.in:
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              * dom/Position.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::moveParagraphs):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData):
              (WebCore::DeleteSelectionCommand::mergeParagraphs):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              (WebCore::Editor::advanceToNextMisspelling):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::shouldUseBreakElement):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion):
              * editing/VisiblePosition.cpp:
              (WebCore::makeRange):
              (WebCore::setStart):
              (WebCore::setEnd):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::firstRange):
              (WebCore::VisibleSelection::toNormalizedRange):
              (WebCore::makeSearchRange):
              * editing/htmlediting.cpp:
              (WebCore::indexForVisiblePosition):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              * page/DOMSelection.cpp:
              (WebCore::anchorPosition):
              (WebCore::focusPosition):
              (WebCore::basePosition):
              (WebCore::extentPosition):
      2011-01-19  Levi Weintraub  <leviw@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              Updating to use Position::parentAnchoredEquivalent instead of
              the old htmlediting rangeCompliantEquivalent.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c56f5de7
  17. 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
  18. 08 Jan, 2011 1 commit
  19. 17 Nov, 2010 1 commit
    • dglazkov@chromium.org's avatar
      Converge means of querying a parent node into one way, which is Node::parentNode. · e43caa78
      dglazkov@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49686
      
      Reviewed by Darin Adler.
      
      WebCore:
      
      No change in behavior, so no new tests.
      
      * accessibility/AccessibilityObject.cpp:
      (WebCore::renderListItemContainerForNode): Changed to use parentNode.
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::mouseButtonListener): Ditto.
      (WebCore::siblingWithAriaRole): Ditto.
      (WebCore::AccessibilityRenderObject::getDocumentLinks): Ditto.
      (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest): Ditto.
      * accessibility/mac/AccessibilityObjectWrapper.mm: Ditto.
      (blockquoteLevel): Ditto.
      * bindings/v8/V8GCController.cpp:
      (WebCore::ObjectGrouperVisitor::visitDOMWrapper): Ditto.
      * dom/ContainerNode.cpp: Ditto.
      (WebCore::ContainerNode::insertBefore): Ditto.
      (WebCore::ContainerNode::insertBeforeCommon): Ditto.
      (WebCore::ContainerNode::replaceChild): Ditto.
      (WebCore::ContainerNode::removeChild): Ditto.
      (WebCore::ContainerNode::appendChild): Ditto.
      (WebCore::ContainerNode::parserAddChild): Ditto.
      * dom/DocumentType.cpp:
      (WebCore::DocumentType::insertedIntoDocument): Ditto.
      * dom/Element.cpp:
      (WebCore::Element::computeInheritedLanguage): Ditto.
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::receivedTarget): Ditto.
      * dom/Position.cpp:
      (WebCore::Position::isCandidate): Changed to use parentNode.
      * dom/PositionIterator.cpp:
      (WebCore::PositionIterator::isCandidate): Ditto.
      * editing/AppendNodeCommand.cpp:
      (WebCore::AppendNodeCommand::AppendNodeCommand): Ditto.
      * editing/ApplyStyleCommand.cpp:
      (WebCore::dummySpanAncestorForNode): Ditto.
      (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): Ditto.
      (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): Ditto.
      (WebCore::highestEmbeddingAncestor): Ditto.
      (WebCore::ApplyStyleCommand::splitTextElementAtEnd): Ditto.
      (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): Ditto.
      (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): Ditto.
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::splitTreeToNode): Ditto.
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::updatePositionForNodeRemoval): Ditto.
      * editing/Editor.cpp:
      (WebCore::Editor::textDirectionForSelection): Ditto.
      * editing/MergeIdenticalElementsCommand.cpp:
      (WebCore::MergeIdenticalElementsCommand::doUnapply): Ditto.
      * editing/htmlediting.cpp:
      (WebCore::isEmptyTableCell): Ditto.
      * editing/markup.cpp:
      (WebCore::StyledMarkupAccumulator::serializeNodes): Ditto.
      * editing/visible_units.cpp:
      (WebCore::previousLinePosition): Ditto.
      (WebCore::nextLinePosition): Ditto.
      * html/HTMLAreaElement.cpp:
      (WebCore::HTMLAreaElement::imageElement): Ditto.
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::setOuterHTML): Ditto.
      (WebCore::HTMLElement::insertAdjacent): Ditto.
      (WebCore::HTMLElement::supportsFocus): Ditto.
      * html/HTMLEmbedElement.cpp:
      (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
      (WebCore::HTMLEmbedElement::attributeChanged): Ditto.
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::insertRow): Ditto.
      * html/HTMLTableRowsCollection.cpp: Ditto.
      (WebCore::isInHead): Ditto.
      (WebCore::isInBody): Ditto.
      (WebCore::isInFoot): Ditto.
      (WebCore::HTMLTableRowsCollection::rowAfter): Ditto.
      * html/HTMLViewSourceDocument.cpp:
      (WebCore::HTMLViewSourceDocument::addRange): Ditto.
      * html/MediaDocument.cpp:
      (WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
      * html/parser/HTMLConstructionSite.cpp:
      (WebCore::HTMLConstructionSite::attach): Ditto.
      (WebCore::HTMLConstructionSite::findFosterSite): Ditto.
      * html/parser/HTMLTreeBuilder.cpp:
      * page/FocusController.cpp:
      (WebCore::FocusController::findFocusableNodeInDirection): Ditto.
      * rendering/MediaControlElements.cpp:
      (WebCore::MediaControlElement::rendererIsNeeded): Ditto.
      (WebCore::MediaControlElement::attach): Ditto.
      (WebCore::MediaControlElement::updateStyle): Ditto.
      (WebCore::MediaControlInputElement::rendererIsNeeded): Ditto.
      (WebCore::MediaControlInputElement::attach): Ditto.
      (WebCore::MediaControlInputElement::updateStyle): Ditto.
      * rendering/RenderSVGGradientStop.cpp:
      (WebCore::RenderSVGGradientStop::gradientElement): Ditto.
      * svg/SVGAElement.cpp:
      (WebCore::SVGAElement::createRenderer): Ditto.
      (WebCore::SVGAElement::childShouldCreateRenderer): Ditto.
      * svg/SVGFELightElement.cpp:
      (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
      (WebCore::SVGFELightElement::childrenChanged): Ditto.
      * svg/SVGFEMergeNodeElement.cpp:
      (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
      * svg/SVGLength.cpp:
      (WebCore::SVGLength::determineViewport): Ditto.
      * svg/SVGStyledElement.cpp:
      (WebCore::SVGStyledElement::updateRelativeLengthsInformation): Ditto.
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::removeDisallowedElementsFromSubtree): Ditto.
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::SVGSMILElement::insertedIntoDocument): Ditto.
      * xml/XPathNodeSet.cpp:
      (WebCore::XPath::NodeSet::sort): Ditto.
      * xml/XPathStep.cpp:
      (WebCore::XPath::Step::nodesInAxis): Ditto.
      * xml/XSLTProcessorLibxslt.cpp:
      (WebCore::xsltStylesheetPointer): Ditto.
      
      WebKit/chromium:
      
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::insertStyleText): Changed to use parentNode.
      (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection): Ditto.
      
      WebKit/qt:
      
      * Api/qwebelement.cpp:
      (QWebElement::prependOutside): Changed to use parentNode.
      (QWebElement::appendOutside): Ditto.
      (QWebElement::encloseContentsWith): Ditto.
      (QWebElement::encloseWith): Ditto.
      
      WebKit2:
      
      * WebProcess/WebPage/WebPage.cpp: Changed to use parentNode.
      (WebKit::WebPage::findZoomableAreaForPoint): Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e43caa78
  20. 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
  21. 14 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-14 Ryosuke Niwa <rniwa@webkit.org> · aeeef960
      rniwa@webkit.org authored
              Reviewed by Tony Chang and Darin Adler.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              The bug was caused by WebKit's not reusing the block node added by previous iteration
              and its inserting block node at wrong places.
      
              Fixed the bug by rewriting FormatBlockCommand::formatRange.  New code resembles that of
              IndentOutdentCommand::indentIntoBlockquote.  The difference between two is that formatRange
              avoids the existing block elements when replacing blocks and it also adds a placeholder
              when removing the existing block caused paragraphs to collapse.
      
              Also fixed a bug in moveParagraphWithClones where erroneous br is added to the start of
              the block element to which the paragraph is moved if the block element is the start of a paragraph
              and not the end of a paragraph.
      
              Tests: editing/execCommand/format-block-multiple-paragraphs.html
                     editing/execCommand/format-block-table.html
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphWithClones): No longer adds erroneous br.
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): Rewritten; see above.
              (WebCore::FormatBlockCommand::isElementToApplyInFormatBlockCommand): Renamed from validBlockElement
              and moved from htmlediting.cpp.
              (WebCore::enclosingBlockToSplitTreeTo): Added.
              * editing/FormatBlockCommand.h:
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement): Changed the return type to Element*
              * editing/VisiblePosition.h:
      2010-10-14  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang and Darin Adler.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              Added tests to ensure WebKit does not add multiple block elements when applying block element to
              multiple paragraphs.  Also added a test to ensure formatBlock works with tables.
      
              * fast/html/nav-element-expected.txt: Preserved new lines and removed redundant br.
              * editing/execCommand/format-block-expected.txt: Preserved span and removed erroneous br.
              * editing/execCommand/format-block-from-range-selection-expected.txt: Merged dl's and removed erroneous br.
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Added.
              * editing/execCommand/format-block-multiple-paragraphs.html: Added.
              * editing/execCommand/format-block-table-expected.txt: Added.
              * editing/execCommand/format-block-table.html: Added.
              * editing/execCommand/format-block-with-braces-expected.txt: Removed erroneous br.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aeeef960
  22. 13 Oct, 2010 2 commits
    • commit-queue@webkit.org's avatar
      2010-10-12 Sheriff Bot <webkit.review.bot@gmail.com> · 93d722a2
      commit-queue@webkit.org authored
              Unreviewed, rolling out r69639.
              http://trac.webkit.org/changeset/69639
              https://bugs.webkit.org/show_bug.cgi?id=47575
      
              "regressed nav-element.html" (Requested by rniwa on #webkit).
      
              * editing/execCommand/format-block-expected.txt:
              * editing/execCommand/format-block-from-range-selection-expected.txt:
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Removed.
              * editing/execCommand/format-block-multiple-paragraphs.html: Removed.
              * editing/execCommand/format-block-table-expected.txt: Removed.
              * editing/execCommand/format-block-table.html: Removed.
              * editing/execCommand/format-block-with-braces-expected.txt:
      2010-10-12  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r69639.
              http://trac.webkit.org/changeset/69639
              https://bugs.webkit.org/show_bug.cgi?id=47575
      
              "regressed nav-element.html" (Requested by rniwa on #webkit).
      
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::formatSelection):
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange):
              * editing/FormatBlockCommand.h:
              (WebCore::FormatBlockCommand::editingAction):
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement):
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              (WebCore::validBlockTag):
              * editing/htmlediting.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      93d722a2
    • rniwa@webkit.org's avatar
      2010-10-12 Ryosuke Niwa <rniwa@webkit.org> · 65f41609
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              The bug was caused by WebKit's not reusing the block node added by previous iteration
              and its inserting block node at wrong places.
      
              Fixed the bug by rewriting FormatBlockCommand::formatRange.  New code resembles that of
              IndentOutdentCommand::indentIntoBlockquote.  The difference between two is that formatRange
              avoids the existing block elements when replacing blocks and it also adds a placeholder
              when removing the existing block caused paragraphs to collapse.
      
              Tests: editing/execCommand/format-block-multiple-paragraphs.html
                     editing/execCommand/format-block-table.html
      
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): Rewritten; see above.
              (WebCore::FormatBlockCommand::isElementToApplyInFormatBlockCommand): Renamed from validBlockElement
              and moved from htmlediting.cpp.
              (WebCore::FormatBlockCommand::enclosingBlockToSplitTreeTo): Added.
              * editing/FormatBlockCommand.h:
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement): Changed the return type to Element*
              * editing/VisiblePosition.h:
      2010-10-12  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              Added tests to ensure WebKit does not add multiple block elements when applying block element to
              multiple paragraphs.  Also added a test to ensure formatBlock works with tables.
      
              * editing/execCommand/format-block-expected.txt: Preserved span and removed erroneous br.
              * editing/execCommand/format-block-from-range-selection-expected.txt: Merged dl's and removed erroneous br.
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Added.
              * editing/execCommand/format-block-multiple-paragraphs.html: Added.
              * editing/execCommand/format-block-table-expected.txt: Added.
              * editing/execCommand/format-block-table.html: Added.
              * editing/execCommand/format-block-with-braces-expected.txt: Removed erroneous br.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      65f41609
  23. 29 Sep, 2010 1 commit
  24. 30 Jul, 2010 1 commit
    • rniwa@webkit.org's avatar
      InsertOrderedList does not switch the list type properly when it has an inner list. · 620e8d1f
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=43166
      
      Reviewed by Darin Adler.
      
      WebCore: 
      
      The bug was caused by forcedCreateList was not set to true when the start and the end
      of the selection lies in the same list. Added selectionHasListOfType to fix this problem.
      
      WebKit used not to convert the outer lists even when the list is fully selected.
      Corrected this behavior by converting the entire list at once when the list is fully selected.
      To decide whether or not a list is fully selected, added currentSelection argument to doApplyForSingleParagraph.
      
      Tests: editing/execCommand/switch-list-type-with-inner-list.html
             editing/execCommand/switch-list-type-with-orphaned-li.html
      
      * editing/InsertListCommand.cpp:
      (WebCore::InsertListCommand::mergeWithNeighboringLists): Extracted the code to merge lists.
      (WebCore::InsertListCommand::selectionHasListOfType): attachment.cgi
      (WebCore::InsertListCommand::doApply): Calls selectionHasListOfType.
      (WebCore::InsertListCommand::doApplyForSingleParagraph): See above.
      (WebCore::InsertListCommand::listifyParagraph): Calls mergeWithNeighboringLists.
      * editing/InsertListCommand.h:
      * editing/htmlediting.cpp:
      (WebCore::canMergeLists): Ensures lists being merged are instances of HTMLElement.
      (WebCore::isNodeVisiblyContainedWithin): Works properly when one end is inside the range.
      
      LayoutTests: 
      
      Added a test to convert an unordered list with a nested list to an ordered list.
      Also added a test to convert multiple lists with an orphaned list to an ordered list.
      The behavior of WebKit is changed not to flatten the lists when inserting ordered/unordered
      lists on nested lists.
      
      * editing/execCommand/5207369-expected.txt: No longer flattens the list to match Firefox and MSIE.
      * editing/execCommand/5207369.html: Updated.
      * editing/execCommand/remove-list-items-expected.txt: Removed one whitespace.
      * editing/execCommand/switch-list-type-with-inner-list-expected.txt: Added.
      * editing/execCommand/switch-list-type-with-inner-list.html: Added.
      * editing/execCommand/switch-list-type-with-orphaned-li-expected.txt: Added.
      * editing/execCommand/switch-list-type-with-orphaned-li.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      620e8d1f
  25. 09 Jun, 2010 1 commit
  26. 30 May, 2010 1 commit
    • darin@apple.com's avatar
      2010-05-30 Darin Adler <darin@apple.com> · 1f643c79
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              Make more HTML DOM members private, especially constructors, third and final batch
              https://bugs.webkit.org/show_bug.cgi?id=39916
      
              * WebView/WebHTMLRepresentation.mm:
              (-[WebHTMLRepresentation elementWithName:inForm:]): Use the new HTMLFormElement
              function, associatedElements, rather than getting directly at a data member
              named formElements.
              (-[WebHTMLRepresentation controlsInForm:]): Ditto.
      2010-05-30  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              Make more HTML DOM members private, especially constructors, third and final batch
              https://bugs.webkit.org/show_bug.cgi?id=39916
      
              * dom/Document.cpp:
              (WebCore::Document::implicitClose):
              * editing/DeleteButtonController.cpp:
              (WebCore::DeleteButtonController::createDeletionUI):
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertHorizontalRule):
              (WebCore::executeInsertImage):
              * editing/htmlediting.cpp:
              (WebCore::createDefaultParagraphElement):
              (WebCore::createListItemElement):
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::handleError):
              (WebCore::HTMLParser::headCreateErrorCheck):
              (WebCore::HTMLParser::formCreateErrorCheck):
              (WebCore::HTMLParser::createHead):
              (WebCore::HTMLParser::handleIsindex):
              (WebCore::HTMLParser::finished):
              * html/HTMLViewSourceDocument.cpp:
              (WebCore::HTMLViewSourceDocument::createContainingTable):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::createSubtreeIfNeeded):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
              Use create instead of new to create HTML elements.
      
              * html/HTMLFormCollection.cpp:
              (WebCore::HTMLFormCollection::formCollectionInfo):
              (WebCore::HTMLFormCollection::item):
              (WebCore::HTMLFormCollection::getNamedFormItem):
              (WebCore::HTMLFormCollection::updateNameCache):
              * html/HTMLFormControlElement.h:
              Updated for name and privacy changes in HTMLFormElement.
      
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::HTMLFormElement):
              (WebCore::HTMLFormElement::create):
              (WebCore::HTMLFormElement::~HTMLFormElement):
              (WebCore::HTMLFormElement::length):
              (WebCore::HTMLFormElement::submitImplicitly):
              (WebCore::HTMLFormElement::createFormData):
              (WebCore::HTMLFormElement::submit):
              (WebCore::HTMLFormElement::reset):
              (WebCore::HTMLFormElement::formElementIndex):
              (WebCore::HTMLFormElement::registerFormElement):
              (WebCore::HTMLFormElement::removeFormElement):
              (WebCore::HTMLFormElement::registerImgElement):
              (WebCore::HTMLFormElement::removeImgElement):
              (WebCore::HTMLFormElement::defaultButton):
              (WebCore::HTMLFormElement::collectUnhandledInvalidControls):
              (WebCore::HTMLFormElement::addElementAlias):
              (WebCore::HTMLFormElement::documentDidBecomeActive):
              * html/HTMLFormElement.h:
              Added create functions. Made constructors and other members private.
              Used an OwnPtr for m_elementAliases. Renamed collectionInfo to
              m_collectionCache and used an OwnPtr for it. Renamed formElements to
              m_associatedElements (since its contents are what HTML5 calls
              "form-associated element", not form elements). Renamed imgElements to
              m_imageElements.
      
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
              (WebCore::HTMLFrameSetElement::create):
              (WebCore::HTMLFrameSetElement::parseMappedAttribute):
              * html/HTMLFrameSetElement.h:
              Added create functions. Made constructors and other members private.
              Renamed m_rows and m_cols to m_rowLengths and m_colLengths and used
              OwnArrayPtr for both.
      
              * html/HTMLLabelElement.cpp:
              (WebCore::nodeAsLabelableFormControl): Made this cast to Element instead
              of HTMLElement, since isFormControlElement is available on Element.
              (WebCore::HTMLLabelElement::HTMLLabelElement):
              (WebCore::HTMLLabelElement::create):
              * html/HTMLLabelElement.h:
              Added create functions. Made constructors and other members private.
      
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::HTMLLegendElement):
              (WebCore::HTMLLegendElement::create):
              (WebCore::HTMLLegendElement::associatedControl):
              (WebCore::HTMLLegendElement::focus):
              (WebCore::HTMLLegendElement::accessKeyAction):
              * html/HTMLLegendElement.h:
              Added create functions. Made constructors and other members private.
              Renamed formElement to associatedControl since hte control associated
              with this legend is not a "form element".
      
              * editing/DeleteButton.cpp:
              (WebCore::DeleteButton::DeleteButton):
              (WebCore::DeleteButton::create):
              * editing/DeleteButton.h:
              * html/HTMLDivElement.cpp:
              (WebCore::HTMLDivElement::HTMLDivElement):
              (WebCore::HTMLDivElement::create):
              * html/HTMLDivElement.h:
              * html/HTMLFontElement.cpp:
              (WebCore::HTMLFontElement::create):
              * html/HTMLFontElement.h:
              * html/HTMLHRElement.cpp:
              (WebCore::HTMLHRElement::HTMLHRElement):
              (WebCore::HTMLHRElement::create):
              * html/HTMLHRElement.h:
              * html/HTMLHeadElement.cpp:
              (WebCore::HTMLHeadElement::HTMLHeadElement):
              (WebCore::HTMLHeadElement::create):
              * html/HTMLHeadElement.h:
              * html/HTMLHeadingElement.cpp:
              (WebCore::HTMLHeadingElement::HTMLHeadingElement):
              (WebCore::HTMLHeadingElement::create):
              * html/HTMLHeadingElement.h:
              * html/HTMLHtmlElement.cpp:
              (WebCore::HTMLHtmlElement::HTMLHtmlElement):
              (WebCore::HTMLHtmlElement::create):
              * html/HTMLHtmlElement.h:
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::HTMLImageElement):
              (WebCore::HTMLImageElement::create):
              * html/HTMLImageElement.h:
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::HTMLInputElement):
              (WebCore::HTMLInputElement::create):
              (WebCore::HTMLInputElement::createTemporaryFormForIsIndex):
              * html/HTMLInputElement.h:
              * html/HTMLIsIndexElement.cpp:
              (WebCore::HTMLIsIndexElement::HTMLIsIndexElement):
              (WebCore::HTMLIsIndexElement::create):
              * html/HTMLIsIndexElement.h:
              * html/HTMLLIElement.cpp:
              (WebCore::HTMLLIElement::HTMLLIElement):
              (WebCore::HTMLLIElement::create):
              * html/HTMLLIElement.h:
              * html/HTMLLinkElement.cpp:
              (WebCore::HTMLLinkElement::HTMLLinkElement):
              (WebCore::HTMLLinkElement::create):
              * html/HTMLLinkElement.h:
              Added create functions. Made constructors and other members private.
      
              * html/HTMLTagNames.in: Removed the createWithNew flag from all the
              tags that were still using it: div, font, form, frameset, h1, h2, h3,
              h4, h5, h6, head, hr, html, image, img, input, ins, isindex, label,
              legend, li, and link.
      
              * html/HTMLTextAreaElement.h: Removed unneeded definition of the readOnly
              function, since the one in HTMLFormElement does the same thing.
      
              * loader/ImageDocument.cpp:
              (WebCore::ImageDocumentElement::ImageDocumentElement):
              (WebCore::ImageDocumentElement::create):
              (WebCore::ImageDocument::createDocumentStructure):
              Added create functions. Made constructors and other members private.
      
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag): Use the non-virtual disabled
              function instead of the virtual isEnabledFormControl function, which just
              turns around and calls the disabled function.
      
              * rendering/MediaControlElements.cpp:
              (WebCore::MediaControlShadowRootElement::MediaControlShadowRootElement):
              (WebCore::MediaControlShadowRootElement::create):
              (WebCore::MediaControlElement::MediaControlElement):
              (WebCore::MediaControlElement::create):
              (WebCore::MediaControlTimelineContainerElement::MediaControlTimelineContainerElement):
              (WebCore::MediaControlTimelineContainerElement::create):
              (WebCore::MediaControlTimelineContainerElement::rendererIsNeeded):
              (WebCore::MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContainerElement):
              (WebCore::MediaControlVolumeSliderContainerElement::create):
              (WebCore::MediaControlStatusDisplayElement::MediaControlStatusDisplayElement):
              (WebCore::MediaControlStatusDisplayElement::create):
              (WebCore::MediaControlStatusDisplayElement::update):
              (WebCore::MediaControlStatusDisplayElement::rendererIsNeeded):
              (WebCore::MediaControlInputElement::MediaControlInputElement):
              (WebCore::MediaControlInputElement::styleForElement):
              (WebCore::MediaControlInputElement::rendererIsNeeded):
              (WebCore::MediaControlInputElement::attach):
              (WebCore::MediaControlInputElement::updateStyle):
              (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement):
              (WebCore::MediaControlMuteButtonElement::create):
              (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
              (WebCore::MediaControlMuteButtonElement::updateDisplayType):
              (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement):
              (WebCore::MediaControlPlayButtonElement::create):
              (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
              (WebCore::MediaControlPlayButtonElement::updateDisplayType):
              (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement):
              (WebCore::MediaControlSeekButtonElement::create):
              (WebCore::MediaControlSeekButtonElement::isForwardButton):
              (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
              (WebCore::MediaControlSeekButtonElement::seekTimerFired):
              (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement):
              (WebCore::MediaControlRewindButtonElement::create):
              (WebCore::MediaControlRewindButtonElement::defaultEventHandler):
              (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement):
              (WebCore::MediaControlReturnToRealtimeButtonElement::create):
              (WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
              (WebCore::MediaControlTimelineElement::MediaControlTimelineElement):
              (WebCore::MediaControlTimelineElement::create):
              (WebCore::MediaControlTimelineElement::defaultEventHandler):
              (WebCore::MediaControlTimelineElement::update):
              (WebCore::MediaControlVolumeSliderElement::MediaControlVolumeSliderElement):
              (WebCore::MediaControlVolumeSliderElement::create):
              (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
              (WebCore::MediaControlVolumeSliderElement::update):
              (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement):
              (WebCore::MediaControlFullscreenButtonElement::create):
              (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
              (WebCore::MediaControlTimeDisplayElement::MediaControlTimeDisplayElement):
              (WebCore::MediaControlTimeDisplayElement::create):
              * rendering/MediaControlElements.h:
              Added create functions. Made constructors and other members private.
      
              * rendering/RenderFileUploadControl.cpp:
              (WebCore::ShadowInputElement::ShadowInputElement):
              (WebCore::ShadowInputElement::create):
              (WebCore::RenderFileUploadControl::updateFromElement):
              Added create functions. Made constructors and other members private.
      
              * rendering/RenderMedia.cpp:
              (WebCore::RenderMedia::createControlsShadowRoot):
              (WebCore::RenderMedia::createPanel):
              (WebCore::RenderMedia::createMuteButton):
              (WebCore::RenderMedia::createPlayButton):
              (WebCore::RenderMedia::createSeekBackButton):
              (WebCore::RenderMedia::createSeekForwardButton):
              (WebCore::RenderMedia::createRewindButton):
              (WebCore::RenderMedia::createReturnToRealtimeButton):
              (WebCore::RenderMedia::createToggleClosedCaptionsButton):
              (WebCore::RenderMedia::createStatusDisplay):
              (WebCore::RenderMedia::createTimelineContainer):
              (WebCore::RenderMedia::createTimeline):
              (WebCore::RenderMedia::createVolumeSliderContainer):
              (WebCore::RenderMedia::createVolumeSlider):
              (WebCore::RenderMedia::createCurrentTimeDisplay):
              (WebCore::RenderMedia::createTimeRemainingDisplay):
              (WebCore::RenderMedia::createFullscreenButton):
              Use create instead of new.
      
              * rendering/RenderProgress.cpp:
              (WebCore::ProgressValueElement::ProgressValueElement):
              (WebCore::ProgressValueElement::create):
              (WebCore::RenderProgress::updateValuePartState):
              * rendering/RenderSlider.cpp:
              (WebCore::SliderThumbElement::SliderThumbElement):
              (WebCore::SliderThumbElement::create):
              (WebCore::RenderSlider::updateFromElement):
              Added create functions. Made constructors and other members private.
      
              * rendering/TextControlInnerElements.cpp:
              (WebCore::TextControlInnerElement::TextControlInnerElement):
              (WebCore::TextControlInnerElement::create):
              (WebCore::TextControlInnerTextElement::TextControlInnerTextElement):
              (WebCore::TextControlInnerTextElement::create):
              (WebCore::TextControlInnerTextElement::defaultEventHandler):
              (WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
              (WebCore::SearchFieldResultsButtonElement::create):
              (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
              (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
              (WebCore::SearchFieldCancelButtonElement::create):
              (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
              (WebCore::SpinButtonElement::SpinButtonElement):
              (WebCore::SpinButtonElement::create):
              (WebCore::SpinButtonElement::defaultEventHandler):
              * rendering/TextControlInnerElements.h:
              Added create functions. Made constructors and other members private.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f643c79
  27. 28 May, 2010 1 commit
    • darin@apple.com's avatar
      2010-05-27 Darin Adler <darin@apple.com> · 877ce5b7
      darin@apple.com authored
              Reviewed by David Levin.
      
              Make more HTML DOM members private, especially constructors, batch 2
              https://bugs.webkit.org/show_bug.cgi?id=39706
      
              Refactoring so no new tests.
      
              Worked my way up from the bottom of HTMLTagNames.in.
      
              * html/HTMLTagNames.in: Removed createWithNew from keygen, listing,
              map, marquee, menu, meta, ol, optgroup, option, p, param, pre,
              script, select, source, style, table, tbody, td, textarea, tfoot,
              th, thead, title, tr, ul, video, xmp, and noscript.
      
              * editing/htmlediting.cpp:
              (WebCore::createOrderedListElement): Use create function instead of new.
              (WebCore::createUnorderedListElement): Ditto.
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::handleError): Ditto.
              (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
              * html/HTMLViewSourceDocument.cpp:
              (WebCore::HTMLViewSourceDocument::createContainingTable): Ditto.
              (WebCore::HTMLViewSourceDocument::addLine): Ditto.
      
              * html/HTMLKeygenElement.cpp:
              (WebCore::HTMLKeygenElement::HTMLKeygenElement): Use create function
              instead of new.
              (WebCore::HTMLKeygenElement::create): Added.
              * html/HTMLKeygenElement.h: Made constructor and virtual function
              overrides private, added create function.
      
              * html/HTMLMapElement.cpp:
              (WebCore::HTMLMapElement::HTMLMapElement):
              (WebCore::HTMLMapElement::create):
              * html/HTMLMapElement.h:
              * html/HTMLMarqueeElement.cpp:
              (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
              (WebCore::HTMLMarqueeElement::create):
              * html/HTMLMarqueeElement.h:
              * html/HTMLMenuElement.cpp:
              (WebCore::HTMLMenuElement::HTMLMenuElement):
              (WebCore::HTMLMenuElement::create):
              * html/HTMLMenuElement.h:
              * html/HTMLMetaElement.cpp:
              (WebCore::HTMLMetaElement::HTMLMetaElement):
              (WebCore::HTMLMetaElement::create):
              * html/HTMLMetaElement.h:
              * html/HTMLNoScriptElement.cpp:
              (WebCore::HTMLNoScriptElement::HTMLNoScriptElement):
              (WebCore::HTMLNoScriptElement::create):
              (WebCore::HTMLNoScriptElement::childShouldCreateRenderer):
              * html/HTMLNoScriptElement.h:
              * html/HTMLOListElement.cpp:
              (WebCore::HTMLOListElement::HTMLOListElement):
              (WebCore::HTMLOListElement::create):
              * html/HTMLOListElement.h:
              * html/HTMLOptGroupElement.cpp:
              (WebCore::HTMLOptGroupElement::HTMLOptGroupElement):
              (WebCore::HTMLOptGroupElement::create):
              * html/HTMLOptGroupElement.h:
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::HTMLOptionElement):
              (WebCore::HTMLOptionElement::create):
              * html/HTMLOptionElement.h:
              * html/HTMLParagraphElement.cpp:
              (WebCore::HTMLParagraphElement::HTMLParagraphElement):
              (WebCore::HTMLParagraphElement::create):
              * html/HTMLParagraphElement.h:
              * html/HTMLParamElement.cpp:
              (WebCore::HTMLParamElement::HTMLParamElement):
              (WebCore::HTMLParamElement::create):
              * html/HTMLParamElement.h:
              * html/HTMLPreElement.cpp:
              (WebCore::HTMLPreElement::HTMLPreElement):
              (WebCore::HTMLPreElement::create):
              * html/HTMLPreElement.h:
              * html/HTMLQuoteElement.cpp:
              (WebCore::HTMLQuoteElement::HTMLQuoteElement):
              (WebCore::HTMLQuoteElement::create):
              * html/HTMLQuoteElement.h:
              * html/HTMLScriptElement.cpp:
              (WebCore::HTMLScriptElement::HTMLScriptElement):
              (WebCore::HTMLScriptElement::create):
              * html/HTMLScriptElement.h:
              * html/HTMLSelectElement.cpp:
              (WebCore::HTMLSelectElement::create):
              * html/HTMLSelectElement.h:
              * html/HTMLSourceElement.cpp:
              (WebCore::HTMLSourceElement::HTMLSourceElement):
              (WebCore::HTMLSourceElement::create):
              * html/HTMLSourceElement.h:
              * html/HTMLStyleElement.cpp:
              (WebCore::HTMLStyleElement::HTMLStyleElement):
              (WebCore::HTMLStyleElement::create):
              * html/HTMLStyleElement.h:
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::HTMLTableRowElement):
              (WebCore::HTMLTableRowElement::create):
              (WebCore::HTMLTableRowElement::insertCell):
              * html/HTMLTableRowElement.h:
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::HTMLTableSectionElement):
              (WebCore::HTMLTableSectionElement::create):
              (WebCore::HTMLTableSectionElement::insertRow):
              * html/HTMLTableSectionElement.h:
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::create):
              * html/HTMLTextAreaElement.h:
              * html/HTMLTitleElement.cpp:
              (WebCore::HTMLTitleElement::HTMLTitleElement):
              (WebCore::HTMLTitleElement::create):
              * html/HTMLTitleElement.h:
              * html/HTMLUListElement.cpp:
              (WebCore::HTMLUListElement::HTMLUListElement):
              (WebCore::HTMLUListElement::create):
              * html/HTMLUListElement.h:
              * html/HTMLVideoElement.cpp:
              (WebCore::HTMLVideoElement::HTMLVideoElement):
              (WebCore::HTMLVideoElement::create):
              * html/HTMLVideoElement.h:
              Made constructors and virtual function overrides private, added
              create function.
      
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::HTMLTableCellElement): Updated
              names of data members. Renamed _row to m_row, _col to m_col,
              rSpan to m_rowSpan, cSpan to m_colSpan, and removed unused
              rowHeight and m_solid.
              (WebCore::HTMLTableCellElement::create): Added.
              (WebCore::HTMLTableCellElement::parseMappedAttribute): Updated names.
              * html/HTMLTableCellElement.h: Ditto.
      
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::create): Added.
              (WebCore::HTMLTableElement::createTHead): Used create instead of new.
              (WebCore::HTMLTableElement::createTFoot): Ditto.
              (WebCore::HTMLTableElement::insertRow): Ditto.
              * html/HTMLTableElement.h:
      
              * html/HTMLTablePartElement.h: Made members protected instead of
              public.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      877ce5b7
  28. 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
  29. 20 Apr, 2010 1 commit
    • rniwa@webkit.org's avatar
      Nested <ul>s are mishandled when converted to <ol> using execCommand('insertorderedlist') · dfb6424f
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=19539
      
      Reviewed by Justin Garcia.
      
      WebCore: 
      
      Fixes a bug where two consecutive lists are not merged if they have been converted
      from ordered/unordered lists inside another list.
      
      The bug was caused by InsertListCommand::doApply where it did not merge a newly inserted
      list element and its neighbors. This patch adds code to doApply so that after inserting
      the list element, it updates previousList and nextList to the outermost list elements around
      insertionPos under the same enclosing list. Because the next and the previous list elements
      are not necessarily visually next to the newly inserted element before moveParagraph moves
      the paragraph into the new list element, doApply merges lists after moveParagraph is called.
      
      Test: editing/execCommand/insert-lists-inside-another-list.html
      
      * editing/InsertListCommand.cpp:
      (WebCore::InsertListCommand::doApply): Modified as described above
      * editing/htmlediting.cpp:
      (WebCore::outermostEnclosingList): Added rootNode. Returns the outermost list element,
        which is a descendent of rootNode.
      * editing/htmlediting.h:
      
      LayoutTests: 
      
      Test to make sure InsertListCommand merges consecutive lists when converting
      ordered/unordered lists to the opposite type of lists inside another list.
      
      * editing/execCommand/insert-lists-inside-another-list-expected.txt: Added.
      * editing/execCommand/insert-lists-inside-another-list.html: Added.
      * editing/execCommand/script-tests/insert-lists-inside-another-list.js: Added.
      (testList):
      * platform/mac/editing/execCommand/create-list-from-range-selection-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dfb6424f
  30. 08 Mar, 2010 1 commit
    • tkent@chromium.org's avatar
      2010-03-08 Kent Tamura <tkent@chromium.org> · 882fe113
      tkent@chromium.org authored
              Reviewed by Adam Barth.
      
              Implement HTML5 <hgroup> element.
              https://bugs.webkit.org/show_bug.cgi?id=32943
      
              The new test file tests:
              - <p> closing,
              - Residual style, and
              - FormatBlock.
      
              * fast/html/hgroup-element-expected.txt: Added.
              * fast/html/hgroup-element.html: Added.
              * fast/html/script-tests/hgroup-element.js: Added.
      2010-03-08  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Adam Barth.
      
              Implement HTML5 <hgroup> element.
              https://bugs.webkit.org/show_bug.cgi?id=33369
      
              <hgroup> should behave the same as <nav>, <section>, <article>, and <aside>.
              <hgroup> has no specific parsing rules.
      
              Test: fast/html/hgroup-element.html
      
              * css/html.css: Add hgroup as a block element.
              * editing/htmlediting.cpp:
              (WebCore::validBlockTag): Add hgroupTag.
              * html/HTMLElement.cpp:
              (WebCore::createTagPriorityMap): Returns 5 for hgroupTag.
              (WebCore::blockTagList): Add hgroupTag.
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::getNode): Add hgroupTag.
              * html/HTMLTagNames.in: Add hgroup.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      882fe113
  31. 26 Feb, 2010 1 commit
    • ossy@webkit.org's avatar
      Unreviewed. Roll-out r55263 because it broke fast/forms/textarea-type-spaces-pretty-diff.html. · 713375e0
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=30946
      
      WebCore: 
      
      * editing/CompositeEditCommand.cpp:
      (WebCore::isWhitespace):
      (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::input):
      * editing/InsertTextCommand.h:
      * editing/htmlediting.cpp:
      * editing/htmlediting.h:
      
      LayoutTests: 
      
      * editing/execCommand/5142012-3-expected.txt:
      * editing/inserting/rebalance-whitespace-1-expected.txt: Removed.
      * editing/inserting/rebalance-whitespace-1.html: Removed.
      * editing/pasteboard/5521237-expected.txt:
      * platform/mac/editing/execCommand/5482023-expected.checksum:
      * platform/mac/editing/execCommand/5482023-expected.png: Added.
      * platform/mac/editing/execCommand/5482023-expected.txt:
      * platform/mac/editing/execCommand/remove-formatting-2-expected.checksum:
      * platform/mac/editing/execCommand/remove-formatting-2-expected.png: Added.
      * platform/mac/editing/execCommand/remove-formatting-expected.checksum:
      * platform/mac/editing/execCommand/remove-formatting-expected.png: Added.
      * platform/mac/editing/execCommand/remove-formatting-expected.txt:
      * platform/mac/editing/inserting/editable-html-element-expected.checksum:
      * platform/mac/editing/inserting/editable-html-element-expected.png: Added.
      * platform/mac/editing/inserting/editable-html-element-expected.txt:
      * platform/mac/editing/pasteboard/4989774-expected.checksum:
      * platform/mac/editing/pasteboard/4989774-expected.png: Added.
      * platform/mac/editing/pasteboard/4989774-expected.txt:
      * platform/mac/editing/selection/4983858-expected.checksum:
      * platform/mac/editing/selection/4983858-expected.png: Added.
      * platform/mac/editing/selection/4983858-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      713375e0
  32. 25 Feb, 2010 1 commit
    • enrica@apple.com's avatar
      Extra layout on keypress after a space (problem with rebalanceWhitespaceAt in InsertTextCommand). · b5adb4e2
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=30946
      <rdar://problem/7639184>
      
      Reviewed by Adele Peterson.
      
      WebCore: 
      
      Do text insertion and whitespace rebalancing around the insertion in one step so that there's only one layout.
      This patch was originally made by Justin Garcia.
              
      Test: editing/inserting/rebalance-whitespace-1.html
      
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): No behavior changes here,
      just pushed the code that determined the extent of whitespace surrounding a position
      to its own helper function.
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::insertTextIntoNodeAndRebalanceWhitespace): Added.  Find 
      whitespace surrounding the insertion position, add the text to insert, rebalance that entire
      string, then insert it into the document.
      (WebCore::InsertTextCommand::input):
      * editing/InsertTextCommand.h:
      * editing/htmlediting.cpp:
      (WebCore::isWhitespace): Moved from CompositeEditCommand.cpp.
      (WebCore::extentOfWhitespaceForRebalancingAt): Moved code from rebalanceWhitespaceAt into this helper
      function.  Obtains the offset of the start and end of whitespace around a particular position.
      * editing/htmlediting.h:
      
      LayoutTests: 
      
      There are now regular spaces where nbsps were used unnecessarily before.  Also,
      multi-character insertions now have their whitespace rebalanced, and this is
      reflected in a few tests.
      
      * editing/execCommand/5142012-3-expected.txt:
      * editing/inserting/rebalance-whitespace-1-expected.txt: Added.
      * editing/inserting/rebalance-whitespace-1.html: Added.
      * editing/pasteboard/5521237-expected.txt:
      * platform/mac/editing/execCommand/5482023-expected.checksum:
      * platform/mac/editing/execCommand/5482023-expected.png: Removed.
      * platform/mac/editing/execCommand/5482023-expected.txt:
      * platform/mac/editing/execCommand/remove-formatting-2-expected.checksum:
      * platform/mac/editing/execCommand/remove-formatting-2-expected.png: Removed.
      * platform/mac/editing/execCommand/remove-formatting-expected.checksum:
      * platform/mac/editing/execCommand/remove-formatting-expected.png: Removed.
      * platform/mac/editing/execCommand/remove-formatting-expected.txt:
      * platform/mac/editing/inserting/editable-html-element-expected.checksum:
      * platform/mac/editing/inserting/editable-html-element-expected.png: Removed.
      * platform/mac/editing/inserting/editable-html-element-expected.txt:
      * platform/mac/editing/pasteboard/4989774-expected.checksum:
      * platform/mac/editing/pasteboard/4989774-expected.png: Removed.
      * platform/mac/editing/pasteboard/4989774-expected.txt:
      * platform/mac/editing/selection/4983858-expected.checksum:
      * platform/mac/editing/selection/4983858-expected.png: Removed.
      * platform/mac/editing/selection/4983858-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5adb4e2
  33. 05 Feb, 2010 1 commit
    • tony@chromium.org's avatar
      2010-02-05 Tony Chang <tony@chromium.org> · cfe6587a
      tony@chromium.org authored
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=24872
              Add a test to make sure copying from a list and pasting into a list
              keeps the list at the same indention level rather than nesting.
      
              * editing/pasteboard/paste-list-002-expected.txt: Added.
              * editing/pasteboard/paste-list-002.html: Added.
      2010-02-05  Tony Chang  <tony@chromium.org>
      
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=24872
              When pasting a list into another list should not indent another level.
              If the cursor is at the beginning of the line, it should insert the
              list items before the current list item.  If the cursor is at the end
              of the line, it should insert the list items after the current list item.
      
              This matches Firefox and IE and makes the common activity of reordering a list
              work as expected.
      
              This also adds a small helper method (isListItem) to htmlediting.h.
      
              Test: editing/pasteboard/paste-list-002.html
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              (WebCore::ReplaceSelectionCommand::insertAsListItems):
              * editing/ReplaceSelectionCommand.h:
              * editing/htmlediting.cpp:
              (WebCore::isListItem):
              (WebCore::appendedSublist):
              * editing/htmlediting.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cfe6587a
  34. 04 Feb, 2010 1 commit
    • enrica@apple.com's avatar
      REGRESSION: Dragging plain text into a styled text region does not acquire the correct style info. · 5b42a264
      enrica@apple.com authored
      <rdar://problem/7595685>
      https://bugs.webkit.org/show_bug.cgi?id=34609
      
      Reviewed by Oliver Hunt.
      
      WebCore: 
      
      Test: editing/pasteboard/drop-inputtext-acquires-style.html
      
      The dragging code did not distinguish the case of dragging the content of an input control
      as a special case. The markup placed in the pasteboard included the style information.
      I've modified the Clipboard class interface adding a new method writePlainText to match the
      behavior of the copy and cut commands and modified the drag code to detect the special case.
      I've modified all the platform specific implementations of the Clipboard class.
              
      * dom/Clipboard.h: Added writePlainText pure virtual function.
      * editing/Editor.cpp:
      (WebCore::Editor::cut): Renamed nodeIsTextFormControl to isNodeInTextFormControl.
      (WebCore::Editor::copy): Renamed nodeIsTextFormControl to isNodeInTextFormControl.
      * editing/htmlediting.cpp:
      (WebCore::isNodeInTextFormControl): Added, after removing the implementation with the old name
      in Editor.cpp
      * editing/htmlediting.h:
      * page/DragController.cpp:
      (WebCore::DragController::startDrag):
      * platform/Pasteboard.h:
      * platform/android/ClipboardAndroid.cpp:
      (WebCore::ClipboardAndroid::writePlainText): Added.
      * platform/android/ClipboardAndroid.h:
      * platform/chromium/ClipboardChromium.cpp:
      (WebCore::ClipboardChromium::writePlainText): Added.
      * platform/chromium/ClipboardChromium.h:
      * platform/gtk/ClipboardGtk.cpp:
      (WebCore::ClipboardGtk::writePlainText): Added.
      * platform/gtk/ClipboardGtk.h:
      * platform/haiku/ClipboardHaiku.cpp:
      (WebCore::ClipboardHaiku::writePlainText): Added.
      * platform/haiku/ClipboardHaiku.h:
      * platform/mac/ClipboardMac.h:
      * platform/mac/ClipboardMac.mm:
      (WebCore::ClipboardMac::writePlainText): Added.
      * platform/mac/PasteboardMac.mm:
      (WebCore::Pasteboard::writePlainText): Added helper function.
      * platform/qt/ClipboardQt.cpp:
      (WebCore::ClipboardQt::writePlainText): Added.
      * platform/qt/ClipboardQt.h:
      * platform/win/ClipboardWin.cpp:
      (WebCore::ClipboardWin::writePlainText): Added.
      * platform/win/ClipboardWin.h:
      
      LayoutTests: 
      
      * editing/pasteboard/drop-inputtext-acquires-style-expected.txt: Added.
      * editing/pasteboard/drop-inputtext-acquires-style.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b42a264