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

Unified Diff: Source/core/dom/Node.h

Issue 607673002: Simplify isEditingText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 8f369dc2adc42b73799d357cc681239215c2f7e8..a073d8809ed633e60f2b4f008c9f6787583f486f 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -334,7 +334,7 @@ public:
virtual void notifyLoadedSheetAndAllCriticalSubresources(bool /* error loading subresource */) { }
virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); }
- bool hasName() const { return !isTextNode() && getFlag(HasNameOrIsEditingTextFlag); }
+ bool hasName() const { ASSERT(!isTextNode()); return getFlag(HasNameOrIsEditingTextFlag); }
bool isUserActionElement() const { return getFlag(IsUserActionElementFlag); }
void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElementFlag); }
@@ -349,7 +349,7 @@ public:
StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); }
bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFlag); }
bool isLink() const { return getFlag(IsLinkFlag); }
- bool isEditingText() const { return isTextNode() && getFlag(HasNameOrIsEditingTextFlag); }
+ bool isEditingText() const { ASSERT(isTextNode()); return getFlag(HasNameOrIsEditingTextFlag); }
void setHasName(bool f) { ASSERT(!isTextNode()); setFlag(f, HasNameOrIsEditingTextFlag); }
void setChildNeedsStyleRecalc() { setFlag(ChildNeedsStyleRecalcFlag); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698