Title: [197605] trunk/Source
Revision
197605
Author
[email protected]
Date
2016-03-04 17:35:12 -0800 (Fri, 04 Mar 2016)

Log Message

[WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
<rdar://problem/24943591>
https://bugs.webkit.org/show_bug.cgi?id=155057

Reviewed by Tim Horton.

Source/WebCore:

Move Editor::insertParagraphSeparatorInQuotedContent() into Editor.cpp
and remove the duplicated code in EditorIOS.mm and EditorMac.mm.

* editing/Editor.cpp:
(WebCore::Editor::insertParagraphSeparatorInQuotedContent):
* editing/Editor.h:
* editing/ios/EditorIOS.mm:
(WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInsertNewlineInQuotedContent):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertNewlineInQuotedContent):
* WebProcess/WebPage/WebPage.h:
Expose WKBundlePageInsertNewlineInQuotedContent as SPI.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (197604 => 197605)


--- trunk/Source/WebCore/ChangeLog	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebCore/ChangeLog	2016-03-05 01:35:12 UTC (rev 197605)
@@ -1,3 +1,22 @@
+2016-03-04  Sam Weinig  <[email protected]>
+
+        [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
+        <rdar://problem/24943591>
+        https://bugs.webkit.org/show_bug.cgi?id=155057
+
+        Reviewed by Tim Horton.
+
+        Move Editor::insertParagraphSeparatorInQuotedContent() into Editor.cpp
+        and remove the duplicated code in EditorIOS.mm and EditorMac.mm.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::insertParagraphSeparatorInQuotedContent):
+        * editing/Editor.h:
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
+
 2016-03-04  Gavin Barraclough  <[email protected]>
 
         Convert DOMTimer interval from int to std::chromo::milliseconds

Modified: trunk/Source/WebCore/editing/Editor.cpp (197604 => 197605)


--- trunk/Source/WebCore/editing/Editor.cpp	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebCore/editing/Editor.cpp	2016-03-05 01:35:12 UTC (rev 197605)
@@ -1234,6 +1234,14 @@
     return true;
 }
 
+bool Editor::insertParagraphSeparatorInQuotedContent()
+{
+    // FIXME: Why is this missing calls to canEdit, canEditRichly, etc.?
+    TypingCommand::insertParagraphSeparatorInQuotedContent(document());
+    revealSelectionAfterEditingOperation();
+    return true;
+}
+
 void Editor::cut()
 {
     if (tryDHTMLCut())

Modified: trunk/Source/WebCore/editing/Editor.h (197604 => 197605)


--- trunk/Source/WebCore/editing/Editor.h	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebCore/editing/Editor.h	2016-03-05 01:35:12 UTC (rev 197605)
@@ -231,6 +231,7 @@
     bool insertTextWithoutSendingTextEvent(const String&, bool selectInsertedText, TextEvent* triggeringEvent);
     bool insertLineBreak();
     bool insertParagraphSeparator();
+    WEBCORE_EXPORT bool insertParagraphSeparatorInQuotedContent();
 
     WEBCORE_EXPORT bool isContinuousSpellCheckingEnabled() const;
     WEBCORE_EXPORT void toggleContinuousSpellChecking();
@@ -430,7 +431,6 @@
 #if PLATFORM(COCOA)
     WEBCORE_EXPORT static RenderStyle* styleForSelectionStart(Frame* , Node *&nodeToRemove);
     void getTextDecorationAttributesRespectingTypingStyle(RenderStyle&, NSMutableDictionary*) const;
-    WEBCORE_EXPORT bool insertParagraphSeparatorInQuotedContent();
     WEBCORE_EXPORT const Font* fontForSelection(bool&) const;
     WEBCORE_EXPORT NSDictionary *fontAttributesForSelectionStart() const;
     WEBCORE_EXPORT String stringSelectionForPasteboard();

Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (197604 => 197605)


--- trunk/Source/WebCore/editing/ios/EditorIOS.mm	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm	2016-03-05 01:35:12 UTC (rev 197605)
@@ -175,14 +175,6 @@
     applyParagraphStyle(style.get());
 }
 
