OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 | 804 |
805 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT
ype, int from, int length) const | 805 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT
ype, int from, int length) const |
806 { | 806 { |
807 Node* node = findFirstMarkable(m_frame.selection().start().deprecatedNode())
; | 807 Node* node = findFirstMarkable(m_frame.selection().start().deprecatedNode())
; |
808 if (!node) | 808 if (!node) |
809 return false; | 809 return false; |
810 | 810 |
811 unsigned startOffset = static_cast<unsigned>(from); | 811 unsigned startOffset = static_cast<unsigned>(from); |
812 unsigned endOffset = static_cast<unsigned>(from + length); | 812 unsigned endOffset = static_cast<unsigned>(from + length); |
813 Vector<DocumentMarker*> markers = m_frame.document()->markers().markersFor(n
ode); | 813 WillBeHeapVector<DocumentMarker*> markers = m_frame.document()->markers().ma
rkersFor(node); |
814 for (size_t i = 0; i < markers.size(); ++i) { | 814 for (size_t i = 0; i < markers.size(); ++i) { |
815 DocumentMarker* marker = markers[i]; | 815 DocumentMarker* marker = markers[i]; |
816 if (marker->startOffset() <= startOffset && endOffset <= marker->endOffs
et() && marker->type() == markerType) | 816 if (marker->startOffset() <= startOffset && endOffset <= marker->endOffs
et() && marker->type() == markerType) |
817 return true; | 817 return true; |
818 } | 818 } |
819 | 819 |
820 return false; | 820 return false; |
821 } | 821 } |
822 | 822 |
823 TextCheckingTypeMask SpellChecker::resolveTextCheckingTypeMask(TextCheckingTypeM
ask textCheckingOptions) | 823 TextCheckingTypeMask SpellChecker::resolveTextCheckingTypeMask(TextCheckingTypeM
ask textCheckingOptions) |
(...skipping 21 matching lines...) Expand all Loading... |
845 } | 845 } |
846 | 846 |
847 void SpellChecker::requestTextChecking(const Element& element) | 847 void SpellChecker::requestTextChecking(const Element& element) |
848 { | 848 { |
849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); | 849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); |
850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); | 850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 } // namespace WebCore | 854 } // namespace WebCore |
OLD | NEW |