Title: [150016] trunk/Source
Revision
150016
Author
[email protected]
Date
2013-05-13 08:29:36 -0700 (Mon, 13 May 2013)

Log Message

Source/WebCore: [Mac] Move writeRange/PlainText/URL from ClipboardMac to PasteboardMac
https://bugs.webkit.org/show_bug.cgi?id=116009

Reviewed by Andreas Kling.

* dom/Clipboard.cpp:
(WebCore::Clipboard::writeRange): Added. Moved from ClipboardMac,
but added some FIXMEs.
(WebCore::Clipboard::writePlainText): Ditto.
(WebCore::Clipboard::writeURL): Ditto.

* dom/Clipboard.h: Made writeURL, writeRange, and writePlainText
non-virtual in non-legacy clipboard implementations.

* platform/mac/ClipboardMac.h: Removed writeRange, writeURL, and
writePlainText.
* platform/mac/ClipboardMac.mm: Ditto.

Source/WebKit/mac: [Mac] Layer-backed WebViews draw their background color even when setDrawsBackground:NO was called
https://bugs.webkit.org/show_bug.cgi?id=116014
<rdar://problem/12781227>

Reviewed by Andreas Kling.

* WebView/WebFrame.mm:
(-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Remove calls to setBackgroundColor: and
setDrawsBackground: on the document view. These were added to support a hypothetical document view
that wanted to draw its background like WebHTMLView does, but this was never communicated as a
document view protocol, formal or informal, and it's unlikely that it was ever used. The bug was
caused because there is an -[NSView setDrawsBackground:] method, probably an internal one, and we
were calling it unintentionally on a WebHTMLView.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150015 => 150016)


--- trunk/Source/WebCore/ChangeLog	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebCore/ChangeLog	2013-05-13 15:29:36 UTC (rev 150016)
@@ -1,3 +1,23 @@
+2013-05-12  Darin Adler  <[email protected]>
+
+        [Mac] Move writeRange/PlainText/URL from ClipboardMac to PasteboardMac
+        https://bugs.webkit.org/show_bug.cgi?id=116009
+
+        Reviewed by Andreas Kling.
+
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::writeRange): Added. Moved from ClipboardMac,
+        but added some FIXMEs.
+        (WebCore::Clipboard::writePlainText): Ditto.
+        (WebCore::Clipboard::writeURL): Ditto.
+
+        * dom/Clipboard.h: Made writeURL, writeRange, and writePlainText
+        non-virtual in non-legacy clipboard implementations.
+
+        * platform/mac/ClipboardMac.h: Removed writeRange, writeURL, and
+        writePlainText.
+        * platform/mac/ClipboardMac.mm: Ditto.
+
 2013-05-13  Noam Rosenthal  <[email protected]>
 
         [CoordGfx] requestAnimationFrame performance issues

Modified: trunk/Source/WebCore/dom/Clipboard.cpp (150015 => 150016)


--- trunk/Source/WebCore/dom/Clipboard.cpp	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebCore/dom/Clipboard.cpp	2013-05-13 15:29:36 UTC (rev 150016)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "Clipboard.h"
 
+#include "Editor.h"
 #include "FileList.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -314,6 +315,29 @@
     return fileList.release();
 }
 
+void Clipboard::writeRange(Range* range, Frame* frame)
+{
+    ASSERT(range);
+    ASSERT(frame);
+    // FIXME: This is a design mistake, a layering violation that should be fixed.
+    // The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument.
+    // FIXME: The frame argument seems redundant, since a Range is in a particular document, which has a corresponding frame.
+    m_pasteboard->writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
+}
+
+void Clipboard::writePlainText(const String& text)
+{
+    m_pasteboard->writePlainText(text, Pasteboard::CannotSmartReplace);
+}
+
+void Clipboard::writeURL(const KURL& url, const String& title, Frame* frame)
+{
+    ASSERT(frame);
+    // FIXME: This is a design mistake, a layering violation that should be fixed.
+    // The pasteboard writeURL function should not take a frame argument, nor does this function need a frame.
+    m_pasteboard->writeURL(url, title, frame);
+}
+
 #endif
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/Clipboard.h (150015 => 150016)