-bool Editor::insertParagraphSeparatorInQuotedContent()
-{
-    // FIXME: Why is this missing calls to canEdit, canEditRichly, etc...
-    TypingCommand::insertParagraphSeparatorInQuotedContent(*m_frame.document());
-    revealSelectionAfterEditingOperation();
-    return true;
-}
-
 const Font* Editor::fontForSelection(bool& hasMultipleFonts) const
 {
     hasMultipleFonts = false;

Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (197604 => 197605)


--- trunk/Source/WebCore/editing/mac/EditorMac.mm	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm	2016-03-05 01:35:12 UTC (rev 197605)
@@ -101,14 +101,6 @@
     client()->setInsertionPasteboard(String());
 }
 
-bool Editor::insertParagraphSeparatorInQuotedContent()
-{
-    // FIXME: Why is this missing calls to canEdit, canEditRichly, etc.?
-    TypingCommand::insertParagraphSeparatorInQuotedContent(document());
-    revealSelectionAfterEditingOperation();
-    return true;
-}
-
 const Font* Editor::fontForSelection(bool& hasMultipleFonts) const
 {
     hasMultipleFonts = false;

Modified: trunk/Source/WebKit2/ChangeLog (197604 => 197605)


--- trunk/Source/WebKit2/ChangeLog	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-05 01:35:12 UTC (rev 197605)
@@ -1,3 +1,19 @@
+2016-03-04  Sam Weinig  <[email protected]>
+
+        [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
+        <rdar://problem/24943591>
+        https://bugs.webkit.org/show_bug.cgi?id=155057
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageInsertNewlineInQuotedContent):
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::insertNewlineInQuotedContent):
+        * WebProcess/WebPage/WebPage.h:
+        Expose WKBundlePageInsertNewlineInQuotedContent as SPI.
+
 2016-03-04  Brent Fulgham  <[email protected]>
 
         Stub API to support a debug menu option for measuring resource load statistics

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (197604 => 197605)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2016-03-05 01:35:12 UTC (rev 197605)
@@ -223,6 +223,11 @@
 #endif
 }
 
+void WKBundlePageInsertNewlineInQuotedContent(WKBundlePageRef pageRef)
+{
+    toImpl(pageRef)->insertNewlineInQuotedContent();
+}
+
 void* WKAccessibilityRootObject(WKBundlePageRef pageRef)
 {
 #if HAVE(ACCESSIBILITY)

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (197604 => 197605)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2016-03-05 01:35:12 UTC (rev 197605)
@@ -90,6 +90,8 @@
 WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuItems(WKBundlePageRef);
 WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuAtPointInWindow(WKBundlePageRef, WKPoint);
 
+WK_EXPORT void WKBundlePageInsertNewlineInQuotedContent(WKBundlePageRef page);
+
 // This only works if the SuppressesIncrementalRendering preference is set as well.
 typedef unsigned WKRenderingSuppressionToken;
 WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197604 => 197605)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-05 01:35:12 UTC (rev 197605)
@@ -2347,6 +2347,14 @@
     m_page->setControlledByAutomation(controlled);
 }
 
+void WebPage::insertNewlineInQuotedContent()
+{
+    Frame& frame = m_page->focusController().focusedOrMainFrame();
+    if (frame.selection().isNone())
+        return;
+    frame.editor().insertParagraphSeparatorInQuotedContent();
+}
+
 #if ENABLE(REMOTE_INSPECTOR)
 void WebPage::setAllowsRemoteInspection(bool allow)
 {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197604 => 197605)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-05 01:34:21 UTC (rev 197604)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-05 01:35:12 UTC (rev 197605)
@@ -932,6 +932,8 @@
     bool isControlledByAutomation() const;
     void setControlledByAutomation(bool);
 
+    void insertNewlineInQuotedContent();
+
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to