⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 99814 in webkit


Ignore:
Timestamp:
Nov 9, 2011, 10:10:59 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Internals.markerRangeForNode should be able to take markers by specifying a marker type.
https://bugs.webkit.org/show_bug.cgi?id=71792

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-11-09
Reviewed by Hajime Morita.

.:

  • Source/autotools/symbols.filter: Exposed necessary symbols.

Source/WebCore:

Test: editing/spelling/markers.html

  • WebCore.exp.in:
  • dom/DocumentMarkerController.cpp:

(WebCore::DocumentMarkerController::markersFor):

Takes marker types to get only necessary markers.

  • dom/DocumentMarkerController.h:
  • testing/Internals.cpp:

(WebCore::markerTypesFrom): Added.
(WebCore::Internals::markerCountForNode):

Takes marker types to get only necessary markers.

(WebCore::Internals::markerRangeForNode): ditto.

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit2:

  • win/WebKit2.def: Exposed necessary references.
  • win/WebKit2CFLite.def: ditto.

LayoutTests:

  • editing/spelling/markers.html: Added.
  • editing/spelling/spelling-insert-html.html: Fixed function usage.
  • platform/chromium/test_expectations.txt: Skipped chromium test.
  • platform/gtk/Skipped: Skipped gtk test.
  • platform/qt/Skipped: Skipped qt test.
  • platform/win/Skipped: Skeipped win test.
