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); |