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

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

Issue 694893003: Clean up isSpecialElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 1 month 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index b995395a689a6fbce84b84c39d6407773e9240fc..caca37d3925d463aefdb0d191890c1e5fde41661 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -425,18 +425,15 @@ const String& nonBreakingSpaceString()
}
// FIXME: need to dump this
-bool isSpecialHTMLElement(const Node* n)
+static bool isSpecialHTMLElement(const Node& n)
{
- if (!n)
- return false;
-
- if (!n->isHTMLElement())
+ if (!n.isHTMLElement())
return false;
- if (n->isLink())
+ if (n.isLink())
return true;
- RenderObject* renderer = n->renderer();
+ RenderObject* renderer = n.renderer();
if (!renderer)
return false;
@@ -453,7 +450,7 @@ static HTMLElement* firstInSpecialElement(const Position& pos)
{
Element* rootEditableElement = pos.containerNode()->rootEditableElement();
for (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode()) {
- if (isSpecialHTMLElement(n)) {
+ if (isSpecialHTMLElement(*n)) {
HTMLElement* specialElement = toHTMLElement(n);
VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
VisiblePosition firstInElement = VisiblePosition(firstPositionInOrBeforeNode(specialElement), DOWNSTREAM);
@@ -470,7 +467,7 @@ static HTMLElement* lastInSpecialElement(const Position& pos)
{
Element* rootEditableElement = pos.containerNode()->rootEditableElement();
for (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode()) {
- if (isSpecialHTMLElement(n)) {
+ if (isSpecialHTMLElement(*n)) {
HTMLElement* specialElement = toHTMLElement(n);
VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
VisiblePosition lastInElement = VisiblePosition(lastPositionInOrAfterNode(specialElement), DOWNSTREAM);
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698