Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: Source/core/editing/SpellChecker.cpp

Issue 428533006: Use ContainerNode::hasChildren() instead of firstChild() in conditionals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/SimplifyMarkupCommand.cpp ('k') | Source/core/editing/TypingCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 854
855 static Node* findFirstMarkable(Node* node) 855 static Node* findFirstMarkable(Node* node)
856 { 856 {
857 while (node) { 857 while (node) {
858 if (!node->renderer()) 858 if (!node->renderer())
859 return 0; 859 return 0;
860 if (node->renderer()->isText()) 860 if (node->renderer()->isText())
861 return node; 861 return node;
862 if (node->renderer()->isTextControl()) 862 if (node->renderer()->isTextControl())
863 node = toRenderTextControl(node->renderer())->textFormControlElement ()->visiblePositionForIndex(1).deepEquivalent().deprecatedNode(); 863 node = toRenderTextControl(node->renderer())->textFormControlElement ()->visiblePositionForIndex(1).deepEquivalent().deprecatedNode();
864 else if (node->firstChild()) 864 else if (node->hasChildren())
865 node = node->firstChild(); 865 node = node->firstChild();
866 else 866 else
867 node = node->nextSibling(); 867 node = node->nextSibling();
868 } 868 }
869 869
870 return 0; 870 return 0;
871 } 871 }
872 872
873 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT ype, int from, int length) const 873 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT ype, int from, int length) const
874 { 874 {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 } 918 }
919 919
920 void SpellChecker::requestTextChecking(const Element& element) 920 void SpellChecker::requestTextChecking(const Element& element)
921 { 921 {
922 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element)); 922 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element));
923 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck)); 923 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck));
924 } 924 }
925 925
926 926
927 } // namespace blink 927 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/SimplifyMarkupCommand.cpp ('k') | Source/core/editing/TypingCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698