| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 unsigned gapStart = prevBox ? prevBox->start() + prevBox->len() : 0; | 783 unsigned gapStart = prevBox ? prevBox->start() + prevBox->len() : 0; |
| 784 if (end < gapStart) | 784 if (end < gapStart) |
| 785 // No more chance for any intersections | 785 // No more chance for any intersections |
| 786 break; | 786 break; |
| 787 | 787 |
| 788 unsigned gapEnd = box ? box->start() : length; | 788 unsigned gapEnd = box ? box->start() : length; |
| 789 bool indicesIntersect = start <= gapEnd && end >= gapStart; | 789 bool indicesIntersect = start <= gapEnd && end >= gapStart; |
| 790 int gapLen = gapEnd - gapStart; | 790 int gapLen = gapEnd - gapStart; |
| 791 if (indicesIntersect && gapLen > 0) { | 791 if (indicesIntersect && gapLen > 0) { |
| 792 gapStart = max(gapStart, start); | 792 gapStart = max(gapStart, start); |
| 793 gapEnd = min(gapEnd, end); | |
| 794 if (str.isNull()) | 793 if (str.isNull()) |
| 795 str = textNode->data().substring(start, end - start); | 794 str = textNode->data().substring(start, end - start); |
| 796 // remove text in the gap | 795 // remove text in the gap |
| 797 str.remove(gapStart - start - removed, gapLen); | 796 str.remove(gapStart - start - removed, gapLen); |
| 798 removed += gapLen; | 797 removed += gapLen; |
| 799 } | 798 } |
| 800 | 799 |
| 801 prevBox = box; | 800 prevBox = box; |
| 802 if (box) { | 801 if (box) { |
| 803 if (++sortedTextBoxesPosition < sortedTextBoxes.size()) | 802 if (++sortedTextBoxesPosition < sortedTextBoxes.size()) |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 return node.release(); | 1495 return node.release(); |
| 1497 } | 1496 } |
| 1498 | 1497 |
| 1499 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) | 1498 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) |
| 1500 { | 1499 { |
| 1501 RefPtr<Element> breakNode = document.createElement(brTag, false); | 1500 RefPtr<Element> breakNode = document.createElement(brTag, false); |
| 1502 return breakNode.release(); | 1501 return breakNode.release(); |
| 1503 } | 1502 } |
| 1504 | 1503 |
| 1505 } // namespace WebCore | 1504 } // namespace WebCore |
| OLD | NEW |