Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. |
| 3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
| 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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 922 && !r->isFloatingOrOutOfFlowPositioned() && !r->isBody() && !r->isRubyTe xt(); | 922 && !r->isFloatingOrOutOfFlowPositioned() && !r->isBody() && !r->isRubyTe xt(); |
| 923 } | 923 } |
| 924 | 924 |
| 925 static bool shouldEmitNewlineAfterNode(Node& node) | 925 static bool shouldEmitNewlineAfterNode(Node& node) |
| 926 { | 926 { |
| 927 // FIXME: It should be better but slower to create a VisiblePosition here. | 927 // FIXME: It should be better but slower to create a VisiblePosition here. |
| 928 if (!shouldEmitNewlinesBeforeAndAfterNode(node)) | 928 if (!shouldEmitNewlinesBeforeAndAfterNode(node)) |
| 929 return false; | 929 return false; |
| 930 // Check if this is the very last renderer in the document. | 930 // Check if this is the very last renderer in the document. |
| 931 // If so, then we should not emit a newline. | 931 // If so, then we should not emit a newline. |
| 932 Node* next = &node; | 932 for (Node* next = NodeTraversal::nextSkippingChildren(node); next; next = No deTraversal::nextSkippingChildren(*next)) { |
|
dmazzoni
2014/07/16 21:21:16
To me, duplicating NodeTraversal::nextSkippingChil
Peter Kasting
2014/07/16 23:06:58
I really find this significantly less readable tha
| |
| 933 while ((next = NodeTraversal::nextSkippingChildren(*next))) { | |
| 934 if (next->renderer()) | 933 if (next->renderer()) |
| 935 return true; | 934 return true; |
| 936 } | 935 } |
| 937 return false; | 936 return false; |
| 938 } | 937 } |
| 939 | 938 |
| 940 static bool shouldEmitNewlineBeforeNode(Node& node) | 939 static bool shouldEmitNewlineBeforeNode(Node& node) |
| 941 { | 940 { |
| 942 return shouldEmitNewlinesBeforeAndAfterNode(node); | 941 return shouldEmitNewlinesBeforeAndAfterNode(node); |
| 943 } | 942 } |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2214 resultEnd = collapseTo; | 2213 resultEnd = collapseTo; |
| 2215 return; | 2214 return; |
| 2216 } | 2215 } |
| 2217 } | 2216 } |
| 2218 | 2217 |
| 2219 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); | 2218 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); |
| 2220 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd); | 2219 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd); |
| 2221 } | 2220 } |
| 2222 | 2221 |
| 2223 } | 2222 } |
| OLD | NEW |