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

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

Issue 420603002: Use tighter typing in editing/ (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 | « Source/core/editing/htmlediting.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 9c78afc0b0036ec3fb3a2c96eac3217fc6c95df7..99b0b522e794bf450ac0c7c6bea8732400af017f 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -53,6 +53,7 @@
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLBodyElement.h"
#include "core/html/HTMLElement.h"
+#include "core/html/HTMLSpanElement.h"
#include "core/html/HTMLTableCellElement.h"
#include "core/html/HTMLTextFormControlElement.h"
#include "core/rendering/RenderObject.h"
@@ -238,7 +239,7 @@ void StyledMarkupAccumulator::appendText(StringBuilder& out, Text& text)
if (!shouldAnnotate() || parentIsTextarea)
MarkupAccumulator::appendText(out, text);
else {
- const bool useRenderedText = !enclosingNodeWithTag(firstPositionInNode(&text), selectTag);
+ const bool useRenderedText = !enclosingElementWithTag(firstPositionInNode(&text), selectTag);
String content = useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range);
StringBuilder buffer;
appendCharactersReplacingEntities(buffer, content, 0, content.length(), EntityMaskInPCDATA);
@@ -380,7 +381,7 @@ Node* StyledMarkupAccumulator::traverseNodesForSerialization(Node* startNode, No
// Don't write out empty block containers that aren't fully selected.
continue;
- if (!n->renderer() && !enclosingNodeWithTag(firstPositionInOrBeforeNode(n), selectTag) && m_shouldAnnotate != AnnotateForNavigationTransition) {
+ if (!n->renderer() && !enclosingElementWithTag(firstPositionInOrBeforeNode(n), selectTag) && m_shouldAnnotate != AnnotateForNavigationTransition) {
next = NodeTraversal::nextSkippingChildren(*n);
// Don't skip over pastEnd.
if (pastEnd && pastEnd->isDescendantOf(n))
@@ -551,10 +552,10 @@ static Node* highestAncestorToWrapMarkup(const Range* range, EAnnotateForInterch
// any tab span that needs to be included.
if (!specialCommonAncestor && isTabSpanTextNode(commonAncestor))
specialCommonAncestor = commonAncestor->parentNode();
- if (!specialCommonAncestor && isTabSpanNode(commonAncestor))
+ if (!specialCommonAncestor && isTabSpanElement(commonAncestor))
specialCommonAncestor = commonAncestor;
- if (Node *enclosingAnchor = enclosingNodeWithTag(firstPositionInNode(specialCommonAncestor ? specialCommonAncestor : commonAncestor), aTag))
+ if (Element* enclosingAnchor = enclosingElementWithTag(firstPositionInNode(specialCommonAncestor ? specialCommonAncestor : commonAncestor), aTag))
specialCommonAncestor = enclosingAnchor;
return specialCommonAncestor;
@@ -578,7 +579,7 @@ static String createMarkupInternal(Document& document, const Range* range, const
document.updateLayoutIgnorePendingStylesheets();
- Node* body = enclosingNodeWithTag(firstPositionInNode(commonAncestor), bodyTag);
+ Element* body = enclosingElementWithTag(firstPositionInNode(commonAncestor), bodyTag);
Node* fullySelectedRoot = 0;
// FIXME: Do this for all fully selected blocks, not just the body.
if (body && areRangesEqual(VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange().get(), range))
« no previous file with comments | « Source/core/editing/htmlediting.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698