| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 Range* paragraphRange, | 40 Range* paragraphRange, |
| 41 const String& text, | 41 const String& text, |
| 42 TextCheckingTypeMask mask, | 42 TextCheckingTypeMask mask, |
| 43 TextCheckingProcessType processType, | 43 TextCheckingProcessType processType, |
| 44 const Vector<uint32_t>& documentMarkersInRange, | 44 const Vector<uint32_t>& documentMarkersInRange, |
| 45 const Vector<unsigned>& documentMarkerOffsets, | 45 const Vector<unsigned>& documentMarkerOffsets, |
| 46 int requestNumber) | 46 int requestNumber) |
| 47 : m_requester(nullptr) | 47 : m_requester(nullptr) |
| 48 , m_checkingRange(checkingRange) | 48 , m_checkingRange(checkingRange) |
| 49 , m_paragraphRange(paragraphRange) | 49 , m_paragraphRange(paragraphRange) |
| 50 , m_rootEditableElement(m_checkingRange->startContainer()->rootEditableEleme
nt()) | 50 , m_rootEditableElement(blink::rootEditableElement(*m_checkingRange->startCo
ntainer())) |
| 51 , m_requestData(unrequestedTextCheckingSequence, text, mask, processType, do
cumentMarkersInRange, documentMarkerOffsets) | 51 , m_requestData(unrequestedTextCheckingSequence, text, mask, processType, do
cumentMarkersInRange, documentMarkerOffsets) |
| 52 , m_requestNumber(requestNumber) | 52 , m_requestNumber(requestNumber) |
| 53 { | 53 { |
| 54 DCHECK(m_checkingRange); | 54 DCHECK(m_checkingRange); |
| 55 DCHECK(m_checkingRange->inShadowIncludingDocument()); | 55 DCHECK(m_checkingRange->inShadowIncludingDocument()); |
| 56 DCHECK(m_paragraphRange); | 56 DCHECK(m_paragraphRange); |
| 57 DCHECK(m_paragraphRange->inShadowIncludingDocument()); | 57 DCHECK(m_paragraphRange->inShadowIncludingDocument()); |
| 58 DCHECK(m_rootEditableElement); | 58 DCHECK(m_rootEditableElement); |
| 59 } | 59 } |
| 60 | 60 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 m_checkingRange->dispose(); | 77 m_checkingRange->dispose(); |
| 78 if (m_paragraphRange && m_paragraphRange != m_checkingRange) | 78 if (m_paragraphRange && m_paragraphRange != m_checkingRange) |
| 79 m_paragraphRange->dispose(); | 79 m_paragraphRange->dispose(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // static | 82 // static |
| 83 SpellCheckRequest* SpellCheckRequest::create(TextCheckingTypeMask textCheckingOp
tions, TextCheckingProcessType processType, const EphemeralRange& checkingRange,
const EphemeralRange& paragraphRange, int requestNumber) | 83 SpellCheckRequest* SpellCheckRequest::create(TextCheckingTypeMask textCheckingOp
tions, TextCheckingProcessType processType, const EphemeralRange& checkingRange,
const EphemeralRange& paragraphRange, int requestNumber) |
| 84 { | 84 { |
| 85 if (checkingRange.isNull()) | 85 if (checkingRange.isNull()) |
| 86 return nullptr; | 86 return nullptr; |
| 87 if (!checkingRange.startPosition().computeContainerNode()->rootEditableEleme
nt()) | 87 if (!blink::rootEditableElement(*checkingRange.startPosition().computeContai
nerNode())) |
| 88 return nullptr; | 88 return nullptr; |
| 89 | 89 |
| 90 String text = plainText(checkingRange, TextIteratorEmitsObjectReplacementCha
racter); | 90 String text = plainText(checkingRange, TextIteratorEmitsObjectReplacementCha
racter); |
| 91 if (text.isEmpty()) | 91 if (text.isEmpty()) |
| 92 return nullptr; | 92 return nullptr; |
| 93 | 93 |
| 94 Range* checkingRangeObject = createRange(checkingRange); | 94 Range* checkingRangeObject = createRange(checkingRange); |
| 95 Range* paragraphRangeObject = nullptr; | 95 Range* paragraphRangeObject = nullptr; |
| 96 // Share identical Range objects. | 96 // Share identical Range objects. |
| 97 if (checkingRange == paragraphRange) | 97 if (checkingRange == paragraphRange) |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 DEFINE_TRACE(SpellCheckRequester) | 313 DEFINE_TRACE(SpellCheckRequester) |
| 314 { | 314 { |
| 315 visitor->trace(m_frame); | 315 visitor->trace(m_frame); |
| 316 visitor->trace(m_processingRequest); | 316 visitor->trace(m_processingRequest); |
| 317 visitor->trace(m_requestQueue); | 317 visitor->trace(m_requestQueue); |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace blink | 320 } // namespace blink |
| OLD | NEW |