diff options
author | Cary Clark <cary@android.com> | 2010-11-09 05:50:56 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-09 05:50:56 -0800 |
commit | f671316a27d2de1c701427993a6acb56349ac96b (patch) | |
tree | a47c27d8367d4ef49c1bef5103bbc7667c10e2b4 /WebCore | |
parent | 31ee2547d67e901b5e9af790f1f4903ecf0faffa (diff) | |
parent | f1610d01f92cb77827d2de13c0ed38554e4f0790 (diff) | |
download | external_webkit-f671316a27d2de1c701427993a6acb56349ac96b.zip external_webkit-f671316a27d2de1c701427993a6acb56349ac96b.tar.gz external_webkit-f671316a27d2de1c701427993a6acb56349ac96b.tar.bz2 |
Merge "update dom version on style change"
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/config.h | 3 | ||||
-rw-r--r-- | WebCore/dom/Document.cpp | 3 | ||||
-rw-r--r-- | WebCore/dom/Document.h | 8 | ||||
-rw-r--r-- | WebCore/dom/Element.cpp | 3 |
4 files changed, 17 insertions, 0 deletions
diff --git a/WebCore/config.h b/WebCore/config.h index 70f8a20..5c3a48c 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -202,6 +202,9 @@ // apple-touch-icon support in <link> tags #define ANDROID_APPLE_TOUCH_ICON +// track changes to the style that may change what is drawn +#define ANDROID_STYLE_VERSION + // Enable prefetching when specified via the rel element of <link> elements. #define ENABLE_LINK_PREFETCH 1 diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 9dfe6a3..9ad263c 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -371,6 +371,9 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con , m_compatibilityMode(NoQuirksMode) , m_compatibilityModeLocked(false) , m_domTreeVersion(0) +#ifdef ANDROID_STYLE_VERSION + , m_styleVersion(0) +#endif , m_styleSheets(StyleSheetList::create(this)) , m_readyState(Complete) , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 1fb7079..25122b5 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -873,6 +873,11 @@ public: void incDOMTreeVersion() { ++m_domTreeVersion; } unsigned domTreeVersion() const { return m_domTreeVersion; } +#ifdef ANDROID_STYLE_VERSION + void incStyleVersion() { ++m_styleVersion; } + unsigned styleVersion() const { return m_styleVersion; } +#endif + void setDocType(PassRefPtr<DocumentType>); #if ENABLE(XPATH) @@ -1164,6 +1169,9 @@ private: mutable RefPtr<Element> m_documentElement; unsigned m_domTreeVersion; +#ifdef ANDROID_STYLE_VERSION + unsigned m_styleVersion; +#endif HashSet<NodeIterator*> m_nodeIterators; HashSet<Range*> m_ranges; diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp index 83e129e..10ba71b 100644 --- a/WebCore/dom/Element.cpp +++ b/WebCore/dom/Element.cpp @@ -930,6 +930,9 @@ void Element::recalcStyle(StyleChange change) #endif if ((change > NoChange || needsStyleRecalc())) { +#ifdef ANDROID_STYLE_VERSION + document()->incStyleVersion(); +#endif if (hasRareData()) rareData()->resetComputedStyle(); } |