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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp

Issue 1611953002: Rename editableRootElementForPosition() to rootEditableElementOf() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-01-21T18:23:57 Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos ition& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote) 105 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos ition& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote)
106 { 106 {
107 Element* enclosingCell = toElement(enclosingNodeOfType(start, &isTableCell)) ; 107 Element* enclosingCell = toElement(enclosingNodeOfType(start, &isTableCell)) ;
108 Element* elementToSplitTo; 108 Element* elementToSplitTo;
109 if (enclosingCell) 109 if (enclosingCell)
110 elementToSplitTo = enclosingCell; 110 elementToSplitTo = enclosingCell;
111 else if (enclosingList(start.computeContainerNode())) 111 else if (enclosingList(start.computeContainerNode()))
112 elementToSplitTo = enclosingBlock(start.computeContainerNode()); 112 elementToSplitTo = enclosingBlock(start.computeContainerNode());
113 else 113 else
114 elementToSplitTo = editableRootElementForPosition(start); 114 elementToSplitTo = rootEditableElementOf(start);
115 115
116 if (!elementToSplitTo) 116 if (!elementToSplitTo)
117 return; 117 return;
118 118
119 RefPtrWillBeRawPtr<Node> outerBlock = (start.computeContainerNode() == eleme ntToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeConta inerNode(), elementToSplitTo).get(); 119 RefPtrWillBeRawPtr<Node> outerBlock = (start.computeContainerNode() == eleme ntToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeConta inerNode(), elementToSplitTo).get();
120 120
121 VisiblePosition startOfContents = createVisiblePosition(start); 121 VisiblePosition startOfContents = createVisiblePosition(start);
122 if (!targetBlockquote) { 122 if (!targetBlockquote) {
123 // Create a new blockquote and insert it as a child of the root editable element. We accomplish 123 // Create a new blockquote and insert it as a child of the root editable element. We accomplish
124 // this by splitting all parents of the current paragraph up to that poi nt. 124 // this by splitting all parents of the current paragraph up to that poi nt.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 void IndentOutdentCommand::formatRange(const Position& start, const Position& en d, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent) 255 void IndentOutdentCommand::formatRange(const Position& start, const Position& en d, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent)
256 { 256 {
257 if (tryIndentingAsListItem(start, end)) 257 if (tryIndentingAsListItem(start, end))
258 blockquoteForNextIndent = nullptr; 258 blockquoteForNextIndent = nullptr;
259 else 259 else
260 indentIntoBlockquote(start, end, blockquoteForNextIndent); 260 indentIntoBlockquote(start, end, blockquoteForNextIndent);
261 } 261 }
262 262
263 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698