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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 return true; | 813 return true; |
814 if (!childRenderer->isBR()) | 814 if (!childRenderer->isBR()) |
815 return false; | 815 return false; |
816 return !childRenderer->nextSibling(); | 816 return !childRenderer->nextSibling(); |
817 } | 817 } |
818 | 818 |
819 PassRefPtr<HTMLElement> createDefaultParagraphElement(Document& document) | 819 PassRefPtr<HTMLElement> createDefaultParagraphElement(Document& document) |
820 { | 820 { |
821 switch (document.frame()->editor().defaultParagraphSeparator()) { | 821 switch (document.frame()->editor().defaultParagraphSeparator()) { |
822 case EditorParagraphSeparatorIsDiv: | 822 case EditorParagraphSeparatorIsDiv: |
823 return HTMLDivElement::create(&document); | 823 return HTMLDivElement::create(document); |
824 case EditorParagraphSeparatorIsP: | 824 case EditorParagraphSeparatorIsP: |
825 return HTMLParagraphElement::create(&document); | 825 return HTMLParagraphElement::create(document); |
826 } | 826 } |
827 | 827 |
828 ASSERT_NOT_REACHED(); | 828 ASSERT_NOT_REACHED(); |
829 return 0; | 829 return 0; |
830 } | 830 } |
831 | 831 |
832 PassRefPtr<HTMLElement> createBreakElement(Document& document) | 832 PassRefPtr<HTMLElement> createBreakElement(Document& document) |
833 { | 833 { |
834 return HTMLBRElement::create(&document); | 834 return HTMLBRElement::create(document); |
835 } | 835 } |
836 | 836 |
837 PassRefPtr<HTMLElement> createOrderedListElement(Document& document) | 837 PassRefPtr<HTMLElement> createOrderedListElement(Document& document) |
838 { | 838 { |
839 return HTMLOListElement::create(&document); | 839 return HTMLOListElement::create(document); |
840 } | 840 } |
841 | 841 |
842 PassRefPtr<HTMLElement> createUnorderedListElement(Document& document) | 842 PassRefPtr<HTMLElement> createUnorderedListElement(Document& document) |
843 { | 843 { |
844 return HTMLUListElement::create(&document); | 844 return HTMLUListElement::create(document); |
845 } | 845 } |
846 | 846 |
847 PassRefPtr<HTMLElement> createListItemElement(Document& document) | 847 PassRefPtr<HTMLElement> createListItemElement(Document& document) |
848 { | 848 { |
849 return HTMLLIElement::create(&document); | 849 return HTMLLIElement::create(document); |
850 } | 850 } |
851 | 851 |
852 PassRefPtr<HTMLElement> createHTMLElement(Document& document, const QualifiedNam
e& name) | 852 PassRefPtr<HTMLElement> createHTMLElement(Document& document, const QualifiedNam
e& name) |
853 { | 853 { |
854 return HTMLElementFactory::createHTMLElement(name, &document, 0, false); | 854 return HTMLElementFactory::createHTMLElement(name, &document, 0, false); |
855 } | 855 } |
856 | 856 |
857 PassRefPtr<HTMLElement> createHTMLElement(Document& document, const AtomicString
& tagName) | 857 PassRefPtr<HTMLElement> createHTMLElement(Document& document, const AtomicString
& tagName) |
858 { | 858 { |
859 return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNam
espaceURI)); | 859 return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNam
espaceURI)); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 // if the selection starts just before a paragraph break, skip over it | 1164 // if the selection starts just before a paragraph break, skip over it |
1165 if (isEndOfParagraph(visiblePosition)) | 1165 if (isEndOfParagraph(visiblePosition)) |
1166 return visiblePosition.next().deepEquivalent().downstream(); | 1166 return visiblePosition.next().deepEquivalent().downstream(); |
1167 | 1167 |
1168 // otherwise, make sure to be at the start of the first selected node, | 1168 // otherwise, make sure to be at the start of the first selected node, |
1169 // instead of possibly at the end of the last node before the selection | 1169 // instead of possibly at the end of the last node before the selection |
1170 return visiblePosition.deepEquivalent().downstream(); | 1170 return visiblePosition.deepEquivalent().downstream(); |
1171 } | 1171 } |
1172 | 1172 |
1173 } // namespace WebCore | 1173 } // namespace WebCore |
OLD | NEW |