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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTitleElement.cpp

Issue 1816963002: Use TemporaryChange in HTMLTitleElement::setText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: third_party/WebKit/Source/core/html/HTMLTitleElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTitleElement.cpp b/third_party/WebKit/Source/core/html/HTMLTitleElement.cpp
index 6c25d4ac03072959cd6340aa4c74a0e1601e1163..e6d5b560b94921f4445a0abc2f1add69c17a53f4 100644
--- a/third_party/WebKit/Source/core/html/HTMLTitleElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTitleElement.cpp
@@ -82,10 +82,11 @@ void HTMLTitleElement::setText(const String &value)
RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this);
ChildListMutationScope mutation(*this);
- // Avoid calling Document::setTitleElement() during intermediate steps.
- m_ignoreTitleUpdatesWhenChildrenChange = !value.isEmpty();
- removeChildren(OmitSubtreeModifiedEvent);
- m_ignoreTitleUpdatesWhenChildrenChange = false;
+ {
+ // Avoid calling Document::setTitleElement() during intermediate steps.
+ TemporaryChange<bool> inhibitTitleUpdateScope(m_ignoreTitleUpdatesWhenChildrenChange, !value.isEmpty());
+ removeChildren(OmitSubtreeModifiedEvent);
+ }
if (!value.isEmpty())
appendChild(document().createTextNode(value.impl()), IGNORE_EXCEPTION);
« 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