OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 | 683 |
684 size_t preCount = preMarkups.size(); | 684 size_t preCount = preMarkups.size(); |
685 for (size_t i = 0; i < preCount; ++i) | 685 for (size_t i = 0; i < preCount; ++i) |
686 length += preMarkups[i].length(); | 686 length += preMarkups[i].length(); |
687 | 687 |
688 size_t postCount = postMarkups.size(); | 688 size_t postCount = postMarkups.size(); |
689 for (size_t i = 0; i < postCount; ++i) | 689 for (size_t i = 0; i < postCount; ++i) |
690 length += postMarkups[i].length(); | 690 length += postMarkups[i].length(); |
691 | 691 |
692 Vector<UChar> result; | 692 Vector<UChar> result; |
693 result.reserveCapacity(length); | 693 result.reserveInitialCapacity(length); |
694 | 694 |
695 for (size_t i = preCount; i > 0; --i) | 695 for (size_t i = preCount; i > 0; --i) |
696 append(result, preMarkups[i - 1]); | 696 append(result, preMarkups[i - 1]); |
697 | 697 |
698 for (size_t i = 0; i < postCount; ++i) | 698 for (size_t i = 0; i < postCount; ++i) |
699 append(result, postMarkups[i]); | 699 append(result, postMarkups[i]); |
700 | 700 |
701 return String::adopt(result); | 701 return String::adopt(result); |
702 } | 702 } |
703 | 703 |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 if (!frame) | 1217 if (!frame) |
1218 return String(); | 1218 return String(); |
1219 | 1219 |
1220 // FIXME: This is always "for interchange". Is that right? See the previous
method. | 1220 // FIXME: This is always "for interchange". Is that right? See the previous
method. |
1221 return frame->documentTypeString() + createMarkup(range, 0, AnnotateForInter
change); | 1221 return frame->documentTypeString() + createMarkup(range, 0, AnnotateForInter
change); |
1222 } | 1222 } |
1223 | 1223 |
1224 } | 1224 } |
1225 | 1225 |
1226 | 1226 |
OLD | NEW |