Remove PLATFORM(IOS) from WebCore/editing (Part 1).
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 22:15:29 +0000 (22:15 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 22:15:29 +0000 (22:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136474

Reviewed by Tim Horton.

Source/WebCore:

This is the first part of the work to remove PLATFORM(IOS) everywhere
in the editing code.

* dom/Range.cpp:
(WebCore::Range::create): Adding create function that takes VisiblePosition.
* dom/Range.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::inputText):
* editing/CompositeEditCommand.h:
* editing/DeleteButton.h: No need for the platform guard since it is already under
DELETION_UI
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::enable):
(WebCore::DeleteButtonController::disable):
* editing/EditAction.h:
* editing/EditCommand.h:
(WebCore::EditCommand::isInsertTextCommand):
* editing/Editor.cpp:
(WebCore::ClearTextCommand::CreateAndApply):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeClearText):
(WebCore::enabledCopy):
(WebCore::enabledCut):
(WebCore::enabledClearText):
(WebCore::createCommandMap):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modifyExtendingRight):
(WebCore::FrameSelection::modifyExtendingForward):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingForward):
(WebCore::FrameSelection::modifyExtendingLeft):
(WebCore::FrameSelection::modifyExtendingBackward):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modifyMovingBackward):
* editing/InsertTextCommand.h:
* editing/TextCheckingHelper.cpp:
* editing/TextGranularity.h:
* editing/VisiblePosition.h:
(WebCore::operator>=):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
* editing/VisibleUnits.cpp:
* editing/VisibleUnits.h:

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):

Source/WebKit2:

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173235 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/Range.h
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/CompositeEditCommand.h
Source/WebCore/editing/DeleteButton.h
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/editing/EditAction.h
Source/WebCore/editing/EditCommand.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/InsertTextCommand.h
Source/WebCore/editing/TextCheckingHelper.cpp
Source/WebCore/editing/TextGranularity.h
Source/WebCore/editing/VisiblePosition.h
Source/WebCore/editing/VisibleSelection.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/VisibleUnits.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebEditCommandProxy.cpp

index 987a1f0..b97f0bf 100644 (file)
@@ -1,3 +1,56 @@
+2014-09-03  Enrica Casucci  <enrica@apple.com>
+
+        Remove PLATFORM(IOS) from WebCore/editing (Part 1).
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+
+        Reviewed by Tim Horton.
+
+        This is the first part of the work to remove PLATFORM(IOS) everywhere
+        in the editing code.
+
+        * dom/Range.cpp:
+        (WebCore::Range::create): Adding create function that takes VisiblePosition.
+        * dom/Range.h:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::apply):
+        (WebCore::CompositeEditCommand::inputText):
+        * editing/CompositeEditCommand.h:
+        * editing/DeleteButton.h: No need for the platform guard since it is already under
+        DELETION_UI
+        * editing/DeleteButtonController.cpp:
+        (WebCore::DeleteButtonController::enable):
+        (WebCore::DeleteButtonController::disable):
+        * editing/EditAction.h:
+        * editing/EditCommand.h:
+        (WebCore::EditCommand::isInsertTextCommand):
+        * editing/Editor.cpp:
+        (WebCore::ClearTextCommand::CreateAndApply):
+        * editing/Editor.h:
+        * editing/EditorCommand.cpp:
+        (WebCore::executeClearText):
+        (WebCore::enabledCopy):
+        (WebCore::enabledCut):
+        (WebCore::enabledClearText):
+        (WebCore::createCommandMap):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::modifyExtendingRight):
+        (WebCore::FrameSelection::modifyExtendingForward):
+        (WebCore::FrameSelection::modifyMovingRight):
+        (WebCore::FrameSelection::modifyMovingForward):
+        (WebCore::FrameSelection::modifyExtendingLeft):
+        (WebCore::FrameSelection::modifyExtendingBackward):
+        (WebCore::FrameSelection::modifyMovingLeft):
+        (WebCore::FrameSelection::modifyMovingBackward):
+        * editing/InsertTextCommand.h:
+        * editing/TextCheckingHelper.cpp:
+        * editing/TextGranularity.h:
+        * editing/VisiblePosition.h:
+        (WebCore::operator>=):
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
+        * editing/VisibleUnits.cpp:
+        * editing/VisibleUnits.h:
+
 2014-09-03  Anders Carlsson  <andersca@apple.com>
 
         Get rid of some uses of OwnPtr
