<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[19929] trunk/WebKit</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/19929">19929</a></dd>
<dt>Author</dt> <dd>justing</dd>
<dt>Date</dt> <dd>2007-03-01 17:57:12 -0800 (Thu, 01 Mar 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by harrison
        
        &lt;rdar://problem/4838199&gt;
        Integrate Mail and WebKit paste operations
        
        Provide subresources used to create the fragment as a
        convenience.

        * WebView/WebHTMLView.mm:
        (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]):
        Update the calls to the changed method.
        (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
        Give the caller the subresources in the WebArchive and RTF cases.
        * WebView/WebHTMLViewPrivate.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebViewWebHTMLViewmm">trunk/WebKit/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkWebKitWebViewWebHTMLViewPrivateh">trunk/WebKit/WebView/WebHTMLViewPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (19928 => 19929)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2007-03-02 01:53:50 UTC (rev 19928)
+++ trunk/WebKit/ChangeLog        2007-03-02 01:57:12 UTC (rev 19929)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2007-03-01  Justin Garcia  &lt;justin.garcia@apple.com&gt;
+
+        Reviewed by harrison
+        
+        &lt;rdar://problem/4838199&gt;
+        Integrate Mail and WebKit paste operations
+        
+        Provide subresources used to create the fragment as a
+        convenience.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]):
+        Update the calls to the changed method.
+        (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+        Give the caller the subresources in the WebArchive and RTF cases.
+        * WebView/WebHTMLViewPrivate.h:
+
</ins><span class="cx"> 2007-02-28  Oliver Hunt  &lt;oliver@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Maciej.
</span></span></pre></div>
<a id="trunkWebKitWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebHTMLView.mm (19928 => 19929)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebHTMLView.mm        2007-03-02 01:53:50 UTC (rev 19928)
+++ trunk/WebKit/WebView/WebHTMLView.mm        2007-03-02 01:57:12 UTC (rev 19929)
</span><span class="lines">@@ -445,60 +445,69 @@
</span><span class="cx"> {
</span><span class="cx">     NSArray *types = [pasteboard types];
</span><span class="cx">     *chosePlainText = NO;
</span><del>-    DOMDocumentFragment *fragment;
</del><ins>+    DOMDocumentFragment *fragment = nil;
</ins><span class="cx"> 
</span><span class="cx">     if ([types containsObject:WebArchivePboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:WebArchivePboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx">                                            
</span><span class="cx">     if ([types containsObject:NSFilenamesPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSFilenamesPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx">     
</span><span class="cx">     if ([types containsObject:NSHTMLPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSHTMLPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx">     
</span><span class="cx">     if ([types containsObject:NSRTFPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSRTFPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx"> 
</span><span class="cx">     if ([types containsObject:NSRTFDPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSRTFDPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx"> 
</span><span class="cx">     if ([types containsObject:NSTIFFPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSTIFFPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx"> 
</span><span class="cx">     if ([types containsObject:NSPICTPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSPICTPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx">     
</span><span class="cx">     if ([types containsObject:NSURLPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard 
</span><span class="cx">                                                   forType:NSURLPboardType
</span><del>-                                                inContext:context]))
</del><ins>+                                                inContext:context
+                                             subresources:0]))
</ins><span class="cx">         return fragment;
</span><span class="cx">         
</span><span class="cx">     if (allowPlainText &amp;&amp; [types containsObject:NSStringPboardType] &amp;&amp;
</span><span class="cx">         (fragment = [self _documentFragmentFromPasteboard:pasteboard
</span><span class="cx">                                                   forType:NSStringPboardType
</span><del>-                                                inContext:context])) {
</del><ins>+                                                inContext:context
+                                             subresources:0])) {
</ins><span class="cx">         *chosePlainText = YES;
</span><span class="cx">         return fragment;
</span><span class="cx">     }
</span><span class="lines">@@ -1796,9 +1805,12 @@
</span><span class="cx"> - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard
</span><span class="cx">                                                  forType:(NSString *)pboardType
</span><span class="cx">                                                inContext:(DOMRange *)context
</span><ins>+                                            subresources:(NSArray **)subresources
</ins><span class="cx"> {
</span><span class="cx">     if (pboardType == WebArchivePboardType) {
</span><span class="cx">         WebArchive *archive = [[WebArchive alloc] initWithData:[pasteboard dataForType:WebArchivePboardType]];
</span><ins>+        if (subresources)
+            *subresources = [archive subresources];
</ins><span class="cx">         DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithArchive:archive];
</span><span class="cx">         [archive release];
</span><span class="cx">         return fragment;
</span><span class="lines">@@ -1831,7 +1843,7 @@
</span><span class="cx">         NSDictionary *documentAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
</span><span class="cx">             [[self class] _excludedElementsForAttributedStringConversion], NSExcludedElementsDocumentAttribute,
</span><span class="cx">             self, @&quot;WebResourceHandler&quot;, nil];
</span><del>-        NSArray *subresources;
</del><ins>+        NSArray *s;
</ins><span class="cx">         
</span><span class="cx">         BOOL wasDeferringCallbacks = [[self _webView] defersCallbacks];
</span><span class="cx">         if (!wasDeferringCallbacks)
</span><span class="lines">@@ -1840,9 +1852,11 @@
</span><span class="cx">         DOMDocumentFragment *fragment = [string _documentFromRange:NSMakeRange(0, [string length]) 
</span><span class="cx">                                                           document:[[self _frame] DOMDocument] 
</span><span class="cx">                                                 documentAttributes:documentAttributes
</span><del>-                                                      subresources:&amp;subresources];
</del><ins>+                                                      subresources:&amp;s];
+        if (subresources)
+            *subresources = s;
</ins><span class="cx">         
</span><del>-        NSEnumerator *e = [subresources objectEnumerator];
</del><ins>+        NSEnumerator *e = [s objectEnumerator];
</ins><span class="cx">         WebResource *r;
</span><span class="cx">         while ((r = [e nextObject]))
</span><span class="cx">             [[self _dataSource] addSubresource:r];
</span></span></pre></div>
<a id="trunkWebKitWebViewWebHTMLViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebHTMLViewPrivate.h (19928 => 19929)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebHTMLViewPrivate.h        2007-03-02 01:53:50 UTC (rev 19928)
+++ trunk/WebKit/WebView/WebHTMLViewPrivate.h        2007-03-02 01:57:12 UTC (rev 19929)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> - (void)_decreaseSelectionListLevel;
</span><span class="cx"> - (void)_setHighlighter:(id&lt;WebHTMLHighlighter&gt;)highlighter ofType:(NSString*)type;
</span><span class="cx"> - (void)_removeHighlighterOfType:(NSString*)type;
</span><del>-- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context;
</del><ins>+- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context subresources:(NSArray **)subresources;
</ins><span class="cx"> 
</span><span class="cx"> // SPI for DumpRenderTree
</span><span class="cx"> - (void)_updateActiveState;
</span></span></pre>
</div>
</div>

</body>
</html>