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

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:58:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 77ba145b3fc87b76fb0db8558539dc35b01a4718
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 3 10:36:04 2010 +0000

    2010-09-03  Hironori Bono  <hbono at chromium.org>
    
            Reviewed by Kent Tamura.
    
            Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
            and implements it for Mac.
            https://bugs.webkit.org/show_bug.cgi?id=41832
    
            * editing/spelling/spelling-contenteditable-expected.txt: Added the expected result for
            spelling-contenteditable.html.
            * editing/spelling/spelling-contenteditable.html: Added a text test of spellcheker APIs
            for contenteditable <div> elements.
            * editing/spelling/spelling-textarea-expected.txt: Added the expected result for spelling-textarea.html.
            * editing/spelling/spelling-textarea.html: Added a text test of spellchecker APIs
            for <textarea> elements.
            * platform/chromium/test_expectations.txt: Skipped the new tests because
            textInputController.hasSpelingMarker() is not implemented.
            * platform/gtk/Skipped: ditto.
            * platform/qt/Skipped: ditto.
            * platform/win/Skipped: ditto.
    2010-09-03  Hironori Bono  <hbono at chromium.org>
    
            Reviewed by Kent Tamura.
    
            Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
            and implements it for Mac.
            https://bugs.webkit.org/show_bug.cgi?id=41832
    
            Tests: editing/spelling/spelling-contenteditable.html
                   editing/spelling/spelling-textarea.html
    
            * WebCore.exp.in: Exported symbols used by [WebFrame hasSpellingMarker:length:].
    2010-09-03  Hironori Bono  <hbono at chromium.org>
    
            Reviewed by Kent Tamura.
    
            Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
            and implements it for Mac.
            https://bugs.webkit.org/show_bug.cgi?id=41832
    
            * WebView/WebFrame.mm: Implemented [WebFrame hasSpellingMarker:length:].
            (spellingNode):
            (-[WebFrame hasSpellingMarker:length:]):
            * WebView/WebFramePrivate.h: Added [WebFrame hasSpellingMarker:length:] so TextInputController can use it.
    2010-09-03  Hironori Bono  <hbono at chromium.org>
    
            Reviewed by Kent Tamura.
    
            Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
            and implements it for Mac.
            https://bugs.webkit.org/show_bug.cgi?id=41832
    
            * DumpRenderTree/mac/TextInputController.m: Added [TextInputController hasSpellingMarker:length:]
            and bind it so we can call it from JavaScript.
            (+[TextInputController isSelectorExcludedFromWebScript:]):
            (+[TextInputController webScriptNameForSelector:]):
            (-[TextInputController hasSpellingMarker:length:]):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66721 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d47b7c3..a0a8558 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,24 @@
+2010-09-03  Hironori Bono  <hbono at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
+        and implements it for Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=41832
+
+        * editing/spelling/spelling-contenteditable-expected.txt: Added the expected result for
+        spelling-contenteditable.html.
+        * editing/spelling/spelling-contenteditable.html: Added a text test of spellcheker APIs
+        for contenteditable <div> elements.
+        * editing/spelling/spelling-textarea-expected.txt: Added the expected result for spelling-textarea.html.
+        * editing/spelling/spelling-textarea.html: Added a text test of spellchecker APIs
+        for <textarea> elements.
+        * platform/chromium/test_expectations.txt: Skipped the new tests because
+        textInputController.hasSpelingMarker() is not implemented.
+        * platform/gtk/Skipped: ditto.
+        * platform/qt/Skipped: ditto.
+        * platform/win/Skipped: ditto.
+
 2010-09-03  Philippe Normand  <pnormand at igalia.com>
 
         Unreviewed, updated GTK baselines of a mathml test.