--- trunk/Source/WebCore/dom/Clipboard.h	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebCore/dom/Clipboard.h	2013-05-13 15:29:36 UTC (rev 150016)
@@ -97,9 +97,9 @@
 #if ENABLE(DRAG_SUPPORT)
         virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*) = 0;
 #endif
-        virtual void writeURL(const KURL&, const String&, Frame*) = 0;
-        virtual void writeRange(Range*, Frame*) = 0;
-        virtual void writePlainText(const String&) = 0;
+        LEGACY_VIRTUAL void writeURL(const KURL&, const String&, Frame*) LEGACY_PURE;
+        LEGACY_VIRTUAL void writeRange(Range*, Frame*) LEGACY_PURE;
+        LEGACY_VIRTUAL void writePlainText(const String&) LEGACY_PURE;
 
         LEGACY_VIRTUAL bool hasData() LEGACY_PURE;
 

Modified: trunk/Source/WebCore/platform/mac/ClipboardMac.h (150015 => 150016)


--- trunk/Source/WebCore/platform/mac/ClipboardMac.h	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebCore/platform/mac/ClipboardMac.h	2013-05-13 15:29:36 UTC (rev 150016)
@@ -60,9 +60,6 @@
 #if ENABLE(DRAG_SUPPORT)
     virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
 #endif
-    virtual void writeRange(Range*, Frame* frame);
-    virtual void writeURL(const KURL&, const String&, Frame* frame);
-    virtual void writePlainText(const String&);
     
     // Methods for getting info in Cocoa's type system
     NSImage *dragNSImage(NSPoint&) const; // loc converted from dragLoc, based on whole image size

Modified: trunk/Source/WebCore/platform/mac/ClipboardMac.mm (150015 => 150016)


--- trunk/Source/WebCore/platform/mac/ClipboardMac.mm	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebCore/platform/mac/ClipboardMac.mm	2013-05-13 15:29:36 UTC (rev 150016)
@@ -115,28 +115,6 @@
     }
 }
     
-void ClipboardMac::writeRange(Range* range, Frame* frame)
-{
-    ASSERT(range);
-    ASSERT(frame);
-    Pasteboard pasteboard(m_pasteboardName);
-    pasteboard.writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
-}
-
-void ClipboardMac::writePlainText(const String& text)
-{
-    Pasteboard pasteboard(m_pasteboardName);
-    pasteboard.writePlainText(text, Pasteboard::CannotSmartReplace);
-}
-
-void ClipboardMac::writeURL(const KURL& url, const String& title, Frame* frame)
-{   
-    ASSERT(frame);
-    ASSERT(m_pasteboardName);
-    Pasteboard pasteboard(m_pasteboardName);
-    pasteboard.writeURL(url, title, frame);
-}
-    
 #if ENABLE(DRAG_SUPPORT)
 void ClipboardMac::declareAndWriteDragImage(Element* element, const KURL& url, const String& title, Frame* frame)
 {

Modified: trunk/Source/WebKit/mac/ChangeLog (150015 => 150016)


--- trunk/Source/WebKit/mac/ChangeLog	2013-05-13 15:29:01 UTC (rev 150015)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-05-13 15:29:36 UTC (rev 150016)
@@ -1,3 +1,19 @@
+2013-05-13  Darin Adler  <[email protected]>
+
+        [Mac] Layer-backed WebViews draw their background color even when setDrawsBackground:NO was called
+        https://bugs.webkit.org/show_bug.cgi?id=116014
+        <rdar://problem/12781227>
+
+        Reviewed by Andreas Kling.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Remove calls to setBackgroundColor: and
+        setDrawsBackground: on the document view. These were added to support a hypothetical document view
+        that wanted to draw its background like WebHTMLView does, but this was never communicated as a
+        document view protocol, formal or informal, and it's unlikely that it was ever used. The bug was
+        caused because there is an -[NSView setDrawsBackground:] method, probably an internal one, and we
+        were calling it unintentionally on a WebHTMLView.
+
 2013-05-13  Zalan Bujtas  <[email protected]>
 
         WebProcess consuming very high CPU on linkedin.com
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to