Index: Source/core/html/HTMLTitleElement.h |
diff --git a/Source/core/html/HTMLTitleElement.h b/Source/core/html/HTMLTitleElement.h |
index fcdcf6a2c81e150bf455f8a46bbc027b3738a39e..ba70c31e9207b9f988daa341827b4dd751c745b7 100644 |
--- a/Source/core/html/HTMLTitleElement.h |
+++ b/Source/core/html/HTMLTitleElement.h |
@@ -26,6 +26,8 @@ |
namespace WebCore { |
+using namespace HTMLNames; |
+ |
class HTMLTitleElement FINAL : public HTMLElement { |
public: |
static PassRefPtr<HTMLTitleElement> create(Document&); |
@@ -34,15 +36,32 @@ public: |
void setText(const String&); |
private: |
+ friend class IgnoreTitleUpdatesWhenChildrenChange; |
explicit HTMLTitleElement(Document&); |
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
virtual void removedFrom(ContainerNode*) OVERRIDE; |
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); |
+ |
+ bool m_ignoreTitleUpdatesWhenChildrenChange; |
}; |
DEFINE_NODE_TYPE_CASTS(HTMLTitleElement, hasTagName(HTMLNames::titleTag)); |
+class IgnoreTitleUpdatesWhenChildrenChange { |
+public: |
+ IgnoreTitleUpdatesWhenChildrenChange(PassRefPtr<HTMLTitleElement> titleElement) : m_titleElement(titleElement) |
+ { |
+ m_titleElement->m_ignoreTitleUpdatesWhenChildrenChange = true; |
+ } |
+ ~IgnoreTitleUpdatesWhenChildrenChange() |
+ { |
+ m_titleElement->m_ignoreTitleUpdatesWhenChildrenChange = false; |
+ } |
+private: |
+ RefPtr<HTMLTitleElement> m_titleElement; |
+}; |
+ |
} //namespace |
#endif |