Location:
trunk
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r99811 r99814  
     12011-11-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Internals.markerRangeForNode should be able to take markers by specifying a marker type.
     4        https://bugs.webkit.org/show_bug.cgi?id=71792
     5
     6        Reviewed by Hajime Morita.
     7
     8        * Source/autotools/symbols.filter: Exposed necessary symbols.
     9
    1102011-11-09  Kevin Ollivier  <kevino@theolliviers.com>
    211
  • trunk/LayoutTests/ChangeLog

    r99801 r99814  
     12011-11-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Internals.markerRangeForNode should be able to take markers by specifying a marker type.
     4        https://bugs.webkit.org/show_bug.cgi?id=71792
     5
     6        Reviewed by Hajime Morita.
     7
     8        * editing/spelling/markers.html: Added.
     9        * editing/spelling/spelling-insert-html.html: Fixed function usage.
     10        * platform/chromium/test_expectations.txt: Skipped chromium test.
     11        * platform/gtk/Skipped: Skipped gtk test.
     12        * platform/qt/Skipped: Skipped qt test.
     13        * platform/win/Skipped: Skeipped win test.
     14
    1152011-11-09  Andrew Scherkus  <scherkus@chromium.org>
    216
  • trunk/LayoutTests/editing/spelling/spelling-insert-html.html

    r99258 r99814  
    2727    var markedText = "";
    2828    for (var i = 0; i < texts.length; ++i) {
    29         var marked = internals.markerRangeForNode(texts[i], 0);
     29        var marked = internals.markerRangeForNode(texts[i], "spelling", 0);
    3030        if (marked)
    3131            markedText += marked.toString()
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r99797 r99814  
    669669// New test added in r82159
    670670BUGCR77706 : editing/spelling/grammar.html = FAIL
     671
     672// Needs grammar checking.
     673BUGWK71792 : editing/spelling/markers.html = FAIL
    671674
    672675// Flaky
  • trunk/LayoutTests/platform/gtk/Skipped

    r99737 r99814  
    297297# DataTransferItems is not yet implemented.
    298298editing/pasteboard/data-transfer-items.html
     299
     300# Needs grammar checking.
     301editing/spelling/markers.html
    299302
    300303# Legacy full screen API tests are now obsolete.
  • trunk/LayoutTests/platform/qt/Skipped

    r99699 r99814  
    10081008# textInputController.hasGrammarMarkers() is not implemented.
    10091009editing/spelling/grammar.html
     1010
     1011# Needs grammar checking.
     1012editing/spelling/markers.html
    10101013
    10111014# https://bugs.webkit.org/show_bug.cgi?id=45435
  • trunk/LayoutTests/platform/win/Skipped

    r99517 r99814  
    10251025editing/spelling/grammar.html
    10261026
     1027# Needs grammar checking.
     1028editing/spelling/markers.html
     1029
    10271030# EditorClient::requestCheckingOfString() is not implemented
    10281031editing/spelling/spellcheck-paste.html
  • trunk/Source/WebCore/ChangeLog

    r99813 r99814  
     12011-11-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Internals.markerRangeForNode should be able to take markers by specifying a marker type.
     4        https://bugs.webkit.org/show_bug.cgi?id=71792
     5
     6        Reviewed by Hajime Morita.
     7
     8        Test: editing/spelling/markers.html
     9
     10        * WebCore.exp.in:
     11        * dom/DocumentMarkerController.cpp:
     12        (WebCore::DocumentMarkerController::markersFor):
     13          Takes marker types to get only necessary markers.
     14        * dom/DocumentMarkerController.h:
     15        * testing/Internals.cpp:
     16        (WebCore::markerTypesFrom): Added.
     17        (WebCore::Internals::markerCountForNode):
     18          Takes marker types to get only necessary markers.
     19        (WebCore::Internals::markerRangeForNode): ditto.
     20        * testing/Internals.h:
     21        * testing/Internals.idl:
     22
    1232011-11-09  David Reveman  <reveman@chromium.org>
    224
  • trunk/Source/WebCore/WebCore.exp.in

    r99778 r99814  
    637637__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
    638638__ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
    639 __ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE
     639__ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeENS_14DocumentMarker11MarkerTypesE
    640640__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker11MarkerTypesE
    641641__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
  • trunk/Source/WebCore/dom/DocumentMarkerController.cpp

    r95901 r99814  
    319319}
    320320
    321 Vector<DocumentMarker*> DocumentMarkerController::markersFor(Node* node)
     321Vector<DocumentMarker*> DocumentMarkerController::markersFor(Node* node, DocumentMarker::MarkerTypes markerTypes)
    322322{
    323323    Vector<DocumentMarker*> result;
     
    326326        return result;
    327327
    328     for (size_t i = 0; i < list->size(); ++i)
    329         result.append(&(list->at(i)));
     328    for (size_t i = 0; i < list->size(); ++i) {
     329        if (markerTypes.contains(list->at(i).type()))
     330            result.append(&(list->at(i)));
     331    }
    330332
    331333    return result;
  • trunk/Source/WebCore/dom/DocumentMarkerController.h

    r95901 r99814  
    7070
    7171    DocumentMarker* markerContainingPoint(const LayoutPoint&, DocumentMarker::MarkerType);
    72     Vector<DocumentMarker*> markersFor(Node*);
     72    Vector<DocumentMarker*> markersFor(Node*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
    7373    Vector<DocumentMarker*> markersInRange(Range*, DocumentMarker::MarkerTypes);
    7474    Vector<DocumentMarker> markersForNode(Node*);
  • trunk/Source/WebCore/testing/Internals.cpp

    r99613 r99814  
    3030#include "ClientRect.h"
    3131#include "Document.h"
     32#include "DocumentMarker.h"
    3233#include "DocumentMarkerController.h"
    3334#include "Element.h"
     
    6465namespace WebCore {
    6566
     67static bool markerTypesFrom(const String& markerType, DocumentMarker::MarkerTypes& result)
     68{
     69    if (markerType.isEmpty() || equalIgnoringCase(markerType, "all"))
     70        result = DocumentMarker::AllMarkers();
     71    else if (equalIgnoringCase(markerType, "Spelling"))
     72        result =  DocumentMarker::Spelling;
     73    else if (equalIgnoringCase(markerType, "Grammar"))
     74        result =  DocumentMarker::Grammar;
     75    else if (equalIgnoringCase(markerType, "TextMatch"))
     76        result =  DocumentMarker::TextMatch;
     77    else if (equalIgnoringCase(markerType, "Replacement"))
     78        result =  DocumentMarker::Replacement;
     79    else if (equalIgnoringCase(markerType, "CorrectionIndicator"))
     80        result =  DocumentMarker::CorrectionIndicator;
     81    else if (equalIgnoringCase(markerType, "RejectedCorrection"))
     82        result =  DocumentMarker::RejectedCorrection;
     83    else if (equalIgnoringCase(markerType, "Autocorrected"))
     84        result =  DocumentMarker::Autocorrected;
     85    else if (equalIgnoringCase(markerType, "SpellCheckingExemption"))
     86        result =  DocumentMarker::SpellCheckingExemption;
     87    else if (equalIgnoringCase(markerType, "DeletedAutocorrection"))
     88        result =  DocumentMarker::DeletedAutocorrection;
     89    else
     90        return false;
     91
     92    return true;
     93}
     94
    6695const char* Internals::internalsId = "internals";
    6796
     
    211240}
    212241
    213 unsigned Internals::markerCountForNode(Node* node, ExceptionCode& ec)
     242unsigned Internals::markerCountForNode(Node* node, const String& markerType, ExceptionCode& ec)
    214243{
    215244    if (!node) {
     
    218247    }
    219248
    220     return node->document()->markers()->markersFor(node).size();
    221 }
    222 
    223 PassRefPtr<Range> Internals::markerRangeForNode(Node* node, unsigned index, ExceptionCode& ec)
     249    DocumentMarker::MarkerTypes markerTypes = 0;
     250    if (!markerTypesFrom(markerType, markerTypes)) {
     251        ec = SYNTAX_ERR;
     252        return 0;
     253    }
     254
     255    return node->document()->markers()->markersFor(node, markerTypes).size();
     256}
     257
     258PassRefPtr<Range> Internals::markerRangeForNode(Node* node, const String& markerType, unsigned index, ExceptionCode& ec)
    224259{
    225260    if (!node) {
     
    227262        return 0;
    228263    }
    229    
    230     Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node);
     264
     265    DocumentMarker::MarkerTypes markerTypes = 0;
     266    if (!markerTypesFrom(markerType, markerTypes)) {
     267        ec = SYNTAX_ERR;
     268        return 0;
     269    }
     270
     271    Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node, markerTypes);
    231272    if (markers.size() <= index)
    232273        return 0;
  • trunk/Source/WebCore/testing/Internals.h

    r99645 r99814  
    7373    PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&);
    7474
    75     unsigned markerCountForNode(Node*, ExceptionCode&);
    76     PassRefPtr<Range> markerRangeForNode(Node*, unsigned, ExceptionCode&);
     75    unsigned markerCountForNode(Node*, const String&, ExceptionCode&);
     76    PassRefPtr<Range> markerRangeForNode(Node*, const String&, unsigned, ExceptionCode&);
    7777
    7878    void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
  • trunk/Source/WebCore/testing/Internals.idl

    r99613 r99814  
    4646
    4747        ClientRect boundingBox(in Element element) raises(DOMException);
    48         unsigned long markerCountForNode(in Node node) raises(DOMException);
    49         Range markerRangeForNode(in Node node, in unsigned long index) raises(DOMException);
     48        unsigned long markerCountForNode(in Node node, in DOMString markerType) raises(DOMException);
     49        Range markerRangeForNode(in Node node, in DOMString markerType, in unsigned long index) raises(DOMException);
    5050
    5151        void setForceCompositingMode(in Document document, in boolean enabled) raises(DOMException);
  • trunk/Source/WebKit2/ChangeLog

    r99802 r99814  
     12011-11-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Internals.markerRangeForNode should be able to take markers by specifying a marker type.
     4        https://bugs.webkit.org/show_bug.cgi?id=71792
     5
     6        Reviewed by Hajime Morita.
     7
     8        * win/WebKit2.def: Exposed necessary references.
     9        * win/WebKit2CFLite.def: ditto.
     10
    1112011-10-26  Martin Robinson  <mrobinson@igalia.com>
    212
  • trunk/Source/WebKit2/win/WebKit2.def

    r99613 r99814  
    155155        ?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
    156156        ?equal@WTF@@YA_NPBVStringImpl@1@PBE@Z
     157        ?equalIgnoringCase@WTF@@YA_NPAVStringImpl@1@PBE@Z
    157158        ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
    158159        ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
     
    163164        ?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
    164165        ?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
    165         ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
     166        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
    166167        ?page@Document@WebCore@@QBEPAVPage@2@XZ
    167168        ?paintControlTints@FrameView@WebCore@@AAEXXZ
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r99625 r99814  
    148148        ?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
    149149        ?equal@WTF@@YA_NPBVStringImpl@1@PBE@Z
     150        ?equalIgnoringCase@WTF@@YA_NPAVStringImpl@1@PBE@Z
    150151        ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
    151152        ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
     
    156157        ?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
    157158        ?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
    158         ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
     159        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
    159160        ?page@Document@WebCore@@QBEPAVPage@2@XZ
    160161        ?paintControlTints@FrameView@WebCore@@AAEXXZ
  • trunk/Source/autotools/symbols.filter

    r99748 r99814  
    5757_ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
    5858_ZN7WebCore22externalRepresentationEPNS_7ElementEj;
    59 _ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE;
     59_ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeENS_14DocumentMarker11MarkerTypesE;
    6060_ZN7WebCore6JSNode10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
    6161_ZN7WebCore6JSNode20visitChildrenVirtualERN3JSC11SlotVisitorE;
Note: See TracChangeset for help on using the changeset viewer.