1. 07 Apr, 2011 2 commits
    • 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
    • commit-queue@webkit.org's avatar
      2011-04-07 Jia Pu <jpu@apple.com> · 6aedb680
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              [Mac] Editor::setComposition() should not trigger correction panel timer.
              https://bugs.webkit.org/show_bug.cgi?id=58049
               <rdar://problem/9226305>
      
              On Mac OS X that supports autocorrection panel, typing unconfirmed composition (i.e. unconfirmed Japanese or Chinese input)
              should not start autocorrection timer. We added a member variable, m_shouldPreventSpellChecking, to TypingCommand.
              When this value is true, markMisspellingsAfterTyping() will not be called in TypingCommand::typingAddedToOpenCommand().
              m_shouldPreventSpellChecking is set to true in the TypingCommand objects created by Editor::setComposition().
      
              No new tests. No deterministically reproducible test case. Patch is based on static code analysis. Testing this also requires firing
              autocorrection panel timer, which can not be easily done in automated fashion.
      
              * editing/Editor.cpp:
              (WebCore::Editor::deleteWithDirection):
              (WebCore::Editor::insertTextWithoutSendingTextEvent):
              (WebCore::Editor::confirmComposition):
              (WebCore::Editor::setComposition):
              * editing/EditorCommand.cpp:
              (WebCore::executeDelete):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::TypingCommand):
              (WebCore::TypingCommand::deleteSelection):
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              (WebCore::TypingCommand::insertText):
              (WebCore::TypingCommand::insertLineBreak):
              (WebCore::TypingCommand::insertParagraphSeparator):
              (WebCore::TypingCommand::typingAddedToOpenCommand):
              * editing/TypingCommand.h:
              (WebCore::TypingCommand::create):
              (WebCore::TypingCommand::setShouldPreventSpellChecking):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6aedb680
  2. 06 Apr, 2011 7 commits
    • commit-queue@webkit.org's avatar
      2011-04-06 Sheriff Bot <webkit.review.bot@gmail.com> · e2d84280
      commit-queue@webkit.org authored
              Unreviewed, rolling out r83039.
              http://trac.webkit.org/changeset/83039
              https://bugs.webkit.org/show_bug.cgi?id=57978
      
              introduced a new regression in conjunction to
              ReplaceSelectionCommand (Requested by rniwa on #webkit).
      
              * editing/inserting/insert-paragraph-separator-tab-span-expected.txt: Removed.
              * editing/inserting/insert-paragraph-separator-tab-span.html: Removed.
      2011-04-06  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r83039.
              http://trac.webkit.org/changeset/83039
              https://bugs.webkit.org/show_bug.cgi?id=57978
      
              introduced a new regression in conjunction to
              ReplaceSelectionCommand (Requested by rniwa on #webkit).
      
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::init):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2d84280
    • commit-queue@webkit.org's avatar
      2011-04-06 Robert Sesek <rsesek@chromium.org> · 5def9a28
      commit-queue@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too
              https://bugs.webkit.org/show_bug.cgi?id=54969
      
              No change in behavior; no new tests.
      
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::locationAndLengthFromRange): New method from duplicated code in WebKits
              * editing/TextIterator.h:
              * page/Frame.cpp:
              (WebCore::Frame::rangeForPoint): New method from duplicated code in WebKits
      2011-04-06  Robert Sesek  <rsesek@chromium.org>
      
              Reviewed by Alexey Proskuryakov.
      
              Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too
              https://bugs.webkit.org/show_bug.cgi?id=54969
      
              * WebView/WebFrame.mm:
              (-[WebFrame _convertToNSRange:]): Moved duplicated code to WebCore
              (-[WebFrame _characterRangeAtPoint:]): Moved duplicated code to WebCore
      2011-04-06  Robert Sesek  <rsesek@chromium.org>
      
              Reviewed by Alexey Proskuryakov.
      
              Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too
              https://bugs.webkit.org/show_bug.cgi?id=54969
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::respondToChangedSelection): Moved duplicated code to WebCore
              * WebProcess/WebPage/mac/WebPageMac.mm: Moved duplicated code to WebCore
              (WebKit::WebPage::getMarkedRange):
              (WebKit::WebPage::getSelectedRange):
              (WebKit::WebPage::characterIndexForPoint):
              (WebKit::WebPage::performDictionaryLookupAtLocation):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5def9a28
    • commit-queue@webkit.org's avatar
      2011-04-06 Jia Pu <jpu@apple.com> · aad7ca2b
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              [Mac] WebCore need to notify AppKit spell checker after user has modified autocorrected text.
              https://bugs.webkit.org/show_bug.cgi?id=57665
              <rdar://problem/7350477>
      
              We need to track how user modified an autocorrected word. If he changed it back to original
              text, we want to record AutocorrectionReverted response. And if he changed it to something
              else, we want to record AutocorrectionEdited response.
      
              To achieve this, we need to distringuish between text replacement caused by autocorrection
              from that due to other causes, such as reversion, text substitution, etc. So we added a new
              marker type "Autocorrected". We also need to be able to check for correction, even when we
              don't intend to actually carry out replacement. For this, we introduced a new TextCheckingOption
              value, "CheckForCorrection".
      
              We also added DocumentMarkerController::markersInRange() to retrieve a vector of markers in
              specified range, and of specified type.
      
              * dom/DocumentMarker.h:
              * dom/DocumentMarkerController.cpp:
              (WebCore::DocumentMarkerController::markersInRange):
              (WebCore::DocumentMarkerController::hasMarkers):
              * dom/DocumentMarkerController.h:
              * editing/Editor.cpp:
              (WebCore::markerTypesForAutocorrection):
              (WebCore::markersHaveIdenticalDescription):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::recordSpellcheckerResponseForModifiedCorrection):
              (WebCore::Editor::changeBackToReplacedString):
              (WebCore::Editor::markMisspellingsAndBadGrammar):
              (WebCore::Editor::applyCorrectionPanelInfo):
              (WebCore::Editor::unappliedSpellCorrection):
              (WebCore::Editor::textCheckingTypeMaskFor):
              * editing/Editor.h:
              * editing/SpellingCorrectionCommand.cpp:
              (WebCore::SpellingCorrectionCommand::doApply):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aad7ca2b
    • commit-queue@webkit.org's avatar
      2011-04-06 Jia Pu <jpu@apple.com> · b8976c4d
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              [Mac] When autocorrection occurs without showing correction panel, WebCore need to post accessibility notification.
              https://bugs.webkit.org/show_bug.cgi?id=57800
              <rdar://problem/9218223>
      
              Defined a new accessibility notification type, AXAutocorrectionOccured. Editor::markAllMisspellingsAndBadGrammarInRanges()
              now posts said notification when any autocorrection or text replacement (e.g. replacing "(c)" with copyright mark) takes place.
      
              * accessibility/AXObjectCache.h:
              * accessibility/chromium/AXObjectCacheChromium.cpp:
              (WebCore::AXObjectCache::postPlatformNotification):
              * accessibility/mac/AXObjectCacheMac.mm:
              (WebCore::AXObjectCache::postPlatformNotification):
              * editing/Editor.cpp:
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8976c4d
    • rniwa@webkit.org's avatar
      2011-04-06 Ryosuke Niwa <rniwa@webkit.org> · 56390f67
      rniwa@webkit.org authored
              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.
      
              Test: editing/inserting/insert-paragraph-separator-tab-span.html
      
              * 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.
      2011-04-06  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
      
              Added a test insert a paragraph separator and text around tab spans. WebKit should not apply the tab span's
              style to the paragraph separator or the text.
      
              * editing/inserting/insert-paragraph-separator-tab-span-expected.txt: Added.
              * editing/inserting/insert-paragraph-separator-tab-span.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      56390f67
    • commit-queue@webkit.org's avatar
      2011-04-06 Anders Bakken <agbakken@gmail.com> · 9844e853
      commit-queue@webkit.org authored
              Reviewed by David Levin.
      
              [Qt] SmartReplaceQt.cpp has coding-style errors
              https://bugs.webkit.org/show_bug.cgi?id=40261
      
              This patch does not require new test cases.
      
              * editing/qt/SmartReplaceQt.cpp:
              (WebCore::isCharacterSmartReplaceExempt):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9844e853
    • commit-queue@webkit.org's avatar
      2011-04-06 Naoki Takano <takano.naoki@gmail.com> · f8b6b0dc
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
              https://bugs.webkit.org/show_bug.cgi?id=57755
      
              * editing/execCommand/insert-line-break-onload-expected.txt: Added.
              * editing/execCommand/insert-line-break-onload.html: Added to check calling InsertLineBreak without any crash.
      2011-04-06  Naoki Takano  <takano.naoki@gmail.com>
      
              Reviewed by Ryosuke Niwa.
      
              REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
              https://bugs.webkit.org/show_bug.cgi?id=57755
      
              Test: editing/execCommand/insert-line-break-onload.html
      
              * editing/TypingCommand.cpp:
              (WebCore::canAppendNewLineFeed): Added null pointer check for rootEditableElement().
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f8b6b0dc
  3. 05 Apr, 2011 3 commits
    • morrita@google.com's avatar
      2011-04-04 MORITA Hajime <morrita@google.com> · 8ee35ac4
      morrita@google.com authored
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              Removed WebCore::SpellCheckingResult and replaced it with TextCheckingResult.
              This change also added TextCheckerClient::requestCheckingOfString() should have
              TextCheckingTypeMask as a parameter to control text checking type.
      
              * WebCore.exp.in:
              * editing/Editor.cpp:
              (WebCore::Editor::replaceSelectionWithFragment):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::textCheckingTypeMaskFor): Extracted from markAllMisspellingsAndBadGrammarInRanges()
              * editing/SpellChecker.cpp:
              (WebCore::SpellChecker::requestCheckingFor): Added a parameter.
              (WebCore::SpellChecker::markAt): Extracted from didCheck(), Added a check for the GrammarDetail object.
              (WebCore::SpellChecker::didCheck):
              * editing/SpellChecker.h:
              * loader/EmptyClients.h:
              (WebCore::EmptyTextCheckerClient::checkTextOfParagraph):
              (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
              * platform/text/TextCheckerClient.h:
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              Followed the signature change.
      
              * src/EditorClientImpl.h:
              * src/EditorClientImpl.cpp:
              * src/WebTextCheckingCompletionImpl.cpp
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/EditorClientEfl.h:
              (WebCore::EditorClientEfl::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/TextCheckerClientEnchant.h:
              (WebKit::TextCheckerClientEnchant::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/EditorClientHaiku.h:
              (WebCore::EditorClientHaiku::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              Removed NSTextCheckingResult to SpellCheckingResult convertion, and extracted
              NSTextCheckingResult to TextCheckingResult convertio from checkTextOfParagraph method.
              for requestCheckingOfString method.
      
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (toCoreTextCheckingResults):
              (WebEditorClient::checkTextOfParagraph):
              (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:types:WebCore::results:]):
              (-[WebEditorSpellCheckResponder perform]):
              (WebEditorClient::requestCheckingOfString):
              * WebView/WebFrame.mm:
              (-[WebFrame markersForSelectionStartAsText]):
              * WebView/WebFramePrivate.h:
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/EditorClientQt.h:
              (WebCore::EditorClientQt::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/WebEditorClient.h:
              (WebEditorClient::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebCoreSupport/EditorClientWinCE.h:
              (WebKit::EditorClientWinCE::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebKitSupport/EditorClientWx.h:
              (WebCore::EditorClientWx::requestCheckingOfString):
      2011-04-04  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
              https://bugs.webkit.org/show_bug.cgi?id=56085
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::requestCheckingOfString):
              * WebProcess/WebCoreSupport/WebEditorClient.h:
              * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
              (WebKit::WebEditorClient::checkTextOfParagraph):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ee35ac4
    • leviw@chromium.org's avatar
      2011-04-05 Levi Weintraub <leviw@chromium.org> · 110c4577
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              DeleteButtonController is given invalid style
              https://bugs.webkit.org/show_bug.cgi?id=57853
      
              DeleteButtonController was assigned an invalid style that can lead to assertions
              in debug builds. This matches up the code with its intent.
      
              No new tests as this changes nothing on release builds.
      
              * editing/DeleteButtonController.cpp:
              (WebCore::DeleteButtonController::createDeletionUI):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      110c4577
    • commit-queue@webkit.org's avatar
      2011-04-05 Anders Bakken <agbakken@gmail.com> · 862a0040
      commit-queue@webkit.org authored
              Reviewed by Laszlo Gombos.
      
              [Qt] EditorQt.cpp has coding-style errors
              https://bugs.webkit.org/show_bug.cgi?id=40260
      
              This patch does not require new test cases.
      
              * editing/qt/EditorQt.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      862a0040
  4. 03 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-21 Ryosuke Niwa <rniwa@webkit.org> · 48291001
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              editing commands shouldn't run when there's no body
              https://bugs.webkit.org/show_bug.cgi?id=56771
      
              The bug was caused by WebKit's not checking the existence of root editable element
              in enabled* functions. Although isContentEditable returns true whenever we're in design mode,
              we should not run editing commands in a document without a body element editable because
              doing so results in appending a non-body element to the document node.
      
              Fixed the bug by modifying various enabled* functions to ensure we have a root editable element.
              New behavior tries to match that of Firefox except StyleWithCSS, which Firefox seems to ignore
              when there are no body element. Since StyleWithCSS is a document's state or property, we allow
              execCommand('StyleWithCSS') even in a document without a body element.
      
              WebKit's and Firefox's behaviors also deviate in insert-image-with-selecting-document.html.
              Whereas WebKit respects selection set by script and ignores execCommand, Firefox modifies
              the selection when document.write("x") is ran and successfully inserts image.
      
              Thus, empty-document-delete.html and empty-document-justify-right.html both pass on Firefox
              while empty-document-stylewithcss.html and insert-image-with-selecting-document.html both fail.
      
              Since Internet Explorer does not allow execCommand to run under design mode properly, we could
              not test its behavior.
      
              Tests: editing/editability/empty-document-delete.html
                     editing/editability/empty-document-justify-right.html
                     editing/editability/empty-document-stylewithcss.html
                     editing/execCommand/insert-image-with-selecting-document.html
      
              * editing/Editor.cpp:
              (WebCore::Editor::canEdit): Verify that the root editable element exists
              instead of just checking that selection endpoints are editable because
              selection endpoints could be document node without a body element in design mode
              and we don't want to consider such a document editable.
              (WebCore::Editor::canDelete): Ditto.
              * editing/EditorCommand.cpp:
              (WebCore::enabledInEditableText): Ditto.
              (WebCore::enabledInRichlyEditableText): Ditto.
              (WebCore::enabledDelete): Call enabledCut and enabledInEditableText instead
              of duplicating the code in order to fix the same bug.
      2011-03-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              editing commands shouldn't run when there's no body
              https://bugs.webkit.org/show_bug.cgi?id=56771
      
              Added tests to ensure WebKit does not crash when attempted to execute editing commands
              in an empty document. Also added a test to ensure WebKit does not crash when InsertImage
              is executed with selection endpoints being document. WebKit should ignore such attempts
              and should not crash.
      
              * editing/editability/empty-document-delete-expected.txt: Added.
              * editing/editability/empty-document-delete.html: Added.
              * editing/editability/empty-document-justify-right-expected.txt: Added.
              * editing/editability/empty-document-justify-right.html: Added.
              * editing/editability/empty-document-stylewithcss-expected.txt: Added.
              * editing/editability/empty-document-stylewithcss.html: Added.
              * editing/execCommand/insert-image-with-selecting-document-expected.txt: Added.
              * editing/execCommand/insert-image-with-selecting-document.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      48291001
  5. 31 Mar, 2011 3 commits
    • rniwa@webkit.org's avatar
      2011-03-31 Ryosuke Niwa <rniwa@webkit.org> · edfefd18
      rniwa@webkit.org authored
              Build fix after r82588. Reverted unintentional change.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyMovingLeft):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      edfefd18
    • xji@chromium.org's avatar
      2011-03-30 Xiaomei Ji <xji@chromium.org> · 429dd21b
      xji@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              * editing/selection/move-by-word-visually-expected.txt: Added.
              * editing/selection/move-by-word-visually.html: Added.
      2011-03-30  Xiaomei Ji  <xji@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              Follow Firefox's convention in Windows, 
              In LTR block, word break visually moves cursor to the left boundary of words,
              In RTL block, word break visually moves cursor to the right boundary of words.
      
              This is the 1st version of implementing "move caret by word in visual order".
              It only works in the following situation:
              1. For a LTR box in a LTR block or a RTL box in RTL block, 
              when caret is at the left boundary of the box and we are looking for 
              the word boundary in right.
              2. For a LTR or RTL box in a LTR block, when caret is at the left boundary
              of the box and we are looking for the word boundary in left and 
              previous box is a LTR box.
              3. For a LTR or RTL box in a RTL block, when the caret is at the right 
              boundary of the box and we are looking for the word boundary in right and next box is RTL box.
      
              An experimental granularity is introduced, as a side effect, functions having switch statements
              to handle those granularities have to add more one case to handle this new granularity.
              The experimental granularity is exposed though JS by '-webkit-visual-word".
      
              The overall algorithm is looping through inline boxes visually and looking
              for the visually nearest word break position. 
      
              Test: editing/selection/move-by-word-visually.html
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRight):
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingRight):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingLeft):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingLeft):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/TextGranularity.h:
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
              * editing/visible_units.cpp:
              (WebCore::previousWordBreakInBoxInsideBlockWithSameDirectionality):
              (WebCore::wordBoundaryInBox):
              (WebCore::wordBoundaryInAdjacentBoxes):
              (WebCore::leftWordBoundary):
              (WebCore::rightWordBoundary):
              (WebCore::leftWordPosition):
              (WebCore::rightWordPosition):
              * editing/visible_units.h:
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::modify):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      429dd21b
    • kalman@chromium.org's avatar
      2011-03-31 Benjamin Kalman <kalman@chromium.org> · 4cb651d7
      kalman@chromium.org authored
              Reviewed by Ojan Vafai.
      
              DeleteSelectionCommand::removeNode tries to insert block placeholder in non-editable table cell positions
              https://bugs.webkit.org/show_bug.cgi?id=57079
      
              Add regression test.
      
              * editing/execCommand/delete-table-with-empty-contents-expected.txt: Added.
              * editing/execCommand/delete-table-with-empty-contents.html: Added.
      2011-03-31  Benjamin Kalman  <kalman@chromium.org>
      
              Reviewed by Ojan Vafai.
      
              DeleteSelectionCommand::removeNode tries to insert block placeholder in non-editable table cell positions
              https://bugs.webkit.org/show_bug.cgi?id=57079
      
              Test: editing/execCommand/delete-table-with-empty-contents.html
      
              This bug results in an ASSERT fail in CompositeEditCommand::insertNodeAt, so is only observable in debug builds
              of WebKit.
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::firstEditablePositionInNode):
              (WebCore::DeleteSelectionCommand::removeNode): Use firstEditablePositionInNode rather than firstPositionInNode
              to find anchor node for the placeholder's position, if any.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4cb651d7
  6. 30 Mar, 2011 6 commits
    • commit-queue@webkit.org's avatar
      2011-03-30 Jia Pu <jpu@apple.com> · 2bc9780b
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              Autocorrection panel isn't positioned correctly in Safari (mac) when the zooming is not 1x.
              https://bugs.webkit.org/show_bug.cgi?id=57353
              <rdar://problem/9163983>
      
              Updated following test in response to recent change in AppKit spell checker.
      
              * platform/mac/editing/spelling/delete-autocorrected-word-1-expected.txt:
              * platform/mac/editing/spelling/delete-autocorrected-word-1.html:
      2011-03-30  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Autocorrection panel isn't positioned correctly in Safari (mac) when the zooming is not 1x.
              https://bugs.webkit.org/show_bug.cgi?id=57353
              <rdar://problem/9163983>
      
              We use Range::textQuads() instead of Range::boundingRect() to compute the position of correction
              panel. The latter function compensates for zooming, which we don't need in this case. We also
              dismiss correction panel when zooming factor is changed. This is done in Frame::setPageAndTextZoomFactors().
      
              * WebCore.exp.in:
              * dom/Range.cpp:
              (WebCore::Range::textQuads):
              * dom/Range.h:
              * editing/Editor.cpp:
              (WebCore::Editor::windowRectForRange):
              * editing/Editor.h:
              * page/Frame.cpp:
              (WebCore::Frame::setPageAndTextZoomFactors):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2bc9780b
    • mitz@apple.com's avatar
      <rdar://problem/9199518> Crash when focusing a styled editable element · 23a4e377
      mitz@apple.com authored
      Reviewed by Darin Adler.
      
      Source/WebCore: 
      
      Test: editing/deleting/delete-button-background-image-none.html
      
      * editing/DeleteButtonController.cpp:
      (WebCore::isDeletableElement): Check all background layers for background images.
      * rendering/style/RenderStyle.h: Removed backgroundImage() as it was only used, incorrectly,
      in the above function.
      
      LayoutTests: 
      
      * editing/deleting/delete-button-background-image-none-expected.txt: Added.
      * editing/deleting/delete-button-background-image-none.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      23a4e377
    • inferno@chromium.org's avatar
      2011-03-30 Abhishek Arya <inferno@chromium.org> · 2da9b7ad
      inferno@chromium.org authored
              Reviewed by Simon Fraser.
      
              Tests that we do not crash when removing inline style
              from a node that is not a html element.
              https://bugs.webkit.org/show_bug.cgi?id=57348
      
              * editing/execCommand/remove-format-non-html-element-crash-expected.txt: Added.
              * editing/execCommand/remove-format-non-html-element-crash.html: Added.
      2011-03-30  Abhishek Arya  <inferno@chromium.org>
      
              Reviewed by Simon Fraser.
      
              Fix wrong type assumptions in editing code. Move code
              from ASSERTs to hard checks.
              https://bugs.webkit.org/show_bug.cgi?id=57348
      
              Test: editing/execCommand/remove-format-non-html-element-crash.html
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::applyProperty):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::getRGBAFontColor):
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
              * editing/DeleteButtonController.cpp:
              (WebCore::enclosingDeletableElement):
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::textDirection):
              (WebCore::EditingStyle::prepareToApplyAt):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2da9b7ad
    • leviw@chromium.org's avatar
      2011-03-30 Levi Weintraub <leviw@chromium.org> · 42ccdc9e
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Clicking below last line of right-to-left editable text that puts caret in the wrong place
              https://bugs.webkit.org/show_bug.cgi?id=38087
      
              Moving getLogical[Start/End]BoxWithNode to RootInlineBox and using it in positionForPointWithInlineChildren
              instead of lastLeafChild, which wasn't correct in the RTL case.
      
              Test: editing/selection/click-below-rtl-text.html
      
              * editing/visible_units.cpp:
              (WebCore::logicalStartPositionForLine): Moved to RootInlineBox.
              (WebCore::logicalEndPositionForLine): Ditto.
              * editing/visible_units.h:
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::positionForPointWithInlineChildren): Useing getLogicalEndBoxWithNode instead
              of lastLeafChild.
              * rendering/RootInlineBox.cpp:
              (WebCore::RootInlineBox::getLogicalStartBoxWithNode): Moved and refactored.
              (WebCore::RootInlineBox::getLogicalEndBoxWithNode): Ditto.
              * rendering/RootInlineBox.h:
      2011-03-30  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Clicking below last line of right-to-left editable text that puts caret in the wrong place
              https://bugs.webkit.org/show_bug.cgi?id=38087
      
              Doing the right thing when clicking below the last line box in RTL editable content.
      
              * editing/selection/click-below-rtl-text-expected.txt: Added.
              * editing/selection/click-below-rtl-text.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      42ccdc9e
    • leviw@chromium.org's avatar
      2011-03-30 Levi Weintraub <leviw@chromium.org> · 6d74acca
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              BreakBlockQuoteCommand assumes all li tags have list item renderers
              https://bugs.webkit.org/show_bug.cgi?id=57253
      
              Checking that the renderers of li nodes are actually RenderListItems
              before treating them as such.
      
              * editing/execCommand/crash-breaking-blockquote-with-list.html: Added.
              * editing/execCommand/crash-breaking-blockquote-with-list-expected.txt: Added.
      2011-03-30  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              BreakBlockQuoteCommand assumes all li tags have list item renderers
              https://bugs.webkit.org/show_bug.cgi?id=57253
      
              Checking that the renderers of li nodes are actually RenderListItems
              before treating them as such.
      
              Test: editing/execCommand/crash-breaking-blockquote-with-list.html
      
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockQuoteCommand::doApply):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6d74acca
    • zimmermann@webkit.org's avatar
      2011-03-29 Nikolas Zimmermann <nzimmermann@rim.com> · c741cd53
      zimmermann@webkit.org authored
              Reviewed by Eric Seidel.
      
              REGRESSION (r68976): Incorrect bidi rendering in SVG text
              https://bugs.webkit.org/show_bug.cgi?id=53980
      
              Deconvolute SVGTextLayoutEngine code, which was confusing due to the simultaneous processing of the rendered text
              in visual and logical order. Added several helper methods to make the code more readable.
      
              Fix Unicode directional formatting characters support, now works as expected.
      
              Test: svg/text/bidi-embedded-direction.svg
      
              * editing/visible_units.cpp: Refactor getLeafBoxesInLogicalOrder(), move to InlineFlowBox.
              (WebCore::getLogicalStartBoxAndNode): Use new collectLeafBoxesInLogicalOrder() method in InlineFlowBox.
              (WebCore::getLogicalEndBoxAndNode): Ditto.
              * rendering/InlineFlowBox.cpp: Add new helper function, that returns a list of all leaf boxes in logical order.
              (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder):
              * rendering/InlineFlowBox.h:
              * rendering/svg/RenderSVGText.cpp: Actually trigger reordering the x/y/dx/dy/rotate value lists, if needed.
              (WebCore::RenderSVGText::RenderSVGText):
              (WebCore::RenderSVGText::layout):
              * rendering/svg/RenderSVGText.h: Ditto.
              (WebCore::RenderSVGText::layoutAttributes):
              (WebCore::RenderSVGText::needsReordering):
              * rendering/svg/SVGRootInlineBox.cpp: Use new InlineFlowBox::collectLeafBoxesINLogicalOrder(), with a custom "inline box reverse" implementation,
                                                    which not only reverses the order of InlineBoxes, but also the order of the x/y/dx/dy/rotate value lists, if needed.
              (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
              (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
              (WebCore::swapItems):
              (WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
              (WebCore::SVGRootInlineBox::reorderValueLists):
              * rendering/svg/SVGRootInlineBox.h:
              * rendering/svg/SVGTextLayoutAttributes.cpp: Store RenderSVGInlineText* pointer, where we belong to.
              (WebCore::SVGTextLayoutAttributes::SVGTextLayoutAttributes):
              (WebCore::SVGTextLayoutAttributes::dump):
              * rendering/svg/SVGTextLayoutAttributes.h:
              (WebCore::SVGTextLayoutAttributes::context):
              * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: Pass RenderSVGInlineText* object when creating SVGTextLayoutAttributes.
              (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree):
              (WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes):
              * rendering/svg/SVGTextLayoutAttributesBuilder.h:
              * rendering/svg/SVGTextLayoutEngine.cpp: Rewrite & cleanup the main layout algorithm, to be less confusing.
              (WebCore::SVGTextLayoutEngine::SVGTextLayoutEngine):
              (WebCore::SVGTextLayoutEngine::updateRelativePositionAdjustmentsIfNeeded):
              (WebCore::SVGTextLayoutEngine::recordTextFragment):
              (WebCore::SVGTextLayoutEngine::currentLogicalCharacterAttributes):
              (WebCore::SVGTextLayoutEngine::currentLogicalCharacterMetrics):
              (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics):
              (WebCore::SVGTextLayoutEngine::advanceToNextLogicalCharacter):
              (WebCore::SVGTextLayoutEngine::advanceToNextVisualCharacter):
              (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
              * rendering/svg/SVGTextLayoutEngine.h:
      2011-03-29  Nikolas Zimmermann  <nzimmermann@rim.com>
      
              Reviewed by Eric Seidel.
      
              REGRESSION (r68976): Incorrect bidi rendering in SVG text
              https://bugs.webkit.org/show_bug.cgi?id=53980
      
              Add testcase from bug 53980, assuring that BiDi works as well, when using the Unicode directional formatting characters.
      
              * platform/mac/svg/text/bidi-embedded-direction-expected.checksum: Added.
              * platform/mac/svg/text/bidi-embedded-direction-expected.png: Added.
              * platform/mac/svg/text/bidi-embedded-direction-expected.txt: Added.
              * platform/mac/svg/text/bidi-reorder-value-lists-expected.checksum:
              * platform/mac/svg/text/bidi-reorder-value-lists-expected.png:
              * platform/mac/svg/text/bidi-reorder-value-lists-expected.txt:
              * platform/mac/svg/text/font-size-below-point-five-expected.txt: Update result, as text runs aren't created anymore for empty text.
              * svg/text/bidi-embedded-direction.svg: Added.
              * svg/text/bidi-reorder-value-lists.svg: Extend testcase, to cover more reordering cases.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c741cd53
  7. 29 Mar, 2011 1 commit
  8. 28 Mar, 2011 3 commits
    • enrica@apple.com's avatar
      REGRESSION: Can't enter pasted with context or Edit menu text in search or... · 68c7c11c
      enrica@apple.com authored
      REGRESSION: Can't enter pasted with context or Edit menu text in search or address field in the browser.
      https://bugs.webkit.org/show_bug.cgi?id=57275
      <rdar://problem/8246691>
      
      Reviewed by Sam Weinig.
      
      We need to classify cut and paste actions as user typing actions even when
      the action is triggered by a context menu selection to
      allow the propagation of the textDidChangeInTextField event.
      
      * editing/EditorCommand.cpp:
      The following methods have been modified to properly set up
      the UserTypingGestureAction when the command source is the
      menu or a key binding sequence.
      (WebCore::executeCut):
      (WebCore::executePaste):
      (WebCore::executePasteAndMatchStyle):
      (WebCore::executePasteAsPlainText):
      (WebCore::executeDelete):
      * page/ContextMenuController.cpp:
      (WebCore::ContextMenuController::contextMenuItemSelected): Changed to
      call execute command instead of referring to the specific method in
      the editor class.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      68c7c11c
    • adele@apple.com's avatar
      Source/WebCore: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check... · aeeb7f1e
      adele@apple.com authored
      Source/WebCore: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
      https://bugs.webkit.org/show_bug.cgi?id=57173
      
      Reviewed by Eric Seidel.
      
      Test: editing/spelling/grammar.html
      
      * WebCore.exp.in: Add symbol for new selectionStartHasMarkerFor method.
      * editing/Editor.cpp:
      (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Every use of paragraph is specific to spelling or grammar, 
       so to avoid confusion, we should explicitly use spellingParagraph or grammarParagraph.  In the case of this bug, 
       when we're consider ambiguous boundary characters (characters that could indicate word boundaries, but are used 
       in the middle of words too, like apostrophes), we should use the use the spellingParagraph since the spellingParagraph 
       is the only one operated on when this information is used.
       (WebCore::Editor::selectionStartHasMarkerFor): Changed from selectionStartHasSpellingMarkerFor so it can check for grammar as well as spelling.
      * editing/Editor.h:
      
      Source/WebKit/mac: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
      https://bugs.webkit.org/show_bug.cgi?id=57173
      
      Reviewed by Eric Seidel.
      
      * WebView/WebFrame.mm:
      (-[WebFrame hasSpellingMarker:length:]): Call new selectionStartHasMarkerFor method instead of selectionStartHasSpellingMarkerFor.
      (-[WebFrame hasGrammarMarker:length:]): Call new selectionStartHasMarkerFor method.
      * WebView/WebFramePrivate.h: Add hasGrammarMarker so grammar marking can be tested.
      
      Tools: Testing support for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
      https://bugs.webkit.org/show_bug.cgi?id=57173
      
      Reviewed by Eric Seidel.
      
      * DumpRenderTree/LayoutTestController.cpp:
      (hasGrammarMarkerCallback): Added.
      (LayoutTestController::staticFunctions): Added case for hasGrammarMarker.
      * DumpRenderTree/LayoutTestController.h:
      * DumpRenderTree/mac/DumpRenderTree.mm: (createWebViewAndOffscreenWindow): Call setGrammarCheckingEnabled.
      * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::hasGrammarMarker): Added. Call new hasGrammarMarker method.
      
      LayoutTests: Test for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
      https://bugs.webkit.org/show_bug.cgi?id=57173
      
      Reviewed by Eric Seidel.
      
      * editing/spelling/grammar-expected.txt: Added.
      * editing/spelling/grammar.html: Added.
      * platform/gtk/Skipped:
      * platform/mac-wk2/Skipped:
      * platform/qt/Skipped:
      * platform/win/Skipped:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aeeb7f1e
    • 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
  9. 27 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-27 Ben Taylor <bentaylor.solx86@gmail.com> · 62573562
      commit-queue@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              https://bugs.webkit.org/show_bug.cgi?id=57170  Fix last elements
              in an enum to remove a trailing comma. Sun Studio 12 CC errors out.
      
              Compile fix only, no actual code change.
      
              * wtf/MessageQueue.h:
      2011-03-27  Ben Taylor  <bentaylor.solx86@gmail.com>
      
              Reviewed by Alexey Proskuryakov.
      
              https://bugs.webkit.org/show_bug.cgi?id=57170  Fix last elements
              in an enum to remove a trailing comma. Sun Studio 12 CC errors out.
      
              Compile fix only, no actual code change.
      
              * dom/ExceptionCode.h:
              * editing/EditorInsertAction.h:
              * loader/FrameLoaderTypes.h:
              * platform/PlatformKeyboardEvent.h:
              * platform/ScrollTypes.h:
              * platform/graphics/BitmapImage.h:
              * platform/image-decoders/ImageDecoder.h:
              * platform/network/ProtectionSpace.h:
              * platform/network/ResourceHandleClient.h:
              * platform/network/ResourceRequestBase.h:
              * platform/text/TextCodec.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62573562
  10. 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
  11. 24 Mar, 2011 4 commits
    • weinig@apple.com's avatar
      2011-03-24 Sam Weinig <sam@webkit.org> · 672e4f48
      weinig@apple.com authored
              Reviewed by Anders Carlsson.
      
              Remove legacy version of findPlainText.
              https://bugs.webkit.org/show_bug.cgi?id=57056
      
              * src/WebFrameImpl.cpp:
              (WebKit::WebFrameImpl::scopeStringMatches):
              Replace use of legacy findPlainText with a version that
              takes an options parameter.
      2011-03-24  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Anders Carlsson.
      
              Remove legacy version of findPlainText.
              https://bugs.webkit.org/show_bug.cgi?id=57056
      
              * editing/TextIterator.cpp:
              * editing/TextIterator.h:
              Remove legacy overload of findPlainText that doesn't
              take an options parameter.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      672e4f48
    • enrica@apple.com's avatar
      WebKit2:Services menu item to convert selected Simplified/Traditional Chinese Text is not working. · 1955ab8a
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=56975
      <rdar://problem/8915066>
              
      Reviewed by Alexey Proskuryakov.
      
      Source/WebCore: 
      
      Adding support in WebCore to implement readSelectionFromPasteboard
      to support Mac OS X services from WebKit2.
      
      * WebCore.exp.in:
      * editing/Editor.h:
      * editing/mac/EditorMac.mm:
      (WebCore::Editor::readSelectionFromPasteboard): Added entry point
      to call the paste functions with the specified pasteboard.
      
      Source/WebKit2: 
      
      Adding missing entry point to support Mac OS X services in WebKit2.
      
      * UIProcess/API/mac/WKView.mm:
      (-[WKView readSelectionFromPasteboard:]): Added.
      * UIProcess/WebPageProxy.h:
      * UIProcess/mac/WebPageProxyMac.mm:
      (WebKit::WebPageProxy::readSelectionFromPasteboard): Added.
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in: Added synchronous
      message.
      * WebProcess/WebPage/mac/WebPageMac.mm:
      (WebKit::WebPage::readSelectionFromPasteboard): Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1955ab8a
    • enrica@apple.com's avatar
      Source/WebCore: Repeated copy and paste-in-place operation results in increasingly verbose HTML. · f8d20922
      enrica@apple.com authored
      <rdar://problem/8690506>
      https://bugs.webkit.org/show_bug.cgi?id=56874
              
      Reviewed by Darin Adler.
      
      When we calculate the style to apply at the insertion point we compare the initial
      style at the insertion point against the style calculated at the span we wrap the
      copied markup fragment with. We could end up with a series of unnecessary spans
      to remove the initial style that simply grow our markup.
      The consists in moving the insertion point outside any inline element that could
      affect the fragment being inserted when we are not pasting and matching the style.
      
      Test: editing/pasteboard/paste-text-with-style.html
      
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::isInlineNodeWithStyle): Added.
      (WebCore::ReplaceSelectionCommand::doApply): Added logic to change the insertion
      point according to the new rules.
      
      LayoutTests: Repeated copy and paste-in-place operation results in increasingly verbose HTML.
      <rdar://problem/8690506>
      https://bugs.webkit.org/show_bug.cgi?id=56874
      
      Reviewed by Darin Adler.
      
      * editing/pasteboard/paste-text-with-style-expected.txt: Added.
      * editing/pasteboard/paste-text-with-style.html: Added.
      The following are new results for existing tests that now produce
      a different markup.
      * platform/mac/editing/pasteboard/5065605-expected.txt:
      * platform/mac/editing/pasteboard/display-block-on-spans-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-011-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f8d20922
    • morrita@google.com's avatar
      2011-03-23 MORITA Hajime <morrita@google.com> · 102429ef
      morrita@google.com authored
              Reviewed by Kent Tamura.
      
              Spellcheck feature specific symbols should be defined.
              https://bugs.webkit.org/show_bug.cgi?id=56818
      
              * Introduced USE(UNIFIED_TEXT_CHECKING), USE(GRAMMAR_CHECKING) and USE(AUTOMATIC_TEXT_REPLACEMENT)
              * Replaced a part of of BUILDING_ON_* conditionals with them.
      
              Note that small amount of code path on Editor.cpp is now compiled under USE(GRAMMAR_CHECKING)
              because these code path is already built under non-Mac ports and
              Keeping them buildable for such platforms reduces the build breakage risk.
              These path is guarded by Settings thus should never get reached.
      
              No new tests. No behavioral change.
      
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * editing/Editor.cpp:
              (WebCore::Editor::advanceToNextMisspelling):
              (WebCore::Editor::isSelectionUngrammatical):
              (WebCore::Editor::guessesForUngrammaticalSelection):
              (WebCore::Editor::guessesForMisspelledOrUngrammaticalSelection):
              (WebCore::Editor::markMisspellingsAfterTypingToWord):
              (WebCore::Editor::markMisspellingsOrBadGrammar):
              (WebCore::Editor::markBadGrammar):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::changeBackToReplacedString):
              (WebCore::Editor::markMisspellingsAndBadGrammar):
              * editing/Editor.h:
              * editing/TextCheckingHelper.cpp:
              (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
              (WebCore::TextCheckingHelper::findFirstGrammarDetail):
              (WebCore::TextCheckingHelper::findFirstBadGrammar):
              (WebCore::TextCheckingHelper::isUngrammatical):
              (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
              (WebCore::TextCheckingHelper::markAllBadGrammar):
              * loader/EmptyClients.h:
              * platform/text/TextCheckerClient.h:
              * platform/text/TextChecking.h: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      102429ef
  12. 23 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-23 Jia Pu <jpu@apple.com> · b5484ecd
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * platform/mac-wk2/Skipped: Enable autocorrection tests for WK2.
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              This patch is to enable WK2 to utilize autocorrection UI on Mac OS X. It contains following
              major changes:
      
              1. All but one autocorrection related message is synchronous. Since dismissing autocorrection
              panel can potentially cause editing to occur, a synchronous dismissCorrectionPanelSoon() function
              is introduced to ensure all editing commands occur in correct order.
      
              2. Additional condition variable is needed to implement dismissCorrectionPanelSoon().
              To improve maintainability, CorrectionPanel class is introduced to manage the
              internal state related to correction panel. This change is applied to both WK1 and WK2.
      
              3. EditorClient::isShowingCorrectionPanel() has been removed. The original purpose is to allow
              editor to know when to handle ESC key event. Now this is handled internally in AppKit, so
              EditorClient::isShowingCorrectionPanel() isn't necessary anymore.
      
              4. The Editor* argument in EditorClient::showCorrectionPanel() has been removed, since we can
              access object via WebView or WKView.
      
              * editing/Editor.cpp:
              (WebCore::Editor::markMisspellingsAfterTypingToWord):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::correctionPanelTimerFired):
              (WebCore::Editor::dismissCorrectionPanel):
              (WebCore::Editor::dismissCorrectionPanelSoon):
              (WebCore::Editor::applyAutocorrectionBeforeTypingIfAppropriate):
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap):
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::showCorrectionPanel):
              (WebCore::EmptyEditorClient::dismissCorrectionPanelSoon):
              * manual-tests/autocorrection/close-window-when-correction-is-shown.html: Added.
              * page/EditorClient.h:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * WebKit.xcodeproj/project.pbxproj:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * WebCoreSupport/CorrectionPanel.h: Added.
              (CorrectionPanel::isShowing):
              * WebCoreSupport/CorrectionPanel.mm: Added.
              (correctionBubbleType):
              (CorrectionPanel::CorrectionPanel):
              (CorrectionPanel::~CorrectionPanel):
              (CorrectionPanel::show):
              (CorrectionPanel::dismiss):
              (CorrectionPanel::dismissSoon):
              (CorrectionPanel::dismissInternal):
              (CorrectionPanel::recordAutocorrectionResponse):
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::WebEditorClient):
              (WebEditorClient::showCorrectionPanel):
              (WebEditorClient::dismissCorrectionPanel):
              (WebEditorClient::dismissCorrectionPanelSoon):
              (WebEditorClient::recordAutocorrectionResponse):
              * WebView/WebView.mm:
              (-[WebView handleCorrectionPanelResult:]):
              * WebView/WebViewPrivate.h:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the
              plumbing work.
      
              * UIProcess/API/mac/PageClientImpl.h:
              * UIProcess/API/mac/PageClientImpl.mm:
              (WebKit::PageClientImpl::showCorrectionPanel):
              (WebKit::PageClientImpl::dismissCorrectionPanel):
              (WebKit::PageClientImpl::dismissCorrectionPanelSoon):
              (WebKit::PageClientImpl::recordAutocorrectionResponse):
              * UIProcess/API/mac/WKView.mm:
              (-[WKView spellCheckerDocumentTag]):
              (-[WKView handleCorrectionPanelResult:]):
              * UIProcess/API/mac/WKViewPrivate.h:
              * UIProcess/PageClient.h:
              * UIProcess/WebPageProxy.cpp:
              (WebKit::WebPageProxy::didCommitLoadForFrame):
              (WebKit::WebPageProxy::showCorrectionPanel):
              (WebKit::WebPageProxy::dismissCorrectionPanel):
              (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
              (WebKit::WebPageProxy::recordAutocorrectionResponse):
              (WebKit::WebPageProxy::handleCorrectionPanelResult):
              * UIProcess/WebPageProxy.h:
              * UIProcess/WebPageProxy.messages.in:
              * UIProcess/mac/CorrectionPanel.h: Added.
              (WebKit::CorrectionPanel::isShowing):
              * UIProcess/mac/CorrectionPanel.mm: Added.
              (correctionBubbleType):
              (WebKit::CorrectionPanel::CorrectionPanel):
              (WebKit::CorrectionPanel::~CorrectionPanel):
              (WebKit::CorrectionPanel::show):
              (WebKit::CorrectionPanel::dismiss):
              (WebKit::CorrectionPanel::dismissSoon):
              (WebKit::CorrectionPanel::dismissInternal):
              (WebKit::CorrectionPanel::recordAutocorrectionResponse):
              * WebKit2.xcodeproj/project.pbxproj:
              * WebProcess/WebCoreSupport/WebEditorClient.h:
              * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
              (WebKit::WebEditorClient::showCorrectionPanel):
              (WebKit::WebEditorClient::dismissCorrectionPanel):
              (WebKit::WebEditorClient::dismissCorrectionPanelSoon):
              (WebKit::WebEditorClient::recordAutocorrectionResponse):
              * WebProcess/WebPage/WebPage.cpp:
              (WebKit::WebPage::handleCorrectionPanelResult):
              * WebProcess/WebPage/WebPage.h:
              * WebProcess/WebPage/WebPage.messages.in:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5484ecd
  13. 21 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-21 Chang Shu <cshu@webkit.org> · f52c4946
      commit-queue@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              Restore the expected result before r79953. r79953 changed behavior slightly in function
              finishedLoadingWithDataSource in file mac/WebView/WebHTMLRepresentation.mm, where
              core(webFrame)->editor()->applyEditingStyleToBodyElement() was called but not before r79953
              or after this patch.
      
              * platform/mac/editing/selection/designmode-no-caret-expected.txt:
      2011-03-21  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              r79953 removed the WebView level editablity which is persistent no matter whether
              underlying document itself is changed and editability gets lost. The resolution is to
              set this WebView editable value to WebCore. This avoids the callback from WebCore to
              WebKit which was the main goal in r79953 to improve performance.
      
              * WebCore.exp.in:
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::isReadOnly):
              * dom/Node.cpp:
              (WebCore::Node::isContentEditable):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::setSelectionFromNone):
              * page/DragController.cpp:
              (WebCore::DragController::operationForLoad):
              * page/Page.cpp:
              (WebCore::Page::Page):
              * page/Page.h:
              (WebCore::Page::setEditable):
              (WebCore::Page::isEditable):
      2011-03-21  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              r79953 removed the WebView level editablity which is persistent no matter whether
              underlying document itself is changed and editability gets lost. The resolution is to
              set this WebView editable value to WebCore. This avoids the callback from WebCore to
              WebKit which was the main goal in r79953 to improve performance.
      
              * webkit/webkitwebview.cpp:
              (webkit_web_view_get_editable):
              (webkit_web_view_set_editable):
      2011-03-21  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              r79953 removed the WebView level editablity which is persistent no matter whether
              underlying document itself is changed and editability gets lost. The resolution is to
              set this WebView editable value to WebCore. This avoids the callback from WebCore to
              WebKit which was the main goal in r79953 to improve performance.
      
              * WebView/WebView.mm:
              (-[WebView setEditable:]):
              (-[WebView isEditable]):
      2011-03-21  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              r79953 removed the WebView level editablity which is persistent no matter whether
              underlying document itself is changed and editability gets lost. The resolution is to
              set this WebView editable value to WebCore. This avoids the callback from WebCore to
              WebKit which was the main goal in r79953 to improve performance.
      
              * Api/qwebpage.cpp:
              (QWebPage::setContentEditable):
              (QWebPage::isContentEditable):
      2011-03-21  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Alexey Proskuryakov.
      
              REGRESSION (r79953): Can't type in MS Outlook 2011
              https://bugs.webkit.org/show_bug.cgi?id=56665
      
              r79953 removed the WebView level editablity which is persistent no matter whether
              underlying document itself is changed and editability gets lost. The resolution is to
              set this WebView editable value to WebCore. This avoids the callback from WebCore to
              WebKit which was the main goal in r79953 to improve performance.
      
              * WebFrame.cpp:
              (wxWebFrame::MakeEditable):
              (wxWebFrame::IsEditable):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f52c4946
  14. 18 Mar, 2011 2 commits
    • 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
    • rniwa@webkit.org's avatar
      2011-03-18 Ryosuke Niwa <rniwa@webkit.org> · d5460018
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              REGRESSION(81374, 81384): editing/deleting/5206311-1.html hits assertion on non-Mac platforms
              https://bugs.webkit.org/show_bug.cgi?id=56599
      
              Re-enabled the test on non-Mac platforms.
      
              * platform/chromium/test_expectations.txt:
              * platform/gtk/Skipped:
              * platform/qt/Skipped:
              * platform/win/Skipped:
      2011-03-18  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              REGRESSION(81374, 81384): editing/deleting/5206311-1.html hits assertion on non-Mac platforms
              https://bugs.webkit.org/show_bug.cgi?id=56599
      
              Debug build fix.
      
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent): If the original position was a position before a node,
              then we can't necessarily instantiate a position inside the node.
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::toNormalizedRange): Even if s and e were not null, container nodes of s and e
              could be null. Exit early in those cases as well.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d5460018
  15. 17 Mar, 2011 3 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
    • commit-queue@webkit.org's avatar
      2011-03-16 Naoki Takano <takano.naoki@gmail.com> · b887b8c9
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              Textarea maxlength doesn't account for newlines
              https://bugs.webkit.org/show_bug.cgi?id=54443
      
              * fast/forms/script-tests/textarea-maxlength.js:
              (createFocusedTextAreaWithMaxLength3): Added two tests to make sure consecutive insertbreaks
              work correctly for textarea maxlength.
              * fast/forms/textarea-maxlength-expected.txt: Added two test results.
      2011-03-16  Naoki Takano  <takano.naoki@gmail.com>
      
              Reviewed by Ryosuke Niwa.
      
              Textarea maxlength doesn't account for newlines
              https://bugs.webkit.org/show_bug.cgi?id=54443
      
              When a user presses a return key, TypingCommand::insertLineBreak() is called.
              So before append a new line, check if we can add the new line.
      
              * editing/TypingCommand.cpp:
              (WebCore::canAppendNewLineFeed): Implement new helper function to check if we can add new line.
              (WebCore::TypingCommand::insertLineBreak): Added check logic before adding the new line.
              (WebCore::TypingCommand::insertParagraphSeparator): Added check logic before adding the new line.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b887b8c9
  16. 16 Mar, 2011 1 commit
    • 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