[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 12:52:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit acd7995dbba4354af90586a3766759e9ab7eb1de
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 31 22:10:10 2010 +0000

    Add ability to count text matches without marking
    https://bugs.webkit.org/show_bug.cgi?id=43996
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Safari needs to be able to count text matches without triggering lots of repainting.
    Rename markAllMatchesForText() to countMatchesForText() and add a markMatches parameter.
    
    * WebCore.exp.in:
    * page/Frame.cpp:
    (WebCore::Frame::countMatchesForText):
    * page/Frame.h:
    * page/Page.cpp:
    (WebCore::Page::markAllMatchesForText):
    
    WebKit/efl:
    
    * ewk/ewk_frame.cpp:
    (ewk_frame_text_matches_mark): Switched to call
    countMatchesForText() instead of markAllMatchesForText().
    
    WebKit/mac:
    
    Safari needs to be able to count text matches without triggering lots of repainting.
    Rename markAllMatchesForText: to countMatchesForText: and add a markMatches:
    parameter.  For backwards compatibility markAllMatchesForText: calls
    countMatchesForText: and passes YES for markMatches:.
    
    * WebView/WebDocumentInternal.h:
    * WebView/WebHTMLView.mm:
    (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]):
    (-[WebHTMLView countMatchesForText:caseSensitive:limit:markMatches:]):
    * WebView/WebPDFView.mm:
    (-[WebPDFView markAllMatchesForText:caseSensitive:limit:]):
    (-[WebPDFView countMatchesForText:caseSensitive:limit:markMatches:]):
    * WebView/WebView.mm:
    (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]):
    (-[WebView countMatchesForText:caseSensitive:highlight:limit:markMatches:]):
    * WebView/WebViewPrivate.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66544 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 78770d9..0f0c623 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-31  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add ability to count text matches without marking
+        https://bugs.webkit.org/show_bug.cgi?id=43996
+
+        Safari needs to be able to count text matches without triggering lots of repainting.
+        Rename markAllMatchesForText() to countMatchesForText() and add a markMatches parameter.
+
+        * WebCore.exp.in:
+        * page/Frame.cpp:
+        (WebCore::Frame::countMatchesForText):
+        * page/Frame.h:
+        * page/Page.cpp:
+        (WebCore::Page::markAllMatchesForText):
+
 2010-08-31  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index ff14785..8d3ca91 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -581,8 +581,8 @@ __ZN7WebCore5Frame10findStringERKN3WTF6StringEbbbb
 __ZN7WebCore5Frame13reapplyStylesEv
 __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE
 __ZN7WebCore5Frame15revealSelectionERKNS_15ScrollAlignmentEb
+__ZN7WebCore5Frame19countMatchesForTextERKN3WTF6StringEbjb
 __ZN7WebCore5Frame20setSelectionFromNoneEv
-__ZN7WebCore5Frame21markAllMatchesForTextERKN3WTF6StringEbj
 __ZN7WebCore5Frame23visiblePositionForPointERKNS_8IntPointE
 __ZN7WebCore5Frame24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
 __ZN7WebCore5Frame25matchLabelsAgainstElementEP7NSArrayPNS_7ElementE
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 614d85a..3f2a5f5 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -1240,7 +1240,7 @@ bool Frame::findString(const String& target, bool forward, bool caseFlag, bool w
     return true;
 }
 
-unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsigned limit)
+unsigned Frame::countMatchesForText(const String& target, bool caseFlag, unsigned limit, bool markMatches)
 {
     if (target.isEmpty())
         return 0;
@@ -1263,7 +1263,8 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
         // Only treat the result as a match if it is visible
         if (editor()->insideVisibleArea(resultRange.get())) {
             ++matchCount;
-            document()->markers()->addMarker(resultRange.get(), DocumentMarker::TextMatch);
+            if (markMatches)
+                document()->markers()->addMarker(resultRange.get(), DocumentMarker::TextMatch);
         }
 
         // Stop looking if we hit the specified limit. A limit of 0 means no limit.
@@ -1281,16 +1282,16 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
             searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), exception);
     } while (true);
 
