OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/dom/shadow/ElementShadowV0.h" | 58 #include "core/dom/shadow/ElementShadowV0.h" |
59 #include "core/dom/shadow/FlatTreeTraversal.h" | 59 #include "core/dom/shadow/FlatTreeTraversal.h" |
60 #include "core/dom/shadow/SelectRuleFeatureSet.h" | 60 #include "core/dom/shadow/SelectRuleFeatureSet.h" |
61 #include "core/dom/shadow/ShadowRoot.h" | 61 #include "core/dom/shadow/ShadowRoot.h" |
62 #include "core/editing/Editor.h" | 62 #include "core/editing/Editor.h" |
63 #include "core/editing/PlainTextRange.h" | 63 #include "core/editing/PlainTextRange.h" |
64 #include "core/editing/SurroundingText.h" | 64 #include "core/editing/SurroundingText.h" |
65 #include "core/editing/iterators/TextIterator.h" | 65 #include "core/editing/iterators/TextIterator.h" |
66 #include "core/editing/markers/DocumentMarker.h" | 66 #include "core/editing/markers/DocumentMarker.h" |
67 #include "core/editing/markers/DocumentMarkerController.h" | 67 #include "core/editing/markers/DocumentMarkerController.h" |
| 68 #include "core/editing/markers/SpellCheckMarker.h" |
68 #include "core/editing/markers/TextMatchMarker.h" | 69 #include "core/editing/markers/TextMatchMarker.h" |
69 #include "core/editing/serializers/Serialization.h" | 70 #include "core/editing/serializers/Serialization.h" |
70 #include "core/editing/spellcheck/IdleSpellCheckCallback.h" | 71 #include "core/editing/spellcheck/IdleSpellCheckCallback.h" |
71 #include "core/editing/spellcheck/SpellCheckRequester.h" | 72 #include "core/editing/spellcheck/SpellCheckRequester.h" |
72 #include "core/editing/spellcheck/SpellChecker.h" | 73 #include "core/editing/spellcheck/SpellChecker.h" |
73 #include "core/frame/EventHandlerRegistry.h" | 74 #include "core/frame/EventHandlerRegistry.h" |
74 #include "core/frame/FrameConsole.h" | 75 #include "core/frame/FrameConsole.h" |
75 #include "core/frame/LocalDOMWindow.h" | 76 #include "core/frame/LocalDOMWindow.h" |
76 #include "core/frame/LocalFrame.h" | 77 #include "core/frame/LocalFrame.h" |
77 #include "core/frame/LocalFrameView.h" | 78 #include "core/frame/LocalFrameView.h" |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 return nullptr; | 1008 return nullptr; |
1008 return Range::Create(node->GetDocument(), node, marker->StartOffset(), node, | 1009 return Range::Create(node->GetDocument(), node, marker->StartOffset(), node, |
1009 marker->EndOffset()); | 1010 marker->EndOffset()); |
1010 } | 1011 } |
1011 | 1012 |
1012 String Internals::markerDescriptionForNode(Node* node, | 1013 String Internals::markerDescriptionForNode(Node* node, |
1013 const String& marker_type, | 1014 const String& marker_type, |
1014 unsigned index, | 1015 unsigned index, |
1015 ExceptionState& exception_state) { | 1016 ExceptionState& exception_state) { |
1016 DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state); | 1017 DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state); |
1017 if (!marker) | 1018 if (!marker || (marker->GetType() != DocumentMarker::kSpelling && |
| 1019 marker->GetType() != DocumentMarker::kGrammar)) |
1018 return String(); | 1020 return String(); |
1019 return marker->Description(); | 1021 return ToSpellCheckMarker(marker)->Description(); |
1020 } | 1022 } |
1021 | 1023 |
1022 static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom( | 1024 static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom( |
1023 const String& match_status) { | 1025 const String& match_status) { |
1024 if (EqualIgnoringASCIICase(match_status, "kActive")) | 1026 if (EqualIgnoringASCIICase(match_status, "kActive")) |
1025 return TextMatchMarker::MatchStatus::kActive; | 1027 return TextMatchMarker::MatchStatus::kActive; |
1026 if (EqualIgnoringASCIICase(match_status, "kInactive")) | 1028 if (EqualIgnoringASCIICase(match_status, "kInactive")) |
1027 return TextMatchMarker::MatchStatus::kInactive; | 1029 return TextMatchMarker::MatchStatus::kInactive; |
1028 return WTF::nullopt; | 1030 return WTF::nullopt; |
1029 } | 1031 } |
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3294 | 3296 |
3295 void Internals::crash() { | 3297 void Internals::crash() { |
3296 CHECK(false) << "Intentional crash"; | 3298 CHECK(false) << "Intentional crash"; |
3297 } | 3299 } |
3298 | 3300 |
3299 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3301 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
3300 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3302 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
3301 } | 3303 } |
3302 | 3304 |
3303 } // namespace blink | 3305 } // namespace blink |
OLD | NEW |