diff --git a/LayoutTests/editing/spelling/spelling-contenteditable-expected.txt b/LayoutTests/editing/spelling/spelling-contenteditable-expected.txt
new file mode 100644
index 0000000..37af821
--- /dev/null
+++ b/LayoutTests/editing/spelling/spelling-contenteditable-expected.txt
@@ -0,0 +1,11 @@
+This tests we can write text tests for spellcheckers. To test manually, type 'zz ' in the contenteditable <div> element and see they are marked as misspelled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+zz 
+PASS 'zz' is marked as misspelled.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/spelling/spelling-contenteditable.html b/LayoutTests/editing/spelling/spelling-contenteditable.html
new file mode 100644
index 0000000..51d28d1
--- /dev/null
+++ b/LayoutTests/editing/spelling/spelling-contenteditable.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js" language="javascript" type="text/javascript"></script>
+<script src="../editing.js" language="javascript" type="text/javascript"></script>
+<title>Editing Test</title> 
+</head> 
+<body>
+<p id="description"></p>
+<div id="test" contenteditable="true"></div>
+<div id="console"></div>
+<script language="javascript" type="text/javascript">
+description('This tests we can write text tests for spellcheckers. To test manually, type \'zz \' in the contenteditable &lt;div&gt; element and see they are marked as misspelled.');
+
+function logResult(result) {
+    if (result)
+        testPassed('\'zz\' is marked as misspelled.');
+    else
+        testPassed('\'zz\' is not marked as misspelled.');
+}
+
+if (window.layoutTestController) {
+    // Type the test text 'zz '.
+    document.getElementById('test').focus();
+    typeCharacterCommand('z');
+    typeCharacterCommand('z');
+    typeCharacterCommand(' ');
+
+    // Test the above 'zz' is marked as misspelled. We test it only on platforms that implement
+    // textInputController.hasSpellingMarker() to avoid exceptions.
+    if (textInputController && textInputController.hasSpellingMarker)
+        logResult(textInputController.hasSpellingMarker(0, 2));
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/editing/spelling/spelling-textarea-expected.txt b/LayoutTests/editing/spelling/spelling-textarea-expected.txt
new file mode 100644
index 0000000..fac07ce
--- /dev/null
+++ b/LayoutTests/editing/spelling/spelling-textarea-expected.txt
@@ -0,0 +1,11 @@
+This tests we can write text tests for spellcheckers. To test manually, type 'zz ' in the <textarea> element and see they are marked as misspelled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS 'zz' is marked as misspelled.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/spelling/spelling-textarea.html b/LayoutTests/editing/spelling/spelling-textarea.html
new file mode 100644
index 0000000..43925b9
--- /dev/null
+++ b/LayoutTests/editing/spelling/spelling-textarea.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js" language="javascript" type="text/javascript"></script>
+<script src=../editing.js language="javascript" type="text/javascript"></script>
+<title>Editing Test</title> 
+</head> 
+<body>
+<p id="description"></p>
+<textarea id="test" cols="80" rows="10"></textarea>
+<div id="console"></div>
+<script language="javascript" type="text/javascript">
+description('This tests we can write text tests for spellcheckers. To test manually, type \'zz \' in the &lt;textarea&gt; element and see they are marked as misspelled.');
+
+function logResult(result) {
+    if (result)
+        testPassed('\'zz\' is marked as misspelled.');
+    else
+        testPassed('\'zz\' is not marked as misspelled.');
+}
+
+if (window.layoutTestController) {
+    // Type the test text 'zz '.
+    document.getElementById('test').focus();
+    typeCharacterCommand('z');
+    typeCharacterCommand('z');
+    typeCharacterCommand(' ');
+
+    // Test the above 'zz' is marked as misspelled. We test it only on platforms that implement
+    // textInputController.hasSpellingMarker() to avoid exceptions.
+    if (textInputController && textInputController.hasSpellingMarker)
+        logResult(textInputController.hasSpellingMarker(0, 2));
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 3caf347..ef30c49 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -2749,6 +2749,10 @@ BUGWK41311 WIN LINUX : fast/borders/borderRadiusDouble07.html = IMAGE
 BUGWK41311 WIN LINUX : fast/borders/borderRadiusDouble08.html = IMAGE
 BUGWK41311 WIN LINUX : fast/borders/borderRadiusDouble09.html = IMAGE
 
+// Need to implement textInputController.hasSpellingMarkers().
+BUGWK41832 : editing/spelling/spelling-textarea.html = FAIL
+BUGWK41832 : editing/spelling/spelling-contenteditable.html = FAIL
+
 // Flaky tests.
 BUG44345 LINUX : svg/zoom/text/zoom-hixie-mixed-009.xml = IMAGE PASS
 BUG44346 LINUX : svg/zoom/page/zoom-hixie-mixed-009.xml = IMAGE PASS
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index aff7ace..87efe2f 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -1013,6 +1013,8 @@ editing/selection/unrendered-space.html
 editing/selection/word-granularity.html
 editing/spelling/inline_spelling_markers.html
 editing/spelling/spellcheck-attribute.html
+editing/spelling/spelling-contenteditable.html
+editing/spelling/spelling-textarea.html
 editing/style/5065910.html
 editing/style/apple-style-editable-mix.html
 editing/style/block-style-001.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 3269eb9..b0af849 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -2297,6 +2297,10 @@ editing/spelling/spelling-linebreak.html
 editing/spelling/spellcheck-attribute.html
 editing/spelling/spelling.html
 
+# textInputController.hasSpellingMarkers() is not implemented.
+editing/spelling/spelling-contenteditable.html
+editing/spelling/spelling-textarea.html
+
 # ============================================================================= #
 # failing editing/style tests
 # ============================================================================= #
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 53edd35..2470e45 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -878,6 +878,10 @@ canvas/philip
 # https://bugs.webkit.org/show_bug.cgi?id=39104
 editing/spelling/context-menu-suggestions.html
 
+# textInputController.hasSpellingMarkers() is not implemented.
+editing/spelling/spelling-contenteditable.html
+editing/spelling/spelling-textarea.html
+
 # IndexedDB is not yet enabled.
 storage/indexeddb
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 88ed5d0..4f39336 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-03  Hironori Bono  <hbono at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
+        and implements it for Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=41832
+
+        Tests: editing/spelling/spelling-contenteditable.html
+               editing/spelling/spelling-textarea.html
+
+        * WebCore.exp.in: Exported symbols used by [WebFrame hasSpellingMarker:length:].
+
 2010-09-02  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index e8b4fe7..85148e5 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -462,6 +462,7 @@ __ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16Doc
 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
 __ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
 __ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
+__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
 __ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
 __ZN7WebCore24contextMenuItemTagItalicEv
 __ZN7WebCore24contextMenuItemTagStylesEv
@@ -886,6 +887,7 @@ __ZNK7WebCore12EventHandler20currentKeyboardEventEv
 __ZNK7WebCore12IconDatabase12databasePathEv
 __ZNK7WebCore12IconDatabase24shouldStopThreadActivityEv
 __ZNK7WebCore12IconDatabase9isEnabledEv
+__ZNK7WebCore12RenderObject7childAtEj
 __ZNK7WebCore12RenderObject14enclosingLayerEv
 __ZNK7WebCore12RenderObject15localToAbsoluteENS_10FloatPointEbb
 __ZNK7WebCore12RenderWidget14windowClipRectEv
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index a5dc792..9e3893e 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-03  Hironori Bono  <hbono at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
+        and implements it for Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=41832
+
+        * WebView/WebFrame.mm: Implemented [WebFrame hasSpellingMarker:length:].
+        (spellingNode):
+        (-[WebFrame hasSpellingMarker:length:]):
+        * WebView/WebFramePrivate.h: Added [WebFrame hasSpellingMarker:length:] so TextInputController can use it.
+
 2010-09-02  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 1feb97e..8dc4039 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1366,6 +1366,40 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     return coreFrame->layerTreeAsText();
 }
 
+static Node* spellingNode(Frame* coreFrame)
+{
+    Node* focusedNode = coreFrame->document()->focusedNode();
+    if (!focusedNode || !focusedNode->renderer())
+        return 0;
+
+    for (const RenderObject* renderer = focusedNode->renderer(); renderer; renderer = renderer->childAt(0)) {
+        if (renderer->isText())
+            return renderer->node();
+    }
+    return 0;
+}
+
+- (BOOL)hasSpellingMarker:(int)from length:(int)length
+{
+    Frame* coreFrame = _private->coreFrame;
+    if (!coreFrame)
+        return NO;
+
+    Node* node = spellingNode(coreFrame);
+    if (!node)
+        return NO;
+
+    unsigned int startOffset = static_cast<unsigned int>(from);
+    unsigned int endOffset = static_cast<unsigned int>(from + length);
+    Vector<DocumentMarker> markers = coreFrame->document()->markers()->markersForNode(node);
+    for (size_t i = 0; i < markers.size(); ++i) {
+        DocumentMarker marker = markers[i];
+        if (marker.startOffset <= startOffset && endOffset <= marker.endOffset && marker.type == DocumentMarker::Spelling)
+            return YES;
+    }
+    return NO;
+}
+
 @end
 
 @implementation WebFrame
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index a1031f3..9cb6232 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -143,4 +143,7 @@ typedef enum {
 
 - (NSString*)_layerTreeAsText;
 
+// Returns whether there is a spelling marker in the specified range of the focused node.
+- (BOOL)hasSpellingMarker:(int)location length:(int)length;
+
 @end
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2d3e662..8140802 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-03  Hironori Bono  <hbono at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
+        and implements it for Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=41832
+
+        * DumpRenderTree/mac/TextInputController.m: Added [TextInputController hasSpellingMarker:length:]
+        and bind it so we can call it from JavaScript.
+        (+[TextInputController isSelectorExcludedFromWebScript:]):
+        (+[TextInputController webScriptNameForSelector:]):
+        (-[TextInputController hasSpellingMarker:length:]):
+
 2010-09-02  Eric Seidel  <eric at webkit.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/DumpRenderTree/mac/TextInputController.m b/WebKitTools/DumpRenderTree/mac/TextInputController.m
index 3ea9c22..a049ac5 100644
--- a/WebKitTools/DumpRenderTree/mac/TextInputController.m
+++ b/WebKitTools/DumpRenderTree/mac/TextInputController.m
@@ -33,6 +33,7 @@
 #import <AppKit/NSInputManager.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebFrame.h>
+#import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebScriptObject.h>
@@ -169,7 +170,8 @@
             || aSelector == @selector(characterIndexForPointX:Y:)
             || aSelector == @selector(validAttributesForMarkedText)
             || aSelector == @selector(attributedStringWithString:)
-            || aSelector == @selector(setInputMethodHandler:))
+            || aSelector == @selector(setInputMethodHandler:)
+            || aSelector == @selector(hasSpellingMarker:length:))
         return NO;
     return YES;
 }
@@ -194,6 +196,8 @@
         return @"makeAttributedString"; // just a factory method, doesn't call into NSTextInput
     else if (aSelector == @selector(setInputMethodHandler:))
         return @"setInputMethodHandler"; 
+    else if (aSelector == @selector(hasSpellingMarker:length:))
+        return @"hasSpellingMarker";
 
     return nil;
 }
@@ -427,4 +431,9 @@
     return YES;
 }
 
+- (BOOL)hasSpellingMarker:(int)from length:(int)length
+{
+    return [[webView mainFrame] hasSpellingMarker:from length:length];
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list