Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: Source/core/editing/htmlediting.cpp

Issue 424493003: Use tighter typing in editing: CompositeEditCommand (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 case EditorParagraphSeparatorIsDiv: 793 case EditorParagraphSeparatorIsDiv:
794 return HTMLDivElement::create(document); 794 return HTMLDivElement::create(document);
795 case EditorParagraphSeparatorIsP: 795 case EditorParagraphSeparatorIsP:
796 return HTMLParagraphElement::create(document); 796 return HTMLParagraphElement::create(document);
797 } 797 }
798 798
799 ASSERT_NOT_REACHED(); 799 ASSERT_NOT_REACHED();
800 return nullptr; 800 return nullptr;
801 } 801 }
802 802
803 PassRefPtrWillBeRawPtr<HTMLElement> createBreakElement(Document& document) 803 PassRefPtrWillBeRawPtr<HTMLBRElement> createBreakElement(Document& document)
804 { 804 {
805 return HTMLBRElement::create(document); 805 return HTMLBRElement::create(document);
806 } 806 }
807 807
808 PassRefPtrWillBeRawPtr<HTMLElement> createOrderedListElement(Document& document) 808 PassRefPtrWillBeRawPtr<HTMLElement> createOrderedListElement(Document& document)
809 { 809 {
810 return HTMLOListElement::create(document); 810 return HTMLOListElement::create(document);
811 } 811 }
812 812
813 PassRefPtrWillBeRawPtr<HTMLElement> createUnorderedListElement(Document& documen t) 813 PassRefPtrWillBeRawPtr<HTMLElement> createUnorderedListElement(Document& documen t)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document, const String& tabText) 869 PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document, const String& tabText)
870 { 870 {
871 return createTabSpanElement(document, document.createTextNode(tabText)); 871 return createTabSpanElement(document, document.createTextNode(tabText));
872 } 872 }
873 873
874 PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document) 874 PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document)
875 { 875 {
876 return createTabSpanElement(document, PassRefPtrWillBeRawPtr<Text>(nullptr)) ; 876 return createTabSpanElement(document, PassRefPtrWillBeRawPtr<Text>(nullptr)) ;
877 } 877 }
878 878
879 PassRefPtrWillBeRawPtr<HTMLBRElement> createBlockPlaceholderElement(Document& do cument)
880 {
881 return toHTMLBRElement(document.createElement(brTag, false).get());
882 }
883
879 bool isNodeRendered(const Node *node) 884 bool isNodeRendered(const Node *node)
880 { 885 {
881 if (!node) 886 if (!node)
882 return false; 887 return false;
883 888
884 RenderObject* renderer = node->renderer(); 889 RenderObject* renderer = node->renderer();
885 if (!renderer) 890 if (!renderer)
886 return false; 891 return false;
887 892
888 return renderer->style()->visibility() == VISIBLE; 893 return renderer->style()->visibility() == VISIBLE;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 // if the selection starts just before a paragraph break, skip over it 1196 // if the selection starts just before a paragraph break, skip over it
1192 if (isEndOfParagraph(visiblePosition)) 1197 if (isEndOfParagraph(visiblePosition))
1193 return visiblePosition.next().deepEquivalent().downstream(); 1198 return visiblePosition.next().deepEquivalent().downstream();
1194 1199
1195 // otherwise, make sure to be at the start of the first selected node, 1200 // otherwise, make sure to be at the start of the first selected node,
1196 // instead of possibly at the end of the last node before the selection 1201 // instead of possibly at the end of the last node before the selection
1197 return visiblePosition.deepEquivalent().downstream(); 1202 return visiblePosition.deepEquivalent().downstream();
1198 } 1203 }
1199 1204
1200 } // namespace blink 1205 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698