[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
morrita at google.com
morrita at google.com
Wed Dec 22 13:22:03 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1baadab423ec20873902d6bac771faa822e644ed
Author: morrita at google.com <morrita at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 13 04:21:00 2010 +0000
2010-09-10 MORITA Hajime <morrita at google.com>
Reviewed by Tony Chang.
[Chromium] Implement textInputController.hasSpellingMarker() for Chromium
https://bugs.webkit.org/show_bug.cgi?id=45441
Add an note for API readiness.
* platform/chromium/test_expectations.txt:
2010-09-10 MORITA Hajime <morrita at google.com>
Reviewed by Tony Chang.
[Chromium] Implement textInputController.hasSpellingMarker() for Chromium
https://bugs.webkit.org/show_bug.cgi?id=45441
Added an API for testing marker state.
We locate this here instead of DRT for sharing the logic between
multiple ports.
* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasSpellingMarkerFor):
* editing/Editor.h:
2010-09-10 MORITA Hajime <morrita at google.com>
Reviewed by Tony Chang.
[Chromium] Implement textInputController.hasSpellingMarker() for Chromium
https://bugs.webkit.org/show_bug.cgi?id=45441
Exported Frame::selectionStartHasSpellingMarkerFor() for DRT use.
* public/WebFrame.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::selectionStartHasSpellingMarkerFor):
* src/WebFrameImpl.h:
2010-09-10 MORITA Hajime <morrita at google.com>
Reviewed by Tony Chang.
[Chromium] Implement textInputController.hasSpellingMarker() for Chromium
https://bugs.webkit.org/show_bug.cgi?id=45441
Moved the actual logic of hasSpellingMarker into WebCore to share
it with other ports.
* WebView/WebFrame.mm:
(-[WebFrame hasSpellingMarker:length:]):
2010-09-10 MORITA Hajime <morrita at google.com>
Reviewed by Tony Chang.
[Chromium] Implement textInputController.hasSpellingMarker() for Chromium
https://bugs.webkit.org/show_bug.cgi?id=45441
Added TextInputController::hasSpellingMarker().
* DumpRenderTree/chromium/TextInputController.cpp:
(TextInputController::TextInputController):
(TextInputController::hasSpellingMarker):
* DumpRenderTree/chromium/TextInputController.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e8ae63d..8779213 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-10 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Add an note for API readiness.
+
+ * platform/chromium/test_expectations.txt:
+
2010-09-12 Dirk Pranke <dpranke at chromium.org>
Unreviewed, expectations change.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 34131ce..95b75e2 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -2718,6 +2718,7 @@ BUGWK41311 WIN LINUX : fast/borders/borderRadiusDouble08.html = IMAGE
BUGWK41311 WIN LINUX : fast/borders/borderRadiusDouble09.html = IMAGE
// Need to implement textInputController.hasSpellingMarkers().
+// Note that hasSpellingMarkers() is available for DRT: http://webkit.org/b/45441
BUGWK41832 : editing/spelling/spelling-textarea.html = FAIL
BUGWK41832 : editing/spelling/spelling-contenteditable.html = FAIL
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b3e8873..9feafe4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-10 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Added an API for testing marker state.
+ We locate this here instead of DRT for sharing the logic between
+ multiple ports.
+
+ * WebCore.exp.in:
+ * editing/Editor.cpp:
+ (WebCore::Editor::selectionStartHasSpellingMarkerFor):
+ * editing/Editor.h:
+
2010-09-12 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 7a3e53e..09caf22 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -844,6 +844,7 @@ __ZN7WebCore9toElementEN3JSC7JSValueE
__ZN7WebCoreeqERKNS_19ResourceRequestBaseES2_
__ZNK3JSC8Bindings10RootObject12globalObjectEv
__ZNK3WTF6String14createCFStringEv
+__ZNK7WebCore6Editor34selectionStartHasSpellingMarkerForEii
__ZNK7WebCore10FloatPointcv8_NSPointEv
__ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringE
__ZNK7WebCore10RenderText16linesBoundingBoxEv
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 34fd99a..01e6c05 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -3591,4 +3591,24 @@ void Editor::respondToChangedSelection(const VisibleSelection& oldSelection, boo
respondToChangedSelection(oldSelection);
}
+bool Editor::selectionStartHasSpellingMarkerFor(int from, int length) const
+{
+ Node* node = m_frame->selection()->start().node();
+ if (!node || !node->renderer())
+ return false;
+ ASSERT(node->renderer()->isText());
+
+ unsigned int startOffset = static_cast<unsigned int>(from);
+ unsigned int endOffset = static_cast<unsigned int>(from + length);
+ Vector<DocumentMarker> markers = m_frame->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 true;
+ }
+
+ return false;
+}
+
+
} // namespace WebCore
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 2c06cea..678ec59 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -360,6 +360,8 @@ public:
NSWritingDirection baseWritingDirectionForSelectionStart() const;
#endif
+ bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+
private:
Frame* m_frame;
OwnPtr<DeleteButtonController> m_deleteButtonController;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 473c112..3b43f63 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-10 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Exported Frame::selectionStartHasSpellingMarkerFor() for DRT use.
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::selectionStartHasSpellingMarkerFor):
+ * src/WebFrameImpl.h:
+
2010-09-10 Jesus Sanchez-Palencia <jesus.palencia at openbossa.org>
Reviewed by Darin Adler.
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index d8eca6a..6725f58 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -533,6 +533,9 @@ public:
// empty ((0,0), (0,0)).
virtual WebRect selectionBoundsRect() const = 0;
+ // Only for testing purpose:
+ // Returns true if selection.anchorNode has a marker on range from |from| with |length|.
+ virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0;
protected:
~WebFrame() { }
};
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index af2f7b6..2d42f4b 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1705,6 +1705,13 @@ WebRect WebFrameImpl::selectionBoundsRect() const
return WebRect();
}
+bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) const
+{
+ if (!m_frame)
+ return false;
+ return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length);
+}
+
// WebFrameImpl public ---------------------------------------------------------
PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 14217fa..25e7004 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -182,6 +182,8 @@ public:
float pageHeightInPixels) const;
virtual WebRect selectionBoundsRect() const;
+ virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
~WebFrameImpl();
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 4d7e083..177b1c6 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-10 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Moved the actual logic of hasSpellingMarker into WebCore to share
+ it with other ports.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame hasSpellingMarker:length:]):
+
2010-09-11 Adam Barth <abarth at webkit.org>
Reviewed by Sam Weinig.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index d222998..02696f4 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1349,38 +1349,12 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return coreFrame->layerTreeAsText();
}
-static Node* spellingNode(Frame* coreFrame)
-{
- Node* focusedNode = coreFrame->selection()->start().node();
- 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;
+ return coreFrame->editor()->selectionStartHasSpellingMarkerFor(from, length);
}
@end
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2b72256..4938e9d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-10 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Added TextInputController::hasSpellingMarker().
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::hasSpellingMarker):
+ * DumpRenderTree/chromium/TextInputController.h:
+
2010-09-12 Dirk Pranke <dpranke at chromium.org>
Unreviewed, build fix.
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 63c4719..79d1abe 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -65,6 +65,7 @@ TextInputController::TextInputController(TestShell* shell)
bindMethod("characterIndexForPoint", &TextInputController::characterIndexForPoint);
bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
bindMethod("makeAttributedString", &TextInputController::makeAttributedString);
+ bindMethod("hasSpellingMarker", &TextInputController::hasSpellingMarker);
}
WebFrame* TextInputController::getMainFrame()
@@ -214,3 +215,14 @@ void TextInputController::makeAttributedString(const CppArgumentList&, CppVarian
// FIXME: Implement this.
result->setNull();
}
+
+void TextInputController::hasSpellingMarker(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+ // Returns as a number for a compatibility reason.
+ result->set(mainFrame->selectionStartHasSpellingMarkerFor(arguments[0].toInt32(), arguments[1].toInt32()) ? 1 : 0);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
index 9896be5..ddacefe 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.h
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -61,6 +61,7 @@ public:
void characterIndexForPoint(const CppArgumentList&, CppVariant*);
void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
void makeAttributedString(const CppArgumentList&, CppVariant*);
+ void hasSpellingMarker(const CppArgumentList&, CppVariant*);
private:
// Returns the test shell's main WebFrame.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list