Changeset 93392 in webkit


Ignore:
Timestamp:
Aug 19, 2011 2:43:23 AM (13 years ago)
Author:
morrita@google.com
Message:

.: 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:

Source/WebCore: 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:

Source/WebKit2: 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:

LayoutTests: 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:
Location:
trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r93097 r93392  
     12011-08-19  MORITA Hajime  <morrita@google.com>
     2
     3        Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
     4        https://bugs.webkit.org/show_bug.cgi?id=65902
     5
     6        Reviewed by Ryosuke Niwa.
     7       
     8        Add export for window.internals object.
     9
     10        * Source/autotools/symbols.filter:
     11
    1122011-08-16  Andras Becsi  <abecsi@webkit.org>
    213
  • trunk/LayoutTests/ChangeLog

    r93390 r93392  
     12011-08-19  MORITA Hajime <morrita@google.com>
     2
     3        Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
     4        https://bugs.webkit.org/show_bug.cgi?id=65902
     5
     6        Reviewed by Ryosuke Niwa.
     7       
     8        Existing expectation was wrong because of some markers on substrings of words.
     9        With this fix, Editor now rejects such markers.
     10
     11        * editing/spelling/spelling-insert-html-expected.txt: Added.
     12        * editing/spelling/spelling-insert-html.html: Added.
     13        * platform/mac/editing/pasteboard/merge-after-delete-1-expected.png:
     14        * platform/mac/editing/pasteboard/merge-after-delete-2-expected.png:
     15        * platform/mac/editing/pasteboard/merge-after-delete-expected.png:
     16        * platform/mac/editing/pasteboard/merge-end-blockquote-expected.png:
     17        * platform/mac/editing/pasteboard/merge-end-list-expected.png:
     18        * platform/mac/editing/pasteboard/merge-end-table-expected.png:
     19        * platform/mac/editing/pasteboard/paste-text-008-expected.png:
     20
    1212011-08-19  Shinya Kawanaka  <shinyak@google.com>
    222
  • trunk/Source/WebCore/ChangeLog

    r93391 r93392  
     12011-08-19  MORITA Hajime  <morrita@google.com>
     2
     3        Spell-checking doesn't recognize word boundaries on contests inserted by execCommand('insertHTML')
     4        https://bugs.webkit.org/show_bug.cgi?id=65902
     5
     6        Reviewed by Ryosuke Niwa.
     7       
     8        markMisspellingsAndBadGrammar() was using markSpelling() and markBadGrammar().
     9        But these are low-level API and caller should take care of word boundary.
     10        This change replaced these call with overloaded version of markMisspellingsAndBadGrammar(),
     11        which handles word boundary correctly.
     12       
     13        Test: editing/spelling/spelling-insert-html.html
     14
     15        * WebCore.exp.in:
     16        * editing/Editor.cpp:
     17        (WebCore::Editor::markMisspellingsAndBadGrammar):
     18        * testing/Internals.cpp:
     19        (WebCore::Internals::markerCountOf): Added.
     20        (WebCore::Internals::markedRangeAt): Added.
     21        * testing/Internals.h:
     22        * testing/Internals.idl:
     23
    1242011-08-19  Nayan Kumar K  <nayankk@motorola.com>
    225
  • trunk/Source/WebCore/WebCore.exp.in

    r93377 r93392  
    598598__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
    599599__ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
     600__ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE
    600601__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker11MarkerTypesE
    601602__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
  • trunk/Source/WebCore/editing/Editor.cpp

    r93273 r93392  
    19421942void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
    19431943{
    1944     bool markSpelling = isContinuousSpellCheckingEnabled();
    1945     bool markGrammar = markSpelling && isGrammarCheckingEnabled();
    1946 
    1947     if (markSpelling) {
    1948         RefPtr<Range> unusedFirstMisspellingRange;
    1949         markMisspellings(movingSelection, unusedFirstMisspellingRange);
    1950     }
    1951 
    1952     if (markGrammar)
    1953         markBadGrammar(movingSelection);
     1944    markMisspellingsAndBadGrammar(movingSelection, isContinuousSpellCheckingEnabled() && isGrammarCheckingEnabled(), movingSelection);
    19541945}
    19551946
  • trunk/Source/WebCore/testing/Internals.cpp

    r93291 r93392  
    3030#include "ClientRect.h"
    3131#include "Document.h"
     32#include "DocumentMarkerController.h"
    3233#include "Element.h"
    3334#include "ExceptionCode.h"
     
    3637#include "NodeRenderingContext.h"
    3738#include "Page.h"
     39#include "Range.h"
    3840#include "RenderObject.h"
    3941#include "RenderTreeAsText.h"
     
    184186}
    185187
     188unsigned Internals::markerCountForNode(Node* node, ExceptionCode& ec)
     189{
     190    if (!node) {
     191        ec = INVALID_ACCESS_ERR;
     192        return 0;
     193    }
     194
     195    return node->document()->markers()->markersFor(node).size();
     196}
     197
     198PassRefPtr<Range> Internals::markerRangeForNode(Node* node, unsigned index, ExceptionCode& ec)
     199{
     200    if (!node) {
     201        ec = INVALID_ACCESS_ERR;
     202        return 0;
     203    }
     204   
     205    Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node);
     206    if (markers.size() <= index)
     207        return 0;
     208    return Range::create(node->document(), node, markers[index]->startOffset(), node, markers[index]->endOffset());
     209}
     210
    186211void Internals::setForceCompositingMode(Document* document, bool enabled, ExceptionCode& ec)
    187212{
     
    234259}
    235260
    236 }
     261
     262}
  • trunk/Source/WebCore/testing/Internals.h

    r93291 r93392  
    3939class Element;
    4040class Node;
     41class Range;
    4142
    4243class Internals : public RefCounted<Internals> {
     
    6869    PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&);
    6970
     71    unsigned markerCountForNode(Node*, ExceptionCode&);
     72    PassRefPtr<Range> markerRangeForNode(Node*, unsigned, ExceptionCode&);
     73
    7074    void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
    7175
  • trunk/Source/WebCore/testing/Internals.idl

    r93291 r93392  
    4343
    4444        ClientRect boundingBox(in Element element) raises(DOMException);
     45        unsigned long markerCountForNode(in Node node) raises(DOMException);
     46        Range markerRangeForNode(in Node node, in unsigned long index) raises(DOMException);
    4547
    4648        void setForceCompositingMode(in Document document, in boolean enabled) raises(DOMException);
  • trunk/Source/WebKit2/ChangeLog

    r93377 r93392  
     12011-08-19  MORITA Hajime  <morrita@google.com>
     2
     3        Spell-checking against execCommand() inserted HTML doesn't care word boundary.
     4        https://bugs.webkit.org/show_bug.cgi?id=65902
     5
     6        Reviewed by Ryosuke Niwa.
     7       
     8        Add exports for window.internals object.
     9
     10        * win/WebKit2.def:
     11        * win/WebKit2CFLite.def:
     12
    1132011-08-18  Beth Dakin  <bdakin@apple.com>
    214
  • trunk/Source/WebKit2/win/WebKit2.def

    r92697 r93392  
    138138        ??0NodeRenderingContext@WebCore@@QAE@PAVNode@1@@Z
    139139        ??1NodeRenderingContext@WebCore@@QAE@XZ
     140        ??1Range@WebCore@@QAE@XZ
    140141        ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
    141142        ??0ClientRect@WebCore@@AAE@ABVIntRect@1@@Z
     
    147148        ?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
    148149        ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
     150        ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
    149151        ?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
    150152        ?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
     
    155157        ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
    156158        ?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
     159        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
    157160        ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
    158161        ?page@Document@WebCore@@QBEPAVPage@2@XZ
     
    167170        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
    168171        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
     172        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVRange@1@@Z
    169173        ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
    170174        ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r92697 r93392  
    135135        ??0String@WTF@@QAE@PB_W@Z
    136136        ??1NodeRenderingContext@WebCore@@QAE@XZ
     137        ??1Range@WebCore@@QAE@XZ
    137138        ?absoluteBoundingBoxRect@RenderObject@WebCore@@QAE?AVIntRect@2@_N@Z
    138139        ?add@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBD@Z
    139140        ?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
    140141        ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
     142        ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
    141143        ?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
    142144        ?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
     
    149151        ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
    150152        ?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
     153        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
    151154        ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
    152155        ?page@Document@WebCore@@QBEPAVPage@2@XZ
     
    160163        ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
    161164        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
     165        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVRange@1@@Z
    162166        ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
    163167        ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
  • trunk/Source/autotools/symbols.filter

    r92697 r93392  
    2828_ZN24DumpRenderTreeSupportGtk*;
    2929_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE;
     30_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE;
     31_ZN7WebCore5Range6createEN3WTF10PassRefPtrINS_8DocumentEEENS2_INS_4NodeEEEiS6_i;
     32_ZN7WebCore5RangeD1Ev;
    3033_ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv;
    3134_ZN7WebCore10JSDocument3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
     
    5053_ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
    5154_ZN7WebCore22externalRepresentationEPNS_7ElementEj;
     55_ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE;
    5256_ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE;
    5357_ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
Note: See TracChangeset for help on using the changeset viewer.