index 0b26383..b0bc320 100644 (file)
@@ -109,14 +109,12 @@ PassRefPtr<Range> Range::create(ScriptExecutionContext& context)
     return adoptRef(new Range(toDocument(context)));
 }
 
-#if PLATFORM(IOS)
 PassRefPtr<Range> Range::create(Document& ownerDocument, const VisiblePosition& visibleStart, const VisiblePosition& visibleEnd)
 {
     Position start = visibleStart.deepEquivalent().parentAnchoredEquivalent();
     Position end = visibleEnd.deepEquivalent().parentAnchoredEquivalent();
     return adoptRef(new Range(ownerDocument, start.anchorNode(), start.deprecatedEditingOffset(), end.anchorNode(), end.deprecatedEditingOffset()));
 }
-#endif
 
 Range::~Range()
 {
index 34cb215..1fe175c 100644 (file)
@@ -45,9 +45,9 @@ class FloatQuad;
 class Node;
 class NodeWithIndex;
 class Text;
+class VisiblePosition;
 #if PLATFORM(IOS)
 class SelectionRect;
-class VisiblePosition;
 #endif
 
 class Range : public RefCounted<Range> {
@@ -56,10 +56,7 @@ public:
     WEBCORE_EXPORT static PassRefPtr<Range> create(Document&, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset);
     WEBCORE_EXPORT static PassRefPtr<Range> create(Document&, const Position&, const Position&);
     WEBCORE_EXPORT static PassRefPtr<Range> create(ScriptExecutionContext&);
-#if PLATFORM(IOS)
-    // FIXME: Consider making this a static non-member, non-friend function.
     WEBCORE_EXPORT static PassRefPtr<Range> create(Document&, const VisiblePosition&, const VisiblePosition&);
-#endif
     WEBCORE_EXPORT ~Range();
 
     Document& ownerDocument() const { return const_cast<Document&>(m_ownerDocument.get()); }
index c161c8b..9b48b2d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "AppendNodeCommand.h"
 #include "ApplyStyleCommand.h"
+#include "BreakBlockquoteCommand.h"
 #include "DeleteFromTextNodeCommand.h"
 #include "DeleteSelectionCommand.h"
 #include "Document.h"
@@ -72,9 +73,6 @@
 #include "DeleteButtonController.h"
 #endif
 
-#if PLATFORM(IOS)
-#include "BreakBlockquoteCommand.h"
-#endif
 
 namespace WebCore {
 
@@ -202,10 +200,8 @@ void CompositeEditCommand::apply()
         case EditActionSetWritingDirection:
         case EditActionCut:
         case EditActionUnspecified:
-#if PLATFORM(IOS)
         case EditActionDelete:
         case EditActionDictation:
-#endif
             break;
         default:
             ASSERT_NOT_REACHED();
@@ -502,7 +498,6 @@ void CompositeEditCommand::splitTextNodeContainingElement(PassRefPtr<Text> text,
     applyCommandToComposite(SplitTextNodeContainingElementCommand::create(text, offset));
 }
 
-#if PLATFORM(IOS)
 void CompositeEditCommand::inputText(const String& text, bool selectInsertedText)
 {
     unsigned offset = 0;
@@ -543,7 +538,6 @@ void CompositeEditCommand::inputText(const String& text, bool selectInsertedText
     if (selectInsertedText)
         setEndingSelection(VisibleSelection(visiblePositionForIndex(startIndex, scope.get()), visiblePositionForIndex(startIndex + length, scope.get())));
 }
-#endif
 
 void CompositeEditCommand::insertTextIntoNode(PassRefPtr<Text> node, unsigned offset, const String& text)
 {
index 1072754..43ef5a6 100644 (file)
@@ -104,9 +104,7 @@ protected:
     void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
     void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
     virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned offset, unsigned count);
-#if PLATFORM(IOS)
     void inputText(const String&, bool selectInsertedText = false);
-#endif
     bool isRemovableBlock(const Node*);
     void insertNodeAfter(PassRefPtr<Node>, PassRefPtr<Node> refChild);
     void insertNodeAt(PassRefPtr<Node>, const Position&);
index 0564270..15658da 100644 (file)
@@ -34,9 +34,7 @@ class DeleteButton : public HTMLImageElement {
 public:
     static PassRefPtr<DeleteButton> create(Document&);
 
-#if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
-#endif // !PLATFORM(IOS)
 
 private:
     explicit DeleteButton(Document&);
index 30637b2..fdcc0b0 100644 (file)
@@ -330,7 +330,6 @@ void DeleteButtonController::hide()
 
 void DeleteButtonController::enable()
 {
-#if !PLATFORM(IOS)
     ASSERT(m_disableStack > 0);
     if (m_disableStack > 0)
         m_disableStack--;
@@ -341,16 +340,13 @@ void DeleteButtonController::enable()
         m_frame.document()->updateStyleIfNeeded();
         show(enclosingDeletableElement(m_frame.selection().selection()));
     }
-#endif
 }
 
 void DeleteButtonController::disable()
 {
-#if !PLATFORM(IOS)
     if (enabled())
         hide();
     m_disableStack++;
-#endif
 }
 
 class RemoveTargetCommand : public CompositeEditCommand {
index e975633..637d1eb 100644 (file)
@@ -57,10 +57,8 @@ namespace WebCore {
         EditActionCut,
         EditActionBold,
         EditActionItalics,
-#if PLATFORM(IOS)
         EditActionDelete,
         EditActionDictation,
-#endif
         EditActionPaste,
         EditActionPasteFont,
         EditActionPasteRuler,
index 3c22cbd..0b65c1f 100644 (file)
@@ -51,10 +51,7 @@ public:
     const VisibleSelection& startingSelection() const { return m_startingSelection; }
     const VisibleSelection& endingSelection() const { return m_endingSelection; }
 
-#if PLATFORM(IOS)
-    virtual bool isInsertTextCommand() const { return false; }
-#endif
-    
+    virtual bool isInsertTextCommand() const { return false; }    
     virtual bool isSimpleEditCommand() const { return false; }
     virtual bool isCompositeEditCommand() const { return false; }
     virtual bool isEditCommandComposition() const { return false; }
index 7425f63..f41065b 100644 (file)
 
 namespace WebCore {
 
-#if PLATFORM(IOS)
 class ClearTextCommand : public DeleteSelectionCommand {
 public:
     ClearTextCommand(Document& document);
@@ -138,7 +137,6 @@ void ClearTextCommand::CreateAndApply(const RefPtr<Frame> frame)
     clearCommand->setStartingSelection(oldSelection);
     applyCommand(clearCommand.release());
 }
-#endif
 
 using namespace HTMLNames;
 using namespace WTF;
@@ -442,12 +440,12 @@ void Editor::deleteSelectionWithSmartDelete(bool smartDelete)
     applyCommand(DeleteSelectionCommand::create(document(), smartDelete));
 }
 
-#if PLATFORM(IOS)
 void Editor::clearText()
 {
     ClearTextCommand::CreateAndApply(&m_frame);
 }
 
+#if PLATFORM(IOS)
 void Editor::insertDictationPhrases(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata)
 {
     if (m_frame.selection().isNone())
index 89f0f87..280163e 100644 (file)
@@ -175,8 +175,8 @@ public:
 
     WEBCORE_EXPORT bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction);
     WEBCORE_EXPORT void deleteSelectionWithSmartDelete(bool smartDelete);
-#if PLATFORM(IOS)
     void clearText();
+#if PLATFORM(IOS)
     WEBCORE_EXPORT void removeUnchangeableStyles();
 #endif
     
index 25d8e1b..7db6364 100644 (file)
@@ -302,13 +302,11 @@ static bool executeCut(Frame& frame, Event*, EditorCommandSource source, const S
     return true;
 }
 
-#if PLATFORM(IOS)
 static bool executeClearText(Frame& frame, Event*, EditorCommandSource, const String&)
 {
     frame.editor().clearText();
     return true;
 }
-#endif
 
 static bool executeDefaultParagraphSeparator(Frame& frame, Event*, EditorCommandSource, const String& value)
 {
@@ -1245,29 +1243,19 @@ static bool enableCaretInEditableText(Frame& frame, Event* event, EditorCommandS
 
 static bool enabledCopy(Frame& frame, Event*, EditorCommandSource)
 {
-#if !PLATFORM(IOS)
     return frame.editor().canDHTMLCopy() || frame.editor().canCopy();
-#else
-    return frame.editor().canCopy();
-#endif
 }
 
 static bool enabledCut(Frame& frame, Event*, EditorCommandSource)
 {
-#if !PLATFORM(IOS)
     return frame.editor().canDHTMLCut() || frame.editor().canCut();
-#else
-    return frame.editor().canCut();
-#endif
 }
 
-#if PLATFORM(IOS)
 static bool enabledClearText(Frame& frame, Event*, EditorCommandSource)
 {
     UNUSED_PARAM(frame);
     return false;
 }
-#endif
 
 static bool enabledInEditableText(Frame& frame, Event* event, EditorCommandSource)
 {
@@ -1492,6 +1480,7 @@ static const CommandMap& createCommandMap()
         { "AlignRight", { executeJustifyRight, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "BackColor", { executeBackColor, supported, enabledInRichlyEditableText, stateNone, valueBackColor, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "Bold", { executeToggleBold, supported, enabledInRichlyEditableText, stateBold, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "ClearText", { executeClearText, supported, enabledClearText, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
         { "Copy", { executeCopy, supportedCopyCut, enabledCopy, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
         { "CreateLink", { executeCreateLink, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "Cut", { executeCut, supportedCopyCut, enabledCut, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
@@ -1630,9 +1619,6 @@ static const CommandMap& createCommandMap()
 #if PLATFORM(MAC)
         { "TakeFindStringFromSelection", { executeTakeFindStringFromSelection, supportedFromMenuOrKeyBinding, enabledTakeFindStringFromSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
 #endif
-#if PLATFORM(IOS)
-        { "ClearText", { executeClearText, supported, enabledClearText, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
-#endif
     };
 
     // These unsupported commands are listed here since they appear in the Microsoft
index fc5ce12..7ddc4e9 100644 (file)
@@ -700,11 +700,9 @@ VisiblePosition FrameSelection::modifyExtendingRight(TextGranularity granularity
         // FIXME: implement all of the above?
         pos = modifyExtendingForward(granularity);
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
 #if ENABLE(USERSELECT_ALL)
     adjustPositionForUserSelectAll(pos, directionOfEnclosingBlock() == LTR);
@@ -731,11 +729,9 @@ VisiblePosition FrameSelection::modifyExtendingForward(TextGranularity granulari
     case ParagraphGranularity:
         pos = nextParagraphPosition(pos, lineDirectionPointForBlockDirectionNavigation(EXTENT));
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     case SentenceBoundary:
         pos = endOfSentence(endForPlatform());
         break;
@@ -791,11 +787,9 @@ VisiblePosition FrameSelection::modifyMovingRight(TextGranularity granularity)
     case LineBoundary:
         pos = rightBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock());
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
     return pos;
 }
@@ -828,11 +822,9 @@ VisiblePosition FrameSelection::modifyMovingForward(TextGranularity granularity)
     case ParagraphGranularity:
         pos = nextParagraphPosition(endForPlatform(), lineDirectionPointForBlockDirectionNavigation(START));
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     case SentenceBoundary:
         pos = endOfSentence(endForPlatform());
         break;
@@ -889,11 +881,9 @@ VisiblePosition FrameSelection::modifyExtendingLeft(TextGranularity granularity)
     case DocumentBoundary:
         pos = modifyExtendingBackward(granularity);
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
 #if ENABLE(USERSELECT_ALL)
     adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR));
@@ -941,11 +931,9 @@ VisiblePosition FrameSelection::modifyExtendingBackward(TextGranularity granular
         else
             pos = startOfDocument(pos);
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
 #if ENABLE(USERSELECT_ALL)
     adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR));
@@ -983,11 +971,9 @@ VisiblePosition FrameSelection::modifyMovingLeft(TextGranularity granularity)
     case LineBoundary:
         pos = leftBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock());
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
     return pos;
 }
@@ -1030,11 +1016,9 @@ VisiblePosition FrameSelection::modifyMovingBackward(TextGranularity granularity
         else
             pos = startOfDocument(pos);
         break;
-#if PLATFORM(IOS)
     case DocumentGranularity:
         ASSERT_NOT_REACHED();
         break;
-#endif
     }
     return pos;
 }
index bc143ea..39f1f75 100644 (file)
@@ -68,9 +68,7 @@ private:
 
     virtual void doApply();
 
-#if PLATFORM(IOS)
     virtual bool isInsertTextCommand() const override { return true; }
-#endif
 
     Position positionInsideTextNode(const Position&);
     Position insertTab(const Position&);
index 42f7f51..e7d5b45 100644 (file)
@@ -240,8 +240,6 @@ TextCheckingHelper::~TextCheckingHelper()
 {
 }
 
-#if !PLATFORM(IOS)
-
 String TextCheckingHelper::findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange)
 {
     firstMisspellingOffset = 0;
@@ -421,8 +419,6 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
     return firstFoundItem;
 }
 
-#endif // !PLATFORM(IOS)
-
 #if USE(GRAMMAR_CHECKING)
 
 int TextCheckingHelper::findFirstGrammarDetail(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int startOffset, int endOffset, bool markAll) const
@@ -622,8 +618,6 @@ Vector<String> TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange(bool
     return guesses;
 }
 
-#if !PLATFORM(IOS)
-
 void TextCheckingHelper::markAllMisspellings(RefPtr<Range>& firstMisspellingRange)
 {
     // Use the "markAll" feature of findFirstMisspelling. Ignore the return value and the "out parameter";
@@ -643,8 +637,6 @@ void TextCheckingHelper::markAllBadGrammar()
 }
 #endif
 
-#endif // !PLATFORM(IOS)
-
 bool TextCheckingHelper::unifiedTextCheckerEnabled() const
 {
     return m_range && WebCore::unifiedTextCheckerEnabled(m_range->ownerDocument().frame());
index b5dd068..2ce9457 100644 (file)
@@ -36,9 +36,7 @@ enum TextGranularity {
     SentenceGranularity,
     LineGranularity,
     ParagraphGranularity,
-#if PLATFORM(IOS)
     DocumentGranularity,
-#endif
     SentenceBoundary,
     LineBoundary,
     ParagraphBoundary,
index 6ce5519..e71185f 100644 (file)
@@ -128,7 +128,6 @@ inline bool operator!=(const VisiblePosition& a, const VisiblePosition& b)
     return !(a == b);
 }
     
-#if PLATFORM(IOS)
 inline bool operator<(const VisiblePosition& a, const VisiblePosition& b)
 {
     return a.deepEquivalent() < b.deepEquivalent();
@@ -148,7 +147,6 @@ inline bool operator>=(const VisiblePosition& a, const VisiblePosition& b)
 {
     return a.deepEquivalent() >= b.deepEquivalent();
 }    
-#endif
 
 WEBCORE_EXPORT PassRefPtr<Range> makeRange(const VisiblePosition&, const VisiblePosition&);
 bool setStart(Range*, const VisiblePosition&);
index a70645c..5fec1f2 100644 (file)
@@ -393,11 +393,9 @@ void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(Text
             m_start = startOfSentence(VisiblePosition(m_start, m_affinity)).deepEquivalent();
             m_end = endOfSentence(VisiblePosition(m_end, m_affinity)).deepEquivalent();
             break;
-#if PLATFORM(IOS)
         case DocumentGranularity:
             ASSERT_NOT_REACHED();
             break;
-#endif
     }
     
     // Make sure we do not have a dangling start or end.
index e0ace44..afb60d2 100644 (file)
@@ -1445,8 +1445,6 @@ VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire
     return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c);
 }
 
-#if PLATFORM(IOS)
-
 static bool directionIsDownstream(SelectionDirection direction)
 {
     if (direction == DirectionBackward)
@@ -1921,6 +1919,4 @@ VisiblePosition closestWordBoundaryForPosition(const VisiblePosition& position)
     return result;
 }
 
-#endif
-
 }
index d0a7cd2..1755728 100644 (file)
@@ -96,7 +96,6 @@ WEBCORE_EXPORT VisiblePosition startOfEditableContent(const VisiblePosition&);
 WEBCORE_EXPORT VisiblePosition endOfEditableContent(const VisiblePosition&);
 WEBCORE_EXPORT bool isEndOfEditableOrNonEditableContent(const VisiblePosition&);
 
-#if PLATFORM(IOS)
 WEBCORE_EXPORT bool atBoundaryOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection);
 WEBCORE_EXPORT bool withinTextUnitOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection);
 WEBCORE_EXPORT VisiblePosition positionOfNextBoundaryOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection);
@@ -105,7 +104,6 @@ WEBCORE_EXPORT int distanceBetweenPositions(const VisiblePosition&, const Visibl
 WEBCORE_EXPORT PassRefPtr<Range> wordRangeFromPosition(const VisiblePosition& position);
 WEBCORE_EXPORT VisiblePosition closestWordBoundaryForPosition(const VisiblePosition& position);
 WEBCORE_EXPORT void charactersAroundPosition(const VisiblePosition&, UChar32& oneAfter, UChar32& oneBefore, UChar32& twoBefore);
-#endif
 } // namespace WebCore
 
 #endif // VisibleUnits_h
index d914b3b..9ad831e 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-03  Enrica Casucci  <enrica@apple.com>
+
+        Remove PLATFORM(IOS) from WebCore/editing (Part 1).
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (undoNameForEditAction):
+
 2014-09-02  Maciej Stachowiak  <mjs@apple.com>
 
         Clean up naming for and slightly refactor legacy video fullscreen support
index b160487..7b6296e 100644 (file)
@@ -586,10 +586,8 @@ static NSString* undoNameForEditAction(EditAction editAction)
         case EditActionOutdent: return UI_STRING_KEY_INTERNAL("Outdent", "Outdent (Undo action name)", "Undo action name");
         case EditActionBold: return UI_STRING_KEY_INTERNAL("Bold", "Bold (Undo action name)", "Undo action name");
         case EditActionItalics: return UI_STRING_KEY_INTERNAL("Italics", "Italics (Undo action name)", "Undo action name");
-#if PLATFORM(IOS)
         case EditActionDelete: return UI_STRING_KEY_INTERNAL("Delete", "Delete (Undo action name)", "Undo action name (Used only by PLATFORM(IOS) code)");
         case EditActionDictation: return UI_STRING_KEY_INTERNAL("Dictation", "Dictation (Undo action name)", "Undo action name (Used only by PLATFORM(IOS) code)");
-#endif
     }
     return nil;
 }
index 9840ad3..f458fe7 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-03  Enrica Casucci  <enrica@apple.com>
+
+        Remove PLATFORM(IOS) from WebCore/editing (Part 1).
+        https://bugs.webkit.org/show_bug.cgi?id=136474
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/WebEditCommandProxy.cpp:
+        (WebKit::WebEditCommandProxy::nameForEditAction):
+
 2014-09-03  Yongjun Zhang  <yongjun_zhang@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=136395
index d3e8584..33797b0 100644 (file)
@@ -129,12 +129,10 @@ String WebEditCommandProxy::nameForEditAction(EditAction editAction)
         return WEB_UI_STRING_KEY("Bold", "Bold (Undo action name)", "Undo action name");
     case EditActionItalics:
         return WEB_UI_STRING_KEY("Italics", "Italics (Undo action name)", "Undo action name");
-#if PLATFORM(IOS)
     case EditActionDelete:
         return WEB_UI_STRING_KEY("Delete", "Delete (Undo action name)", "Undo action name");
     case EditActionDictation:
         return WEB_UI_STRING_KEY("Dictation", "Dictation (Undo action name)", "Undo action name");
-#endif
     case EditActionPaste:
         return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name");
     case EditActionPasteFont: