diff options
Diffstat (limited to 'Source/WebCore/testing')
-rw-r--r-- | Source/WebCore/testing/InternalSettings.cpp | 23 | ||||
-rw-r--r-- | Source/WebCore/testing/InternalSettings.h | 5 | ||||
-rw-r--r-- | Source/WebCore/testing/InternalSettings.idl | 2 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.cpp | 16 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.h | 4 | ||||
-rw-r--r-- | Source/WebCore/testing/Internals.idl | 4 |
6 files changed, 49 insertions, 5 deletions
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp index 493a39da1..8594b704d 100644 --- a/Source/WebCore/testing/InternalSettings.cpp +++ b/Source/WebCore/testing/InternalSettings.cpp @@ -98,6 +98,8 @@ InternalSettings::InternalSettings(Frame* frame) #if ENABLE(SHADOW_DOM) , m_originalShadowDOMEnabled(RuntimeEnabledFeatures::shadowDOMEnabled()) #endif + , m_originalEditingBehavior(settings()->editingBehaviorType()) + , m_originalFixedPositionCreatesStackingContext(settings()->fixedPositionCreatesStackingContext()) { } @@ -109,6 +111,8 @@ void InternalSettings::restoreTo(Settings* settings) #if ENABLE(SHADOW_DOM) RuntimeEnabledFeatures::setShadowDOMEnabled(m_originalShadowDOMEnabled); #endif + settings->setEditingBehaviorType(m_originalEditingBehavior); + settings->setFixedPositionCreatesStackingContext(m_originalFixedPositionCreatesStackingContext); } Settings* InternalSettings::settings() const @@ -329,4 +333,23 @@ void InternalSettings::setMediaPlaybackRequiresUserGesture(bool enabled, Excepti settings()->setMediaPlaybackRequiresUserGesture(enabled); } +void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec) +{ + InternalSettingsGuardForSettings(); + if (equalIgnoringCase(editingBehavior, "win")) + settings()->setEditingBehaviorType(EditingWindowsBehavior); + else if (equalIgnoringCase(editingBehavior, "mac")) + settings()->setEditingBehaviorType(EditingMacBehavior); + else if (equalIgnoringCase(editingBehavior, "unix")) + settings()->setEditingBehaviorType(EditingUnixBehavior); + else + ec = SYNTAX_ERR; +} + +void InternalSettings::setFixedPositionCreatesStackingContext(bool creates, ExceptionCode& ec) +{ + InternalSettingsGuardForFrameView(); + settings()->setFixedPositionCreatesStackingContext(creates); +} + } diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h index 661976754..7fea75dfb 100644 --- a/Source/WebCore/testing/InternalSettings.h +++ b/Source/WebCore/testing/InternalSettings.h @@ -26,6 +26,7 @@ #ifndef InternalSettings_h #define InternalSettings_h +#include "EditingBehaviorTypes.h" #include "FrameDestructionObserver.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -74,6 +75,8 @@ public: bool scrollAnimatorEnabled(ExceptionCode&); void setCSSExclusionsEnabled(bool enabled, ExceptionCode&); void setMediaPlaybackRequiresUserGesture(bool, ExceptionCode&); + void setEditingBehavior(const String&, ExceptionCode&); + void setFixedPositionCreatesStackingContext(bool, ExceptionCode&); void restoreTo(Settings*); @@ -90,6 +93,8 @@ private: #if ENABLE(SHADOW_DOM) bool m_originalShadowDOMEnabled; #endif + EditingBehaviorType m_originalEditingBehavior; + bool m_originalFixedPositionCreatesStackingContext; }; } // namespace WebCore diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl index bbabe3ab3..7b30179bd 100644 --- a/Source/WebCore/testing/InternalSettings.idl +++ b/Source/WebCore/testing/InternalSettings.idl @@ -53,6 +53,8 @@ module window { boolean scrollAnimatorEnabled() raises(DOMException); void setCSSExclusionsEnabled(in boolean enabled) raises(DOMException); void setMediaPlaybackRequiresUserGesture(in boolean enabled) raises(DOMException); + void setEditingBehavior(in DOMString behavior) raises(DOMException); + void setFixedPositionCreatesStackingContext(in boolean creates) raises(DOMException); }; } diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp index e17185fc2..842e8e144 100644 --- a/Source/WebCore/testing/Internals.cpp +++ b/Source/WebCore/testing/Internals.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -399,6 +399,16 @@ void Internals::selectColorInColorChooser(Element* element, const String& colorV } #endif +PassRefPtr<ClientRect> Internals::absoluteCaretBounds(Document* document, ExceptionCode& ec) +{ + if (!document || !document->frame() || !document->frame()->selection()) { + ec = INVALID_ACCESS_ERR; + return ClientRect::create(); + } + + return ClientRect::create(document->frame()->selection()->absoluteCaretBounds()); +} + PassRefPtr<ClientRect> Internals::boundingBox(Element* element, ExceptionCode& ec) { if (!element) { @@ -463,8 +473,8 @@ void Internals::setBackgroundBlurOnNode(Node* node, int blurLength, ExceptionCod return; } - FilterOperations filters; - filters.operations().append(BlurFilterOperation::create(Length(blurLength, Fixed), FilterOperation::BLUR)); + WebKit::WebFilterOperations filters; + filters.append(WebKit::WebFilterOperation::createBlurFilter(blurLength)); platformLayer->setBackgroundFilters(filters); } #else diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h index 89faeac50..8e010e986 100644 --- a/Source/WebCore/testing/Internals.h +++ b/Source/WebCore/testing/Internals.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -96,6 +96,8 @@ public: void selectColorInColorChooser(Element*, const String& colorValue); #endif + PassRefPtr<ClientRect> absoluteCaretBounds(Document*, ExceptionCode&); + PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&); PassRefPtr<ClientRectList> inspectorHighlightRects(Document*, ExceptionCode&); diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl index 6c9e88e38..ef9ed753d 100644 --- a/Source/WebCore/testing/Internals.idl +++ b/Source/WebCore/testing/Internals.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,6 +68,8 @@ module window { void selectColorInColorChooser(in Element element, in DOMString colorValue); #endif + ClientRect absoluteCaretBounds(in Document document) raises(DOMException); + ClientRect boundingBox(in Element element) raises(DOMException); ClientRectList inspectorHighlightRects(in Document document) raises (DOMException); |