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

Unified Diff: Source/core/editing/BreakBlockquoteCommand.cpp

Issue 417113011: Cast highestEnclosingNodeOfType() return value to tighter type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/BreakBlockquoteCommand.cpp
diff --git a/Source/core/editing/BreakBlockquoteCommand.cpp b/Source/core/editing/BreakBlockquoteCommand.cpp
index 5ffa2096df791b5a3d48ac397ea65720c5a5c08b..8caf333487ffb7fe3adca3341fbe5e8d069d38fb 100644
--- a/Source/core/editing/BreakBlockquoteCommand.cpp
+++ b/Source/core/editing/BreakBlockquoteCommand.cpp
@@ -33,6 +33,7 @@
#include "core/editing/htmlediting.h"
#include "core/html/HTMLBRElement.h"
#include "core/html/HTMLElement.h"
+#include "core/html/HTMLQuoteElement.h"
#include "core/rendering/RenderListItem.h"
namespace blink {
@@ -68,8 +69,8 @@ void BreakBlockquoteCommand::doApply()
Position pos = endingSelection().start().downstream();
// Find the top-most blockquote from the start.
- Node* topBlockquote = highestEnclosingNodeOfType(pos, isMailBlockquote);
- if (!topBlockquote || !topBlockquote->parentNode() || !topBlockquote->isElementNode())
+ HTMLQuoteElement* topBlockquote = toHTMLQuoteElement(highestEnclosingNodeOfType(pos, isMailHTMLBlockquoteElement));
+ if (!topBlockquote || !topBlockquote->parentNode())
return;
RefPtrWillBeRawPtr<HTMLBRElement> breakElement = createBreakElement(document());
@@ -101,7 +102,7 @@ void BreakBlockquoteCommand::doApply()
pos = pos.next();
// Adjust the position so we don't split at the beginning of a quote.
- while (isFirstVisiblePositionInNode(VisiblePosition(pos), enclosingNodeOfType(pos, isMailBlockquote)))
+ while (isFirstVisiblePositionInNode(VisiblePosition(pos), enclosingNodeOfType(pos, isMailHTMLBlockquoteElement)))
pos = pos.previous();
// startNode is the first node that we need to move to the new blockquote.
@@ -134,7 +135,7 @@ void BreakBlockquoteCommand::doApply()
ancestors.append(node);
// Insert a clone of the top blockquote after the break.
- RefPtrWillBeRawPtr<Element> clonedBlockquote = toElement(topBlockquote)->cloneElementWithoutChildren();
+ RefPtrWillBeRawPtr<Element> clonedBlockquote = topBlockquote->cloneElementWithoutChildren();
insertNodeAfter(clonedBlockquote.get(), breakElement.get());
// Clone startNode's ancestors into the cloned blockquote.
« no previous file with comments | « no previous file | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698