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

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

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 if (wasEndOfParagraph && !isEndOfParagraph(lastParagraphInBlockNode) && !isS tartOfParagraph(lastParagraphInBlockNode)) 94 if (wasEndOfParagraph && !isEndOfParagraph(lastParagraphInBlockNode) && !isS tartOfParagraph(lastParagraphInBlockNode))
95 insertBlockPlaceholder(lastParagraphInBlockNode); 95 insertBlockPlaceholder(lastParagraphInBlockNode);
96 } 96 }
97 97
98 Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range) 98 Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range)
99 { 99 {
100 if (!range) 100 if (!range)
101 return 0; 101 return 0;
102 102
103 Node* commonAncestor = range->commonAncestorContainer(IGNORE_EXCEPTION_STATE ); 103 Node* commonAncestor = range->commonAncestorContainer(IGNORE_EXCEPTION);
104 while (commonAncestor && !isElementForFormatBlock(commonAncestor)) 104 while (commonAncestor && !isElementForFormatBlock(commonAncestor))
105 commonAncestor = commonAncestor->parentNode(); 105 commonAncestor = commonAncestor->parentNode();
106 106
107 if (!commonAncestor) 107 if (!commonAncestor)
108 return 0; 108 return 0;
109 109
110 Element* rootEditableElement = range->startContainer()->rootEditableElement( ); 110 Element* rootEditableElement = range->startContainer()->rootEditableElement( );
111 if (!rootEditableElement || commonAncestor->contains(rootEditableElement)) 111 if (!rootEditableElement || commonAncestor->contains(rootEditableElement))
112 return 0; 112 return 0;
113 113
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return n; 154 return n;
155 if (isBlock(n)) 155 if (isBlock(n))
156 lastBlock = n; 156 lastBlock = n;
157 if (isListElement(n)) 157 if (isListElement(n))
158 return n->parentNode()->rendererIsEditable() ? n->parentNode() : n; 158 return n->parentNode()->rendererIsEditable() ? n->parentNode() : n;
159 } 159 }
160 return lastBlock; 160 return lastBlock;
161 } 161 }
162 162
163 } 163 }
OLDNEW
« no previous file with comments | « Source/core/editing/EditorCommand.cpp ('k') | Source/core/editing/InsertIntoTextNodeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698