-    // Do a "fake" paint in order to execute the code that computes the rendered rect for
-    // each text match.
-    Document* doc = document();
-    if (m_view && contentRenderer()) {
-        doc->updateLayout(); // Ensure layout is up to date.
-        IntRect visibleRect = m_view->visibleContentRect();
-        if (!visibleRect.isEmpty()) {
-            GraphicsContext context((PlatformGraphicsContext*)0);
-            context.setPaintingDisabled(true);
-            m_view->paintContents(&context, visibleRect);
+    if (markMatches) {
+        // Do a "fake" paint in order to execute the code that computes the rendered rect for each text match.
+        if (m_view && contentRenderer()) {
+            document()->updateLayout(); // Ensure layout is up to date.
+            IntRect visibleRect = m_view->visibleContentRect();
+            if (!visibleRect.isEmpty()) {
+                GraphicsContext context((PlatformGraphicsContext*)0);
+                context.setPaintingDisabled(true);
+                m_view->paintContents(&context, visibleRect);
+            }
         }
     }
 
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index 58520a6..198e2e7 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -207,7 +207,7 @@ namespace WebCore {
 
         RenderStyle* styleForSelectionStart(Node*& nodeToRemove) const;
 
-        unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit);
+        unsigned countMatchesForText(const String&, bool caseFlag, unsigned limit, bool markMatches);
         bool markedTextMatchesAreHighlighted() const;
         void setMarkedTextMatchesAreHighlighted(bool flag);
 
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index f692cb9..bb6fa50 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -526,7 +526,7 @@ unsigned int Page::markAllMatchesForText(const String& target, TextCaseSensitivi
     Frame* frame = mainFrame();
     do {
         frame->setMarkedTextMatchesAreHighlighted(shouldHighlight);
-        matches += frame->markAllMatchesForText(target, caseSensitivity == TextCaseSensitive, (limit == 0) ? 0 : (limit - matches));
+        matches += frame->countMatchesForText(target, caseSensitivity == TextCaseSensitive, (limit == 0) ? 0 : (limit - matches), true);
         frame = incrementFrame(frame, true, false);
     } while (frame);
 
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 3f9bb54..538d464 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-31  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add ability to count text matches without marking
+        https://bugs.webkit.org/show_bug.cgi?id=43996
+
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_text_matches_mark): Switched to call
+        countMatchesForText() instead of markAllMatchesForText().
+
 2010-08-31  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
 
         Unreviewed build fix.
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index d37d7ba..a7ce1ff 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -772,7 +772,7 @@ unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Ein
     EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0);
 
     sd->frame->setMarkedTextMatchesAreHighlighted(highlight);
-    return sd->frame->markAllMatchesForText(WTF::String::fromUTF8(string), case_sensitive, limit);
+    return sd->frame->countMatchesForText(WTF::String::fromUTF8(string), case_sensitive, limit, true);
 }
 
 /**
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index e0f007d..1bfdb6d 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,27 @@
+2010-08-31  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add ability to count text matches without marking
+        https://bugs.webkit.org/show_bug.cgi?id=43996
+
+        Safari needs to be able to count text matches without triggering lots of repainting.
+        Rename markAllMatchesForText: to countMatchesForText: and add a markMatches:
+        parameter.  For backwards compatibility markAllMatchesForText: calls
+        countMatchesForText: and passes YES for markMatches:.
+
+        * WebView/WebDocumentInternal.h:
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]):
+        (-[WebHTMLView countMatchesForText:caseSensitive:limit:markMatches:]):
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView markAllMatchesForText:caseSensitive:limit:]):
+        (-[WebPDFView countMatchesForText:caseSensitive:limit:markMatches:]):
+        * WebView/WebView.mm:
+        (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]):
+        (-[WebView countMatchesForText:caseSensitive:highlight:limit:markMatches:]):
+        * WebView/WebViewPrivate.h:
+
 2010-08-31  Darin Adler  <darin at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit/mac/WebView/WebDocumentInternal.h b/WebKit/mac/WebView/WebDocumentInternal.h
index 191264b..0f63d75 100644
--- a/WebKit/mac/WebView/WebDocumentInternal.h
+++ b/WebKit/mac/WebView/WebDocumentInternal.h
@@ -62,6 +62,7 @@
 - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue;
 - (BOOL)markedTextMatchesAreHighlighted;
 - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(WebNSUInteger)limit;
+- (WebNSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
 - (void)unmarkAllTextMatches;
 - (NSArray *)rectsForTextMatches;
 @end
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index a619f18..8edff95 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -6202,10 +6202,15 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
 
 - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit
 {
+    return [self countMatchesForText:string caseSensitive:caseFlag limit:limit markMatches:YES];
+}
+
+- (NSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit markMatches:(BOOL)markMatches
+{
     Frame* coreFrame = core([self _frame]);
     if (!coreFrame)
         return 0;
-    return coreFrame->markAllMatchesForText(string, caseFlag, limit);
+    return coreFrame->countMatchesForText(string, caseFlag, limit, markMatches);
 }
 
 - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue
diff --git a/WebKit/mac/WebView/WebPDFView.mm b/WebKit/mac/WebView/WebPDFView.mm
index 5e7b73c..70fceb6 100644
--- a/WebKit/mac/WebView/WebPDFView.mm
+++ b/WebKit/mac/WebView/WebPDFView.mm
@@ -628,6 +628,11 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
 
 - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit
 {
+    return [self countMatchesForText:string caseSensitive:caseFlag limit:limit markMatches:YES];
+}
+
+- (NSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit markMatches:(BOOL)markMatches
+{
     PDFSelection *previousMatch = nil;
     PDFSelection *nextMatch = nil;
     NSMutableArray *matches = [[NSMutableArray alloc] initWithCapacity:limit];
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index a8c405c..b4f17e4 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -4375,15 +4375,21 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
 
 - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(NSUInteger)limit
 {
+    return [self countMatchesForText:string caseSensitive:caseFlag highlight:highlight limit:limit markMatches:YES];
+}
+
+- (NSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(NSUInteger)limit markMatches:(BOOL)markMatches
+{
     WebFrame *frame = [self mainFrame];
     unsigned matchCount = 0;
     do {
         id <WebDocumentView> view = [[frame frameView] documentView];
         if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)]) {
-            [(NSView <WebMultipleTextMatches>*)view  setMarkedTextMatchesAreHighlighted:highlight];
+            if (markMatches)
+                [(NSView <WebMultipleTextMatches>*)view setMarkedTextMatchesAreHighlighted:highlight];
         
             ASSERT(limit == 0 || matchCount < limit);
-            matchCount += [(NSView <WebMultipleTextMatches>*)view markAllMatchesForText:string caseSensitive:caseFlag limit:limit == 0 ? 0 : limit - matchCount];
+            matchCount += [(NSView <WebMultipleTextMatches>*)view countMatchesForText:string caseSensitive:caseFlag limit:limit == 0 ? 0 : limit - matchCount markMatches:markMatches];
 
             // Stop looking if we've reached the limit. A limit of 0 means no limit.
             if (limit > 0 && matchCount >= limit)
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 9d47a4d..28348cc 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -180,6 +180,7 @@ typedef enum {
 // These methods are still in flux; don't rely on them yet.
 - (BOOL)canMarkAllTextMatches;
 - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit;
+- (WebNSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
 - (void)unmarkAllTextMatches;
 - (NSArray *)rectsForTextMatches;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list