| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 897 |
| 898 // Make the span to hold the tab. | 898 // Make the span to hold the tab. |
| 899 RefPtr<Element> spanElement = document->createElement(spanTag, false); | 899 RefPtr<Element> spanElement = document->createElement(spanTag, false); |
| 900 spanElement->setAttribute(classAttr, AppleTabSpanClass); | 900 spanElement->setAttribute(classAttr, AppleTabSpanClass); |
| 901 spanElement->setAttribute(styleAttr, "white-space:pre"); | 901 spanElement->setAttribute(styleAttr, "white-space:pre"); |
| 902 | 902 |
| 903 // Add tab text to that span. | 903 // Add tab text to that span. |
| 904 if (!tabTextNode) | 904 if (!tabTextNode) |
| 905 tabTextNode = document->createEditingTextNode("\t"); | 905 tabTextNode = document->createEditingTextNode("\t"); |
| 906 | 906 |
| 907 spanElement->appendChild(tabTextNode.release(), ASSERT_NO_EXCEPTION); | 907 spanElement->appendChild(tabTextNode.release(), ASSERT_NO_EXCEPTION, Depreca
tedAttachNow); |
| 908 | 908 |
| 909 return spanElement.release(); | 909 return spanElement.release(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 PassRefPtr<Element> createTabSpanElement(Document* document, const String& tabTe
xt) | 912 PassRefPtr<Element> createTabSpanElement(Document* document, const String& tabTe
xt) |
| 913 { | 913 { |
| 914 return createTabSpanElement(document, document->createTextNode(tabText)); | 914 return createTabSpanElement(document, document->createTextNode(tabText)); |
| 915 } | 915 } |
| 916 | 916 |
| 917 PassRefPtr<Element> createTabSpanElement(Document* document) | 917 PassRefPtr<Element> createTabSpanElement(Document* document) |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 // if the selection starts just before a paragraph break, skip over it | 1167 // if the selection starts just before a paragraph break, skip over it |
| 1168 if (isEndOfParagraph(visiblePosition)) | 1168 if (isEndOfParagraph(visiblePosition)) |
| 1169 return visiblePosition.next().deepEquivalent().downstream(); | 1169 return visiblePosition.next().deepEquivalent().downstream(); |
| 1170 | 1170 |
| 1171 // otherwise, make sure to be at the start of the first selected node, | 1171 // otherwise, make sure to be at the start of the first selected node, |
| 1172 // instead of possibly at the end of the last node before the selection | 1172 // instead of possibly at the end of the last node before the selection |
| 1173 return visiblePosition.deepEquivalent().downstream(); | 1173 return visiblePosition.deepEquivalent().downstream(); |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 } // namespace WebCore | 1176 } // namespace WebCore |
| OLD | NEW |