diff options
author | Kristian Monsen <kristianm@google.com> | 2010-07-30 10:46:49 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-08-04 13:01:34 +0100 |
commit | 0617145a89917ae7735fe1c9538688ab9a577df5 (patch) | |
tree | 56206078694427c37ed7bdf27eb5221398b833c0 /WebCore/css/CSSSelector.h | |
parent | ef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff) | |
download | external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2 |
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebCore/css/CSSSelector.h')
-rw-r--r-- | WebCore/css/CSSSelector.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h index 518ff2c..34e4af0 100644 --- a/WebCore/css/CSSSelector.h +++ b/WebCore/css/CSSSelector.h @@ -30,6 +30,8 @@ namespace WebCore { + class CSSSelectorBag; + // this class represents a selector for a StyleRule class CSSSelector : public Noncopyable { public: @@ -57,7 +59,21 @@ namespace WebCore { { } - ~CSSSelector(); + ~CSSSelector() + { + // Exit if this selector does not own any objects to be deleted. + if (m_hasRareData) { + if (!m_data.m_rareData) + return; + } else if (!m_data.m_tagHistory) + return; + + // We can not delete the owned object(s) by simply calling delete + // directly on them. That would lead to recursive destructor calls + // which might cause stack overflow. We have to delete them + // iteratively. + deleteReachableSelectors(); + } /** * Re-create selector text from selector's data @@ -275,6 +291,9 @@ namespace WebCore { bool m_hasRareData : 1; bool m_isForPage : 1; + void releaseOwnedSelectorsToBag(CSSSelectorBag&); + void deleteReachableSelectors(); + unsigned specificityForPage(); void extractPseudoType() const; |