| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // and should be rewritten. | 600 // and should be rewritten. |
| 601 // Expand the range to encompass entire paragraphs, since text checking needs | 601 // Expand the range to encompass entire paragraphs, since text checking needs |
| 602 // that much context. | 602 // that much context. |
| 603 int ambiguous_boundary_offset = -1; | 603 int ambiguous_boundary_offset = -1; |
| 604 | 604 |
| 605 if (GetFrame().Selection().ComputeVisibleSelectionInDOMTree().IsCaret()) { | 605 if (GetFrame().Selection().ComputeVisibleSelectionInDOMTree().IsCaret()) { |
| 606 // TODO(xiaochengh): The following comment does not match the current | 606 // TODO(xiaochengh): The following comment does not match the current |
| 607 // behavior and should be rewritten. | 607 // behavior and should be rewritten. |
| 608 // Attempt to save the caret position so we can restore it later if needed | 608 // Attempt to save the caret position so we can restore it later if needed |
| 609 const Position& caret_position = | 609 const Position& caret_position = |
| 610 GetFrame().Selection().ComputeVisibleSelectionInDOMTree().end(); | 610 GetFrame().Selection().ComputeVisibleSelectionInDOMTree().End(); |
| 611 const Position& paragraph_start = checking_range.StartPosition(); | 611 const Position& paragraph_start = checking_range.StartPosition(); |
| 612 const int selection_offset = | 612 const int selection_offset = |
| 613 paragraph_start < caret_position | 613 paragraph_start < caret_position |
| 614 ? TextIterator::RangeLength(paragraph_start, caret_position) | 614 ? TextIterator::RangeLength(paragraph_start, caret_position) |
| 615 : 0; | 615 : 0; |
| 616 if (selection_offset > 0 && | 616 if (selection_offset > 0 && |
| 617 static_cast<unsigned>(selection_offset) <= | 617 static_cast<unsigned>(selection_offset) <= |
| 618 paragraph.GetText().length() && | 618 paragraph.GetText().length() && |
| 619 IsAmbiguousBoundaryCharacter( | 619 IsAmbiguousBoundaryCharacter( |
| 620 paragraph.TextCharAt(selection_offset - 1))) { | 620 paragraph.TextCharAt(selection_offset - 1))) { |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 if (!input.IsFocusedElementInDocument()) | 1231 if (!input.IsFocusedElementInDocument()) |
| 1232 return false; | 1232 return false; |
| 1233 } | 1233 } |
| 1234 } | 1234 } |
| 1235 HTMLElement* element = | 1235 HTMLElement* element = |
| 1236 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); | 1236 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); |
| 1237 return element && element->IsSpellCheckingEnabled(); | 1237 return element && element->IsSpellCheckingEnabled(); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 } // namespace blink | 1240 } // namespace blink |
| OLD | NEW |