diff options
Diffstat (limited to 'WebCore')
| -rw-r--r-- | WebCore/config.h | 1 | ||||
| -rw-r--r-- | WebCore/dom/Document.cpp | 8 | ||||
| -rw-r--r-- | WebCore/dom/Document.h | 19 | ||||
| -rw-r--r-- | WebCore/html/HTMLTokenizer.cpp | 4 | ||||
| -rw-r--r-- | WebCore/page/FrameView.cpp | 8 |
5 files changed, 13 insertions, 27 deletions
diff --git a/WebCore/config.h b/WebCore/config.h index 8fbed4f..6fa1f40 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -80,7 +80,6 @@ #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." // This must be defined before we include FastMalloc.h, below. #define USE_SYSTEM_MALLOC 1 -#define ANDROID_MOBILE // change can be merged back to WebKit.org for MOBILE #define LOG_DISABLED 1 #include <wtf/Assertions.h> // Central place to set which optional features Android uses. diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 85966d7..13c2fae 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -371,9 +371,6 @@ Document::Document(Frame* frame, bool isXHTML) , m_hasOpenDatabases(false) #endif , m_usingGeolocation(false) -#ifdef ANDROID_MOBILE - , mExtraLayoutDelay(0) -#endif #if ENABLE(WML) , m_containsWMLContent(false) #endif @@ -431,6 +428,7 @@ Document::Document(Frame* frame, bool isXHTML) m_processingLoadEvent = false; m_startTime = currentTime(); m_overMinimumLayoutThreshold = false; + m_extraLayoutDelay = 0; initSecurityContext(); initDNSPrefetch(); @@ -1880,13 +1878,13 @@ bool Document::shouldScheduleLayout() int Document::minimumLayoutDelay() { if (m_overMinimumLayoutThreshold) - return 0; + return m_extraLayoutDelay; int elapsed = elapsedTime(); m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold; // We'll want to schedule the timer to fire at the minimum layout threshold. - return max(0, cLayoutScheduleThreshold - elapsed); + return max(0, cLayoutScheduleThreshold - elapsed) + m_extraLayoutDelay; } int Document::elapsedTime() const diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 3d0582c..f2125b1 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -523,6 +523,10 @@ public: void setParsing(bool); bool parsing() const { return m_bParsing; } int minimumLayoutDelay(); + + // This method is used by Android. + void setExtraLayoutDelay(int delay) { m_extraLayoutDelay = delay; } + bool shouldScheduleLayout(); int elapsedTime() const; @@ -815,11 +819,6 @@ public: void updateFocusAppearanceSoon(); void cancelFocusAppearanceUpdate(); -#ifdef ANDROID_MOBILE - void setExtraLayoutDelay(int delay) { mExtraLayoutDelay = delay; } - int extraLayoutDelay() { return mExtraLayoutDelay; } -#endif - // FF method for accessing the selection added for compatability. DOMSelection* getSelection() const; @@ -1091,9 +1090,11 @@ private: typedef std::pair<Vector<DocumentMarker>, Vector<IntRect> > MarkerMapVectorPair; typedef HashMap<RefPtr<Node>, MarkerMapVectorPair*> MarkerMap; MarkerMap m_markers; + #if !PLATFORM(ANDROID) mutable AXObjectCache* m_axObjectCache; #endif + Timer<Document> m_updateFocusAppearanceTimer; Element* m_cssTarget; @@ -1103,6 +1104,10 @@ private: HashSet<RefPtr<HistoryItem> > m_associatedHistoryItems; double m_startTime; bool m_overMinimumLayoutThreshold; + // This is used to increase the minimum delay between re-layouts. It is set + // using setExtraLayoutDelay to modify the minimum delay used at different + // points during the lifetime of the Document. + int m_extraLayoutDelay; Vector<std::pair<ScriptElementData*, CachedResourceHandle<CachedScript> > > m_scriptsToExecuteSoon; Timer<Document> m_executeScriptSoonTimer; @@ -1195,10 +1200,6 @@ private: bool m_usingGeolocation; -#ifdef ANDROID_MOBILE - int mExtraLayoutDelay; -#endif - #if ENABLE(WML) bool m_containsWMLContent; #endif diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp index 3ca6958..a552442 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/HTMLTokenizer.cpp @@ -1849,11 +1849,7 @@ void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*) printf("Beginning timer write at time %d\n", m_doc->elapsedTime()); #endif -#ifdef ANDROID_MOBILE - if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay() && !m_doc->extraLayoutDelay()) { -#else if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay()) { -#endif // Restart the timer and let layout win. This is basically a way of ensuring that the layout // timer has higher priority than our timer. m_timer.startOneShot(0); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index b338017..b533bad 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -1151,11 +1151,7 @@ void FrameView::scheduleRelayout() m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc(); #endif -#ifdef ANDROID_MOBILE - int delay = m_frame->document()->minimumLayoutDelay() + m_frame->document()->extraLayoutDelay(); -#else int delay = m_frame->document()->minimumLayoutDelay(); -#endif if (m_layoutTimer.isActive() && m_delayedLayout && !delay) unscheduleRelayout(); if (m_layoutTimer.isActive()) @@ -1209,11 +1205,7 @@ void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot) } } } else { -#ifdef ANDROID_MOBILE - int delay = m_frame->document()->minimumLayoutDelay() + m_frame->document()->extraLayoutDelay(); -#else int delay = m_frame->document()->minimumLayoutDelay(); -#endif m_layoutRoot = relayoutRoot; m_delayedLayout = delay != 0; m_layoutTimer.startOneShot(delay * 0.001); |
