Diff
Modified: trunk/ChangeLog (93391 => 93392)
--- trunk/ChangeLog 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/ChangeLog 2011-08-19 09:43:23 UTC (rev 93392)
@@ -1,3 +1,14 @@
+2011-08-19 MORITA Hajime <morr...@google.com>
+
+ Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
+ https://bugs.webkit.org/show_bug.cgi?id=65902
+
+ Reviewed by Ryosuke Niwa.
+
+ Add export for window.internals object.
+
+ * Source/autotools/symbols.filter:
+
2011-08-16 Andras Becsi <abe...@webkit.org>
Reviewed by Csaba Osztrogonác.
Modified: trunk/LayoutTests/ChangeLog (93391 => 93392)
--- trunk/LayoutTests/ChangeLog 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/LayoutTests/ChangeLog 2011-08-19 09:43:23 UTC (rev 93392)
@@ -1,3 +1,23 @@
+2011-08-19 MORITA Hajime <morr...@google.com>
+
+ Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
+ https://bugs.webkit.org/show_bug.cgi?id=65902
+
+ Reviewed by Ryosuke Niwa.
+
+ Existing expectation was wrong because of some markers on substrings of words.
+ With this fix, Editor now rejects such markers.
+
+ * editing/spelling/spelling-insert-html-expected.txt: Added.
+ * editing/spelling/spelling-insert-html.html: Added.
+ * platform/mac/editing/pasteboard/merge-after-delete-1-expected.png:
+ * platform/mac/editing/pasteboard/merge-after-delete-2-expected.png:
+ * platform/mac/editing/pasteboard/merge-after-delete-expected.png:
+ * platform/mac/editing/pasteboard/merge-end-blockquote-expected.png:
+ * platform/mac/editing/pasteboard/merge-end-list-expected.png:
+ * platform/mac/editing/pasteboard/merge-end-table-expected.png:
+ * platform/mac/editing/pasteboard/paste-text-008-expected.png:
+
2011-08-19 Shinya Kawanaka <shin...@google.com>
input[maxlength=0] should ignore text input.
Added: trunk/LayoutTests/editing/spelling/spelling-insert-html-expected.txt (0 => 93392)
--- trunk/LayoutTests/editing/spelling/spelling-insert-html-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/spelling/spelling-insert-html-expected.txt 2011-08-19 09:43:23 UTC (rev 93392)
@@ -0,0 +1,10 @@
+The spellchecker shouldn't mark substrings of words after pasting.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS markedText is "zz"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo zz
+food.
Added: trunk/LayoutTests/editing/spelling/spelling-insert-html.html (0 => 93392)
--- trunk/LayoutTests/editing/spelling/spelling-insert-html.html (rev 0)
+++ trunk/LayoutTests/editing/spelling/spelling-insert-html.html 2011-08-19 09:43:23 UTC (rev 93392)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<pre id="description"></pre>
+<pre id="console"></pre>
+<div id="container">
+ <div id="destination" contentEditable>food.</div>
+</div>
+
+<script>
+description("The spellchecker shouldn't mark substrings of words after pasting.");
+
+var sel = window.getSelection();
+var destination = document.getElementById("destination");
+var destinationText = destination.firstChild;
+sel.setBaseAndExtent(destinationText, 2, destinationText, 2);
+
+document.execCommand("InsertHTML", false, "<div>o zz</div><div>fo</div>");
+
+if (window.internals) {
+ // The destination node has multiple text nodes,
+ // so we need concatenate the marked text.
+ var texts = destination.childNodes;
+ var markedText = "";
+ for (var i = 0; i < texts.length; ++i) {
+ var marked = internals.markerRangeForNode(texts[i], 0);
+ if (marked)
+ markedText += marked.toString()
+ }
+
+ // The first "foo" isn't checked because it crosses the pasted and base html.
+ // See http://webkit.org/b/66450.
+ shouldBeEqualToString("markedText", "zz");
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-1-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-2-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-end-blockquote-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-end-list-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/merge-end-table-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/paste-text-008-expected.png
(Binary files differ)
Modified: trunk/Source/WebCore/ChangeLog (93391 => 93392)
--- trunk/Source/WebCore/ChangeLog 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/ChangeLog 2011-08-19 09:43:23 UTC (rev 93392)
@@ -1,3 +1,26 @@
+2011-08-19 MORITA Hajime <morr...@google.com>
+
+ Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
+ https://bugs.webkit.org/show_bug.cgi?id=65902
+
+ Reviewed by Ryosuke Niwa.
+
+ markMisspellingsAndBadGrammar() was using markSpelling() and markBadGrammar().
+ But these are low-level API and caller should take care of word boundary.
+ This change replaced these call with overloaded version of markMisspellingsAndBadGrammar(),
+ which handles word boundary correctly.
+
+ Test: editing/spelling/spelling-insert-html.html
+
+ * WebCore.exp.in:
+ * editing/Editor.cpp:
+ (WebCore::Editor::markMisspellingsAndBadGrammar):
+ * testing/Internals.cpp:
+ (WebCore::Internals::markerCountOf): Added.
+ (WebCore::Internals::markedRangeAt): Added.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2011-08-19 Nayan Kumar K <naya...@motorola.com>
Run-time error fix in WebKit-GTK with video support disabled.
Modified: trunk/Source/WebCore/WebCore.exp.in (93391 => 93392)
--- trunk/Source/WebCore/WebCore.exp.in 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-08-19 09:43:23 UTC (rev 93392)
@@ -597,6 +597,7 @@
__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
__ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
+__ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE
__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker11MarkerTypesE
__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore24contextMenuItemTagItalicEv
Modified: trunk/Source/WebCore/editing/Editor.cpp (93391 => 93392)
--- trunk/Source/WebCore/editing/Editor.cpp 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/editing/Editor.cpp 2011-08-19 09:43:23 UTC (rev 93392)
@@ -1941,16 +1941,7 @@
void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
{
- bool markSpelling = isContinuousSpellCheckingEnabled();
- bool markGrammar = markSpelling && isGrammarCheckingEnabled();
-
- if (markSpelling) {
- RefPtr<Range> unusedFirstMisspellingRange;
- markMisspellings(movingSelection, unusedFirstMisspellingRange);
- }
-
- if (markGrammar)
- markBadGrammar(movingSelection);
+ markMisspellingsAndBadGrammar(movingSelection, isContinuousSpellCheckingEnabled() && isGrammarCheckingEnabled(), movingSelection);
}
void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement)
Modified: trunk/Source/WebCore/testing/Internals.cpp (93391 => 93392)
--- trunk/Source/WebCore/testing/Internals.cpp 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/testing/Internals.cpp 2011-08-19 09:43:23 UTC (rev 93392)
@@ -29,12 +29,14 @@
#include "CachedResourceLoader.h"
#include "ClientRect.h"
#include "Document.h"
+#include "DocumentMarkerController.h"
#include "Element.h"
#include "ExceptionCode.h"
#include "InspectorController.h"
#include "MemoryCache.h"
#include "NodeRenderingContext.h"
#include "Page.h"
+#include "Range.h"
#include "RenderObject.h"
#include "RenderTreeAsText.h"
#include "Settings.h"
@@ -183,6 +185,29 @@
return ClientRect::create(renderer->absoluteBoundingBoxRect());
}
+unsigned Internals::markerCountForNode(Node* node, ExceptionCode& ec)
+{
+ if (!node) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ return node->document()->markers()->markersFor(node).size();
+}
+
+PassRefPtr<Range> Internals::markerRangeForNode(Node* node, unsigned index, ExceptionCode& ec)
+{
+ if (!node) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node);
+ if (markers.size() <= index)
+ return 0;
+ return Range::create(node->document(), node, markers[index]->startOffset(), node, markers[index]->endOffset());
+}
+
void Internals::setForceCompositingMode(Document* document, bool enabled, ExceptionCode& ec)
{
if (!document || !document->settings()) {
@@ -233,4 +258,5 @@
document->settings()->setPasswordEchoDurationInSeconds(passwordEchoEnabledBackup);
}
+
}
Modified: trunk/Source/WebCore/testing/Internals.h (93391 => 93392)
--- trunk/Source/WebCore/testing/Internals.h 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/testing/Internals.h 2011-08-19 09:43:23 UTC (rev 93392)
@@ -38,6 +38,7 @@
class Document;
class Element;
class Node;
+class Range;
class Internals : public RefCounted<Internals> {
public:
@@ -67,6 +68,9 @@
PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&);
+ unsigned markerCountForNode(Node*, ExceptionCode&);
+ PassRefPtr<Range> markerRangeForNode(Node*, unsigned, ExceptionCode&);
+
void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
void setPasswordEchoEnabled(Document*, bool enabled, ExceptionCode&);
Modified: trunk/Source/WebCore/testing/Internals.idl (93391 => 93392)
--- trunk/Source/WebCore/testing/Internals.idl 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebCore/testing/Internals.idl 2011-08-19 09:43:23 UTC (rev 93392)
@@ -42,6 +42,8 @@
void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException);
ClientRect boundingBox(in Element element) raises(DOMException);
+ unsigned long markerCountForNode(in Node node) raises(DOMException);
+ Range markerRangeForNode(in Node node, in unsigned long index) raises(DOMException);
void setForceCompositingMode(in Document document, in boolean enabled) raises(DOMException);
Modified: trunk/Source/WebKit2/ChangeLog (93391 => 93392)
--- trunk/Source/WebKit2/ChangeLog 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-19 09:43:23 UTC (rev 93392)
@@ -1,3 +1,15 @@
+2011-08-19 MORITA Hajime <morr...@google.com>
+
+ Spell-checking against execCommand() inserted HTML doesn't care word boundary.
+ https://bugs.webkit.org/show_bug.cgi?id=65902
+
+ Reviewed by Ryosuke Niwa.
+
+ Add exports for window.internals object.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
2011-08-18 Beth Dakin <bda...@apple.com>
Reviewed by Sam Weinig.
Modified: trunk/Source/WebKit2/win/WebKit2.def (93391 => 93392)
--- trunk/Source/WebKit2/win/WebKit2.def 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebKit2/win/WebKit2.def 2011-08-19 09:43:23 UTC (rev 93392)
@@ -137,6 +137,7 @@
; Re-exports from WebCore for test harnesses
??0NodeRenderingContext@WebCore@@QAE@PAVNode@1@@Z
??1NodeRenderingContext@WebCore@@QAE@XZ
+ ??1Range@WebCore@@QAE@XZ
?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
??0ClientRect@WebCore@@AAE@ABVIntRect@1@@Z
??0ClientRect@WebCore@@AAE@XZ
@@ -146,6 +147,7 @@
?add@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBD@Z
?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
+ ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
@@ -154,6 +156,7 @@
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
+ ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
?page@Document@WebCore@@QBEPAVPage@2@XZ
?removeShadowRoot@Element@WebCore@@QAEXXZ
@@ -166,5 +169,6 @@
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
+ ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVRange@1@@Z
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
Modified: trunk/Source/WebKit2/win/WebKit2CFLite.def (93391 => 93392)
--- trunk/Source/WebKit2/win/WebKit2CFLite.def 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/WebKit2/win/WebKit2CFLite.def 2011-08-19 09:43:23 UTC (rev 93392)
@@ -134,10 +134,12 @@
??0String@WTF@@QAE@PBD@Z
??0String@WTF@@QAE@PB_W@Z
??1NodeRenderingContext@WebCore@@QAE@XZ
+ ??1Range@WebCore@@QAE@XZ
?absoluteBoundingBoxRect@RenderObject@WebCore@@QAE?AVIntRect@2@_N@Z
?add@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBD@Z
?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
+ ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
@@ -148,6 +150,7 @@
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
+ ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
?page@Document@WebCore@@QBEPAVPage@2@XZ
?removeShadowRoot@Element@WebCore@@QAEXXZ
@@ -159,5 +162,6 @@
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
+ ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVRange@1@@Z
?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
Modified: trunk/Source/autotools/symbols.filter (93391 => 93392)
--- trunk/Source/autotools/symbols.filter 2011-08-19 08:58:27 UTC (rev 93391)
+++ trunk/Source/autotools/symbols.filter 2011-08-19 09:43:23 UTC (rev 93392)
@@ -27,6 +27,9 @@
_ZN3WTF7CStringaSERKS0_;
_ZN24DumpRenderTreeSupportGtk*;
_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE;
+_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE;
+_ZN7WebCore5Range6createEN3WTF10PassRefPtrINS_8DocumentEEENS2_INS_4NodeEEEiS6_i;
+_ZN7WebCore5RangeD1Ev;
_ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv;
_ZN7WebCore10JSDocument3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
_ZN7WebCore10JSDocument6s_infoE;
@@ -49,6 +52,7 @@
_ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE;
_ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
_ZN7WebCore22externalRepresentationEPNS_7ElementEj;
+_ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE;
_ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE;
_ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
_ZN7WebCore6JSNode6s_infoE;