diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-01 10:36:58 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-01 10:36:58 +0200 |
commit | b1e9e47fa11f608ae16bc07f97a2acf95bf80272 (patch) | |
tree | c88c45e80c9c44506e7cdf9a3bb39ebf82a8cd5b /Source/WebCore/testing | |
parent | be01689f43cf6882cf670d33df49ead1f570c53a (diff) | |
download | qtwebkit-b1e9e47fa11f608ae16bc07f97a2acf95bf80272.tar.gz |
Imported WebKit commit 499c84c99aa98e9870fa7eaa57db476c6d160d46 (http://svn.webkit.org/repository/webkit/trunk@119200)
Weekly update :). Particularly relevant changes for Qt are the use of the WebCore image decoders and direct usage
of libpng/libjpeg if available in the system.
Diffstat (limited to 'Source/WebCore/testing')
-rw-r--r-- | Source/WebCore/testing/InternalSettings.cpp | 39 | ||||
-rw-r--r-- | Source/WebCore/testing/InternalSettings.h | 9 | ||||
-rw-r--r-- | Source/WebCore/testing/InternalSettings.idl | 3 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.cpp | 12 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.h | 3 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.idl | 2 |
6 files changed, 68 insertions, 0 deletions
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp index d99335b91..60304aa65 100644 --- a/Source/WebCore/testing/InternalSettings.cpp +++ b/Source/WebCore/testing/InternalSettings.cpp @@ -101,6 +101,11 @@ InternalSettings::InternalSettings(Frame* frame) , m_originalEditingBehavior(settings()->editingBehaviorType()) , m_originalFixedPositionCreatesStackingContext(settings()->fixedPositionCreatesStackingContext()) , m_originalSyncXHRInDocumentsEnabled(settings()->syncXHRInDocumentsEnabled()) +#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER) + , m_originalJavaScriptProfilingEnabled(page() && page()->inspectorController() && page()->inspectorController()->profilerEnabled()) +#endif + , m_originalWindowFocusRestricted(settings()->windowFocusRestricted()) + , m_originalDeviceSupportsTouch(settings()->deviceSupportsTouch()) { } @@ -115,6 +120,12 @@ void InternalSettings::restoreTo(Settings* settings) settings->setEditingBehaviorType(m_originalEditingBehavior); settings->setFixedPositionCreatesStackingContext(m_originalFixedPositionCreatesStackingContext); settings->setSyncXHRInDocumentsEnabled(m_originalSyncXHRInDocumentsEnabled); +#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER) + if (page() && page()->inspectorController()) + page()->inspectorController()->setProfilerEnabled(m_originalJavaScriptProfilingEnabled); +#endif + settings->setWindowFocusRestricted(m_originalWindowFocusRestricted); + settings->setDeviceSupportsTouch(m_originalDeviceSupportsTouch); } Settings* InternalSettings::settings() const @@ -251,6 +262,12 @@ void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode #endif } +void InternalSettings::setDeviceSupportsTouch(bool enabled, ExceptionCode& ec) +{ + InternalSettingsGuardForSettings(); + settings()->setDeviceSupportsTouch(enabled); +} + typedef void (Settings::*SetFontFamilyFunction)(const AtomicString&, UScriptCode); static void setFontFamily(Settings* settings, const String& family, const String& script, SetFontFamilyFunction setter) { @@ -360,4 +377,26 @@ void InternalSettings::setSyncXHRInDocumentsEnabled(bool creates, ExceptionCode& settings()->setSyncXHRInDocumentsEnabled(creates); } +void InternalSettings::setJavaScriptProfilingEnabled(bool enabled, ExceptionCode& ec) +{ +#if ENABLE(INSPECTOR) + if (!page() || !page()->inspectorController()) { + ec = INVALID_ACCESS_ERR; + return; + } + + page()->inspectorController()->setProfilerEnabled(enabled); +#else + UNUSED_PARAM(enabled); + UNUSED_PARAM(ec); + return; +#endif +} + +void InternalSettings::setWindowFocusRestricted(bool restricted, ExceptionCode& ec) +{ + InternalSettingsGuardForSettings(); + settings()->setWindowFocusRestricted(restricted); +} + } diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h index 92b1bdfeb..affef0790 100644 --- a/Source/WebCore/testing/InternalSettings.h +++ b/Source/WebCore/testing/InternalSettings.h @@ -63,6 +63,7 @@ public: void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&); void setPerTileDrawingEnabled(bool enabled, ExceptionCode&); void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&); + void setDeviceSupportsTouch(bool enabled, ExceptionCode&); void setShadowDOMEnabled(bool enabled, ExceptionCode&); void setStandardFontFamily(const String& family, const String& script, ExceptionCode&); void setSerifFontFamily(const String& family, const String& script, ExceptionCode&); @@ -78,9 +79,12 @@ public: void setEditingBehavior(const String&, ExceptionCode&); void setFixedPositionCreatesStackingContext(bool, ExceptionCode&); void setSyncXHRInDocumentsEnabled(bool, ExceptionCode&); + void setWindowFocusRestricted(bool, ExceptionCode&); void restoreTo(Settings*); + void setJavaScriptProfilingEnabled(bool enabled, ExceptionCode&); + private: InternalSettings(Frame*); @@ -97,6 +101,11 @@ private: EditingBehaviorType m_originalEditingBehavior; bool m_originalFixedPositionCreatesStackingContext; bool m_originalSyncXHRInDocumentsEnabled; +#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER) + bool m_originalJavaScriptProfilingEnabled; +#endif + bool m_originalWindowFocusRestricted; + bool m_originalDeviceSupportsTouch; }; } // namespace WebCore diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl index 2ef35f2ab..53c517638 100644 --- a/Source/WebCore/testing/InternalSettings.idl +++ b/Source/WebCore/testing/InternalSettings.idl @@ -41,6 +41,7 @@ module window { boolean unifiedTextCheckingEnabled() raises (DOMException); void setPageScaleFactor(in float scaleFactor, in long x, in long y) raises(DOMException); void setTouchEventEmulationEnabled(in boolean enabled) raises(DOMException); + void setDeviceSupportsTouch(in boolean enabled) raises(DOMException); void setShadowDOMEnabled(in boolean enabled) raises(DOMException); void setStandardFontFamily(in DOMString family, in DOMString script) raises(DOMException); void setSerifFontFamily(in DOMString family, in DOMString script) raises(DOMException); @@ -56,6 +57,8 @@ module window { void setEditingBehavior(in DOMString behavior) raises(DOMException); void setFixedPositionCreatesStackingContext(in boolean creates) raises(DOMException); void setSyncXHRInDocumentsEnabled(in boolean enabled) raises(DOMException); + void setJavaScriptProfilingEnabled(in boolean creates) raises(DOMException); + void setWindowFocusRestricted(in boolean restricted) raises(DOMException); }; } diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp index 842e8e144..f4ad3f68b 100644 --- a/Source/WebCore/testing/Internals.cpp +++ b/Source/WebCore/testing/Internals.cpp @@ -60,6 +60,7 @@ #include "ShadowRoot.h" #include "SpellChecker.h" #include "TextIterator.h" +#include "TextRun.h" #include "TreeScope.h" #if ENABLE(INPUT_TYPE_COLOR) @@ -592,6 +593,13 @@ void Internals::reset(Document* document) if (document->frame() == page->mainFrame()) setUserPreferredLanguages(Vector<String>()); } + + resetDefaultsToConsistentValues(); +} + +void Internals::resetDefaultsToConsistentValues() +{ + TextRun::setAllowsRoundingHacks(false); } bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionCode& ec) @@ -1050,6 +1058,10 @@ void Internals::resumeAnimations(Document* document, ExceptionCode& ec) const controller->resumeAnimations(); } +void Internals::allowRoundingHacks() const +{ + TextRun::setAllowsRoundingHacks(true); +} #if ENABLE(FULLSCREEN_API) void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element) diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h index 8e010e986..6fa4a45c6 100644 --- a/Source/WebCore/testing/Internals.h +++ b/Source/WebCore/testing/Internals.h @@ -168,6 +168,8 @@ public: void suspendAnimations(Document*, ExceptionCode&) const; void resumeAnimations(Document*, ExceptionCode&) const; + void allowRoundingHacks() const; + #if ENABLE(INSPECTOR) unsigned numberOfLiveNodes() const; unsigned numberOfLiveDocuments() const; @@ -184,6 +186,7 @@ public: private: explicit Internals(Document*); DocumentMarker* markerAt(Node*, const String& markerType, unsigned index, ExceptionCode&); + void resetDefaultsToConsistentValues(); RefPtr<InternalSettings> m_settings; }; diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl index ef9ed753d..aa10858bb 100644 --- a/Source/WebCore/testing/Internals.idl +++ b/Source/WebCore/testing/Internals.idl @@ -137,6 +137,8 @@ module window { void suspendAnimations(in Document document) raises (DOMException); void resumeAnimations(in Document document) raises (DOMException); + void allowRoundingHacks(); + #if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS void setBatteryStatus(in Document document, in DOMString eventType, in boolean charging, in double chargingTime, in double dischargingTime, in double level) raises (DOMException); #endif |