[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:43:09 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 4c40d581c2f7fdd098bb2f7acd92e5d487769476
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 1 23:08:20 2004 +0000

            Reviewed by Ken.
    
            - fixed <rdar://problem/3655378>: (Editing:�changeDocumentBackgroundColor:�        method�nimplemented�WebKit�diting�PI))
            - made startSpeaking: actually work; previous implementation raised a DOMException
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
            added range parameter
            (-[WebHTMLView _entireDOMRange]):
            new convenience method
            (-[WebHTMLView changeDocumentBackgroundColor:]):
            now affects entire document, not just selected range, a la NSTextView
            (-[WebHTMLView changeColor:]):
            now passes in a range to _changeCSSColorUsingSelector:inRange:
            (-[WebHTMLView startSpeaking:]):
            now uses _entireDOMRange
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8c34595..a4c0003 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2004-06-01  John Sullivan  <sullivan at apple.com>
+
+        Reviewed by Ken.
+        
+        - fixed <rdar://problem/3655378>: (Editing:Ê-changeDocumentBackgroundColor:Ê
+        methodÊunimplementedÊ(WebKitÊeditingÊAPI))
+        - made startSpeaking: actually work; previous implementation raised a DOMException
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]):
+        added range parameter
+        (-[WebHTMLView _entireDOMRange]):
+        new convenience method
+        (-[WebHTMLView changeDocumentBackgroundColor:]):
+        now affects entire document, not just selected range, a la NSTextView
+        (-[WebHTMLView changeColor:]):
+        now passes in a range to _changeCSSColorUsingSelector:inRange:
+        (-[WebHTMLView startSpeaking:]):
+        now uses _entireDOMRange
+
 2004-06-01  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3661505>: (REGRESSION (Safari-140) can't drag standalone images more than once)
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 744b282..36ba6a9 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -2432,19 +2432,33 @@ static WebHTMLView *lastHitView = nil;
     return style;
 }
 
-- (void)_changeCSSColorUsingSelector:(SEL)selector
+- (void)_changeCSSColorUsingSelector:(SEL)selector inRange:(DOMRange *)range
 {
     DOMCSSStyleDeclaration *style = [self _colorPanelColorAsStyleUsingSelector:selector];
     WebView *webView = [self _webView];
-    WebBridge *bridge = [self _bridge];
-    if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:[bridge selectedDOMRange]]) {
-        [bridge applyStyle:style];
+    if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:range]) {
+        [[self _bridge] applyStyle:style];
     }
 }
 
+- (DOMRange *)_entireDOMRange
+{
+    DOMDocument *document = [[self _bridge] DOMDocument];
+    DOMRange *range = [document createRange];
+    [range selectNode:[document documentElement]];
+    return range;
+}
+
 - (void)changeDocumentBackgroundColor:(id)sender
 {
-    [self _changeCSSColorUsingSelector:@selector(setBackgroundColor:)];
+    // Mimicking NSTextView, this method sets the background color for the
+    // entire document. There is no NSTextView API for setting the background
+    // color on the selected range only. Note that this method is currently
+    // never called from the UI (see comment in changeColor:).
+    // FIXME: this actually has no effect when called, probably due to 3654850. _entireDOMRange seems
+    // to do the right thing because it works in startSpeaking:, and I know setBackgroundColor: does the
+    // right thing because I tested it with [[self _bridge] selectedDOMRange].
+    [self _changeCSSColorUsingSelector:@selector(setBackgroundColor:) inRange:[self _entireDOMRange]];
 }
 
 - (void)changeColor:(id)sender
@@ -2454,7 +2468,7 @@ static WebHTMLView *lastHitView = nil;
     // AppKit will have to be revised to allow this to work with anything that isn't an 
     // NSTextView. However, this might not be required for Tiger, since the background-color 
     // changing box in the font panel doesn't work in Mail (3674481), though it does in TextEdit.
-    [self _changeCSSColorUsingSelector:@selector(setColor:)];
+    [self _changeCSSColorUsingSelector:@selector(setColor:) inRange:[[self _bridge] selectedDOMRange]];
 }
 
 - (void)alignCenter:(id)sender
@@ -2788,9 +2802,7 @@ static WebHTMLView *lastHitView = nil;
     WebBridge *bridge = [self _bridge];
     DOMRange *range = [bridge selectedDOMRange];
     if (!range || [range collapsed]) {
-        DOMDocument *document = [bridge DOMDocument];
-        range = [document createRange];
-        [range selectNode:document];
+        range = [self _entireDOMRange];
     }
     [NSApp speakString:[bridge stringForRange:range]];
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list