summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog37
-rw-r--r--Source/JavaScriptCore/ChangeLog261
-rw-r--r--Source/JavaScriptCore/JSCTypedArrayStubs.h2
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h6
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerX86.h7
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h7
-rw-r--r--Source/JavaScriptCore/assembler/X86Assembler.h9
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.cpp2
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.h10
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp17
-rw-r--r--Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp40
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.cpp63
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.h80
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp19
-rw-r--r--Source/JavaScriptCore/dfg/DFGCSEPhase.cpp1
-rw-r--r--Source/JavaScriptCore/dfg/DFGFixupPhase.cpp19
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGNode.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGNodeType.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp73
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp45
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp44
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp3
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp78
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp74
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp70
-rw-r--r--Source/JavaScriptCore/jit/JIT.h1
-rw-r--r--Source/JavaScriptCore/jit/JITInlineMethods.h8
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess.cpp1
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp1
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm5
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm5
-rw-r--r--Source/JavaScriptCore/runtime/Arguments.h2
-rw-r--r--Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h4
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.h11
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.cpp1
-rw-r--r--Source/JavaScriptCore/runtime/JSNotAnObject.h2
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.h38
-rw-r--r--Source/JavaScriptCore/runtime/JSString.h2
-rw-r--r--Source/Platform/ChangeLog12
-rw-r--r--Source/Platform/chromium/public/WebScrollbar.h2
-rw-r--r--Source/WTF/ChangeLog36
-rw-r--r--Source/WTF/wtf/HashTraits.h7
-rw-r--r--Source/WTF/wtf/TypeTraits.h2
-rw-r--r--Source/WTF/wtf/text/WTFString.cpp22
-rw-r--r--Source/WebCore/CMakeLists.txt20
-rw-r--r--Source/WebCore/ChangeLog1823
-rw-r--r--Source/WebCore/DerivedSources.make6
-rw-r--r--Source/WebCore/DerivedSources.pri16
-rw-r--r--Source/WebCore/GNUmakefile.am10
-rw-r--r--Source/WebCore/GNUmakefile.list.am12
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBBackingStore.h46
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.cpp8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.cpp7
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp142
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h15
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp42
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h6
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp211
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h55
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp102
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h12
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp6
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.cpp5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.cpp12
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.h1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h1
-rw-r--r--Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp6
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPicker.js30
-rw-r--r--Source/WebCore/Target.pri10
-rw-r--r--Source/WebCore/WebCore.exp.in6
-rw-r--r--Source/WebCore/WebCore.gyp/WebCore.gyp28
-rw-r--r--Source/WebCore/WebCore.gypi16
-rw-r--r--Source/WebCore/WebCore.order1
-rw-r--r--Source/WebCore/WebCore.pri12
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj92
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj48
-rw-r--r--Source/WebCore/accessibility/AccessibilityNodeObject.cpp7
-rw-r--r--Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp1
-rw-r--r--Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h5
-rw-r--r--Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/js/ScriptEventListener.cpp6
-rw-r--r--Source/WebCore/bindings/js/ScriptEventListener.h2
-rw-r--r--Source/WebCore/bindings/v8/NPV8Object.cpp4
-rw-r--r--Source/WebCore/bindings/v8/ScriptController.cpp1
-rw-r--r--Source/WebCore/bindings/v8/ScriptEventListener.cpp14
-rw-r--r--Source/WebCore/bindings/v8/ScriptEventListener.h2
-rw-r--r--Source/WebCore/bindings/v8/ScriptRunner.cpp8
-rw-r--r--Source/WebCore/bindings/v8/ScriptSourceCode.cpp3
-rw-r--r--Source/WebCore/bindings/v8/V8Binding.cpp5
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWindowShell.cpp1
-rw-r--r--Source/WebCore/bindings/v8/V8GCController.cpp1
-rw-r--r--Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp34
-rw-r--r--Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h3
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp4
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp2
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h27
-rw-r--r--Source/WebCore/css/CSSProperty.cpp1
-rw-r--r--Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp2
-rw-r--r--Source/WebCore/css/SVGCSSParser.cpp5
-rw-r--r--Source/WebCore/css/SVGCSSPropertyNames.in1
-rw-r--r--Source/WebCore/css/SVGCSSStyleSelector.cpp8
-rw-r--r--Source/WebCore/css/SVGCSSValueKeywords.in2
-rw-r--r--Source/WebCore/css/StyleResolver.cpp9
-rw-r--r--Source/WebCore/css/StyleRule.cpp5
-rw-r--r--Source/WebCore/dom/Element.cpp4
-rw-r--r--Source/WebCore/dom/Element.h2
-rw-r--r--Source/WebCore/dom/Element.idl2
-rw-r--r--Source/WebCore/fileapi/Blob.cpp15
-rw-r--r--Source/WebCore/fileapi/Blob.h8
-rw-r--r--Source/WebCore/fileapi/Blob.idl4
-rw-r--r--Source/WebCore/fileapi/File.h2
-rw-r--r--Source/WebCore/html/BaseButtonInputType.cpp51
-rw-r--r--Source/WebCore/html/BaseButtonInputType.h7
-rw-r--r--Source/WebCore/html/FileInputType.cpp2
-rw-r--r--Source/WebCore/html/HTMLFormControlElementWithState.cpp14
-rw-r--r--Source/WebCore/html/HTMLFormControlElementWithState.h1
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp1
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.cpp12
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.h1
-rw-r--r--Source/WebCore/html/InputType.cpp4
-rw-r--r--Source/WebCore/html/InputType.h1
-rw-r--r--Source/WebCore/html/TimeInputType.cpp1
-rw-r--r--Source/WebCore/html/shadow/ContentDistributor.cpp13
-rw-r--r--Source/WebCore/html/shadow/ContentDistributor.h2
-rwxr-xr-xSource/WebCore/inspector/CodeGeneratorInspector.py3
-rw-r--r--Source/WebCore/inspector/InjectedScriptCanvasModule.cpp (renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.cpp)34
-rw-r--r--Source/WebCore/inspector/InjectedScriptCanvasModule.h (renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.h)19
-rw-r--r--Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js (renamed from Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js)0
-rw-r--r--Source/WebCore/inspector/Inspector.json9
-rw-r--r--Source/WebCore/inspector/InspectorAllInOne.cpp4
-rw-r--r--Source/WebCore/inspector/InspectorCanvasAgent.cpp (renamed from Source/WebCore/inspector/InspectorWebGLAgent.cpp)72
-rw-r--r--Source/WebCore/inspector/InspectorCanvasAgent.h (renamed from Source/WebCore/inspector/InspectorWebGLAgent.h)30
-rw-r--r--Source/WebCore/inspector/InspectorCanvasInstrumentation.h (renamed from Source/WebCore/inspector/InspectorWebGLInstrumentation.h)14
-rw-r--r--Source/WebCore/inspector/InspectorController.cpp6
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.cpp7
-rw-r--r--Source/WebCore/inspector/InstrumentingAgents.h20
-rwxr-xr-xSource/WebCore/inspector/compile-front-end.py12
-rw-r--r--Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js4
-rw-r--r--Source/WebCore/inspector/front-end/CallStackSidebarPane.js2
-rw-r--r--Source/WebCore/inspector/front-end/CanvasProfileView.js (renamed from Source/WebCore/inspector/front-end/WebGLProfileView.js)58
-rw-r--r--Source/WebCore/inspector/front-end/CookieParser.js2
-rw-r--r--Source/WebCore/inspector/front-end/EventListenersSidebarPane.js22
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionPanel.js3
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionServer.js20
-rw-r--r--Source/WebCore/inspector/front-end/ExtensionView.js1
-rw-r--r--Source/WebCore/inspector/front-end/FileUtils.js2
-rw-r--r--Source/WebCore/inspector/front-end/Linkifier.js2
-rw-r--r--Source/WebCore/inspector/front-end/NetworkRequest.js8
-rw-r--r--Source/WebCore/inspector/front-end/ProfilesPanel.js6
-rw-r--r--Source/WebCore/inspector/front-end/ResourceUtils.js2
-rw-r--r--Source/WebCore/inspector/front-end/Settings.js2
-rw-r--r--Source/WebCore/inspector/front-end/WebKit.qrc4
-rw-r--r--Source/WebCore/inspector/front-end/canvasProfiler.css (renamed from Source/WebCore/inspector/front-end/webGLProfiler.css)10
-rw-r--r--Source/WebCore/inspector/front-end/inspector.css2
-rw-r--r--Source/WebCore/loader/DocumentLoader.cpp10
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp1
-rw-r--r--Source/WebCore/loader/FrameLoaderClient.h2
-rw-r--r--Source/WebCore/loader/ResourceLoadScheduler.cpp4
-rw-r--r--Source/WebCore/loader/SubresourceLoader.cpp10
-rw-r--r--Source/WebCore/loader/cache/CachedImage.cpp2
-rw-r--r--Source/WebCore/loader/cache/CachedImage.h2
-rwxr-xr-xSource/WebCore/loader/cache/CachedResource.cpp2
-rw-r--r--Source/WebCore/loader/cache/CachedResource.h1
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp51
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.h10
-rw-r--r--Source/WebCore/page/EventHandler.cpp12
-rw-r--r--Source/WebCore/page/Settings.cpp38
-rw-r--r--Source/WebCore/page/Settings.h12
-rw-r--r--Source/WebCore/page/TouchAdjustment.cpp58
-rw-r--r--Source/WebCore/platform/Scrollbar.cpp1
-rw-r--r--Source/WebCore/platform/Scrollbar.h5
-rw-r--r--Source/WebCore/platform/ScrollbarThemeClient.h3
-rw-r--r--Source/WebCore/platform/blackberry/PageClientBlackBerry.h1
-rw-r--r--Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp8
-rw-r--r--Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp51
-rw-r--r--Source/WebCore/platform/chromium/PlatformSupport.h4
-rw-r--r--Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm4
-rw-r--r--Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp10
-rw-r--r--Source/WebCore/platform/chromium/support/WebScrollbarImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/IntRect.cpp13
-rw-r--r--Source/WebCore/platform/graphics/IntRect.h2
-rw-r--r--Source/WebCore/platform/graphics/MediaPlayer.cpp2
-rw-r--r--Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp31
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm3
-rw-r--r--Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp8
-rw-r--r--Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp11
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h3
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp8
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp173
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h14
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp6
-rw-r--r--Source/WebCore/platform/graphics/skia/PlatformContextSkia.h8
-rw-r--r--Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm8
-rw-r--r--Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp6
-rw-r--r--Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h1
-rw-r--r--Source/WebCore/platform/mac/NSScrollerImpDetails.mm3
-rw-r--r--Source/WebCore/platform/mac/ScrollAnimatorMac.mm3
-rw-r--r--Source/WebCore/platform/mac/WebWindowAnimation.mm3
-rw-r--r--Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp26
-rw-r--r--Source/WebCore/platform/network/blackberry/CredentialBackingStore.h1
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkJob.cpp5
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkManager.cpp14
-rw-r--r--Source/WebCore/platform/win/BString.cpp10
-rw-r--r--Source/WebCore/platform/win/BString.h2
-rw-r--r--Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp8
-rw-r--r--Source/WebCore/plugins/win/PluginViewWin.cpp8
-rw-r--r--Source/WebCore/rendering/RenderBox.h2
-rw-r--r--Source/WebCore/rendering/RenderButton.cpp36
-rw-r--r--Source/WebCore/rendering/RenderButton.h6
-rw-r--r--Source/WebCore/rendering/RenderIFrame.cpp51
-rw-r--r--Source/WebCore/rendering/RenderIFrame.h3
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp4
-rw-r--r--Source/WebCore/rendering/RenderTable.h13
-rw-r--r--Source/WebCore/rendering/RenderTableCell.cpp26
-rw-r--r--Source/WebCore/rendering/RenderTableCell.h18
-rw-r--r--Source/WebCore/rendering/RenderTableCol.cpp23
-rw-r--r--Source/WebCore/rendering/RenderTableCol.h6
-rw-r--r--Source/WebCore/rendering/RenderTableRow.cpp14
-rw-r--r--Source/WebCore/rendering/RenderTableRow.h7
-rw-r--r--Source/WebCore/rendering/RenderTableSection.cpp18
-rw-r--r--Source/WebCore/rendering/RenderTableSection.h12
-rw-r--r--Source/WebCore/rendering/RenderText.cpp2
-rw-r--r--Source/WebCore/rendering/TextAutosizer.cpp9
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.cpp3
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.h11
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyleDefs.h5
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp6
-rw-r--r--Source/WebCore/svg/SVGStyledElement.cpp2
-rw-r--r--Source/WebCore/svg/svgattrs.in1
-rwxr-xr-xSource/WebCore/testing/InternalSettings.cpp16
-rwxr-xr-xSource/WebCore/testing/InternalSettings.h5
-rwxr-xr-xSource/WebCore/testing/InternalSettings.idl2
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore.cpp4
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp7
-rw-r--r--Source/WebKit/blackberry/Api/WebPage_p.h1
-rw-r--r--Source/WebKit/blackberry/ChangeLog184
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp2
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp18
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h2
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp26
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h17
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp129
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.h12
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp4
-rw-r--r--Source/WebKit/chromium/ChangeLog305
-rw-r--r--Source/WebKit/chromium/DEPS4
-rw-r--r--Source/WebKit/chromium/WebKit.gyp1
-rw-r--r--Source/WebKit/chromium/WebKit.gypi1
-rw-r--r--Source/WebKit/chromium/features.gypi3
-rw-r--r--Source/WebKit/chromium/public/WebFrame.h24
-rw-r--r--Source/WebKit/chromium/public/WebRuntimeFeatures.h2
-rw-r--r--Source/WebKit/chromium/public/WebViewClient.h3
-rw-r--r--Source/WebKit/chromium/public/WebWidget.h4
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.h3
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp20
-rw-r--r--Source/WebKit/chromium/src/PlatformSupport.cpp17
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp66
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h5
-rw-r--r--Source/WebKit/chromium/src/WebImageSkia.cpp48
-rw-r--r--Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebPluginScrollbarImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebRuntimeFeatures.cpp18
-rw-r--r--Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp60
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h2
-rw-r--r--Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/IDBFakeBackingStore.h44
-rw-r--r--Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp36
-rw-r--r--Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp17
-rw-r--r--Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/WebFrameTest.cpp114
-rw-r--r--Source/WebKit/chromium/tests/WebImageTest.cpp102
-rw-r--r--Source/WebKit/chromium/tests/WebViewTest.cpp58
-rw-r--r--Source/WebKit/chromium/tests/data/black-and-white.icobin0 -> 158 bytes
-rw-r--r--Source/WebKit/chromium/tests/data/white-1x1.pngbin0 -> 103 bytes
-rw-r--r--Source/WebKit/efl/ChangeLog243
-rw-r--r--Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp14
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp7
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h1
-rw-r--r--Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp4
-rw-r--r--Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp24
-rw-r--r--Source/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp6
-rw-r--r--Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp6
-rw-r--r--Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp3
-rw-r--r--Source/WebKit/efl/ewk/ewk_auth_soup.cpp8
-rw-r--r--Source/WebKit/efl/ewk/ewk_file_chooser.cpp1
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.cpp19
-rw-r--r--Source/WebKit/efl/ewk/ewk_js.cpp21
-rw-r--r--Source/WebKit/efl/ewk/ewk_main.cpp2
-rw-r--r--Source/WebKit/efl/ewk/ewk_private.h4
-rw-r--r--Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp14
-rw-r--r--Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp8
-rw-r--r--Source/WebKit/efl/ewk/ewk_tiled_model.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp102
-rw-r--r--Source/WebKit/efl/ewk/ewk_view_private.h2
-rw-r--r--Source/WebKit/efl/ewk/ewk_view_single.cpp2
-rw-r--r--Source/WebKit/efl/ewk/ewk_view_tiled.cpp6
-rw-r--r--Source/WebKit/gtk/ChangeLog17
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebsettings.cpp26
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h1
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebview.cpp5
-rw-r--r--Source/WebKit/mac/ChangeLog16
-rw-r--r--Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h1
-rw-r--r--Source/WebKit/mac/WebView/WebPreferences.mm11
-rw-r--r--Source/WebKit/mac/WebView/WebPreferencesPrivate.h3
-rw-r--r--Source/WebKit/mac/WebView/WebView.mm1
-rw-r--r--Source/WebKit/qt/ChangeLog21
-rw-r--r--Source/WebKit/qt/WebCoreSupport/UndoStepQt.cpp84
-rw-r--r--Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp15
-rw-r--r--Source/WebKit/win/ChangeLog70
-rw-r--r--Source/WebKit/win/DefaultPolicyDelegate.cpp15
-rw-r--r--Source/WebKit/win/MarshallingHelpers.cpp26
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp12
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp9
-rw-r--r--Source/WebKit/win/WebFrame.cpp3
-rw-r--r--Source/WebKit/win/WebHistory.cpp7
-rw-r--r--Source/WebKit/win/WebIconDatabase.cpp3
-rw-r--r--Source/WebKit/win/WebNotificationCenter.cpp6
-rw-r--r--Source/WebKit/win/WebPreferences.cpp4
-rw-r--r--Source/WebKit/win/WebView.cpp176
-rw-r--r--Source/WebKit2/ChangeLog681
-rw-r--r--Source/WebKit2/GNUmakefile.list.am4
-rw-r--r--Source/WebKit2/Shared/FontInfo.cpp5
-rw-r--r--Source/WebKit2/Shared/PlatformPopupMenuData.cpp5
-rw-r--r--Source/WebKit2/Shared/SandboxExtension.h4
-rw-r--r--Source/WebKit2/Shared/ShareableSurface.cpp1
-rw-r--r--Source/WebKit2/Shared/WebMemorySampler.cpp2
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.h1
-rw-r--r--Source/WebKit2/Shared/WebProcessCreationParameters.cpp12
-rw-r--r--Source/WebKit2/Shared/WebProcessCreationParameters.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferences.cpp14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/BatteryProvider.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_main.cpp9
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_private.h6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp68
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.h10
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp26
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_private.h6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp20
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp154
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h8
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/resources/same_page_navigation.html5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp292
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp336
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h106
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h28
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp95
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h11
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp21
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp9
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp119
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt34
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp72
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp78
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/webkit2.h1
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp6
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h7
-rw-r--r--Source/WebKit2/UIProcess/FindIndicator.cpp2
-rw-r--r--Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp2
-rw-r--r--Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp2
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp30
-rw-r--r--Source/WebKit2/UIProcess/WebContext.h8
-rw-r--r--Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp2
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h3
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.messages.in4
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.cpp2
-rw-r--r--Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp4
-rw-r--r--Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp4
-rw-r--r--Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp4
-rw-r--r--Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp13
-rw-r--r--Source/WebKit2/UIProcess/mac/BackingStoreMac.mm2
-rw-r--r--Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp12
-rw-r--r--Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp2
-rw-r--r--Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp10
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp4
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp10
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp2
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp7
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp27
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginView.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp14
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp1
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp20
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp8
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingArea.h5
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/FindController.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.messages.in2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp10
-rw-r--r--Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h5
-rw-r--r--Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp7
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp27
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.h4
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.messages.in4
-rw-r--r--Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp2
-rw-r--r--Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp4
-rw-r--r--Source/WebKit2/win/WebKit2.def2
-rw-r--r--Source/WebKit2/win/WebKit2CFLite.def1
-rw-r--r--Source/api.pri8
-rw-r--r--Source/autotools/symbols.filter2
-rw-r--r--Tools/ChangeLog579
-rw-r--r--Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp2
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp6
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h1
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp4
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp2
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp5
-rw-r--r--Tools/DumpRenderTree/efl/TestRunnerEfl.cpp2
-rw-r--r--Tools/DumpRenderTree/gtk/DumpRenderTree.cpp2
-rw-r--r--Tools/DumpRenderTree/mac/FrameLoadDelegate.mm2
-rwxr-xr-xTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp2
-rw-r--r--Tools/DumpRenderTree/qt/EventSenderQt.cpp15
-rw-r--r--Tools/DumpRenderTree/qt/EventSenderQt.h8
-rw-r--r--Tools/DumpRenderTree/win/FrameLoadDelegate.cpp2
-rw-r--r--Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp2
-rwxr-xr-xTools/Scripts/convert-test-expectations19
-rw-r--r--Tools/Scripts/webkitpy/common/config/committers.py5
-rw-r--r--Tools/Scripts/webkitpy/common/net/resultsjsonparser.py5
-rw-r--r--Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py19
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py2
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py8
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py254
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py387
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_failures.py16
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/port_testcase.py4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/test.py10
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py6
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/views/printing.py9
-rw-r--r--Tools/Scripts/webkitpy/performance_tests/perftest.py24
-rwxr-xr-xTools/Scripts/webkitpy/performance_tests/perftest_unittest.py10
-rwxr-xr-xTools/Scripts/webkitpy/performance_tests/perftestsrunner.py7
-rwxr-xr-xTools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py46
-rw-r--r--Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py2
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py24
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queues.py27
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queues_unittest.py10
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/rebaseline.py2
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py26
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard.js111
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js62
-rw-r--r--Tools/Tools.pro1
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm51
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp4
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp4
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp11
-rw-r--r--Tools/qmake/config.tests/gccdepends/empty.cpp0
-rw-r--r--Tools/qmake/mkspecs/features/default_post.prf19
-rw-r--r--Tools/qmake/mkspecs/features/production_build.prf2
-rw-r--r--Tools/qmake/mkspecs/features/webkit_modules.prf15
483 files changed, 9907 insertions, 2635 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bbb88870..df74473f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2012-09-20 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] QtWebKit module header includes private dependencies
+
+ Reviewed by Tor Arne Vestbø.
+
+ Moved loading of webkit_modules.prf a few lines down after the definition
+ of QT_API_DEPENDS, because webkit_modules.prf does the sanitization of the
+ QT variable now and therefore needs QT_API_DEPENDS.
+
+ * Source/api.pri:
+
+2012-09-18 Sailesh Agrawal <sail@chromium.org>
+
+ Chromium: Scrollbar with tickmarks doesn't respond to clicks
+ https://bugs.webkit.org/show_bug.cgi?id=96049
+
+ Reviewed by Beth Dakin.
+
+ Update exported symbols.
+
+ * Source/autotools/symbols.filter:
+
+2012-09-18 Bo Liu <boliu@chromium.org>
+
+ Revert 128780, 128676, 128645
+ https://bugs.webkit.org/show_bug.cgi?id=97022
+
+ Reviewed by Adam Barth.
+
+ I made these revisions to add in-place reload behavior to ImagesEnabled setting.
+ Reverting this for now due to them causing performance regression in
+ chromium, possibly caused by increased calls to
+ PermissionClient::imageAllowed.
+
+ * Source/autotools/symbols.filter:
+
2012-09-18 Ryuan Choi <ryuan.choi@samsung.com>
[CMAKE] Fix build break because of memory exhausted.
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 76a90cad0..243e2a887 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,264 @@
+2012-09-19 Geoffrey Garen <ggaren@apple.com>
+
+ OSR exit sometimes neglects to create the arguments object
+ https://bugs.webkit.org/show_bug.cgi?id=97162
+
+ Reviewed by Filip Pizlo.
+
+ No performance change.
+
+ I don't know of any case where this is a real problem in TOT, but it
+ will become a problem if we start compiling eval, with, or catch, and/or
+ sometimes stop doing arguments optimizations in the bytecode.
+
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run): Account for a
+ CreateArguments that has transformed into PhantomArguments. We used to
+ clear our reference to the CreateArguments node, but now we hold onto it,
+ so we need to account for it transforming.
+
+ Don't replace a SetLocal(CreateArguments) with a SetLocal(JSValue())
+ because that doesn't leave enough information behind for OSR exit to do
+ the right thing. Instead, maintain our reference to CreateArguments, and
+ rely on CreateArguments transforming into PhantomArguments after
+ optimization. SetLocal(PhantomArguments) is efficient, and it's a marker
+ for OSR exit to create the arguments object.
+
+ Don't ASSERT that all PhantomArguments are unreferenced because we now
+ leave them in the graph as SetLocal(PhantomArguments), and that's harmless.
+
+ * dfg/DFGArgumentsSimplificationPhase.h:
+ (NullableHashTraits):
+ (JSC::DFG::NullableHashTraits::emptyValue): Export our special hash table
+ for inline call frames so the OSR exit compiler can use it.
+
+ * dfg/DFGOSRExitCompiler32_64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit):
+ * dfg/DFGOSRExitCompiler64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit): Don't load the 'arguments'
+ register to decide if we need to create the arguments object. Optimization
+ may have eliminated the initializing store to this register, in which
+ case we'll load garbage. Instead, use the global knowledge that all call
+ frames that optimized out 'arguments' now need to create it, and use a hash
+ table to make sure we do so only once per call frame.
+
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile): SetLocal(PhantomArguments) is unique
+ because we haven't just changed a value's format or elided a load or store;
+ instead, we've replaced an object with JSValue(). We could try to account
+ for this in a general way, but for now it's a special-case optimization,
+ so we give it a specific OSR hint instead.
+
+2012-09-19 Filip Pizlo <fpizlo@apple.com>
+
+ REGRESSION(r128802): It made some JS tests crash
+ https://bugs.webkit.org/show_bug.cgi?id=97001
+
+ Reviewed by Mark Hahnenberg.
+
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::visitChildren):
+
+2012-09-19 Filip Pizlo <fpizlo@apple.com>
+
+ DFG should not assume that a ByVal access is generic just because it was unprofiled
+ https://bugs.webkit.org/show_bug.cgi?id=97088
+
+ Reviewed by Geoffrey Garen.
+
+ We were not disambiguating between "Undecided" in the sense that the array profile
+ has no useful information versus "Undecided" in the sense that the array profile
+ knows that the access has not executed. That's an important distinction, since
+ the former form of "Undecided" means that we should consult value profiling, while
+ the latter means that we should force exit unless the value profiling indicates
+ that the access must be generic (base is not cell or property is not int).
+
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGArrayMode.cpp:
+ (JSC::DFG::fromObserved):
+ (JSC::DFG::refineArrayMode):
+ (JSC::DFG::modeAlreadyChecked):
+ (JSC::DFG::modeToString):
+ * dfg/DFGArrayMode.h:
+ (JSC::DFG::canCSEStorage):
+ (JSC::DFG::modeIsSpecific):
+ (JSC::DFG::modeSupportsLength):
+ (JSC::DFG::benefitsFromStructureCheck):
+
+2012-09-19 Filip Pizlo <fpizlo@apple.com>
+
+ DFG should not emit PutByVal hole case unless it has to
+ https://bugs.webkit.org/show_bug.cgi?id=97080
+
+ Reviewed by Geoffrey Garen.
+
+ This causes us to generate less code for typical PutByVal's. But if profiling tells us
+ that the hole case is being hit, we generate the same code as we would have generated
+ before. This seems like a slight speed-up across the board.
+
+ * assembler/MacroAssemblerARMv7.h:
+ (JSC::MacroAssemblerARMv7::store8):
+ (MacroAssemblerARMv7):
+ * assembler/MacroAssemblerX86.h:
+ (MacroAssemblerX86):
+ (JSC::MacroAssemblerX86::store8):
+ * assembler/MacroAssemblerX86_64.h:
+ (MacroAssemblerX86_64):
+ (JSC::MacroAssemblerX86_64::store8):
+ * assembler/X86Assembler.h:
+ (X86Assembler):
+ (JSC::X86Assembler::movb_i8m):
+ * bytecode/ArrayProfile.h:
+ (JSC::ArrayProfile::ArrayProfile):
+ (JSC::ArrayProfile::addressOfMayStoreToHole):
+ (JSC::ArrayProfile::mayStoreToHole):
+ (ArrayProfile):
+ * dfg/DFGArrayMode.cpp:
+ (JSC::DFG::fromObserved):
+ (JSC::DFG::modeAlreadyChecked):
+ (JSC::DFG::modeToString):
+ * dfg/DFGArrayMode.h:
+ (DFG):
+ (JSC::DFG::mayStoreToHole):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * jit/JIT.h:
+ (JIT):
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::emitArrayProfileStoreToHoleSpecialCase):
+ (JSC):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_put_by_val):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_put_by_val):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-09-18 Filip Pizlo <fpizlo@apple.com>
+
+ DFG should not call out to C++ every time that it tries to put to an object that doesn't yet have array storage
+ https://bugs.webkit.org/show_bug.cgi?id=96983
+
+ Reviewed by Oliver Hunt.
+
+ Introduce more polymorphism into the DFG's array mode support. Use that to
+ introduce the notion of effectul array modes, where the check for the mode
+ will perform actions necessary to ensure that we have the mode we want, if
+ the object is not already in that mode. Also added profiling support for
+ checking if an object is of a type that would not allow us to create array
+ storage (like a typed array or a string for example).
+
+ This is a ~2x speed-up on loops that transform an object that did not have
+ indexed storage into one that does.
+
+ * JSCTypedArrayStubs.h:
+ (JSC):
+ * bytecode/ArrayProfile.cpp:
+ (JSC::ArrayProfile::computeUpdatedPrediction):
+ * bytecode/ArrayProfile.h:
+ (JSC::ArrayProfile::ArrayProfile):
+ (JSC::ArrayProfile::mayInterceptIndexedAccesses):
+ (ArrayProfile):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGArrayMode.cpp:
+ (JSC::DFG::fromObserved):
+ (DFG):
+ (JSC::DFG::modeAlreadyChecked):
+ (JSC::DFG::modeToString):
+ * dfg/DFGArrayMode.h:
+ (DFG):
+ (JSC::DFG::modeUsesButterfly):
+ (JSC::DFG::isSlowPutAccess):
+ (JSC::DFG::benefitsFromStructureCheck):
+ (JSC::DFG::isEffectful):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::getArrayMode):
+ (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks):
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode):
+ (JSC::DFG::FixupPhase::checkArray):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::byValIsPure):
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::hasArrayMode):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArray):
+ (JSC::DFG::SpeculativeJIT::arrayify):
+ (DFG):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * runtime/Arguments.h:
+ (Arguments):
+ * runtime/JSNotAnObject.h:
+ (JSNotAnObject):
+ * runtime/JSObject.h:
+ (JSObject):
+ (JSC::JSObject::ensureArrayStorage):
+ * runtime/JSString.h:
+ (JSC::JSString::createStructure):
+
+2012-09-18 Filip Pizlo <fpizlo@apple.com>
+
+ Include PhantomArguments in DFGDisassembly
+ https://bugs.webkit.org/show_bug.cgi?id=97043
+
+ Reviewed by Geoffrey Garen.
+
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::willHaveCodeGenOrOSR):
+
+2012-09-18 Filip Pizlo <fpizlo@apple.com>
+
+ REGRESSION(r128802): It made some JS tests crash
+ https://bugs.webkit.org/show_bug.cgi?id=97001
+
+ Reviewed by Mark Hahnenberg.
+
+ IndexingHeaderInlineMethods was incorrectly assuming that if the HasArrayStorage bit is clear, then that means that indexing payload capacity is zero.
+
+ * runtime/IndexingHeaderInlineMethods.h:
+ (JSC::IndexingHeader::preCapacity):
+ (JSC::IndexingHeader::indexingPayloadSizeInBytes):
+
+2012-09-18 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Use WTF::HasTrivialDestructor instead of compiler-specific versions in JSC::NeedsDestructor
+ https://bugs.webkit.org/show_bug.cgi?id=96980
+
+ Reviewed by Benjamin Poulain.
+
+ * runtime/JSCell.h:
+ (JSC):
+ (NeedsDestructor):
+
+2012-09-18 Filip Pizlo <fpizlo@apple.com>
+
+ DFGOperations doesn't use NativeCallFrameTracer in enough places
+ https://bugs.webkit.org/show_bug.cgi?id=96987
+
+ Reviewed by Mark Hahnenberg.
+
+ Anything that can GC should use it.
+
+ * dfg/DFGOperations.cpp:
+
2012-09-18 Mark Lam <mark.lam@apple.com>
Not reviewed. Attempt at greening the WinCairo bot. Touching
diff --git a/Source/JavaScriptCore/JSCTypedArrayStubs.h b/Source/JavaScriptCore/JSCTypedArrayStubs.h
index fa42d3c56..e3926338c 100644
--- a/Source/JavaScriptCore/JSCTypedArrayStubs.h
+++ b/Source/JavaScriptCore/JSCTypedArrayStubs.h
@@ -74,7 +74,7 @@ public: \
protected:\
JS##name##Array(JSC::Structure*, JSGlobalObject*, PassRefPtr<name##Array>);\
void finishCreation(JSC::JSGlobalData&);\
- static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;\
+ static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; \
JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\
void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\
};\
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
index 1dfe888d3..09a88fdda 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
@@ -737,6 +737,12 @@ public:
store8(src, setupArmAddress(address));
}
+ void store8(RegisterID src, void* address)
+ {
+ move(TrustedImmPtr(address), addressTempRegister);
+ store8(src, ArmAddress(addressTempRegister, 0));
+ }
+
void store16(RegisterID src, BaseIndex address)
{
store16(src, setupArmAddress(address));
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
index d46867ae3..f6e373d3e 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
@@ -44,6 +44,7 @@ public:
using MacroAssemblerX86Common::or32;
using MacroAssemblerX86Common::load32;
using MacroAssemblerX86Common::store32;
+ using MacroAssemblerX86Common::store8;
using MacroAssemblerX86Common::branch32;
using MacroAssemblerX86Common::call;
using MacroAssemblerX86Common::jump;
@@ -132,6 +133,12 @@ public:
m_assembler.movl_rm(src, address);
}
+ void store8(TrustedImm32 imm, void* address)
+ {
+ ASSERT(-128 <= imm.m_value && imm.m_value < 128);
+ m_assembler.movb_i8m(imm.m_value, address);
+ }
+
Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, AbsoluteAddress dest)
{
m_assembler.addl_im(imm.m_value, dest.m_ptr);
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
index c827e8ae9..6493b0c34 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
@@ -45,6 +45,7 @@ public:
using MacroAssemblerX86Common::sub32;
using MacroAssemblerX86Common::load32;
using MacroAssemblerX86Common::store32;
+ using MacroAssemblerX86Common::store8;
using MacroAssemblerX86Common::call;
using MacroAssemblerX86Common::jump;
using MacroAssemblerX86Common::addDouble;
@@ -114,6 +115,12 @@ public:
move(TrustedImmPtr(address), scratchRegister);
store32(imm, scratchRegister);
}
+
+ void store8(TrustedImm32 imm, void* address)
+ {
+ move(TrustedImmPtr(address), scratchRegister);
+ store8(imm, Address(scratchRegister));
+ }
Call call()
{
diff --git a/Source/JavaScriptCore/assembler/X86Assembler.h b/Source/JavaScriptCore/assembler/X86Assembler.h
index acd573049..ecb178e88 100644
--- a/Source/JavaScriptCore/assembler/X86Assembler.h
+++ b/Source/JavaScriptCore/assembler/X86Assembler.h
@@ -1155,6 +1155,15 @@ public:
m_formatter.immediate32(imm);
}
+#if !CPU(X86_64)
+ void movb_i8m(int imm, const void* addr)
+ {
+ ASSERT(-128 <= imm && imm < 128);
+ m_formatter.oneByteOp(OP_GROUP11_EvIb, GROUP11_MOV, addr);
+ m_formatter.immediate8(imm);
+ }
+#endif
+
void movb_i8m(int imm, int offset, RegisterID base)
{
ASSERT(-128 <= imm && imm < 128);
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
index 9f4e1ce20..3ba974d74 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
@@ -32,6 +32,8 @@ void ArrayProfile::computeUpdatedPrediction(OperationInProgress operation)
{
if (m_lastSeenStructure) {
m_observedArrayModes |= arrayModeFromStructure(m_lastSeenStructure);
+ m_mayInterceptIndexedAccesses |=
+ m_lastSeenStructure->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero();
if (!m_structureIsPolymorphic) {
if (!m_expectedStructure)
m_expectedStructure = m_lastSeenStructure;
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.h b/Source/JavaScriptCore/bytecode/ArrayProfile.h
index 43818d77d..3b462eaba 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.h
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.h
@@ -54,6 +54,8 @@ public:
, m_lastSeenStructure(0)
, m_expectedStructure(0)
, m_structureIsPolymorphic(false)
+ , m_mayStoreToHole(false)
+ , m_mayInterceptIndexedAccesses(false)
, m_observedArrayModes(0)
{
}
@@ -63,6 +65,8 @@ public:
, m_lastSeenStructure(0)
, m_expectedStructure(0)
, m_structureIsPolymorphic(false)
+ , m_mayStoreToHole(false)
+ , m_mayInterceptIndexedAccesses(false)
, m_observedArrayModes(0)
{
}
@@ -71,6 +75,7 @@ public:
Structure** addressOfLastSeenStructure() { return &m_lastSeenStructure; }
ArrayModes* addressOfArrayModes() { return &m_observedArrayModes; }
+ bool* addressOfMayStoreToHole() { return &m_mayStoreToHole; }
void observeStructure(Structure* structure)
{
@@ -89,6 +94,9 @@ public:
return !structureIsPolymorphic() && m_expectedStructure;
}
ArrayModes observedArrayModes() const { return m_observedArrayModes; }
+ bool mayInterceptIndexedAccesses() const { return m_mayInterceptIndexedAccesses; }
+
+ bool mayStoreToHole() const { return m_mayStoreToHole; }
private:
friend class LLIntOffsetsExtractor;
@@ -97,6 +105,8 @@ private:
Structure* m_lastSeenStructure;
Structure* m_expectedStructure;
bool m_structureIsPolymorphic;
+ bool m_mayStoreToHole; // This flag may become overloaded to indicate other special cases that were encountered during array access, as it depends on indexing type. Since we currently have basically just one indexing type (two variants of ArrayStorage), this flag for now just means exactly what its name implies.
+ bool m_mayInterceptIndexedAccesses;
ArrayModes m_observedArrayModes;
};
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 153ba311c..50b9e2b9f 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -841,6 +841,7 @@ bool AbstractState::execute(unsigned indexInBlock)
node.setCanExit(true);
switch (node.arrayMode()) {
case Array::Undecided:
+ case Array::Unprofiled:
ASSERT_NOT_REACHED();
break;
case Array::ForceExit:
@@ -863,6 +864,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(nodeIndex).makeTop();
break;
case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
forNode(node.child2()).filter(SpecInt32);
clobberWorld(node.codeOrigin, indexInBlock);
forNode(nodeIndex).makeTop();
@@ -926,6 +928,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(child2).filter(SpecInt32);
break;
case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
forNode(child2).filter(SpecInt32);
clobberWorld(node.codeOrigin, indexInBlock);
break;
@@ -1397,6 +1400,20 @@ bool AbstractState::execute(unsigned indexInBlock)
}
break;
}
+ case Arrayify: {
+ switch (node.arrayMode()) {
+ case EFFECTFUL_NON_ARRAY_ARRAY_STORAGE_MODES:
+ node.setCanExit(true);
+ forNode(node.child1()).filter(SpecCell);
+ forNode(nodeIndex).clear();
+ clobberStructures(indexInBlock);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ break;
+ }
case GetIndexedPropertyStorage: {
switch (node.arrayMode()) {
case Array::String:
diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
index fe839d54f..ba6673963 100644
--- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
@@ -41,12 +41,6 @@ namespace JSC { namespace DFG {
namespace {
-template<typename T>
-struct NullableHashTraits : public HashTraits<T> {
- static const bool emptyValueIsZero = false;
- static T emptyValue() { return reinterpret_cast<T>(1); }
-};
-
struct ArgumentsAliasingData {
InlineCallFrame* callContext;
bool callContextSet;
@@ -181,7 +175,7 @@ public:
VariableAccessData* variableAccessData = node.variableAccessData();
int argumentsRegister =
m_graph.uncheckedArgumentsRegisterFor(node.codeOrigin);
- if (source.op() != CreateArguments) {
+ if (source.op() != CreateArguments && source.op() != PhantomArguments) {
// Make sure that the source of the SetLocal knows that if it's
// a variable that we think is aliased to the arguments, then it
// may escape at this point. In future, we could track transitive
@@ -435,18 +429,9 @@ public:
VariableAccessData* variableAccessData = node.variableAccessData();
if (m_graph.argumentsRegisterFor(node.codeOrigin) == variableAccessData->local()
- || unmodifiedArgumentsRegister(m_graph.argumentsRegisterFor(node.codeOrigin)) == variableAccessData->local()) {
- // The child of this store should really be the empty value.
- Node emptyJSValue(JSConstant, node.codeOrigin, OpInfo(codeBlock()->addOrFindConstant(JSValue())));
- emptyJSValue.ref();
- NodeIndex emptyJSValueIndex = m_graph.size();
- m_graph.deref(node.child1());
- node.children.child1() = Edge(emptyJSValueIndex);
- m_graph.append(emptyJSValue);
- insertionSet.append(indexInBlock, emptyJSValueIndex);
- changed = true;
+ || unmodifiedArgumentsRegister(m_graph.argumentsRegisterFor(node.codeOrigin)) == variableAccessData->local())
break;
- }
+
ASSERT(!variableAccessData->isCaptured());
// If this is a store into a VariableAccessData* that is marked as
@@ -661,25 +646,8 @@ public:
insertionSet.execute(*block);
}
- if (changed) {
+ if (changed)
m_graph.collectGarbage();
-
- // Verify that PhantomArguments nodes are not shouldGenerate().
-#if !ASSERT_DISABLED
- for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
- BasicBlock* block = m_graph.m_blocks[blockIndex].get();
- if (!block)
- continue;
- for (unsigned indexInBlock = 0; indexInBlock < block->size(); ++indexInBlock) {
- NodeIndex nodeIndex = block->at(indexInBlock);
- Node& node = m_graph[nodeIndex];
- if (node.op() != PhantomArguments)
- continue;
- ASSERT(!node.shouldGenerate());
- }
- }
-#endif
- }
return changed;
}
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
index fe2a05b8b..12c9640c8 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
@@ -32,26 +32,39 @@
namespace JSC { namespace DFG {
-Array::Mode fromObserved(ArrayModes modes, bool makeSafe)
+Array::Mode fromObserved(ArrayProfile* profile, Array::Action action, bool makeSafe)
{
- // FIXME: we may want to add some polymorphic support in the future. That's why this
- // is a switch statement right now.
-
- switch (modes) {
+ switch (profile->observedArrayModes()) {
case 0:
+ return Array::Unprofiled;
+ case asArrayModes(NonArray):
+ if (action == Array::Write && !profile->mayInterceptIndexedAccesses())
+ return Array::BlankToArrayStorage; // FIXME: we don't know whether to go to slow put mode, or not. This is a decent guess.
return Array::Undecided;
case asArrayModes(NonArrayWithArrayStorage):
- return makeSafe ? Array::ArrayStorageOutOfBounds : Array::ArrayStorage;
+ return makeSafe ? Array::ArrayStorageOutOfBounds : (profile->mayStoreToHole() ? Array::ArrayStorageToHole : Array::ArrayStorage);
case asArrayModes(NonArrayWithSlowPutArrayStorage):
+ case asArrayModes(NonArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage):
return Array::SlowPutArrayStorage;
case asArrayModes(ArrayWithArrayStorage):
- return makeSafe ? Array::ArrayWithArrayStorageOutOfBounds : Array::ArrayWithArrayStorage;
+ return makeSafe ? Array::ArrayWithArrayStorageOutOfBounds : (profile->mayStoreToHole() ? Array::ArrayWithArrayStorageToHole : Array::ArrayWithArrayStorage);
case asArrayModes(ArrayWithSlowPutArrayStorage):
+ case asArrayModes(ArrayWithArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage):
return Array::ArrayWithSlowPutArrayStorage;
case asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage):
- return makeSafe ? Array::PossiblyArrayWithArrayStorageOutOfBounds : Array::PossiblyArrayWithArrayStorage;
+ return makeSafe ? Array::PossiblyArrayWithArrayStorageOutOfBounds : (profile->mayStoreToHole() ? Array::PossiblyArrayWithArrayStorageToHole : Array::PossiblyArrayWithArrayStorage);
case asArrayModes(NonArrayWithSlowPutArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage):
+ case asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage):
return Array::PossiblyArrayWithSlowPutArrayStorage;
+ case asArrayModes(NonArray) | asArrayModes(NonArrayWithArrayStorage):
+ if (action == Array::Write && !profile->mayInterceptIndexedAccesses())
+ return Array::BlankToArrayStorage;
+ return Array::Undecided;
+ case asArrayModes(NonArray) | asArrayModes(NonArrayWithSlowPutArrayStorage):
+ case asArrayModes(NonArray) | asArrayModes(NonArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage):
+ if (action == Array::Write && !profile->mayInterceptIndexedAccesses())
+ return Array::BlankToSlowPutArrayStorage;
+ return Array::Undecided;
default:
// We know that this is possibly a kind of array for which, though there is no
// useful data in the array profile, we may be able to extract useful data from
@@ -61,11 +74,6 @@ Array::Mode fromObserved(ArrayModes modes, bool makeSafe)
}
}
-Array::Mode fromStructure(Structure* structure, bool makeSafe)
-{
- return fromObserved(arrayModeFromStructure(structure), makeSafe);
-}
-
Array::Mode refineArrayMode(Array::Mode arrayMode, SpeculatedType base, SpeculatedType index)
{
if (!base || !index) {
@@ -79,6 +87,12 @@ Array::Mode refineArrayMode(Array::Mode arrayMode, SpeculatedType base, Speculat
if (!isInt32Speculation(index) || !isCellSpeculation(base))
return Array::Generic;
+ if (arrayMode == Array::Unprofiled) {
+ // If the indexing type wasn't recorded in the array profile but the values are
+ // base=cell property=int, then we know that this access didn't execute.
+ return Array::ForceExit;
+ }
+
if (arrayMode != Array::Undecided)
return arrayMode;
@@ -131,8 +145,10 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
return isStringSpeculation(value.m_type);
case Array::ArrayStorage:
+ case Array::ArrayStorageToHole:
case Array::ArrayStorageOutOfBounds:
case Array::PossiblyArrayWithArrayStorage:
+ case Array::PossiblyArrayWithArrayStorageToHole:
case Array::PossiblyArrayWithArrayStorageOutOfBounds:
return value.m_currentKnownStructure.hasSingleton()
&& (value.m_currentKnownStructure.singleton()->indexingType() & HasArrayStorage);
@@ -140,9 +156,10 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
case Array::SlowPutArrayStorage:
case Array::PossiblyArrayWithSlowPutArrayStorage:
return value.m_currentKnownStructure.hasSingleton()
- && (value.m_currentKnownStructure.singleton()->indexingType() & HasSlowPutArrayStorage);
+ && (value.m_currentKnownStructure.singleton()->indexingType() & (HasArrayStorage | HasSlowPutArrayStorage));
case Array::ArrayWithArrayStorage:
+ case Array::ArrayWithArrayStorageToHole:
case Array::ArrayWithArrayStorageOutOfBounds:
return value.m_currentKnownStructure.hasSingleton()
&& (value.m_currentKnownStructure.singleton()->indexingType() & HasArrayStorage)
@@ -150,9 +167,12 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
case Array::ArrayWithSlowPutArrayStorage:
return value.m_currentKnownStructure.hasSingleton()
- && (value.m_currentKnownStructure.singleton()->indexingType() & HasSlowPutArrayStorage)
+ && (value.m_currentKnownStructure.singleton()->indexingType() & (HasArrayStorage | HasSlowPutArrayStorage))
&& (value.m_currentKnownStructure.singleton()->indexingType() & IsArray);
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
+ return false;
+
case Array::Arguments:
return isArgumentsSpeculation(value.m_type);
@@ -184,6 +204,7 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
return isFloat64ArraySpeculation(value.m_type);
case Array::Undecided:
+ case Array::Unprofiled:
break;
}
@@ -196,6 +217,8 @@ const char* modeToString(Array::Mode mode)
switch (mode) {
case Array::Undecided:
return "Undecided";
+ case Array::Unprofiled:
+ return "Unprofiled";
case Array::Generic:
return "Generic";
case Array::ForceExit:
@@ -204,22 +227,32 @@ const char* modeToString(Array::Mode mode)
return "String";
case Array::ArrayStorage:
return "ArrayStorage";
+ case Array::ArrayStorageToHole:
+ return "ArrayStorageToHole";
case Array::SlowPutArrayStorage:
return "SlowPutArrayStorage";
case Array::ArrayStorageOutOfBounds:
return "ArrayStorageOutOfBounds";
case Array::ArrayWithArrayStorage:
return "ArrayWithArrayStorage";
+ case Array::ArrayWithArrayStorageToHole:
+ return "ArrayWithArrayStorageToHole";
case Array::ArrayWithSlowPutArrayStorage:
return "ArrayWithSlowPutArrayStorage";
case Array::ArrayWithArrayStorageOutOfBounds:
return "ArrayWithArrayStorageOutOfBounds";
case Array::PossiblyArrayWithArrayStorage:
return "PossiblyArrayWithArrayStorage";
+ case Array::PossiblyArrayWithArrayStorageToHole:
+ return "PossiblyArrayWithArrayStorageToHole";
case Array::PossiblyArrayWithSlowPutArrayStorage:
return "PossiblyArrayWithSlowPutArrayStorage";
case Array::PossiblyArrayWithArrayStorageOutOfBounds:
return "PossiblyArrayWithArrayStorageOutOfBounds";
+ case Array::BlankToArrayStorage:
+ return "BlankToArrayStorage";
+ case Array::BlankToSlowPutArrayStorage:
+ return "BlankToSlowPutArrayStorage";
case Array::Arguments:
return "Arguments";
case Array::Int8Array:
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.h b/Source/JavaScriptCore/dfg/DFGArrayMode.h
index cc8b1b809..d4be9c0eb 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.h
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.h
@@ -41,20 +41,36 @@ struct AbstractValue;
// that would otherwise occur, since we say things like "Int8Array" and "JSArray"
// in lots of other places, to mean subtly different things.
namespace Array {
+enum Action {
+ Read,
+ Write
+};
+
enum Mode {
Undecided, // Implies that we need predictions to decide. We will never get to the backend in this mode.
+ Unprofiled, // Implies that array profiling didn't see anything. But that could be because the operands didn't comply with basic type assumptions (base is cell, property is int). This either becomes Generic or ForceExit depending on value profiling.
ForceExit, // Implies that we have no idea how to execute this operation, so we should just give up.
Generic,
String,
+
+ // Modes of conventional indexed storage where the check is non side-effecting.
ArrayStorage,
+ ArrayStorageToHole,
SlowPutArrayStorage,
ArrayStorageOutOfBounds,
ArrayWithArrayStorage,
+ ArrayWithArrayStorageToHole,
ArrayWithSlowPutArrayStorage,
ArrayWithArrayStorageOutOfBounds,
PossiblyArrayWithArrayStorage,
+ PossiblyArrayWithArrayStorageToHole,
PossiblyArrayWithSlowPutArrayStorage,
PossiblyArrayWithArrayStorageOutOfBounds,
+
+ // Modes of conventional indexed storage where the check is side-effecting.
+ BlankToArrayStorage,
+ BlankToSlowPutArrayStorage,
+
Arguments,
Int8Array,
Int16Array,
@@ -71,22 +87,32 @@ enum Mode {
// Helpers for 'case' statements. For example, saying "case AllArrayStorageModes:"
// is the same as having multiple case statements listing off all of the modes that
// have the word "ArrayStorage" in them.
+
+// First: helpers for non-side-effecting checks.
#define NON_ARRAY_ARRAY_STORAGE_MODES \
Array::ArrayStorage: \
+ case Array::ArrayStorageToHole: \
case Array::SlowPutArrayStorage: \
case Array::ArrayStorageOutOfBounds: \
case Array::PossiblyArrayWithArrayStorage: \
+ case Array::PossiblyArrayWithArrayStorageToHole: \
case Array::PossiblyArrayWithSlowPutArrayStorage: \
case Array::PossiblyArrayWithArrayStorageOutOfBounds
#define ARRAY_WITH_ARRAY_STORAGE_MODES \
Array::ArrayWithArrayStorage: \
+ case Array::ArrayWithArrayStorageToHole: \
case Array::ArrayWithSlowPutArrayStorage: \
case Array::ArrayWithArrayStorageOutOfBounds
#define ALL_ARRAY_STORAGE_MODES \
NON_ARRAY_ARRAY_STORAGE_MODES: \
case ARRAY_WITH_ARRAY_STORAGE_MODES
+#define ARRAY_STORAGE_TO_HOLE_MODES \
+ Array::ArrayStorageToHole: \
+ case Array::ArrayWithArrayStorageToHole: \
+ case Array::PossiblyArrayWithArrayStorageToHole
#define IN_BOUNDS_ARRAY_STORAGE_MODES \
- Array::ArrayStorage: \
+ ARRAY_STORAGE_TO_HOLE_MODES: \
+ case Array::ArrayStorage: \
case Array::ArrayWithArrayStorage: \
case Array::PossiblyArrayWithArrayStorage
#define SLOW_PUT_ARRAY_STORAGE_MODES \
@@ -99,9 +125,16 @@ enum Mode {
case Array::ArrayWithArrayStorageOutOfBounds: \
case Array::PossiblyArrayWithArrayStorageOutOfBounds
-Array::Mode fromObserved(ArrayModes modes, bool makeSafe);
+// Next: helpers for side-effecting checks.
+#define EFFECTFUL_NON_ARRAY_ARRAY_STORAGE_MODES \
+ Array::BlankToArrayStorage: \
+ case Array::BlankToSlowPutArrayStorage
+#define ALL_EFFECTFUL_ARRAY_STORAGE_MODES \
+ EFFECTFUL_NON_ARRAY_ARRAY_STORAGE_MODES
+#define SLOW_PUT_EFFECTFUL_ARRAY_STORAGE_MODES \
+ Array::BlankToSlowPutArrayStorage
-Array::Mode fromStructure(Structure*, bool makeSafe);
+Array::Mode fromObserved(ArrayProfile*, Array::Action, bool makeSafe);
Array::Mode refineArrayMode(Array::Mode, SpeculatedType base, SpeculatedType index);
@@ -113,6 +146,7 @@ inline bool modeUsesButterfly(Array::Mode arrayMode)
{
switch (arrayMode) {
case ALL_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
return true;
default:
return false;
@@ -143,6 +177,19 @@ inline bool isSlowPutAccess(Array::Mode arrayMode)
{
switch (arrayMode) {
case SLOW_PUT_ARRAY_STORAGE_MODES:
+ case SLOW_PUT_EFFECTFUL_ARRAY_STORAGE_MODES:
+ return true;
+ default:
+ return false;
+ }
+}
+
+inline bool mayStoreToHole(Array::Mode arrayMode)
+{
+ switch (arrayMode) {
+ case ARRAY_STORAGE_TO_HOLE_MODES:
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
return true;
default:
return false;
@@ -153,6 +200,7 @@ inline bool canCSEStorage(Array::Mode arrayMode)
{
switch (arrayMode) {
case Array::Undecided:
+ case Array::Unprofiled:
case Array::ForceExit:
case Array::Generic:
case Array::Arguments:
@@ -185,6 +233,7 @@ inline bool modeIsSpecific(Array::Mode mode)
{
switch (mode) {
case Array::Undecided:
+ case Array::Unprofiled:
case Array::ForceExit:
case Array::Generic:
return false;
@@ -197,6 +246,7 @@ inline bool modeSupportsLength(Array::Mode mode)
{
switch (mode) {
case Array::Undecided:
+ case Array::Unprofiled:
case Array::ForceExit:
case Array::Generic:
case NON_ARRAY_ARRAY_STORAGE_MODES:
@@ -206,6 +256,30 @@ inline bool modeSupportsLength(Array::Mode mode)
}
}
+inline bool benefitsFromStructureCheck(Array::Mode mode)
+{
+ switch (mode) {
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
+ case Array::Undecided:
+ case Array::Unprofiled:
+ case Array::ForceExit:
+ case Array::Generic:
+ return false;
+ default:
+ return true;
+ }
+}
+
+inline bool isEffectful(Array::Mode mode)
+{
+ switch (mode) {
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
+ return true;
+ default:
+ return false;
+ }
+}
+
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index f8ef37b03..fb897ff5b 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -828,26 +828,29 @@ private:
Array::Mode getArrayMode(ArrayProfile* profile)
{
profile->computeUpdatedPrediction();
- return fromObserved(profile->observedArrayModes(), false);
+ return fromObserved(profile, Array::Read, false);
}
- Array::Mode getArrayModeAndEmitChecks(ArrayProfile* profile, NodeIndex base)
+ Array::Mode getArrayModeAndEmitChecks(ArrayProfile* profile, Array::Action action, NodeIndex base)
{
profile->computeUpdatedPrediction();
- if (profile->hasDefiniteStructure())
- addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
if (m_inlineStackTop->m_profiledBlock->numberOfRareCaseProfiles())
dataLog("Slow case profile for bc#%u: %u\n", m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);
- dataLog("Array profile for bc#%u: %p%s, %u\n", m_currentIndex, profile->expectedStructure(), profile->structureIsPolymorphic() ? " (polymorphic)" : "", profile->observedArrayModes());
+ dataLog("Array profile for bc#%u: %p%s%s, %u\n", m_currentIndex, profile->expectedStructure(), profile->structureIsPolymorphic() ? " (polymorphic)" : "", profile->mayInterceptIndexedAccesses() ? " (may intercept)" : "", profile->observedArrayModes());
#endif
bool makeSafe =
m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)
|| m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, OutOfBounds);
- return fromObserved(profile->observedArrayModes(), makeSafe);
+ Array::Mode result = fromObserved(profile, action, makeSafe);
+
+ if (profile->hasDefiniteStructure() && benefitsFromStructureCheck(result))
+ addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
+
+ return result;
}
NodeIndex makeSafe(NodeIndex nodeIndex)
@@ -2188,7 +2191,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
SpeculatedType prediction = getPrediction();
NodeIndex base = get(currentInstruction[2].u.operand);
- Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, base);
+ Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, Array::Read, base);
NodeIndex property = get(currentInstruction[3].u.operand);
NodeIndex getByVal = addToGraph(GetByVal, OpInfo(arrayMode), OpInfo(prediction), base, property);
set(currentInstruction[1].u.operand, getByVal);
@@ -2199,7 +2202,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
case op_put_by_val: {
NodeIndex base = get(currentInstruction[1].u.operand);
- Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, base);
+ Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, Array::Write, base);
NodeIndex property = get(currentInstruction[2].u.operand);
NodeIndex value = get(currentInstruction[3].u.operand);
diff --git a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
index 0914f62c6..111c15f17 100644
--- a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
@@ -592,6 +592,7 @@ private:
case AllocatePropertyStorage:
case ReallocatePropertyStorage:
+ case Arrayify:
// If we can cheaply prove this is a change to our object's storage, we
// can optimize and use its result.
if (node.child1() == child1)
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 2f92e5608..aa2d5dff4 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -90,7 +90,7 @@ private:
if (arrayProfile) {
arrayProfile->computeUpdatedPrediction();
arrayMode = refineArrayMode(
- fromObserved(arrayProfile->observedArrayModes(), false),
+ fromObserved(arrayProfile, Array::Read, false),
m_graph[node.child1()].prediction(),
m_graph[m_compileIndex].prediction());
if (modeSupportsLength(arrayMode) && arrayProfile->hasDefiniteStructure()) {
@@ -380,6 +380,23 @@ private:
ASSERT(modeIsSpecific(arrayMode));
m_graph.ref(array);
+
+ if (isEffectful(arrayMode)) {
+ Node arrayify(Arrayify, codeOrigin, OpInfo(arrayMode), array);
+ arrayify.ref(); // Once because it's used as a butterfly.
+ arrayify.ref(); // And twice because it's must-generate.
+ NodeIndex arrayifyIndex = m_graph.size();
+ m_graph.append(arrayify);
+ m_insertionSet.append(m_indexInBlock, arrayifyIndex);
+
+ ASSERT(storageCheck == canCSEStorage);
+ ASSERT(shouldGenerate);
+ ASSERT(canCSEStorage(arrayMode));
+ ASSERT(modeUsesButterfly(arrayMode));
+
+ return arrayifyIndex;
+ }
+
Node checkArray(CheckArray, codeOrigin, OpInfo(arrayMode), array);
checkArray.ref();
NodeIndex checkArrayIndex = m_graph.size();
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index 4166f72c9..64d81f526 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -474,6 +474,7 @@ public:
switch (node.arrayMode()) {
case Array::Generic:
case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES:
return false;
case Array::String:
return node.op() == GetByVal;
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index a4358798a..195135c7b 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -740,6 +740,7 @@ struct Node {
case StringCharAt:
case StringCharCodeAt:
case CheckArray:
+ case Arrayify:
case ArrayPush:
case ArrayPop:
return true;
@@ -806,6 +807,7 @@ struct Node {
case ValueToInt32:
case UInt32ToNumber:
case DoubleAsInt32:
+ case PhantomArguments:
return true;
case Phantom:
case Nop:
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index 4c2a85ccc..584e28cca 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -139,6 +139,7 @@ namespace JSC { namespace DFG {
macro(ReallocatePropertyStorage, NodeMustGenerate | NodeDoesNotExit | NodeResultStorage) \
macro(GetButterfly, NodeResultStorage) \
macro(CheckArray, NodeMustGenerate) \
+ macro(Arrayify, NodeResultStorage | NodeMustGenerate | NodeClobbersWorld) \
macro(GetIndexedPropertyStorage, NodeResultStorage) \
macro(GetByOffset, NodeResultJS) \
macro(PutByOffset, NodeMustGenerate) \
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
index 6bc136da4..8c8e2f949 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
@@ -612,6 +612,9 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
// registers.
if (haveArguments) {
+ HashSet<InlineCallFrame*, DefaultHash<InlineCallFrame*>::Hash,
+ NullableHashTraits<InlineCallFrame*> > didCreateArgumentsObject;
+
for (size_t index = 0; index < operands.size(); ++index) {
const ValueRecovery& recovery = operands[index];
if (recovery.technique() != ArgumentsThatWereNotCreated)
@@ -627,44 +630,42 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
break;
}
}
+
int argumentsRegister = m_jit.argumentsRegisterFor(inlineCallFrame);
-
- m_jit.load32(AssemblyHelpers::payloadFor(argumentsRegister), GPRInfo::regT0);
- AssemblyHelpers::Jump haveArguments = m_jit.branch32(
- AssemblyHelpers::NotEqual,
- AssemblyHelpers::tagFor(argumentsRegister),
- AssemblyHelpers::TrustedImm32(JSValue::EmptyValueTag));
-
- if (inlineCallFrame) {
- m_jit.setupArgumentsWithExecState(
- AssemblyHelpers::TrustedImmPtr(inlineCallFrame));
- m_jit.move(
- AssemblyHelpers::TrustedImmPtr(
- bitwise_cast<void*>(operationCreateInlinedArguments)),
- GPRInfo::nonArgGPR0);
- } else {
- m_jit.setupArgumentsExecState();
- m_jit.move(
- AssemblyHelpers::TrustedImmPtr(
- bitwise_cast<void*>(operationCreateArguments)),
- GPRInfo::nonArgGPR0);
+ if (didCreateArgumentsObject.add(inlineCallFrame).isNewEntry) {
+ // We know this call frame optimized out an arguments object that
+ // the baseline JIT would have created. Do that creation now.
+ if (inlineCallFrame) {
+ m_jit.setupArgumentsWithExecState(
+ AssemblyHelpers::TrustedImmPtr(inlineCallFrame));
+ m_jit.move(
+ AssemblyHelpers::TrustedImmPtr(
+ bitwise_cast<void*>(operationCreateInlinedArguments)),
+ GPRInfo::nonArgGPR0);
+ } else {
+ m_jit.setupArgumentsExecState();
+ m_jit.move(
+ AssemblyHelpers::TrustedImmPtr(
+ bitwise_cast<void*>(operationCreateArguments)),
+ GPRInfo::nonArgGPR0);
+ }
+ m_jit.call(GPRInfo::nonArgGPR0);
+ m_jit.store32(
+ AssemblyHelpers::TrustedImm32(JSValue::CellTag),
+ AssemblyHelpers::tagFor(argumentsRegister));
+ m_jit.store32(
+ GPRInfo::returnValueGPR,
+ AssemblyHelpers::payloadFor(argumentsRegister));
+ m_jit.store32(
+ AssemblyHelpers::TrustedImm32(JSValue::CellTag),
+ AssemblyHelpers::tagFor(unmodifiedArgumentsRegister(argumentsRegister)));
+ m_jit.store32(
+ GPRInfo::returnValueGPR,
+ AssemblyHelpers::payloadFor(unmodifiedArgumentsRegister(argumentsRegister)));
+ m_jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); // no-op move on almost all platforms.
}
- m_jit.call(GPRInfo::nonArgGPR0);
- m_jit.store32(
- AssemblyHelpers::TrustedImm32(JSValue::CellTag),
- AssemblyHelpers::tagFor(argumentsRegister));
- m_jit.store32(
- GPRInfo::returnValueGPR,
- AssemblyHelpers::payloadFor(argumentsRegister));
- m_jit.store32(
- AssemblyHelpers::TrustedImm32(JSValue::CellTag),
- AssemblyHelpers::tagFor(unmodifiedArgumentsRegister(argumentsRegister)));
- m_jit.store32(
- GPRInfo::returnValueGPR,
- AssemblyHelpers::payloadFor(unmodifiedArgumentsRegister(argumentsRegister)));
- m_jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); // no-op move on almost all platforms.
-
- haveArguments.link(&m_jit);
+
+ m_jit.load32(AssemblyHelpers::payloadFor(argumentsRegister), GPRInfo::regT0);
m_jit.store32(
AssemblyHelpers::TrustedImm32(JSValue::CellTag),
AssemblyHelpers::tagFor(operand));
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
index 2f38ba79b..fcaf0a4bc 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
@@ -587,6 +587,9 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
// registers.
if (haveArguments) {
+ HashSet<InlineCallFrame*, DefaultHash<InlineCallFrame*>::Hash,
+ NullableHashTraits<InlineCallFrame*> > didCreateArgumentsObject;
+
for (size_t index = 0; index < operands.size(); ++index) {
const ValueRecovery& recovery = operands[index];
if (recovery.technique() != ArgumentsThatWereNotCreated)
@@ -602,29 +605,29 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
break;
}
}
+
int argumentsRegister = m_jit.argumentsRegisterFor(inlineCallFrame);
-
+ if (didCreateArgumentsObject.add(inlineCallFrame).isNewEntry) {
+ // We know this call frame optimized out an arguments object that
+ // the baseline JIT would have created. Do that creation now.
+ if (inlineCallFrame) {
+ m_jit.addPtr(AssemblyHelpers::TrustedImm32(inlineCallFrame->stackOffset * sizeof(EncodedJSValue)), GPRInfo::callFrameRegister, GPRInfo::regT0);
+ m_jit.setupArguments(GPRInfo::regT0);
+ } else
+ m_jit.setupArgumentsExecState();
+ m_jit.move(
+ AssemblyHelpers::TrustedImmPtr(
+ bitwise_cast<void*>(operationCreateArguments)),
+ GPRInfo::nonArgGPR0);
+ m_jit.call(GPRInfo::nonArgGPR0);
+ m_jit.storePtr(GPRInfo::returnValueGPR, AssemblyHelpers::addressFor(argumentsRegister));
+ m_jit.storePtr(
+ GPRInfo::returnValueGPR,
+ AssemblyHelpers::addressFor(unmodifiedArgumentsRegister(argumentsRegister)));
+ m_jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); // no-op move on almost all platforms.
+ }
+
m_jit.loadPtr(AssemblyHelpers::addressFor(argumentsRegister), GPRInfo::regT0);
- AssemblyHelpers::Jump haveArguments = m_jit.branchTestPtr(
- AssemblyHelpers::NonZero, GPRInfo::regT0);
-
- if (inlineCallFrame) {
- m_jit.addPtr(AssemblyHelpers::TrustedImm32(inlineCallFrame->stackOffset * sizeof(EncodedJSValue)), GPRInfo::callFrameRegister, GPRInfo::regT0);
- m_jit.setupArguments(GPRInfo::regT0);
- } else
- m_jit.setupArgumentsExecState();
- m_jit.move(
- AssemblyHelpers::TrustedImmPtr(
- bitwise_cast<void*>(operationCreateArguments)),
- GPRInfo::nonArgGPR0);
- m_jit.call(GPRInfo::nonArgGPR0);
- m_jit.storePtr(GPRInfo::returnValueGPR, AssemblyHelpers::addressFor(argumentsRegister));
- m_jit.storePtr(
- GPRInfo::returnValueGPR,
- AssemblyHelpers::addressFor(unmodifiedArgumentsRegister(argumentsRegister)));
- m_jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); // no-op move on almost all platforms.
-
- haveArguments.link(&m_jit);
m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
}
}
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index 67ae7bf03..3452b2f0d 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -1193,9 +1193,11 @@ void DFG_OPERATION operationTearOffInlinedArguments(
EncodedJSValue DFG_OPERATION operationGetArgumentsLength(ExecState* exec, int32_t argumentsRegister)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
// Here we can assume that the argumernts were created. Because otherwise the JIT code would
// have not made this call.
- Identifier ident(&exec->globalData(), "length");
+ Identifier ident(&globalData, "length");
JSValue baseValue = exec->uncheckedR(argumentsRegister).jsValue();
PropertySlot slot(baseValue);
return JSValue::encode(baseValue.get(exec, ident, slot));
@@ -1203,6 +1205,9 @@ EncodedJSValue DFG_OPERATION operationGetArgumentsLength(ExecState* exec, int32_
EncodedJSValue DFG_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t argumentsRegister, int32_t index)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
JSValue argumentsValue = exec->uncheckedR(argumentsRegister).jsValue();
// If there are no arguments, and we're accessing out of bounds, then we have to create the
@@ -1216,6 +1221,9 @@ EncodedJSValue DFG_OPERATION operationGetArgumentByVal(ExecState* exec, int32_t
EncodedJSValue DFG_OPERATION operationGetInlinedArgumentByVal(
ExecState* exec, int32_t argumentsRegister, InlineCallFrame* inlineCallFrame, int32_t index)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
JSValue argumentsValue = exec->uncheckedR(argumentsRegister).jsValue();
// If there are no arguments, and we're accessing out of bounds, then we have to create the
@@ -1239,6 +1247,10 @@ JSCell* DFG_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExec
JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState* exec, JSCell* functionExecutableAsCell)
{
ASSERT(functionExecutableAsCell->inherits(&FunctionExecutable::s_info));
+
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
FunctionExecutable* functionExecutable =
static_cast<FunctionExecutable*>(functionExecutableAsCell);
return JSFunction::create(exec, functionExecutable, exec->scope());
@@ -1257,6 +1269,8 @@ size_t DFG_OPERATION operationIsFunction(EncodedJSValue value)
void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState* exec, JSObject* base, Structure* structure, PropertyOffset offset, EncodedJSValue value)
{
JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
ASSERT(structure->outOfLineCapacity() > base->structure()->outOfLineCapacity());
ASSERT(!globalData.heap.storageAllocator().fastPathShouldSucceed(structure->outOfLineCapacity() * sizeof(JSValue)));
base->setStructureAndReallocateStorageIfNecessary(globalData, structure);
@@ -1265,31 +1279,51 @@ void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState* exec, JSObj
char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
return reinterpret_cast<char*>(
- Butterfly::createUninitialized(exec->globalData(), 0, initialOutOfLineCapacity, false, 0));
+ Butterfly::createUninitialized(globalData, 0, initialOutOfLineCapacity, false, 0));
}
char* DFG_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
return reinterpret_cast<char*>(
- Butterfly::createUninitialized(exec->globalData(), 0, newSize, false, 0));
+ Butterfly::createUninitialized(globalData, 0, newSize, false, 0));
}
char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)
{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
ASSERT(!object->structure()->outOfLineCapacity());
- Butterfly* result = object->growOutOfLineStorage(exec->globalData(), 0, initialOutOfLineCapacity);
+ Butterfly* result = object->growOutOfLineStorage(globalData, 0, initialOutOfLineCapacity);
object->setButterflyWithoutChangingStructure(result);
return reinterpret_cast<char*>(result);
}
char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)
{
- Butterfly* result = object->growOutOfLineStorage(exec->globalData(), object->structure()->outOfLineCapacity(), newSize);
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
+ Butterfly* result = object->growOutOfLineStorage(globalData, object->structure()->outOfLineCapacity(), newSize);
object->setButterflyWithoutChangingStructure(result);
return reinterpret_cast<char*>(result);
}
+char* DFG_OPERATION operationEnsureArrayStorage(ExecState* exec, JSObject* object)
+{
+ JSGlobalData& globalData = exec->globalData();
+ NativeCallFrameTracer tracer(&globalData, exec);
+
+ return reinterpret_cast<char*>(object->ensureArrayStorage(globalData));
+}
+
double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b)
{
return fmod(a, b);
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.h b/Source/JavaScriptCore/dfg/DFGOperations.h
index 02c6b3ab3..f86f5cf1f 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.h
+++ b/Source/JavaScriptCore/dfg/DFGOperations.h
@@ -193,6 +193,7 @@ char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecStat
char* DFG_OPERATION operationAllocatePropertyStorage(ExecState*, size_t newSize) WTF_INTERNAL;
char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState*, JSObject*) WTF_INTERNAL;
char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState*, JSObject*, size_t newSize) WTF_INTERNAL;
+char* DFG_OPERATION operationEnsureArrayStorage(ExecState*, JSObject*);
// This method is used to lookup an exception hander, keyed by faultLocation, which is
// the return location from one of the calls out to one of the helper operations above.
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index 5b23650fa..a918bbbe5 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -619,7 +619,8 @@ private:
case GetMyArgumentByVal:
case PhantomPutStructure:
case PhantomArguments:
- case CheckArray: {
+ case CheckArray:
+ case Arrayify: {
// This node should never be visible at this stage of compilation. It is
// inserted by fixup(), which follows this phase.
ASSERT_NOT_REACHED();
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 07cb11032..0228f846a 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -325,7 +325,7 @@ void SpeculativeJIT::checkArray(Node& node)
MacroAssembler::Zero,
MacroAssembler::Address(temp.gpr(), Structure::indexingTypeOffset()),
MacroAssembler::TrustedImm32(
- isSlowPutAccess(node.arrayMode()) ? HasSlowPutArrayStorage : HasArrayStorage)));
+ isSlowPutAccess(node.arrayMode()) ? (HasArrayStorage | HasSlowPutArrayStorage) : HasArrayStorage)));
noResult(m_compileIndex);
return;
@@ -347,7 +347,7 @@ void SpeculativeJIT::checkArray(Node& node)
Uncountable, JSValueRegs(), NoNode,
m_jit.branchTest32(
MacroAssembler::Zero, tempGPR, MacroAssembler::TrustedImm32(
- isSlowPutAccess(node.arrayMode()) ? HasSlowPutArrayStorage : HasArrayStorage)));
+ isSlowPutAccess(node.arrayMode()) ? (HasArrayStorage | HasSlowPutArrayStorage) : HasArrayStorage)));
noResult(m_compileIndex);
return;
@@ -384,6 +384,80 @@ void SpeculativeJIT::checkArray(Node& node)
noResult(m_compileIndex);
}
+void SpeculativeJIT::arrayify(Node& node)
+{
+ ASSERT(modeIsSpecific(node.arrayMode()));
+ ASSERT(!modeAlreadyChecked(m_state.forNode(node.child1()), node.arrayMode()));
+
+ SpeculateCellOperand base(this, node.child1());
+ GPRReg baseReg = base.gpr();
+
+ switch (node.arrayMode()) {
+ case EFFECTFUL_NON_ARRAY_ARRAY_STORAGE_MODES: {
+ GPRTemporary structure(this);
+ GPRTemporary temp(this);
+ GPRReg structureGPR = structure.gpr();
+ GPRReg tempGPR = temp.gpr();
+
+ m_jit.loadPtr(
+ MacroAssembler::Address(baseReg, JSCell::structureOffset()), structureGPR);
+
+ // We can skip all that comes next if we already have array storage.
+ IndexingType desiredIndexingTypeMask =
+ isSlowPutAccess(node.arrayMode()) ? (HasArrayStorage | HasSlowPutArrayStorage) : HasArrayStorage;
+ MacroAssembler::Jump slowCase = m_jit.branchTest8(
+ MacroAssembler::Zero,
+ MacroAssembler::Address(structureGPR, Structure::indexingTypeOffset()),
+ MacroAssembler::TrustedImm32(desiredIndexingTypeMask));
+
+ m_jit.loadPtr(
+ MacroAssembler::Address(baseReg, JSObject::butterflyOffset()), tempGPR);
+
+ MacroAssembler::Jump done = m_jit.jump();
+
+ slowCase.link(&m_jit);
+
+ // Next check that the object does not intercept indexed accesses. If it does,
+ // then this mode won't work.
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchTest8(
+ MacroAssembler::NonZero,
+ MacroAssembler::Address(structureGPR, Structure::typeInfoFlagsOffset()),
+ MacroAssembler::TrustedImm32(InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero)));
+
+ // Now call out to create the array storage.
+ silentSpillAllRegisters(tempGPR);
+ callOperation(operationEnsureArrayStorage, tempGPR, baseReg);
+ silentFillAllRegisters(tempGPR);
+
+ // Alas, we need to reload the structure because silent spilling does not save
+ // temporaries. Nor would it be useful for it to do so. Either way we're talking
+ // about a load.
+ m_jit.loadPtr(
+ MacroAssembler::Address(baseReg, JSCell::structureOffset()), structureGPR);
+
+ // Finally, check that we have the kind of array storage that we wanted to get.
+ // Note that this is a backwards speculation check, which will result in the
+ // bytecode operation corresponding to this arrayification being reexecuted.
+ // That's fine, since arrayification is not user-visible.
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchTest8(
+ MacroAssembler::Zero,
+ MacroAssembler::Address(structureGPR, Structure::indexingTypeOffset()),
+ MacroAssembler::TrustedImm32(desiredIndexingTypeMask)));
+
+ done.link(&m_jit);
+ storageResult(tempGPR, m_compileIndex);
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+}
+
GPRReg SpeculativeJIT::fillStorage(NodeIndex nodeIndex)
{
Node& node = m_jit.graph()[nodeIndex];
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 286b72c1a..15314b2f2 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -2265,6 +2265,7 @@ public:
const TypedArrayDescriptor* typedArrayDescriptor(Array::Mode);
void checkArray(Node&);
+ void arrayify(Node&);
template<bool strict>
GPRReg fillSpeculateIntInternal(NodeIndex, DataFormat& returnFormat);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 85e32ddb9..22941358a 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -2055,9 +2055,6 @@ void SpeculativeJIT::compile(Node& node)
break;
case PhantomArguments:
- // This should never be must-generate.
- ASSERT_NOT_REACHED();
- // But as a release-mode fall-back make it the empty value.
initConstantInfo(m_compileIndex);
break;
@@ -2244,6 +2241,15 @@ void SpeculativeJIT::compile(Node& node)
m_jit.store32(value.tagGPR(), JITCompiler::tagFor(node.local()));
noResult(m_compileIndex);
recordSetLocal(node.local(), ValueSource(ValueInRegisterFile));
+
+ // If we're storing an arguments object that has been optimized away,
+ // our variable event stream for OSR exit now reflects the optimized
+ // value (JSValue()). On the slow path, we want an arguments object
+ // instead. We add an additional move hint to show OSR exit that it
+ // needs to reconstruct the arguments object.
+ if (at(node.child1()).op() == PhantomArguments)
+ compileMovHint(node);
+
break;
}
@@ -2531,6 +2537,11 @@ void SpeculativeJIT::compile(Node& node)
checkArray(node);
break;
}
+
+ case Arrayify: {
+ arrayify(node);
+ break;
+ }
case GetByVal: {
switch (node.arrayMode()) {
@@ -2575,7 +2586,8 @@ void SpeculativeJIT::compile(Node& node)
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
- case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES: {
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES: {
SpeculateCellOperand base(this, node.child1());
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
@@ -2702,7 +2714,8 @@ void SpeculativeJIT::compile(Node& node)
GPRReg propertyReg = property.gpr();
switch (arrayMode) {
- case ALL_ARRAY_STORAGE_MODES: {
+ case ALL_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES: {
JSValueOperand value(this, child3);
GPRReg valueTagReg = value.tagGPR();
@@ -2734,31 +2747,40 @@ void SpeculativeJIT::compile(Node& node)
if (isInBoundsAccess(node.arrayMode()))
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, beyondArrayBounds);
- base.use();
- property.use();
- value.use();
- storage.use();
-
// Check if we're writing to a hole; if so increment m_numValuesInVector.
- MacroAssembler::Jump notHoleValue = m_jit.branch32(MacroAssembler::NotEqual, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));
MacroAssembler::Jump isHoleValue;
- if (isSlowPutAccess(arrayMode)) {
- // This is sort of strange. If we wanted to optimize this code path, we would invert
- // the above branch. But it's simply not worth it since this only happens if we're
- // already having a bad time.
- isHoleValue = m_jit.jump();
+ if (!mayStoreToHole(arrayMode)) {
+ // This is uncountable because if we take this exit, then the baseline JIT
+ // will immediately count the hole store. So there is no need for exit
+ // profiling.
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branch32(MacroAssembler::Equal, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag)));
} else {
- m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
-
- // If we're writing to a hole we might be growing the array;
- MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
- m_jit.add32(TrustedImm32(1), propertyReg);
- m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
- m_jit.sub32(TrustedImm32(1), propertyReg);
-
- lengthDoesNotNeedUpdate.link(&m_jit);
+ MacroAssembler::Jump notHoleValue = m_jit.branch32(MacroAssembler::NotEqual, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));
+ if (isSlowPutAccess(arrayMode)) {
+ // This is sort of strange. If we wanted to optimize this code path, we would invert
+ // the above branch. But it's simply not worth it since this only happens if we're
+ // already having a bad time.
+ isHoleValue = m_jit.jump();
+ } else {
+ m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
+
+ // If we're writing to a hole we might be growing the array;
+ MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
+ m_jit.add32(TrustedImm32(1), propertyReg);
+ m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
+ m_jit.sub32(TrustedImm32(1), propertyReg);
+
+ lengthDoesNotNeedUpdate.link(&m_jit);
+ }
+ notHoleValue.link(&m_jit);
}
- notHoleValue.link(&m_jit);
+
+ base.use();
+ property.use();
+ value.use();
+ storage.use();
// Store the value to the array.
m_jit.store32(valueTagReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index f050af699..87be658ad 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -2119,9 +2119,6 @@ void SpeculativeJIT::compile(Node& node)
break;
case PhantomArguments:
- // This should never be must-generate.
- ASSERT_NOT_REACHED();
- // But as a release-mode fall-back make it the empty value.
initConstantInfo(m_compileIndex);
break;
@@ -2280,6 +2277,15 @@ void SpeculativeJIT::compile(Node& node)
noResult(m_compileIndex);
recordSetLocal(node.local(), ValueSource(ValueInRegisterFile));
+
+ // If we're storing an arguments object that has been optimized away,
+ // our variable event stream for OSR exit now reflects the optimized
+ // value (JSValue()). On the slow path, we want an arguments object
+ // instead. We add an additional move hint to show OSR exit that it
+ // needs to reconstruct the arguments object.
+ if (at(node.child1()).op() == PhantomArguments)
+ compileMovHint(node);
+
break;
}
@@ -2563,6 +2569,11 @@ void SpeculativeJIT::compile(Node& node)
checkArray(node);
break;
}
+
+ case Arrayify: {
+ arrayify(node);
+ break;
+ }
case GetByVal: {
switch (node.arrayMode()) {
@@ -2603,7 +2614,8 @@ void SpeculativeJIT::compile(Node& node)
jsValueResult(result.gpr(), m_compileIndex);
break;
}
- case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES: {
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES: {
SpeculateCellOperand base(this, node.child1());
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
@@ -2723,7 +2735,8 @@ void SpeculativeJIT::compile(Node& node)
GPRReg propertyReg = property.gpr();
switch (arrayMode) {
- case ALL_ARRAY_STORAGE_MODES: {
+ case ALL_ARRAY_STORAGE_MODES:
+ case ALL_EFFECTFUL_ARRAY_STORAGE_MODES: {
JSValueOperand value(this, child3);
GPRReg valueReg = value.gpr();
@@ -2753,31 +2766,40 @@ void SpeculativeJIT::compile(Node& node)
if (isInBoundsAccess(arrayMode))
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, beyondArrayBounds);
- base.use();
- property.use();
- value.use();
- storage.use();
-
// Check if we're writing to a hole; if so increment m_numValuesInVector.
- MacroAssembler::Jump notHoleValue = m_jit.branchTestPtr(MacroAssembler::NonZero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
MacroAssembler::Jump isHoleValue;
- if (isSlowPutAccess(arrayMode)) {
- // This is sort of strange. If we wanted to optimize this code path, we would invert
- // the above branch. But it's simply not worth it since this only happens if we're
- // already having a bad time.
- isHoleValue = m_jit.jump();
+ if (!mayStoreToHole(arrayMode)) {
+ // This is uncountable because if we take this exit, then the baseline JIT
+ // will immediately count the hole store. So there is no need for exit
+ // profiling.
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchTestPtr(MacroAssembler::Zero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))));
} else {
- m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
+ MacroAssembler::Jump notHoleValue = m_jit.branchTestPtr(MacroAssembler::NonZero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ if (isSlowPutAccess(arrayMode)) {
+ // This is sort of strange. If we wanted to optimize this code path, we would invert
+ // the above branch. But it's simply not worth it since this only happens if we're
+ // already having a bad time.
+ isHoleValue = m_jit.jump();
+ } else {
+ m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
- // If we're writing to a hole we might be growing the array;
- MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
- m_jit.add32(TrustedImm32(1), propertyReg);
- m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
- m_jit.sub32(TrustedImm32(1), propertyReg);
+ // If we're writing to a hole we might be growing the array;
+ MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
+ m_jit.add32(TrustedImm32(1), propertyReg);
+ m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
+ m_jit.sub32(TrustedImm32(1), propertyReg);
- lengthDoesNotNeedUpdate.link(&m_jit);
+ lengthDoesNotNeedUpdate.link(&m_jit);
+ }
+ notHoleValue.link(&m_jit);
}
- notHoleValue.link(&m_jit);
+
+ base.use();
+ property.use();
+ value.use();
+ storage.use();
// Store the value to the array.
m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index ac7c8765b..150aae9ea 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -451,6 +451,7 @@ namespace JSC {
#endif
void emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile*);
void emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex);
+ void emitArrayProfileStoreToHoleSpecialCase(ArrayProfile*);
enum FinalObjectMode { MayBeFinal, KnownNotFinal };
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index 302e109ca..a4f9107df 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -556,6 +556,14 @@ inline void JIT::emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndI
#endif
}
+inline void JIT::emitArrayProfileStoreToHoleSpecialCase(ArrayProfile* arrayProfile)
+{
+ if (!canBeOptimized())
+ return;
+
+ store8(TrustedImm32(1), arrayProfile->addressOfMayStoreToHole());
+}
+
#if USE(JSVALUE32_64)
inline void JIT::emitLoadTag(int index, RegisterID tag)
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
index bbc289838..b4d52e225 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -247,6 +247,7 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
Jump end = jump();
empty.link(this);
+ emitArrayProfileStoreToHoleSpecialCase(currentInstruction[4].u.arrayProfile);
add32(TrustedImm32(1), Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
branch32(Below, regT1, Address(regT2, ArrayStorage::lengthOffset())).linkTo(storeResult, this);
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index 1692f33c3..ed561a28b 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -283,6 +283,7 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
Jump end = jump();
empty.link(this);
+ emitArrayProfileStoreToHoleSpecialCase(currentInstruction[4].u.arrayProfile);
add32(TrustedImm32(1), Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
branch32(Below, regT2, Address(regT3, ArrayStorage::lengthOffset())).linkTo(storeResult, this);
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index 41926d8db..953bb3a92 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1388,8 +1388,8 @@ _llint_op_put_by_val:
loadi 4[PC], t0
loadConstantOrVariablePayload(t0, CellTag, t1, .opPutByValSlow)
loadp JSCell::m_structure[t1], t2
- loadp 16[PC], t0
- arrayProfile(t2, t0, t3)
+ loadp 16[PC], t3
+ arrayProfile(t2, t3, t0)
btiz t2, HasArrayStorage, .opPutByValSlow
loadi 8[PC], t0
loadConstantOrVariablePayload(t0, Int32Tag, t2, .opPutByValSlow)
@@ -1405,6 +1405,7 @@ _llint_op_put_by_val:
dispatch(5)
.opPutByValEmpty:
+ storeb 1, ArrayProfile::m_mayStoreToHole[t3]
addi 1, ArrayStorage::m_numValuesInVector[t0]
bib t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValStoreResult
addi 1, t2, t1
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index 51a11f53f..812be0ec9 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -1231,8 +1231,8 @@ _llint_op_put_by_val:
loadis 8[PB, PC, 8], t0
loadConstantOrVariableCell(t0, t1, .opPutByValSlow)
loadp JSCell::m_structure[t1], t2
- loadp 32[PB, PC, 8], t0
- arrayProfile(t2, t0, t3)
+ loadp 32[PB, PC, 8], t3
+ arrayProfile(t2, t3, t0)
btiz t2, HasArrayStorage, .opPutByValSlow
loadis 16[PB, PC, 8], t0
loadConstantOrVariableInt32(t0, t2, .opPutByValSlow)
@@ -1248,6 +1248,7 @@ _llint_op_put_by_val:
dispatch(5)
.opPutByValEmpty:
+ storeb 1, ArrayProfile::m_mayStoreToHole[t3]
addi 1, ArrayStorage::m_numValuesInVector[t0]
bib t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValStoreResult
addi 1, t2, t1
diff --git a/Source/JavaScriptCore/runtime/Arguments.h b/Source/JavaScriptCore/runtime/Arguments.h
index ad0e651ea..c9d0d503d 100644
--- a/Source/JavaScriptCore/runtime/Arguments.h
+++ b/Source/JavaScriptCore/runtime/Arguments.h
@@ -89,7 +89,7 @@ namespace JSC {
}
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
void finishCreation(CallFrame*);
void finishCreation(CallFrame*, InlineCallFrame*);
diff --git a/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
index 8d6e08256..e1d893b0b 100644
--- a/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
+++ b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
@@ -34,7 +34,7 @@ namespace JSC {
inline size_t IndexingHeader::preCapacity(Structure* structure)
{
- if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ if (LIKELY(!hasArrayStorage(structure->indexingType())))
return 0;
return arrayStorage()->m_indexBias;
@@ -42,7 +42,7 @@ inline size_t IndexingHeader::preCapacity(Structure* structure)
inline size_t IndexingHeader::indexingPayloadSizeInBytes(Structure* structure)
{
- if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ if (LIKELY(!hasArrayStorage(structure->indexingType())))
return 0;
return ArrayStorage::sizeFor(arrayStorage()->vectorLength());
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index 94f08f31b..d6abcba99 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -33,6 +33,7 @@
#include "SlotVisitorInlineMethods.h"
#include "WriteBarrier.h"
#include <wtf/Noncopyable.h>
+#include <wtf/TypeTraits.h>
namespace JSC {
@@ -308,18 +309,10 @@ namespace JSC {
return isCell() ? asCell()->toObject(exec, globalObject) : toObjectSlowCase(exec, globalObject);
}
-#if COMPILER(CLANG)
template<class T>
struct NeedsDestructor {
- static const bool value = !__has_trivial_destructor(T);
+ static const bool value = !WTF::HasTrivialDestructor<T>::value;
};
-#else
- // Write manual specializations for this struct template if you care about non-clang compilers.
- template<class T>
- struct NeedsDestructor {
- static const bool value = true;
- };
-#endif
template<typename T>
void* allocateCell(Heap& heap)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index a6993aabc..27f68e55b 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -482,6 +482,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
visitor.append(&thisObject->m_nameScopeStructure);
visitor.append(&thisObject->m_argumentsStructure);
visitor.append(&thisObject->m_arrayStructure);
+ visitor.append(&thisObject->m_arrayStructureForSlowPut);
visitor.append(&thisObject->m_booleanObjectStructure);
visitor.append(&thisObject->m_callbackConstructorStructure);
visitor.append(&thisObject->m_callbackFunctionStructure);
diff --git a/Source/JavaScriptCore/runtime/JSNotAnObject.h b/Source/JavaScriptCore/runtime/JSNotAnObject.h
index 9980e4aab..3636c9bd4 100644
--- a/Source/JavaScriptCore/runtime/JSNotAnObject.h
+++ b/Source/JavaScriptCore/runtime/JSNotAnObject.h
@@ -62,7 +62,7 @@ namespace JSC {
private:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | OverridesGetPropertyNames | JSObject::StructureFlags;
// JSValue methods
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 8b52915b6..bf2dae20d 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -505,6 +505,25 @@ namespace JSC {
// foo->attemptToInterceptPutByIndexOnHole(...);
bool attemptToInterceptPutByIndexOnHoleForPrototype(ExecState*, JSValue thisValue, unsigned propertyName, JSValue, bool shouldThrow);
+ // Ensure that the object is in a mode where it has array storage. Use
+ // this if you're about to perform actions that would have required the
+ // object to be converted to have array storage, if it didn't have it
+ // already.
+ ArrayStorage* ensureArrayStorage(JSGlobalData& globalData)
+ {
+ switch (structure()->indexingType()) {
+ case ALL_ARRAY_STORAGE_INDEXING_TYPES:
+ return m_butterfly->arrayStorage();
+
+ case ALL_BLANK_INDEXING_TYPES:
+ return createInitialArrayStorage(globalData);
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ }
+
static size_t offsetOfInlineStorage();
static ptrdiff_t butterflyOffset()
@@ -565,25 +584,6 @@ namespace JSC {
}
}
- // Ensure that the object is in a mode where it has array storage. Use
- // this if you're about to perform actions that would have required the
- // object to be converted to have array storage, if it didn't have it
- // already.
- ArrayStorage* ensureArrayStorage(JSGlobalData& globalData)
- {
- switch (structure()->indexingType()) {
- case ALL_ARRAY_STORAGE_INDEXING_TYPES:
- return m_butterfly->arrayStorage();
-
- case ALL_BLANK_INDEXING_TYPES:
- return createInitialArrayStorage(globalData);
-
- default:
- ASSERT_NOT_REACHED();
- return 0;
- }
- }
-
ArrayStorage* createArrayStorage(JSGlobalData&, unsigned length, unsigned vectorLength);
ArrayStorage* createInitialArrayStorage(JSGlobalData&);
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 7821b42b8..1500636f2 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -153,7 +153,7 @@ namespace JSC {
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
{
- return Structure::create(globalData, globalObject, proto, TypeInfo(StringType, OverridesGetOwnPropertySlot), &s_info);
+ return Structure::create(globalData, globalObject, proto, TypeInfo(StringType, OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero), &s_info);
}
static size_t offsetOfLength() { return OBJECT_OFFSETOF(JSString, m_length); }
diff --git a/Source/Platform/ChangeLog b/Source/Platform/ChangeLog
index bedc71772..1a4e101e0 100644
--- a/Source/Platform/ChangeLog
+++ b/Source/Platform/ChangeLog
@@ -1,3 +1,15 @@
+2012-09-18 Sailesh Agrawal <sail@chromium.org>
+
+ Chromium: Scrollbar with tickmarks doesn't respond to clicks
+ https://bugs.webkit.org/show_bug.cgi?id=96049
+
+ Reviewed by Beth Dakin.
+
+ Added isAlphaLocked and setIsAlphaLocked.
+
+ * chromium/public/WebScrollbar.h:
+ (WebScrollbar):
+
2012-09-17 Brian Anderson <brianderson@chromium.org>
[chromium] Add rendering commit statistics
diff --git a/Source/Platform/chromium/public/WebScrollbar.h b/Source/Platform/chromium/public/WebScrollbar.h
index 0462b6489..95ce7ab8f 100644
--- a/Source/Platform/chromium/public/WebScrollbar.h
+++ b/Source/Platform/chromium/public/WebScrollbar.h
@@ -106,6 +106,8 @@ public:
virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const = 0;
virtual bool isCustomScrollbar() const = 0;
virtual Orientation orientation() const = 0;
+ virtual bool isAlphaLocked() const { return false; }
+ virtual void setIsAlphaLocked(bool) { }
};
} // namespace WebKit
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 0836c8e5c..7c32e9224 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,39 @@
+2012-09-19 Geoffrey Garen <ggaren@apple.com>
+
+ OSR exit sometimes neglects to create the arguments object
+ https://bugs.webkit.org/show_bug.cgi?id=97162
+
+ Reviewed by Filip Pizlo.
+
+ * wtf/HashTraits.h:
+ (NullableHashTraits):
+ (WTF::NullableHashTraits::emptyValue):
+ (WTF):
+
+2012-09-18 Glenn Adams <glenn@skynav.com>
+
+ WTFString::show doesn't dump non-ASCII characters in a readable manner
+ https://bugs.webkit.org/show_bug.cgi?id=96749
+
+ Reviewed by Benjamin Poulain.
+
+ Dump non-ASCII characters in a useful form for debugging.
+
+ * wtf/text/WTFString.cpp:
+ (asciiDebug):
+ Dump non-ASCII characters (i.e., UTF-16 code elements) as well as non-printable ASCII characters
+ using \uXXXX format. Also escape \ as \\ in order to remove ambiguity.
+
+2012-09-18 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Use WTF::HasTrivialDestructor instead of compiler-specific versions in JSC::NeedsDestructor
+ https://bugs.webkit.org/show_bug.cgi?id=96980
+
+ Reviewed by Benjamin Poulain.
+
+ * wtf/TypeTraits.h:
+ (WTF):
+
2012-09-17 Glenn Adams <glenn@skynav.com>
Including HexNumber.h fails build if hexDigitsForMode is not referenced
diff --git a/Source/WTF/wtf/HashTraits.h b/Source/WTF/wtf/HashTraits.h
index ebe795eb1..4305430a1 100644
--- a/Source/WTF/wtf/HashTraits.h
+++ b/Source/WTF/wtf/HashTraits.h
@@ -231,9 +231,16 @@ namespace WTF {
template<typename Key, typename Value>
struct HashTraits<KeyValuePair<Key, Value> > : public KeyValuePairHashTraits<HashTraits<Key>, HashTraits<Value> > { };
+ template<typename T>
+ struct NullableHashTraits : public HashTraits<T> {
+ static const bool emptyValueIsZero = false;
+ static T emptyValue() { return reinterpret_cast<T>(1); }
+ };
+
} // namespace WTF
using WTF::HashTraits;
using WTF::PairHashTraits;
+using WTF::NullableHashTraits;
#endif // WTF_HashTraits_h
diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h
index 266aad82e..097b2fd79 100644
--- a/Source/WTF/wtf/TypeTraits.h
+++ b/Source/WTF/wtf/TypeTraits.h
@@ -251,7 +251,7 @@ namespace WTF {
typedef IntegralConstant<bool, true> true_type;
typedef IntegralConstant<bool, false> false_type;
-#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER)
+#if COMPILER(CLANG) || (defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER))
// VC8 (VS2005) and later have built-in compiler support for HasTrivialConstructor / HasTrivialDestructor,
// but for some unexplained reason it doesn't work on built-in types.
template <typename T> struct HasTrivialConstructor : public IntegralConstant<bool, __has_trivial_constructor(T)>{ };
diff --git a/Source/WTF/wtf/text/WTFString.cpp b/Source/WTF/wtf/text/WTFString.cpp
index b89acb663..9f739c91b 100644
--- a/Source/WTF/wtf/text/WTFString.cpp
+++ b/Source/WTF/wtf/text/WTFString.cpp
@@ -26,6 +26,7 @@
#include <stdarg.h>
#include <wtf/ASCIICType.h>
#include <wtf/DataLog.h>
+#include <wtf/HexNumber.h>
#include <wtf/MathExtras.h>
#include <wtf/MemoryInstrumentation.h>
#include <wtf/text/CString.h>
@@ -1135,16 +1136,19 @@ Vector<char> asciiDebug(StringImpl* impl)
return asciiDebug(String("[null]").impl());
Vector<char> buffer;
- unsigned length = impl->length();
- const UChar* characters = impl->characters();
-
- buffer.resize(length + 1);
- for (unsigned i = 0; i < length; ++i) {
- UChar ch = characters[i];
- buffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch;
+ for (unsigned i = 0; i < impl->length(); ++i) {
+ UChar ch = (*impl)[i];
+ if (isASCIIPrintable(ch)) {
+ if (ch == '\\')
+ buffer.append(ch);
+ buffer.append(ch);
+ } else {
+ buffer.append('\\');
+ buffer.append('u');
+ appendUnsignedAsHexFixedSize(ch, buffer, 4);
+ }
}
- buffer[length] = '\0';
-
+ buffer.append('\0');
return buffer;
}
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index f74ba2d28..4b0250629 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -1538,15 +1538,16 @@ SET(WebCore_SOURCES
inspector/IdentifiersFactory.cpp
inspector/InjectedScript.cpp
inspector/InjectedScriptBase.cpp
+ inspector/InjectedScriptCanvasModule.cpp
inspector/InjectedScriptHost.cpp
inspector/InjectedScriptManager.cpp
inspector/InjectedScriptModule.cpp
- inspector/InjectedScriptWebGLModule.cpp
inspector/InspectorAgent.cpp
inspector/InspectorApplicationCacheAgent.cpp
inspector/InspectorBaseAgent.cpp
inspector/InspectorPageAgent.cpp
inspector/InspectorCSSAgent.cpp
+ inspector/InspectorCanvasAgent.cpp
inspector/InspectorClient.cpp
inspector/InspectorConsoleAgent.cpp
inspector/InspectorController.cpp
@@ -1574,7 +1575,6 @@ SET(WebCore_SOURCES
inspector/InspectorStyleTextEditor.cpp
inspector/InspectorTimelineAgent.cpp
inspector/InspectorValues.cpp
- inspector/InspectorWebGLAgent.cpp
inspector/InspectorWorkerAgent.cpp
inspector/InstrumentingAgents.cpp
inspector/MemoryInstrumentationImpl.cpp
@@ -2776,15 +2776,13 @@ ADD_CUSTOM_COMMAND(
LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.h)
-# Generate InjectedScriptWebGLModuleSource.h
-IF (ENABLE_WEBGL)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptWebGLModuleSource.h
- MAIN_DEPENDENCY inspector/InjectedScriptWebGLModuleSource.js
- COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InjectedScriptWebGLModuleSource_js ${WEBCORE_DIR}/inspector/InjectedScriptWebGLModuleSource.js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptWebGLModuleSource.h
- VERBATIM)
- LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptWebGLModuleSource.h)
-ENDIF ()
+# Generate InjectedScriptCanvasModuleSource.h
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h
+ MAIN_DEPENDENCY inspector/InjectedScriptCanvasModuleSource.js
+ COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InjectedScriptCanvasModuleSource_js ${WEBCORE_DIR}/inspector/InjectedScriptCanvasModuleSource.js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h
+ VERBATIM)
+LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h)
MAKE_HASH_TOOLS(${WEBCORE_DIR}/platform/ColorData)
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b5036afcf..1d3aa8f4b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,1826 @@
+2012-09-20 Otto Derek Cheung <otcheung@rim.com>
+
+ Web Inspector: Cookie info in Network Resources Cookies tab are incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=95491
+
+ Reviewed by Vsevolod Vlasov.
+
+ Web Inspector: Cookie info in Network Resources Cookies tab are incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=95491
+
+ Fixing a typo that causes cookies to appear as a "Session"
+ cookie in the Networking panel because it can never find a properly named
+ "expired" header.
+
+ This bug exposes another bug where the cookie GMT strings are inproperly
+ parsed, causing an "invalid date" error to show up in the cookies tab in
+ the Networking panel.
+
+ Also changed test expectations in LayoutTests/inspector/cookie-parser-expected.txt
+
+ * inspector/front-end/CookieParser.js:
+ (WebInspector.Cookie.prototype.get session):
+
+2012-09-20 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [Elements] Word wrap disablement in the DOM tree broken
+ https://bugs.webkit.org/show_bug.cgi?id=97185
+
+ Reviewed by Pavel Feldman.
+
+ Restored the effective "white-space: nowrap" for the tree elements.
+
+ * inspector/front-end/inspector.css:
+ (.nowrap):
+
+2012-09-20 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [TouchAdjustment] Simplify and improve hybrid distance function.
+ https://bugs.webkit.org/show_bug.cgi?id=96519
+
+ Reviewed by Antonio Gomes.
+
+ The current distance function is a combination of two functions. One measuring the distance from
+ the hot-spot in the touch-area to the centerline of the target, and one measuring how much of the
+ target is covered.
+
+ The distance to the center-line was used instead of just the distance to the target, to make it
+ easier to hit small targets near big targets. The very same feature is however also the reason
+ measuring how much the target is covered is added. Using the distance to center-line is therefore
+ redundant now, and can be replaced with the simpler 'distance the hot-spot needs to be adjusted'.
+
+ Tested by existing touchadjustment tests.
+
+ * page/TouchAdjustment.cpp:
+ (TouchAdjustment):
+ (WebCore::TouchAdjustment::hybridDistanceFunction):
+ * platform/graphics/IntRect.cpp:
+ * platform/graphics/IntRect.h:
+ (IntRect):
+
+2012-09-20 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] HTMLSelectElement should call formStateDidChange on both menulist and lisbox mode
+ https://bugs.webkit.org/show_bug.cgi?id=97177
+
+ Reviewed by Kent Tamura.
+
+ This patch makes listbox mode select element to call formStateDidChange()
+ when selected options are changed.
+
+ For this change, this patch moves notifyFormStateChanged() to
+ HTMLFormControlElementWithState class from HTMLTextFormControlElement
+ for sharing code HTMLSelectElement class and HTMLInputElement/HTMLTextAreaElement
+ derived from HTMLTextFormControlElement.
+
+ No new tests. We can't test this change in WebKit test tools. Test script
+ will be implemented in Chromium side.
+
+ * html/HTMLFormControlElementWithState.cpp:
+ (WebCore::HTMLFormControlElementWithState::notifyFormStateChanged):
+ (WebCore):
+ * html/HTMLFormControlElementWithState.h: Moved a declaration of notifyFormStateChanged() from HTMLTextFormControlElement.
+ (HTMLFormControlElementWithState): Moved an implemented of notifyFormStateChanged() from HTMLTextFormControlElement.
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::selectOption): Changed to call notifyFormStateChanged() instead of formStateDidChange().
+ (WebCore::HTMLSelectElement::updateListBoxSelection): Changed to call notifyFormStateChanged().
+ * html/HTMLTextFormControlElement.cpp: Moved an implemented of notifyFormStateChanged() to HTMLFormControlElementWithState class.
+ * html/HTMLTextFormControlElement.h: Moved a declaration of notifyFormStateChanged() to HTMLFormControlElementWithState class.
+
+2012-09-20 Keishi Hattori <keishi@webkit.org>
+
+ REGRESSION(r127727): Can't navigate between months with arrow keys in calendar picker
+ https://bugs.webkit.org/show_bug.cgi?id=97166
+
+ Reviewed by Kent Tamura.
+
+ Fixing bug in r127727 so arrow keys work properly.
+
+ Test: fast/forms/date/calendar-picker-key-operations.html
+
+ * Resources/pagepopups/calendarPicker.js:
+ (DaysTable.prototype._maybeSetPreviousMonth):
+ (DaysTable.prototype._maybeSetNextMonth):
+
+2012-09-18 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: Use and process the actual ScriptId in the protocol EventListener object
+ https://bugs.webkit.org/show_bug.cgi?id=93271
+
+ Reviewed by Yury Semikhatsky.
+
+ - Use the actual script identifier in the "location" object's "scriptId" field
+ for the DOM.EventListener protocol type, but send the script URL in the new "sourceName" field.
+ - Use 0-based lines in the "location" object's "lineNumber" field for linkifyRawLocation() to work correctly.
+ - Fixed formatting of links to listener locations to contain "(program)" rather than empty string.
+
+ * bindings/js/ScriptEventListener.cpp:
+ (WebCore::eventListenerHandlerLocation):
+ * bindings/js/ScriptEventListener.h:
+ (WebCore):
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::eventListenerHandlerLocation):
+ * bindings/v8/ScriptEventListener.h:
+ (WebCore):
+ * inspector/Inspector.json:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::buildObjectForEventListener):
+ * inspector/front-end/BreakpointsSidebarPane.js:
+ * inspector/front-end/EventListenersSidebarPane.js:
+ * inspector/front-end/Linkifier.js:
+ (WebInspector.Linkifier.DefaultFormatter.prototype.formatLiveAnchor):
+ * inspector/front-end/ResourceUtils.js:
+ (WebInspector.formatLinkText): Use "(program)" if URL is empty.
+
+2012-09-19 Dan Bernstein <mitz@apple.com>
+
+ WebCore part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * WebCore.exp.in: Added an entry for Settings::setScreenFontSubstitutionEnabled.
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList): Changed to use printer fonts if
+ screen font substitution is not enabled.
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings): Added initializer for new m_screenFontSubstitutionEnabled
+ member variable. The initial value is true, matching existing behavior.
+ (WebCore::Settings::setScreenFontSubstitutionEnabled): Added this setter, which updated the
+ member variable and forces a style recalc in all pages using this Settings.
+ * page/Settings.h:
+ (Settings): Added m_screenFontSubstitutionEnabled boolean member variable.
+ (WebCore::Settings::screenFontSubstitutionEnabled): Added this getter.
+
+2012-09-19 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] multiple fields time input UI should call notifyFormStateChanged() when value of field is changed
+ https://bugs.webkit.org/show_bug.cgi?id=97169
+
+ Reviewed by Kent Tamura.
+
+ This patch makes multiple fields time input UI calls notifyFormStateChanged()
+ when field value is changed as other input types do.
+
+ This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
+ ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.
+
+ No new tests. We can't test this change in WebKit test tools. Test script
+ will be implemented in Chromium side.
+
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged):
+
+2012-09-19 Keishi Hattori <keishi@webkit.org>
+
+ REGRESSION(r127727): Calendar picker focus ring should be hidden until key event
+ https://bugs.webkit.org/show_bug.cgi?id=97165
+
+ Reviewed by Kent Tamura.
+
+ The regression was caused because NoFocusRing class was being removed
+ from then main element inside resetMain().
+
+ No new tests. Covered by calendar-picker-appearance.html.
+
+ * Resources/pagepopups/calendarPicker.js:
+ (initialize):
+ (CalendarPicker):
+ (CalendarPicker.prototype._layout):
+ (DaysTable.prototype._handleKey):
+ (CalendarPicker.prototype._handleBodyKeyDown):
+ (CalendarPicker.prototype.maybeUpdateFocusStyle): Make this a method of CalendarPicker because we don't use it for other pickers.
+
+2012-09-19 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: Print console warning about setVersion
+ https://bugs.webkit.org/show_bug.cgi?id=96575
+
+ Reviewed by Tony Chang.
+
+ setVersion has been out of the spec for almost a year but there are
+ still a lot of users.
+
+ We show the warning once per database object as an approximation for
+ once per page.
+
+ No new tests, but 150-something rebaselines.
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::IDBDatabase):
+ (WebCore::IDBDatabase::setVersion):
+ * Modules/indexeddb/IDBDatabase.h:
+ (IDBDatabase):
+
+2012-09-19 Sean Wang <Xuewen.Wang@torchmobile.com.cn>
+
+ [BlackBerry] Basic authentication challenge credentials for stored credentials again after restarting browser
+ https://bugs.webkit.org/show_bug.cgi?id=96362
+
+ Reviewed by Rob Buis.
+
+ This patch enable reading credentials from the persistent credential storage
+ when it is not private browsing mode and there is not a credential in the RAM
+ for the requested resource.
+
+ Since we don't load persistent stored credentials into RAM at the starting time,
+ even we have saved the credentials at the last browsing, after restarting the browser,
+ it will still challenge for credentials for the requesting resources.
+
+ No new tests, it uses the original authentication tests. There is no way to
+ clear all credentials or restarting browsers to test this feature.
+
+ * platform/network/blackberry/CredentialBackingStore.cpp:
+ (WebCore::CredentialBackingStore::getProtectionSpace):
+ (WebCore):
+ * platform/network/blackberry/CredentialBackingStore.h:
+ (CredentialBackingStore):
+ * platform/network/blackberry/NetworkManager.cpp:
+ (WebCore::NetworkManager::startJob):
+
+2012-09-19 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Refactoring] ButtonInputType of <input> element should have innerElement to make <input> AuthorShadowDOM-ready
+ https://bugs.webkit.org/show_bug.cgi?id=95939
+
+ Reviewed by Dimitri Glazkov.
+
+ We had 2 ways to show text in RenderButton. One is to use RenderButton::setText() and the other is to add renderer
+ as a child of RenderButton. <input type="button"> used the former one, and <button> used the latter one.
+ The former makes RenderButton a bit messy, and also prevents from making <input> AuthorShadowDOM ready.
+
+ So we remove RenderButton::setText() and refactor <input type="button"> to use a Shadow DOM to show text.
+
+ Since the text in <input type="button"> should create RenderTextFragment, we introduce TextForButtonInputType
+ class. RenderText will allow us to select the inner text of <input>, but it should not.
+
+ No new tests, existing tests should cover the change.
+
+ * html/BaseButtonInputType.cpp:
+ (TextForButtonInputType): Special Text node which creates RenderTextFragment.
+ (WebCore):
+ (WebCore::TextForButtonInputType::create):
+ (WebCore::TextForButtonInputType::TextForButtonInputType):
+ (WebCore::TextForButtonInputType::createRenderer):
+ (WebCore::BaseButtonInputType::BaseButtonInputType):
+ (WebCore::BaseButtonInputType::createShadowSubtree):
+ (WebCore::BaseButtonInputType::destroyShadowSubtree):
+ (WebCore::BaseButtonInputType::valueAttributeChanged): When a button value is changed, we reflect the value to
+ the text node in ShadowDOM.
+ * html/BaseButtonInputType.h:
+ (BaseButtonInputType):
+ * html/FileInputType.cpp:
+ (WebCore::UploadButtonElement::create): Creates Shadow DOM subtree.
+ (WebCore::UploadButtonElement::createForMultiple): Creates Shadow DOM subtree.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::parseAttribute):
+ * html/InputType.cpp:
+ (WebCore::InputType::valueAttributeChanged):
+ (WebCore):
+ * html/InputType.h:
+ (InputType):
+ * rendering/RenderButton.cpp:
+ (WebCore::RenderButton::RenderButton):
+ (WebCore::RenderButton::styleDidChange): Removed unnecessary text related code.
+ * rendering/RenderButton.h:
+ (RenderButton):
+
+2012-09-19 Jason Liu <jason.liu@torchmobile.com.cn>
+
+ [BlackBerry] Get infinite amount of requests after attempting re-authentication basic.
+ https://bugs.webkit.org/show_bug.cgi?id=96994
+
+ Reviewed by Rob Buis.
+
+ We should remove the wrong credentials before calling sendRequestWithCredentials again.
+ #PR 200226
+ Reviewed internally by Jonathan Dong.
+
+ No new tests. It is covered by ManualTests/blackberry/http-auth-challenge.html.
+
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::notifyAuthReceived):
+
+2012-09-19 Adam Barth <abarth@webkit.org>
+
+ Remove Blob.webkitSlice
+ https://bugs.webkit.org/show_bug.cgi?id=96715
+
+ Reviewed by Darin Fisher.
+
+ Based on these usage metrics, it appears that it is safe to remove
+ Blob.webkitSlice. Folks that were previously calling webkitSlice should
+ just call slice instead. They do the same thing.
+
+ Ratio of Blob.webkitSlice calls to Blob.slice: 14.87%
+ Ratio of Blob.webkitSlice calls to Document creation: 0.0053%
+
+ * fileapi/Blob.cpp:
+ (WebCore::Blob::slice):
+ * fileapi/Blob.h:
+ (Blob):
+ * fileapi/Blob.idl:
+ * fileapi/File.h:
+ (File):
+ * inspector/front-end/FileUtils.js:
+ (WebInspector.ChunkedFileReader.prototype._loadChunk):
+
+2012-09-19 Julien Chaffraix <jchaffraix@webkit.org>
+
+ The collapsing border code needs direction-aware border getters
+ https://bugs.webkit.org/show_bug.cgi?id=96710
+
+ Reviewed by Ojan Vafai.
+
+ This refactoring is needed to extend our collapsing border support for mixed directionality
+ at the table cell level (we currently wrongly ignore any direction below the row-group). For
+ now, the new helpers are dumb and return exactly the old result but they will be made
+ direction-aware in a follow-up change.
+
+ Refactoring covered by existing tests.
+
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::hasSameDirectionAs):
+ Added this helper function. For now, it's only used to compare against
+ the table direction but we will reuse it to compare the current cell
+ direction against the other table parts.
+
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::computeCollapsedStartBorder):
+ (WebCore::RenderTableCell::computeCollapsedEndBorder):
+ Transitioned those 2 functions to using the new direction-aware functions.
+
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::tableStartBorderAdjoiningCell):
+ (WebCore::RenderTable::tableEndBorderAdjoiningCell):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::firstRowCellAdjoiningTableStart):
+ (WebCore::RenderTableSection::firstRowCellAdjoiningTableEnd):
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::borderAdjoiningTableStart):
+ (WebCore::RenderTableCell::borderAdjoiningTableEnd):
+ * rendering/RenderTableSection.h:
+ (WebCore::RenderTableSection::borderAdjoiningTableStart):
+ (WebCore::RenderTableSection::borderAdjoiningTableEnd):
+ Updated those call sites to use RenderBox::hasSameDirectionAs.
+
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::borderAdjoiningNextCell):
+ (WebCore::RenderTableCell::borderAdjoiningPreviousCell):
+ * rendering/RenderTableCol.cpp:
+ (WebCore::RenderTableCol::borderAdjoiningCellStartBorder):
+ (WebCore::RenderTableCol::borderAdjoiningCellEndBorder):
+ (WebCore::RenderTableCol::borderAdjoiningCellBefore):
+ (WebCore::RenderTableCol::borderAdjoiningCellAfter):
+ * rendering/RenderTableCol.h:
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::borderAdjoiningStartCell):
+ (WebCore::RenderTableRow::borderAdjoiningEndCell):
+ * rendering/RenderTableRow.h:
+ (WebCore::RenderTableRow::borderAdjoiningTableStart):
+ (WebCore::RenderTableRow::borderAdjoiningTableEnd):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::borderAdjoiningStartCell):
+ (WebCore::RenderTableSection::borderAdjoiningEndCell):
+ New direction-aware functions. Added some ASSERT to ensure
+ we don't call them with the wrong parameters.
+
+2012-09-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] ScriptController::compileAndRunScript() can crash
+ https://bugs.webkit.org/show_bug.cgi?id=96567
+
+ Reviewed by Adam Barth.
+
+ See chromium bug: http://code.google.com/p/chromium/issues/detail?id=146776
+
+ The root cause is that v8::PreCompile() can return 0 when the stack of
+ V8's parser overflows (c.f. http://code.google.com/codesearch#OAMlx_jo-ck/src/v8/src/parser.cc&exact_package=chromium&q=kPreParseStackOverflow&type=cs&l=6021).
+
+ This patch adds the 0 check to the caller side. Given that precompileScript()
+ is just trying to speculatively precompile a script, it's OK to give up
+ precompiling for such edge cases.
+
+ Manually tested with the html generated by the following shell script:
+
+ echo '<script language="JavaScript" type="text/javascript" src="asan-crash.js"></script>' > asan-crash.html
+ echo 'if(wURLF.search("")>=0) {}' > asan-crash.js
+ for i in `seq 14830`
+ do
+ echo 'else if(wURLF.search("")>=0) {}' >> asan-crash.js
+ done
+
+ I didn't add the test because '14380' depends on an environment
+ and because we don't want to add a huge html test.
+
+ * bindings/v8/ScriptSourceCode.cpp:
+ (WebCore::ScriptSourceCode::precompileScript):
+
+2012-09-19 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Pending call cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=96952
+
+ Reviewed by Tony Chang.
+
+ Replace RefPtr usage with OwnPtr for PendingXXXCalls (since they're never referenced twice)
+ and replace queue of "second half open" calls with a single item.
+
+ No new tests - no functional changes.
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create):
+ (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
+ (WebCore::IDBDatabaseBackendImpl::PendingDeleteCall::create):
+ (WebCore::IDBDatabaseBackendImpl::PendingSetVersionCall::create):
+ (WebCore::IDBDatabaseBackendImpl::setVersion):
+ (WebCore::IDBDatabaseBackendImpl::transactionFinishedAndAbortFired):
+ (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
+ (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
+ (WebCore::IDBDatabaseBackendImpl::close):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+ (IDBDatabaseBackendImpl):
+
+2012-09-19 Kenichi Ishibashi <bashi@chromium.org>
+
+ [Chromium] Improve glyph positioning of HarfBuzzShaper
+ https://bugs.webkit.org/show_bug.cgi?id=97093
+
+ Reviewed by Tony Chang.
+
+ For proper positioning, HarfBuzzShaper requires the positions(offsets and advance)
+ of the previous glyph. This mean we need to shape all HarfBuzzRuns before glyph positioning.
+ Collect and shape HarfBuzzRuns, then set positions of glyphs.
+
+ No new tests. Tests that uses spacing for complex text (e.g. fast/text/atsui-negative-spacing-features.html)
+ should close in the expectations. (not the identical, maybe there are subtle differences between
+ harfbuzz old and harfbuzz ng)
+
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
+ (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Allocate m_offsets.
+ (WebCore::HarfBuzzShaper::HarfBuzzRun::setGlyphAndPositions): Renamed and set offset too.
+ (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
+ (WebCore::HarfBuzzShaper::shape): Call fillGlyphBuffer() if we need to fill glyphBuffer.
+ (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Removed glyph positioning code.
+ (WebCore::HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun): Ditto.
+ (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Added.
+ (WebCore):
+ (WebCore::HarfBuzzShaper::fillGlyphBuffer): Added.
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h:
+ (HarfBuzzRun):
+ (WebCore::HarfBuzzShaper::HarfBuzzRun::offsets): Added.
+ (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphToCharacterIndexes): Added.
+ (HarfBuzzShaper):
+
+2012-09-19 James Simonsen <simonjam@chromium.org>
+
+ [Chromium] Disable resource load scheduling
+ https://bugs.webkit.org/show_bug.cgi?id=97131
+
+ Reviewed by Nate Chapin.
+
+ We'll use Chrome's network stack for scheduling instead.
+
+ No new tests.
+
+ * loader/ResourceLoadScheduler.cpp:
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::preload):
+
+2012-09-19 Dan Bernstein <mitz@apple.com>
+
+ When kerning is enabled, word spacing is doubly accounted for in RenderText::computePreferredLogicalWidths
+ https://bugs.webkit.org/show_bug.cgi?id=97146
+
+ Reviewed by Anders Carlsson.
+
+ Test: fast/text/word-space-with-kerning.html
+
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::computePreferredLogicalWidths): When kerning is enabled, words are
+ measured with their trailing space, if there is one, then the width of a space is subtracted.
+ Changed that width, stored in the local variable wordTrailingSpaceWidth, to include the
+ word spacing, since it is included in the result of widthFromCache().
+
+2012-09-19 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Remove "current transaction" concept from backing store
+ https://bugs.webkit.org/show_bug.cgi?id=96663
+
+ Reviewed by Tony Chang.
+
+ IndexedDB should allow multiple transactions to run in parallel within and
+ across databases within an origin. As an initial step to enabling this, the
+ backing store should not hold a "current transaction" - instead, operations
+ should be done relative to a transaction managed by the database.
+
+ No new tests - no functional changes.
+
+ * Modules/indexeddb/IDBBackingStore.h:
+ (IDBBackingStore):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
+ (WebCore::IDBDatabaseBackendImpl::deleteObjectStoreInternal):
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+ (IDBDatabaseBackendImpl):
+ * Modules/indexeddb/IDBIndexBackendImpl.cpp:
+ (WebCore::IDBIndexBackendImpl::openCursorInternal):
+ (WebCore::IDBIndexBackendImpl::countInternal):
+ (WebCore::IDBIndexBackendImpl::count):
+ (WebCore::IDBIndexBackendImpl::getInternal):
+ (WebCore::IDBIndexBackendImpl::getKeyInternal):
+ (WebCore::IDBIndexBackendImpl::get):
+ (WebCore::IDBIndexBackendImpl::getKey):
+ * Modules/indexeddb/IDBIndexBackendImpl.h:
+ (IDBIndexBackendImpl):
+ * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+ (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
+ (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseMetaData):
+ (WebCore::IDBLevelDBBackingStore::createObjectStore):
+ (WebCore::IDBLevelDBBackingStore::deleteObjectStore):
+ (WebCore::IDBLevelDBBackingStore::getObjectStoreRecord):
+ (WebCore):
+ (WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
+ (WebCore::IDBLevelDBBackingStore::clearObjectStore):
+ (WebCore::IDBLevelDBBackingStore::deleteObjectStoreRecord):
+ (WebCore::IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber):
+ (WebCore::IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
+ (WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore):
+ (WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
+ (WebCore::IDBLevelDBBackingStore::createIndex):
+ (WebCore::IDBLevelDBBackingStore::deleteIndex):
+ (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
+ (WebCore::IDBLevelDBBackingStore::deleteIndexDataForRecord):
+ (WebCore::IDBLevelDBBackingStore::findKeyInIndex):
+ (WebCore::IDBLevelDBBackingStore::getPrimaryKeyViaIndex):
+ (WebCore::IDBLevelDBBackingStore::keyExistsInIndex):
+ (WebCore::IDBLevelDBBackingStore::openObjectStoreCursor):
+ (WebCore::IDBLevelDBBackingStore::openObjectStoreKeyCursor):
+ (WebCore::IDBLevelDBBackingStore::openIndexKeyCursor):
+ (WebCore::IDBLevelDBBackingStore::openIndexCursor):
+ (WebCore::IDBLevelDBBackingStore::Transaction::Transaction):
+ (WebCore::IDBLevelDBBackingStore::Transaction::begin):
+ (WebCore::IDBLevelDBBackingStore::Transaction::commit):
+ (WebCore::IDBLevelDBBackingStore::Transaction::rollback):
+ * Modules/indexeddb/IDBLevelDBBackingStore.h:
+ (IDBLevelDBBackingStore):
+ (WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransaction):
+ (Transaction):
+ (WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransactionFrom):
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::get):
+ (WebCore::IDBObjectStoreBackendImpl::getInternal):
+ (WebCore):
+ (WebCore::makeIndexWriters):
+ (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
+ (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
+ (WebCore::IDBObjectStoreBackendImpl::clear):
+ (WebCore::IDBObjectStoreBackendImpl::clearInternal):
+ (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
+ (WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
+ (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
+ (WebCore::IDBObjectStoreBackendImpl::count):
+ (WebCore::IDBObjectStoreBackendImpl::countInternal):
+ (WebCore::IDBObjectStoreBackendImpl::generateKey):
+ (WebCore::IDBObjectStoreBackendImpl::updateKeyGenerator):
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
+ (IDBObjectStoreBackendImpl):
+
+2012-09-19 Terry Anderson <tdanderson@chromium.org>
+
+ [chromium] Store the contents scale factor in PlatformContextSkia on initialization
+ https://bugs.webkit.org/show_bug.cgi?id=96137
+
+ Reviewed by Stephen White.
+
+ When the compositor creates a PlatformContextSkia, the scale on |canvas| will
+ be equal to the content scale factor (which, without pinch-to-zoom, will be
+ the same as the device scale factor). Set this value as a member on PlatformContextSkia,
+ which will be used to correctly render glyphs when hinting is used and the device
+ scale factor is not 1.
+
+ Tests: added two new unit tests.
+
+ * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
+ (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::PlatformContextSkia):
+ (WebCore::PlatformContextSkia::setupPaintCommon):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ (PlatformContextSkia):
+ (WebCore::PlatformContextSkia::setHintingScaleFactor):
+ (WebCore::PlatformContextSkia::hintingScaleFactor):
+
+2012-09-19 Kenichi Ishibashi <bashi@chromium.org>
+
+ [Chromium] HarfBuzzShaper should take into account combining characters
+ https://bugs.webkit.org/show_bug.cgi?id=97069
+
+ Reviewed by Tony Chang.
+
+ When dividing a text run into HarfBuzzRuns, try to find suitable SimpleFontData for
+ combining character sequence if there are one or more mark characters are followed.
+ If there is no combined glyphs in the font, use fallback font for mark characters.
+
+ No new tests.
+ In platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html,
+ U+0947 (devanagari vowel sign e) should be displayed.
+ In fast/text/wide-zero-width-space.html, &eacute; and e&#0301; should look identical.
+
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
+ (WebCore):
+ (WebCore::fontDataForCombiningCharacterSequence): Added.
+ (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): See above description.
+
+2012-09-19 Tony Chang <tony@chromium.org>
+
+ Remove RenderIFrame::updateLogicalHeight and RenderIFrame::updateLogicalWidth
+ https://bugs.webkit.org/show_bug.cgi?id=97049
+
+ Reviewed by Ojan Vafai.
+
+ This is an incremental step in making updateLogicalHeight non-virtual so it's
+ possible to call computeLogicalHeight on any RenderBox and get the right
+ version of the function.
+
+ The code in RenderIFrame::layout was calling flattenFrame(), which would
+ query it's bounding box size. Since we hadn't done a layout yet, the size
+ is unknown. The fix is to only call flattenFrame() after calling
+ updateLogicalWidth and updateLogicalHeight. We can then fixup the size of
+ the iframe.
+
+ No new tests, existing tests in fast/frames/flattening should continue to pass.
+
+ * rendering/RenderIFrame.cpp:
+ (WebCore::RenderIFrame::layout):
+ * rendering/RenderIFrame.h:
+ (RenderIFrame):
+
+2012-09-19 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Free up resources used by completed cursors earlier
+ https://bugs.webkit.org/show_bug.cgi?id=97023
+
+ Reviewed by Tony Chang.
+
+ Prior to this patch, IDBCursor objects are kept around by their parent
+ IDBTransaction until the transaction finishes. It's possible to release
+ references to them earlier, when the cursor has been "run to the end",
+ as no further events will fire and all calls to continue() etc should fail.
+
+ This change tells the cursor it's done when "null" finally comes through in
+ the IDBRequest, and the cursor then lets transaction know it can be
+ forgotten.
+
+ The added test doesn't distinguish the new behavior, but does exercise
+ "finished" cursors and apparently we didn't have tests for these before.
+
+ Test: storage/indexeddb/cursor-finished.html
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::close): Make idempotent; notify transaction.
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::onSuccess): Tell cursor it's finished before releasing.
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::OpenCursorNotifier::~OpenCursorNotifier):
+ (WebCore):
+ (WebCore::IDBTransaction::OpenCursorNotifier::cursorFinished): New method for explicit notification.
+ * Modules/indexeddb/IDBTransaction.h:
+ (OpenCursorNotifier):
+
+2012-09-19 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: fire upgradeneeded even without an explicit integer version
+ https://bugs.webkit.org/show_bug.cgi?id=96444
+
+ Reviewed by Tony Chang.
+
+ Also of note:
+ - New databases now get a default version of 1 instead of
+ the empty string when they are opened.
+ - We now allow databases with an integer version to revert to a string
+ version by calling setVersion.
+
+ Implementation detail: we store both an integer version and string
+ version for a particular database. If both are set we give preference
+ to the integer version and assume the db is on the integer track.
+
+ Test: storage/indexeddb/intversion-two-opens-no-versions.html
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore):
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ (WebCore::IDBDatabaseBackendImpl::setVersion):
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ Now that this can be called even after an int version is set we have
+ to make it revoke the int version.
+
+ (WebCore::IDBDatabaseBackendImpl::openConnection):
+ Nested ifs were getting deep, so refactor to return early instead.
+
+ (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
+ (WebCore::IDBDatabaseBackendImpl::resetVersion):
+ Now that an int version could have been set before setVersion was
+ called we have to reset the int version on abort.
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+ (IDBDatabaseBackendImpl):
+ * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+ (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
+ * Modules/indexeddb/IDBOpenDBRequest.cpp:
+ 0 is now a valid integer version to store to leveldb if an idb
+ database is reverting to a string version.
+
+ (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+ If the open request did not specify an integer version but
+ upgradeneeded is called, it means the database was given the default
+ version of 1.
+
+2012-09-19 Dominic Mazzoni <dmazzoni@google.com>
+
+ AX: A few control types are returning the wrong answer for isReadOnly
+ https://bugs.webkit.org/show_bug.cgi?id=96735
+
+ Reviewed by Chris Fleizach.
+
+ All input types should be read-only except ones that
+ are text fields. The previous logic was marking things like
+ checkboxes as not read-only.
+
+ Tests: platform/chromium/accessibility/readonly.html
+ platform/mac/accessibility/form-control-value-settable.html
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::isReadOnly):
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove unused PlatformSupport reference in V8GCController
+ https://bugs.webkit.org/show_bug.cgi?id=97118
+
+ Reviewed by Ryosuke Niwa.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * bindings/v8/V8GCController.cpp:
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove unused PlatformSupport reference in V8DOMWindowShell
+ https://bugs.webkit.org/show_bug.cgi?id=97117
+
+ Reviewed by Ryosuke Niwa.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+
+2012-09-19 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Remove WorkerContextExecutionProxy::runScript()
+ https://bugs.webkit.org/show_bug.cgi?id=97060
+
+ Reviewed by Adam Barth.
+
+ To kill WorkerContextExecutionProxy, this patch removes
+ WorkerContextExecutionProxy::runScript() by replacing it
+ with ScriptRunner::runCompiledScript().
+
+ For the replacement, this patch moves TryCatch logic in
+ runCompiledScript() to the caller side. The reason why
+ we have to avoid nesting TryCatches is a V8 bug:
+ http://code.google.com/p/v8/issues/detail?id=2166
+
+ No tests. No change in behavior.
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::compileAndRunScript):
+ * bindings/v8/ScriptRunner.cpp:
+ (WebCore::ScriptRunner::runCompiledScript):
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ (WorkerContextExecutionProxy):
+
+2012-09-19 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Fix vertical positioning problem for 'X' in search field
+ https://bugs.webkit.org/show_bug.cgi?id=97126
+
+ Reviewed by Antonio Gomes.
+
+ We have the same problem as described in bug 30245, so integrate that code.
+
+ * platform/blackberry/RenderThemeBlackBerry.cpp:
+ (WebCore::RenderThemeBlackBerry::convertToPaintingRect):
+ (WebCore):
+ (WebCore::RenderThemeBlackBerry::paintSearchFieldCancelButton):
+
+2012-09-19 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Remove custom painting code for searchCancel
+ https://bugs.webkit.org/show_bug.cgi?id=97119
+
+ Reviewed by Antonio Gomes.
+
+ Remove the dynamic painting code for searchCancel, we use a png file now.
+
+ * platform/graphics/blackberry/ImageBlackBerry.cpp:
+ (WebCore::Image::loadPlatformResource):
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move notifyJSOutOfMemory out of PlatformSupport
+ https://bugs.webkit.org/show_bug.cgi?id=97116
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::handleOutOfMemory):
+ * loader/FrameLoaderClient.h:
+ (WebCore::FrameLoaderClient::didExhaustMemoryAvailableForScript):
+ (FrameLoaderClient):
+ * platform/chromium/PlatformSupport.h:
+ (PlatformSupport):
+
+2012-09-18 Dirk Schulze <krit@webkit.org>
+
+ Implement 'mask-type' for <mask>
+ https://bugs.webkit.org/show_bug.cgi?id=97011
+
+ Reviewed by Andreas Kling.
+
+ The CSS Masking specification defines the presentation attribute 'mask-type' to
+ switch between luminance and alpha masking. 'mask-type' just affects the SVG
+ mask element. The luminance masking is the current behavior of of SVG masking.
+ Alpha masking is simular to '-webkit-mask-image'.
+
+ This patch implements this property and make it possible to switch between both
+ masking modes. Since the default value is 'luminance', this does not break
+ exisiting content which is tested with exisiting tests.
+
+ http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#the-mask-type
+
+ Tests: svg/css/mask-type.html
+ svg/masking/mask-type-alpha-expected.svg
+ svg/masking/mask-type-alpha.svg
+ svg/masking/mask-type-luminance-expected.svg
+ svg/masking/mask-type-luminance.svg
+ svg/masking/mask-type-not-set-expected.svg
+ svg/masking/mask-type-not-set.svg
+
+ * css/CSSComputedStyleDeclaration.cpp: Add mask-type property.
+ (WebCore):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore):
+ (WebCore::CSSPrimitiveValue::operator EMaskType):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/SVGCSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
+ * css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGValue):
+ * css/SVGCSSPropertyNames.in: Add mask-type.
+ * css/SVGCSSStyleSelector.cpp:
+ (WebCore::StyleResolver::applySVGProperty):
+ * css/SVGCSSValueKeywords.in:
+ * rendering/style/SVGRenderStyle.cpp:
+ (WebCore::SVGRenderStyle::diff):
+ * rendering/style/SVGRenderStyle.h:
+ (WebCore::SVGRenderStyle::initialMaskType):
+ (WebCore::SVGRenderStyle::setMaskType):
+ (SVGRenderStyle):
+ (WebCore::SVGRenderStyle::maskType):
+ (WebCore::SVGRenderStyle::setBitDefaults):
+ * rendering/style/SVGRenderStyleDefs.h:
+ * rendering/svg/RenderSVGResourceMasker.cpp:
+
+ Switch between the two masking modes according to the
+ computed value of mask-type.
+
+ (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+ * svg/SVGStyledElement.cpp:
+ (WebCore::SVGStyledElement::cssPropertyIdForSVGAttributeName):
+ (WebCore::cssPropertyToTypeMap):
+ * svg/svgattrs.in: Add the new attribute to the attribute list.
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove unused popupsAllowed function from PlatformSupport
+ https://bugs.webkit.org/show_bug.cgi?id=96521
+
+ Reviewed by Eric Seidel.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * bindings/v8/NPV8Object.cpp:
+ (WebCore::v8ObjectToNPObject):
+ (_NPN_Evaluate):
+ (_NPN_GetProperty):
+ * platform/chromium/PlatformSupport.h:
+ (PlatformSupport):
+
+2012-09-19 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] Add function playerId() in class PageClientBlackBerry
+ https://bugs.webkit.org/show_bug.cgi?id=97099
+
+ Reviewed by Yong Li.
+
+ Added function playerID() in class PageClientBlackBerry.
+
+ Internally reviewed by Charles Wei.
+
+ No new tests since there's no functional change.
+
+ * platform/blackberry/PageClientBlackBerry.h:
+
+2012-09-19 Raul Hudea <rhudea@adobe.com>
+
+ [CSSRegions][CSSOM] Make sure all Regions APIs are not visible if CSS_REGIONS is not defined
+ https://bugs.webkit.org/show_bug.cgi?id=96300
+
+ Reviewed by Yury Semikhatsky.
+
+ All CSS Regions APIs should be exposed only if CSS_REGIONS is enabled
+
+ No new tests because of no behavior changes.
+
+ * css/StyleRule.cpp:
+ (WebCore::StyleRuleBase::reportMemoryUsage): Fix compile without CSS_REGIONS enabled and added an ASSERT_NOT_REACHED as in other functions
+ * dom/Element.cpp: Compile webkitRegionOverset only if CSS_REGIONS is enabled
+ (WebCore):
+ * dom/Element.h:
+ * dom/Element.idl: Expose webkitRegionOverset only if CSS_REGIONS is enabled
+
+2012-09-19 Patrick Gansterer <paroga@webkit.org>
+
+ Remove all usages of M_PI from WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=93109
+
+ Reviewed by Dirk Schulze.
+
+ <wtf/MathExtras.h> implements many functions dealing with M_PI.
+ Use them in WebCore instead of duplicating the functionality.
+
+ * platform/blackberry/PlatformTouchEventBlackBerry.cpp:
+ (WebCore::PlatformTouchEvent::PlatformTouchEvent):
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (PlatformCALayer::setFilters):
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::drawEllipse):
+ (WebCore::GraphicsContext::strokeArc):
+ * platform/graphics/wx/FontPlatformDataWxMac.mm:
+ * platform/mac/WebWindowAnimation.mm:
+ (-[WebWindowScaleAnimation currentValue]):
+ * platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp:
+ (DegToRad):
+ (RadToDeg):
+
+2012-09-10 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Network request headers text fallback has typo.
+ https://bugs.webkit.org/show_bug.cgi?id=96280
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/NetworkRequest.js:
+ (WebInspector.NetworkRequest.prototype.get requestHeadersText):
+ (WebInspector.NetworkRequest.prototype.get responseHeadersText):
+
+2012-09-19 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] remove static_cast which will cause video crash
+ https://bugs.webkit.org/show_bug.cgi?id=97070
+
+ Reviewed by Antonio Gomes.
+
+ Removed the static_cast to avoid layering violation which
+ will cause a runtime crash.
+ We won't create a real MediaPlayerPrivate object before we call
+ MediaPlayer::load(), so if we use player()->implementation()
+ before calling load() in some cases, it points to a
+ NullMediaPlayerPrivate object. Here we should not use static_cast,
+ instead we should use HTMLMediaElement::percentLoaded() to
+ avoid layering violation as we don't have the buffering bug which
+ the deleted comment refers to.
+
+ Internally reviewed by Max Feil.
+
+ Test case: media/video-size.html
+
+ * platform/blackberry/RenderThemeBlackBerry.cpp:
+ (WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):
+
+2012-09-19 Rick Byers <rbyers@chromium.org>
+
+ Do touch adjustment on GestureTapDown
+ https://bugs.webkit.org/show_bug.cgi?id=96677
+
+ Reviewed by Antonio Gomes.
+
+ Do touch adjustment on GestureTapDown exactly as for GestureTap today.
+
+ Test: touchadjustment/touch-links-active.html
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleGestureEvent):
+ (WebCore::EventHandler::adjustGesturePosition):
+
+2012-09-19 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Unreviewed another follow up Apple Win build fix for r128992.
+
+ * inspector/InspectorAllInOne.cpp:
+
+2012-09-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] REGRESSION(r128907): it broke several WebKit2 API tests
+ https://bugs.webkit.org/show_bug.cgi?id=97092
+
+ Reviewed by Martin Robinson.
+
+ Calling resizeLater() from the constructor of
+ RedirectedXCompositeWindow can cause the callback to be called
+ later by the main loop after the RedirectedXCompositeWindow object
+ has been destroyed. Instead of calling resizeLater(), initialize
+ the usable size to the given initial size.
+
+ * platform/gtk/RedirectedXCompositeWindow.cpp:
+ (WebCore::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
+
+2012-09-19 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Unreviewed follow up Apple Win build fix for r128992.
+
+ * inspector/InspectorAllInOne.cpp:
+
+2012-09-19 Andrey Adaikin <aandrey@chromium.org>
+
+ Web Inspector: [WebGL] -> [Canvas] Rename WebGLAgent to CanvasAgent
+ https://bugs.webkit.org/show_bug.cgi?id=96917
+
+ Reviewed by Vsevolod Vlasov.
+
+ Rename WebGLAgent* and WebGLInstrumentation* files to Canvas* as we will support both 2D and 3D/WebGL canvas instrumentation.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSHTMLCanvasElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/InjectedScriptCanvasModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.cpp.
+ (WebCore):
+ (WebCore::InjectedScriptCanvasModule::InjectedScriptCanvasModule):
+ (WebCore::InjectedScriptCanvasModule::moduleForState):
+ (WebCore::InjectedScriptCanvasModule::source):
+ (WebCore::InjectedScriptCanvasModule::wrapWebGLContext):
+ (WebCore::InjectedScriptCanvasModule::captureFrame):
+ (WebCore::InjectedScriptCanvasModule::dropTraceLog):
+ (WebCore::InjectedScriptCanvasModule::traceLog):
+ (WebCore::InjectedScriptCanvasModule::replayTraceLog):
+ * inspector/InjectedScriptCanvasModule.h: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.h.
+ (WebCore):
+ (InjectedScriptCanvasModule):
+ * inspector/InjectedScriptCanvasModuleSource.js: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js.
+ (.):
+ * inspector/Inspector.json:
+ * inspector/InspectorAllInOne.cpp:
+ * inspector/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWebGLAgent.cpp.
+ (WebCore):
+ (CanvasAgentState):
+ (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::~InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::setFrontend):
+ (WebCore::InspectorCanvasAgent::clearFrontend):
+ (WebCore::InspectorCanvasAgent::restore):
+ (WebCore::InspectorCanvasAgent::enable):
+ (WebCore::InspectorCanvasAgent::disable):
+ (WebCore::InspectorCanvasAgent::dropTraceLog):
+ (WebCore::InspectorCanvasAgent::captureFrame):
+ (WebCore::InspectorCanvasAgent::getTraceLog):
+ (WebCore::InspectorCanvasAgent::replayTraceLog):
+ (WebCore::InspectorCanvasAgent::wrapWebGLRenderingContextForInstrumentation):
+ (WebCore::InspectorCanvasAgent::injectedScriptCanvasModuleForTraceLogId):
+ * inspector/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorWebGLAgent.h.
+ (WebCore):
+ (InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::create):
+ (WebCore::InspectorCanvasAgent::enabled):
+ * inspector/InspectorCanvasInstrumentation.h: Renamed from Source/WebCore/inspector/InspectorWebGLInstrumentation.h.
+ (WebCore):
+ (WebCore::InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InstrumentingAgents.h:
+ (WebCore):
+ (WebCore::InstrumentingAgents::InstrumentingAgents):
+ (WebCore::InstrumentingAgents::inspectorCanvasAgent):
+ (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
+ (InstrumentingAgents):
+ * inspector/compile-front-end.py:
+ * inspector/front-end/CanvasProfileView.js: Renamed from Source/WebCore/inspector/front-end/WebGLProfileView.js.
+ (WebInspector.CanvasProfileView):
+ (WebInspector.CanvasProfileView.prototype.dispose):
+ (WebInspector.CanvasProfileView.prototype.get statusBarItems):
+ (WebInspector.CanvasProfileView.prototype.get profile):
+ (WebInspector.CanvasProfileView.prototype.wasShown):
+ (WebInspector.CanvasProfileView.prototype.willHide):
+ (WebInspector.CanvasProfileView.prototype._showTraceLog):
+ (WebInspector.CanvasProfileView.prototype._onTraceLogItemClick.didReplayTraceLog):
+ (WebInspector.CanvasProfileView.prototype._onTraceLogItemClick):
+ (WebInspector.CanvasProfileType):
+ (WebInspector.CanvasProfileType.prototype.get buttonTooltip):
+ (WebInspector.CanvasProfileType.prototype.buttonClicked.didStartCapturingFrame):
+ (WebInspector.CanvasProfileType.prototype.buttonClicked):
+ (WebInspector.CanvasProfileType.prototype.get treeItemTitle):
+ (WebInspector.CanvasProfileType.prototype.get description):
+ (WebInspector.CanvasProfileType.prototype.reset):
+ (WebInspector.CanvasProfileType.prototype.createTemporaryProfile):
+ (WebInspector.CanvasProfileType.prototype.createProfile):
+ (WebInspector.CanvasProfileHeader):
+ (WebInspector.CanvasProfileHeader.prototype.traceLogId):
+ (WebInspector.CanvasProfileHeader.prototype.createSidebarTreeElement):
+ (WebInspector.CanvasProfileHeader.prototype.createView):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/canvasProfiler.css: Renamed from Source/WebCore/inspector/front-end/webGLProfiler.css.
+ (.canvas-profile-view):
+ (.canvas-trace-log):
+ (.canvas-trace-log div):
+ (#canvas-replay-image-container):
+ (#canvas-replay-image):
+
+2012-09-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add API to get/set the security policy of a given URI scheme to WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=96497
+
+ Reviewed by Martin Robinson.
+
+ * WebCore.exp.in: Add new exported symbols.
+
+2012-09-19 Patrick Gansterer <paroga@webkit.org>
+
+ [WIN] Use BString in favour of BSTR to improve memory management
+ https://bugs.webkit.org/show_bug.cgi?id=93128
+
+ Reviewed by Anders Carlsson.
+
+ BString automatically calls SysFreeString() in its destructor which helps
+ avoiding memory leaks. So it should be used instead of BSTR directly.
+ Add operator& to BString to allow its usage for out parameters too (like COMPtr).
+ This fixes already a few memory leaks in the existing code.
+
+ * platform/win/BString.cpp:
+ (WebCore::BString::~BString):
+ (WebCore::BString::adoptBSTR):
+ (WebCore::BString::clear):
+ (WebCore):
+ * platform/win/BString.h:
+ (BString):
+ (WebCore::BString::operator&):
+
+2012-09-19 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Link failure with bfd linker on --minimal build
+ https://bugs.webkit.org/show_bug.cgi?id=97075
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix two dependency errors triggered by --minimal:
+
+ - GStreamerVersioning.cpp uses functions from libgstvideo (gst_video_format_parse_caps), so we need to pull
+ that module not only when video is enabled by generally when using gstreamer.
+ - GraphicsSurfaceGLX depends on Xlib (XOpenDisplay, etc.), so we need to do CONFIG += x11 to get that and not
+ implicitly rely on x11 netscape plugins being enabled.
+
+ * WebCore.pri:
+
+2012-09-19 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Rename the RTCIceServer uri parameter to url.
+ https://bugs.webkit.org/show_bug.cgi?id=97086
+
+ Reviewed by Hajime Morita.
+
+ Either the standard has changed or I can't read.
+ http://dev.w3.org/2011/webrtc/editor/webrtc.html#dictionary-rtciceserver-members
+
+ Existing tests changed to cover this patch.
+
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::parseConfiguration):
+
+2012-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r128976.
+ http://trac.webkit.org/changeset/128976
+ https://bugs.webkit.org/show_bug.cgi?id=97083
+
+ Breaks compilation on QT, Apple WIn (Requested by vsevik on
+ #webkit).
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSHTMLCanvasElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/InjectedScriptWebGLModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptCanvasModule.cpp.
+ (WebCore):
+ (WebCore::InjectedScriptWebGLModule::InjectedScriptWebGLModule):
+ (WebCore::InjectedScriptWebGLModule::moduleForState):
+ (WebCore::InjectedScriptWebGLModule::source):
+ (WebCore::InjectedScriptWebGLModule::wrapWebGLContext):
+ (WebCore::InjectedScriptWebGLModule::captureFrame):
+ (WebCore::InjectedScriptWebGLModule::dropTraceLog):
+ (WebCore::InjectedScriptWebGLModule::traceLog):
+ (WebCore::InjectedScriptWebGLModule::replayTraceLog):
+ * inspector/InjectedScriptWebGLModule.h: Renamed from Source/WebCore/inspector/InjectedScriptCanvasModule.h.
+ (WebCore):
+ (InjectedScriptWebGLModule):
+ * inspector/InjectedScriptWebGLModuleSource.js: Renamed from Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js.
+ (.):
+ * inspector/Inspector.json:
+ * inspector/InspectorAllInOne.cpp:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorWebGLAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
+ (WebCore):
+ (WebGLAgentState):
+ (WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
+ (WebCore::InspectorWebGLAgent::~InspectorWebGLAgent):
+ (WebCore::InspectorWebGLAgent::setFrontend):
+ (WebCore::InspectorWebGLAgent::clearFrontend):
+ (WebCore::InspectorWebGLAgent::restore):
+ (WebCore::InspectorWebGLAgent::enable):
+ (WebCore::InspectorWebGLAgent::disable):
+ (WebCore::InspectorWebGLAgent::dropTraceLog):
+ (WebCore::InspectorWebGLAgent::captureFrame):
+ (WebCore::InspectorWebGLAgent::getTraceLog):
+ (WebCore::InspectorWebGLAgent::replayTraceLog):
+ (WebCore::InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation):
+ (WebCore::InspectorWebGLAgent::injectedScriptWebGLModuleForTraceLogId):
+ * inspector/InspectorWebGLAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
+ (WebCore):
+ (InspectorWebGLAgent):
+ (WebCore::InspectorWebGLAgent::create):
+ (WebCore::InspectorWebGLAgent::enabled):
+ * inspector/InspectorWebGLInstrumentation.h: Renamed from Source/WebCore/inspector/InspectorCanvasInstrumentation.h.
+ (WebCore):
+ (WebCore::InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation):
+ * inspector/InstrumentingAgents.h:
+ (WebCore):
+ (WebCore::InstrumentingAgents::InstrumentingAgents):
+ (InstrumentingAgents):
+ (WebCore::InstrumentingAgents::inspectorWebGLAgent):
+ (WebCore::InstrumentingAgents::setInspectorWebGLAgent):
+ * inspector/compile-front-end.py:
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+ * inspector/front-end/WebGLProfileView.js: Renamed from Source/WebCore/inspector/front-end/CanvasProfileView.js.
+ (WebInspector.WebGLProfileView):
+ (WebInspector.WebGLProfileView.prototype.dispose):
+ (WebInspector.WebGLProfileView.prototype.get statusBarItems):
+ (WebInspector.WebGLProfileView.prototype.get profile):
+ (WebInspector.WebGLProfileView.prototype.wasShown):
+ (WebInspector.WebGLProfileView.prototype.willHide):
+ (WebInspector.WebGLProfileView.prototype._showTraceLog):
+ (WebInspector.WebGLProfileView.prototype._onTraceLogItemClick.didReplayTraceLog):
+ (WebInspector.WebGLProfileView.prototype._onTraceLogItemClick):
+ (WebInspector.WebGLProfileType):
+ (WebInspector.WebGLProfileType.prototype.get buttonTooltip):
+ (WebInspector.WebGLProfileType.prototype.buttonClicked.didStartCapturingFrame):
+ (WebInspector.WebGLProfileType.prototype.buttonClicked):
+ (WebInspector.WebGLProfileType.prototype.get treeItemTitle):
+ (WebInspector.WebGLProfileType.prototype.get description):
+ (WebInspector.WebGLProfileType.prototype.reset):
+ (WebInspector.WebGLProfileType.prototype.createTemporaryProfile):
+ (WebInspector.WebGLProfileType.prototype.createProfile):
+ (WebInspector.WebGLProfileHeader):
+ (WebInspector.WebGLProfileHeader.prototype.traceLogId):
+ (WebInspector.WebGLProfileHeader.prototype.createSidebarTreeElement):
+ (WebInspector.WebGLProfileHeader.prototype.createView):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/webGLProfiler.css: Renamed from Source/WebCore/inspector/front-end/canvasProfiler.css.
+ (.webgl-profile-view):
+ (.webgl-trace-log):
+ (.webgl-trace-log div):
+ (#webgl-replay-image-container):
+ (#webgl-replay-image):
+
+2012-09-19 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt][Win] Fix rendering of flash content when scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=92905
+
+ Reviewed by Jocelyn Turcotte.
+
+ Fix rendering offset similar to r121441.
+
+ * plugins/win/PluginViewWin.cpp:
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::setNPWindowRect):
+
+2012-09-19 Andrey Adaikin <aandrey@chromium.org>
+
+ Web Inspector: [WebGL] -> [Canvas] Rename WebGLAgent to CanvasAgent
+ https://bugs.webkit.org/show_bug.cgi?id=96917
+
+ Reviewed by Vsevolod Vlasov.
+
+ Rename WebGLAgent* and WebGLInstrumentation* files to Canvas* as we will support both 2D and 3D/WebGL canvas instrumentation.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSHTMLCanvasElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/InjectedScriptCanvasModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.cpp.
+ (WebCore):
+ (WebCore::InjectedScriptCanvasModule::InjectedScriptCanvasModule):
+ (WebCore::InjectedScriptCanvasModule::moduleForState):
+ (WebCore::InjectedScriptCanvasModule::source):
+ (WebCore::InjectedScriptCanvasModule::wrapWebGLContext):
+ (WebCore::InjectedScriptCanvasModule::captureFrame):
+ (WebCore::InjectedScriptCanvasModule::dropTraceLog):
+ (WebCore::InjectedScriptCanvasModule::traceLog):
+ (WebCore::InjectedScriptCanvasModule::replayTraceLog):
+ * inspector/InjectedScriptCanvasModule.h: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModule.h.
+ (WebCore):
+ (InjectedScriptCanvasModule):
+ * inspector/InjectedScriptCanvasModuleSource.js: Renamed from Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js.
+ (.):
+ * inspector/Inspector.json:
+ * inspector/InspectorAllInOne.cpp:
+ * inspector/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWebGLAgent.cpp.
+ (WebCore):
+ (CanvasAgentState):
+ (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::~InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::setFrontend):
+ (WebCore::InspectorCanvasAgent::clearFrontend):
+ (WebCore::InspectorCanvasAgent::restore):
+ (WebCore::InspectorCanvasAgent::enable):
+ (WebCore::InspectorCanvasAgent::disable):
+ (WebCore::InspectorCanvasAgent::dropTraceLog):
+ (WebCore::InspectorCanvasAgent::captureFrame):
+ (WebCore::InspectorCanvasAgent::getTraceLog):
+ (WebCore::InspectorCanvasAgent::replayTraceLog):
+ (WebCore::InspectorCanvasAgent::wrapWebGLRenderingContextForInstrumentation):
+ (WebCore::InspectorCanvasAgent::injectedScriptCanvasModuleForTraceLogId):
+ * inspector/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorWebGLAgent.h.
+ (WebCore):
+ (InspectorCanvasAgent):
+ (WebCore::InspectorCanvasAgent::create):
+ (WebCore::InspectorCanvasAgent::enabled):
+ * inspector/InspectorCanvasInstrumentation.h: Renamed from Source/WebCore/inspector/InspectorWebGLInstrumentation.h.
+ (WebCore):
+ (WebCore::InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InstrumentingAgents.h:
+ (WebCore):
+ (WebCore::InstrumentingAgents::InstrumentingAgents):
+ (WebCore::InstrumentingAgents::inspectorCanvasAgent):
+ (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
+ (InstrumentingAgents):
+ * inspector/compile-front-end.py:
+ * inspector/front-end/CanvasProfileView.js: Renamed from Source/WebCore/inspector/front-end/WebGLProfileView.js.
+ (WebInspector.CanvasProfileView):
+ (WebInspector.CanvasProfileView.prototype.dispose):
+ (WebInspector.CanvasProfileView.prototype.get statusBarItems):
+ (WebInspector.CanvasProfileView.prototype.get profile):
+ (WebInspector.CanvasProfileView.prototype.wasShown):
+ (WebInspector.CanvasProfileView.prototype.willHide):
+ (WebInspector.CanvasProfileView.prototype._showTraceLog):
+ (WebInspector.CanvasProfileView.prototype._onTraceLogItemClick.didReplayTraceLog):
+ (WebInspector.CanvasProfileView.prototype._onTraceLogItemClick):
+ (WebInspector.CanvasProfileType):
+ (WebInspector.CanvasProfileType.prototype.get buttonTooltip):
+ (WebInspector.CanvasProfileType.prototype.buttonClicked.didStartCapturingFrame):
+ (WebInspector.CanvasProfileType.prototype.buttonClicked):
+ (WebInspector.CanvasProfileType.prototype.get treeItemTitle):
+ (WebInspector.CanvasProfileType.prototype.get description):
+ (WebInspector.CanvasProfileType.prototype.reset):
+ (WebInspector.CanvasProfileType.prototype.createTemporaryProfile):
+ (WebInspector.CanvasProfileType.prototype.createProfile):
+ (WebInspector.CanvasProfileHeader):
+ (WebInspector.CanvasProfileHeader.prototype.traceLogId):
+ (WebInspector.CanvasProfileHeader.prototype.createSidebarTreeElement):
+ (WebInspector.CanvasProfileHeader.prototype.createView):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/canvasProfiler.css: Renamed from Source/WebCore/inspector/front-end/webGLProfiler.css.
+ (.canvas-profile-view):
+ (.canvas-trace-log):
+ (.canvas-trace-log div):
+ (#canvas-replay-image-container):
+ (#canvas-replay-image):
+
+2012-09-18 Kenichi Ishibashi <bashi@chromium.org>
+
+ [Chromium] SkiaGetGlyphWidthAndExtents() should invert y-axis
+ https://bugs.webkit.org/show_bug.cgi?id=97067
+
+ Reviewed by Yuta Kitamura.
+
+ Invert skBounds.fTop and skBounds.height(). Don't call hb_font_set_ppem().
+
+ No new tests. Arabic shadda (U+0651) should be placed more higher when Arabic lam (U+0644) follows it.
+ Tests under svg/W3C-I18N contain such sequences so these tests cover this change.
+
+ * platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp:
+ (WebCore::SkiaGetGlyphWidthAndExtents):
+ (WebCore::HarfBuzzNGFace::createFont):
+
+2012-09-18 Kenichi Ishibashi <bashi@chromium.org>
+
+ [Chromium] Don't treat tab as spaces for word-end in HarfBuzzShaper
+ https://bugs.webkit.org/show_bug.cgi?id=97068
+
+ Reviewed by Yuta Kitamura.
+
+ No new tests. fast/text/wide-zero-width-space.html should cover this change.
+
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
+ (WebCore::normalizeCharacters): Don't treat tab as space.
+
+2012-09-18 Eric Carlson <eric.carlson@apple.com>
+
+ Check settings before registering AVFoundation media engine.
+ https://bugs.webkit.org/show_bug.cgi?id=97048
+ <rdar://problem/12313594>
+
+ Reviewed by Dan Bernstein.
+
+ Fix the bug introduced in r122676.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::installedMediaEngines): Uncomment the call to check AVFoundation settings.
+
+2012-09-18 Sailesh Agrawal <sail@chromium.org>
+
+ Chromium: Scrollbar with tickmarks doesn't respond to clicks
+ https://bugs.webkit.org/show_bug.cgi?id=96049
+
+ Reviewed by Beth Dakin.
+
+ Currently when a scrollbar has tickmarks its forced to be visible by setting its alpha to 1.0. The alpha value is reset to its old value at the end of the drawing routine. This approach doesn't work with the hit testing code which relies on the scrollbar's alpha value
+
+ Unfortunately there doesn't seem to be anyway to force a scrollbar to be visible. The closest API is -[NSScrollerImpPair lockOverlayScrollerState:]. Unfortunately this locks both the horizontal and vertical scrollbar. It also doesn't expand the knob width.
+
+ My fix simply adds a new alphaLocked attribute to the scrollbar. If this attribute is set to true then hit testing will return true.
+
+ Test: fast/scrolling/scrollbar-tickmarks-hittest.html
+
+ * WebCore.exp.in:
+ * WebCore.order:
+ * page/Settings.cpp:
+ (WebCore):
+ (WebCore::Settings::setUsesOverlayScrollbars): Sets the usesOverlayScrollbars flag.
+ (WebCore::Settings::usesOverlayScrollbars): Gets the usesOverlayScrollbars flag.
+ * page/Settings.h:
+ (Settings):
+ * platform/Scrollbar.cpp:
+ (WebCore::Scrollbar::Scrollbar):
+ * platform/Scrollbar.h:
+ (WebCore::Scrollbar::isAlphaLocked):
+ (WebCore::Scrollbar::setIsAlphaLocked):
+ (Scrollbar):
+ * platform/ScrollbarThemeClient.h:
+ (ScrollbarThemeClient):
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::paint): Updated to set and unset the alphaLocked attribute.
+ * platform/chromium/support/WebScrollbarImpl.cpp:
+ (WebKit::WebScrollbarImpl::isAlphaLocked):
+ (WebKit):
+ (WebKit::WebScrollbarImpl::setIsAlphaLocked):
+ * platform/chromium/support/WebScrollbarImpl.h:
+ (WebScrollbarImpl):
+ * platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
+ (WebCore::CCScrollbarLayerImpl::CCScrollbarLayerImpl):
+ (WebCore::CCScrollbarLayerImpl::CCScrollbar::isAlphaLocked):
+ (WebCore):
+ (WebCore::CCScrollbarLayerImpl::CCScrollbar::setIsAlphaLocked):
+ * platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
+ (CCScrollbar):
+ (CCScrollbarLayerImpl):
+ * platform/mac/NSScrollerImpDetails.mm:
+ (WebCore::recommendedScrollerStyle): Check the usesOverlayScrollbars setting to see if overlay scrollbars should be forced on.
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting): Updated to check the alphaLocked attribute.
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::reset): Resets the usesOverlayScrollbars setting.
+ (WebCore::InternalSettings::setUsesOverlayScrollbars): Sets the usesOverlayScrollbars setting.
+ (WebCore):
+ * testing/InternalSettings.h:
+ (InternalSettings):
+ * testing/InternalSettings.idl: Add a new setUsesOverlayScrollbars function.
+
+2012-09-18 Kentaro Hara <haraken@chromium.org>
+
+ [V8] Notification.requestPermission(function() {alert();}) crashes
+ https://bugs.webkit.org/show_bug.cgi?id=94462
+
+ Reviewed by Adam Barth.
+
+ Since Notification.requestPermission() is a static method,
+ we need to use getExecutionContext() instead of retrieving a context
+ from a DOM object.
+
+ Test: http/tests/notifications/notification-request-permission.html
+
+ * bindings/v8/custom/V8NotificationCustom.cpp:
+ (WebCore::V8Notification::requestPermissionCallback):
+
+2012-09-18 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Refactoring] ContentDistributor::distributeSelectionsTo should not change ContentDistribution pool.
+ https://bugs.webkit.org/show_bug.cgi?id=96993
+
+ Reviewed by Dimitri Glazkov.
+
+ Since we would like to reuse ContentDistribution pool, it should not be updated in
+ ContentDistributor::distributeSelectionsTo. Instead, we should have Vector<bool> to indicate an element is
+ distributed or not.
+
+ No new tests, simple refactoring.
+
+ * html/shadow/ContentDistributor.cpp:
+ (WebCore::ContentDistributor::distribute):
+ (WebCore::ContentDistributor::distributeSelectionsTo):
+ * html/shadow/ContentDistributor.h:
+ (ContentDistributor):
+
+2012-09-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Title string should be changed when document.title is set to ''.
+ https://bugs.webkit.org/show_bug.cgi?id=96793
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DocumentLoader::setTitle() function returns without anything (changing
+ m_pageTitle and calling FrameLoaderClient::setTitle()) when new title
+ string is empty.
+ So, when document.title is set to '', title string of a browser cannot
+ be changed.
+ For applying the change of document.title properly, empty string check
+ should be removed.
+
+ Test: fast/dom/title-text-property-assigning-empty-string.html
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::setTitle):
+
+2012-09-18 Simon Fraser <simon.fraser@apple.com>
+
+ fast/forms/search-event-delay.html is asserting in markAllMisspellingsAndBadGrammarInRanges()
+ https://bugs.webkit.org/show_bug.cgi?id=82761
+
+ Reviewed by Ryosuke Niwa.
+
+ Speculative fix for this assertion: have InternalSettings save
+ and restore the value of the "unifiedTextCheckerEnabled" setting
+ between tests, so that tests change the value of this setting don't
+ affect later tests.
+
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::Backup::Backup):
+ (WebCore::InternalSettings::Backup::restoreTo):
+ * testing/InternalSettings.h:
+ (Backup):
+
+2012-09-18 John Mellor <johnme@chromium.org>
+
+ Text Autosizing: Ignore constrained heights in certain circumstances.
+ https://bugs.webkit.org/show_bug.cgi?id=96848
+
+ Reviewed by Julien Chaffraix.
+
+ Ignore constrained heights on html and body elements, as some sites
+ (e.g. wikipedia) set height:100% on these, without intending to
+ constrain the height of descendants.
+
+ Also ignore constrained heights on ancestors of floats and out-of-flow
+ positioned elements with no height set, since the height of these is
+ determined independently from their ancestors.
+
+ Test: fast/text-autosizing/constrained-height-body.html
+ fast/text-autosizing/constrained-out-of-flow.html
+ fast/text-autosizing/constrained-then-float-ancestors.html
+ fast/text-autosizing/constrained-then-position-absolute-ancestors.html
+ fast/text-autosizing/constrained-then-position-fixed-ancestors.html
+
+ * rendering/TextAutosizer.cpp:
+ (WebCore::contentHeightIsConstrained):
+
+ Adjusted constrainedness algorithm.
+
+2012-09-18 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Create a flag to enable PeerConnection00
+ https://bugs.webkit.org/show_bug.cgi?id=96989
+
+ Reviewed by Adam Barth.
+
+ Adding the functionality to separately enable/disable PeerConnection00.
+ For now it is enabled by default.
+
+ Not testable, nor likely to cause issues.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore):
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::deprecatedPeerConnectionEnabled):
+ (WebCore::RuntimeEnabledFeatures::setDeprecatedPeerConnectionEnabled):
+ (WebCore::RuntimeEnabledFeatures::webkitPeerConnection00Enabled):
+ (RuntimeEnabledFeatures):
+
+2012-09-18 Bo Liu <boliu@chromium.org>
+
+ Revert 128780, 128676, 128645
+ https://bugs.webkit.org/show_bug.cgi?id=97022
+
+ Reviewed by Adam Barth.
+
+ I made these revisions to add in-place reload behavior to ImagesEnabled setting.
+ Reverting this for now due to them causing performance regression in
+ chromium, possibly caused by increased calls to
+ PermissionClient::imageAllowed.
+
+ * WebCore.exp.in:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::didBeginDocument):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::willSendRequest):
+ * loader/cache/CachedImage.cpp:
+ (WebCore::CachedImage::load):
+ * loader/cache/CachedImage.h:
+ (WebCore::CachedImage::stillNeedsLoad):
+ * loader/cache/CachedResource.cpp:
+ (WebCore::CachedResource::didAddClient):
+ * loader/cache/CachedResource.h:
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::CachedResourceLoader):
+ (WebCore::CachedResourceLoader::requestImage):
+ (WebCore::CachedResourceLoader::canRequest):
+ (WebCore::CachedResourceLoader::determineRevalidationPolicy):
+ (WebCore::CachedResourceLoader::setAutoLoadImages):
+ * loader/cache/CachedResourceLoader.h:
+ (CachedResourceLoader):
+ * page/Settings.cpp:
+ (WebCore::setLoadsImagesAutomaticallyInAllFrames):
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setLoadsImagesAutomatically):
+ (WebCore::Settings::loadsImagesAutomaticallyTimerFired):
+ (WebCore::Settings::setImagesEnabled):
+ * page/Settings.h:
+ (Settings):
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::Backup::Backup):
+ (WebCore::InternalSettings::Backup::restoreTo):
+ (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
+ * testing/InternalSettings.h:
+ (Backup):
+ (InternalSettings):
+ * testing/InternalSettings.idl:
+
+2012-09-18 John J. Barton <johnjbarton@chromium.org>
+
+ Web Inspector: Set focus on the ExtensionPanel's iframe when it is selected
+ https://bugs.webkit.org/show_bug.cgi?id=96148
+
+ Reviewed by Vsevolod Vlasov.
+
+ ExtensionView ctor calls setDefaultFocusedElement with its iframe,
+ ExtensionPanel ctor calls setDefaultFocusedElement with the extensionView
+ and ExtensionPanel's setDefaultFocusedElement calls its grandparent impl
+
+ Tests: Added hasFocus test to extensions/extension-panel.html
+
+ * inspector/front-end/ExtensionPanel.js:
+ (WebInspector.ExtensionPanel):
+ (WebInspector.ExtensionPanel.prototype.defaultFocusedElement):
+ * inspector/front-end/ExtensionView.js:
+ (WebInspector.ExtensionView):
+
+2012-09-18 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] [WebKit2] Use XComposite window for accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=94417
+
+ Reviewed by Carlos Garcia Campos.
+
+ Instead of rendering directly to the widget's native window, render to an
+ offscreen window redirected to a Pixmap with XComposite.
+
+ No new tests. This will be covered by the existing accelerated compositing tests,
+ which should now give correct pixel results.
+
+ * platform/gtk/RedirectedXCompositeWindow.cpp:
+ (WebCore::RedirectedXCompositeWindow::resize): Add a call to XFlush which ensures
+ that pending X11 operations complete.
+ * platform/gtk/RedirectedXCompositeWindow.h:
+ (WebCore::RedirectedXCompositeWindow::windowId): Added this accessor.
+
+2012-09-18 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Tables without any descendant and auto logical width should have a 0px logical width
+ https://bugs.webkit.org/show_bug.cgi?id=95521
+
+ Reviewed by Abhishek Arya.
+
+ The code would wrongly add the border-spacing in the row direction to the table's logical
+ width even if we didn't have a column. The new behavior matches FireFox and Opera. IE
+ matches our old behavior for inline tables but our new behavior for normal tables which
+ is a bug on their side.
+
+ Tests: fast/table/empty-table-should-take-no-space.html
+ fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout.html
+
+ * rendering/RenderTable.h:
+ (WebCore::RenderTable::borderSpacingInRowDirection):
+ Added this new helper function to return the right border-spacing. Added a FIXME as the code always
+ return the horizontal dimension which is wrong in vertical-writing mode.
+
+ (WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection):
+ Changed to call borderSpacingInRowDirection. Added a comment as to why we don't add border-spacing on
+ border-collapse: separate tables.
+
+2012-09-18 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] Build is broken without option --enable-unstable-features
+ https://bugs.webkit.org/show_bug.cgi?id=96996
+
+ Reviewed by Martin Robinson.
+
+ When searching for the bare feature define in feature_defines_unstable or
+ feature_defines_overrides, search for the bare define followed by = character.
+ This avoids incorrectly matching the ENABLE_VIDEO define to the ENABLE_VIDEO_TRACK
+ overriding define (and works as well for other similarly named feature defines).
+
+ No new tests - no new functionality.
+
+ * GNUmakefile.am:
+
+2012-09-18 Andrey Kosyakov <caseq@chromium.org>
+
+ Web Inspector: [Extensions API] postpone requests to add extensions until extension server is initialized
+ https://bugs.webkit.org/show_bug.cgi?id=97012
+
+ Reviewed by Vsevolod Vlasov.
+
+ - queue extensions being added unless initialization is complete;
+ - add queued extensions upon completion of initialization;
+
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype.initExtensions):
+ (WebInspector.ExtensionServer.prototype._addExtensions):
+ (WebInspector.ExtensionServer.prototype._addExtension):
+ (WebInspector.ExtensionServer.prototype._innerAddExtension):
+
2012-09-18 Christophe Dumez <christophe.dumez@intel.com>
[EFL] min-device-width failures in media tests
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index d1f0972cd..f77555239 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -1044,10 +1044,10 @@ all : InjectedScriptSource.h
InjectedScriptSource.h : InjectedScriptSource.js
perl $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(WebCore)/inspector/InjectedScriptSource.js InjectedScriptSource.h
-all : InjectedScriptWebGLModuleSource.h
+all : InjectedScriptCanvasModuleSource.h
-InjectedScriptWebGLModuleSource.h : InjectedScriptWebGLModuleSource.js
- perl $(WebCore)/inspector/xxd.pl InjectedScriptWebGLModuleSource_js $(WebCore)/inspector/InjectedScriptWebGLModuleSource.js InjectedScriptWebGLModuleSource.h
+InjectedScriptCanvasModuleSource.h : InjectedScriptCanvasModuleSource.js
+ perl $(WebCore)/inspector/xxd.pl InjectedScriptCanvasModuleSource_js $(WebCore)/inspector/InjectedScriptCanvasModuleSource.js InjectedScriptCanvasModuleSource.h
-include $(JS_DOM_HEADERS:.h=.dep)
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index 717930c14..93b0aec9b 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -61,7 +61,7 @@ INSPECTOR_OVERLAY_PAGE = $$PWD/inspector/InspectorOverlayPage.html
INJECTED_SCRIPT_SOURCE = $$PWD/inspector/InjectedScriptSource.js
-INJECTED_SCRIPT_WEBGL_MODULE_SOURCE = $$PWD/inspector/InjectedScriptWebGLModuleSource.js
+INJECTED_SCRIPT_CANVAS_MODULE_SOURCE = $$PWD/inspector/InjectedScriptCanvasModuleSource.js
XPATHBISON = $$PWD/xml/XPathGrammar.y
@@ -787,19 +787,19 @@ inspectorOverlayPage.commands = perl $$PWD/inspector/xxd.pl InspectorOverlayPage
inspectorOverlayPage.add_output_to_sources = false
GENERATORS += inspectorOverlayPage
-# GENERATOR 2-a: inspector injected script source compiler
+# GENERATOR 2: inspector injected script source compiler
injectedScriptSource.output = InjectedScriptSource.h
injectedScriptSource.input = INJECTED_SCRIPT_SOURCE
injectedScriptSource.commands = perl $$PWD/inspector/xxd.pl InjectedScriptSource_js ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
injectedScriptSource.add_output_to_sources = false
GENERATORS += injectedScriptSource
-# GENERATOR 2-b: inspector webgl injected script source compiler
-InjectedScriptWebGLModuleSource.output = InjectedScriptWebGLModuleSource.h
-InjectedScriptWebGLModuleSource.input = INJECTED_SCRIPT_WEBGL_MODULE_SOURCE
-InjectedScriptWebGLModuleSource.commands = perl $$PWD/inspector/xxd.pl InjectedScriptWebGLModuleSource_js ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
-InjectedScriptWebGLModuleSource.add_output_to_sources = false
-GENERATORS += InjectedScriptWebGLModuleSource
+# GENERATOR 3: inspector canvas injected script source compiler
+InjectedScriptCanvasModuleSource.output = InjectedScriptCanvasModuleSource.h
+InjectedScriptCanvasModuleSource.input = INJECTED_SCRIPT_CANVAS_MODULE_SOURCE
+InjectedScriptCanvasModuleSource.commands = perl $$PWD/inspector/xxd.pl InjectedScriptCanvasModuleSource_js ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+InjectedScriptCanvasModuleSource.add_output_to_sources = false
+GENERATORS += InjectedScriptCanvasModuleSource
# GENERATOR 4: CSS grammar
cssbison.output = ${QMAKE_FILE_BASE}.cpp
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index 61f2d9ed4..cfd3f8f10 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -365,9 +365,9 @@ feature_defines += $(strip $(foreach bare_define, \
$(if $(findstring =$(fvalue),$(define)),$(patsubst %=$(fvalue),%,$(define))) \
) \
), \
- $(if $(findstring $(bare_define), $(feature_defines_unstable)), \
+ $(if $(findstring $(bare_define)=, $(feature_defines_unstable)), \
$(filter $(bare_define)=%,$(feature_defines_unstable)), \
- $(if $(findstring $(bare_define), $(feature_defines_overrides)), \
+ $(if $(findstring $(bare_define)=, $(feature_defines_overrides)), \
$(filter $(bare_define)=%,$(feature_defines_overrides)), \
$(filter $(bare_define)=%,$(feature_defines_defaults)) \
) \
@@ -500,10 +500,10 @@ DerivedSources/WebCore/InspectorBackendCommands.js: DerivedSources/WebCore/Inspe
DerivedSources/WebCore/InspectorBackendDispatcher.h: DerivedSources/WebCore/InspectorBackendDispatcher.cpp
DerivedSources/WebCore/InspectorOverlayPage.h: $(WebCore)/inspector/InspectorOverlayPage.html
$(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InspectorOverlayPage_html $(WebCore)/inspector/InspectorOverlayPage.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.h
+DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h: $(WebCore)/inspector/InjectedScriptCanvasModuleSource.js
+ $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptCanvasModuleSource_js $(WebCore)/inspector/InjectedScriptCanvasModuleSource.js $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.h
DerivedSources/WebCore/InjectedScriptSource.h: $(WebCore)/inspector/InjectedScriptSource.js
$(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(WebCore)/inspector/InjectedScriptSource.js $(GENSOURCES_WEBCORE)/InjectedScriptSource.h
-DerivedSources/WebCore/InjectedScriptWebGLModuleSource.h: $(WebCore)/inspector/InjectedScriptWebGLModuleSource.js
- $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptWebGLModuleSource_js $(WebCore)/inspector/InjectedScriptWebGLModuleSource.js $(GENSOURCES_WEBCORE)/InjectedScriptWebGLModuleSource.h
if ENABLE_WEB_AUDIO
# Installing HRTF database wav files
@@ -774,8 +774,8 @@ EXTRA_DIST += \
Source/WebCore/html/parser/HTMLEntityNames.in \
Source/WebCore/icu/LICENSE \
Source/WebCore/inspector/CodeGeneratorInspector.py \
+ Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js \
Source/WebCore/inspector/InjectedScriptSource.js \
- Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js \
Source/WebCore/inspector/Inspector.json \
Source/WebCore/inspector/Inspector-1.0.json \
Source/WebCore/inspector/InspectorOverlayPage.html \
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index ca6dabcf5..8ca8b268e 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -19,8 +19,8 @@ webcore_built_sources += \
DerivedSources/WebCore/HTMLEntityTable.cpp \
DerivedSources/WebCore/HTMLNames.cpp \
DerivedSources/WebCore/HTMLNames.h \
+ DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h \
DerivedSources/WebCore/InjectedScriptSource.h \
- DerivedSources/WebCore/InjectedScriptWebGLModuleSource.h \
DerivedSources/WebCore/InspectorBackendDispatcher.cpp \
DerivedSources/WebCore/InspectorBackendDispatcher.h \
DerivedSources/WebCore/InspectorFrontend.cpp \
@@ -3633,20 +3633,23 @@ webcore_sources += \
Source/WebCore/inspector/InjectedScript.h \
Source/WebCore/inspector/InjectedScriptBase.cpp \
Source/WebCore/inspector/InjectedScriptBase.h \
+ Source/WebCore/inspector/InjectedScriptCanvasModule.cpp \
+ Source/WebCore/inspector/InjectedScriptCanvasModule.h \
Source/WebCore/inspector/InjectedScriptHost.cpp \
Source/WebCore/inspector/InjectedScriptHost.h \
Source/WebCore/inspector/InjectedScriptManager.cpp \
Source/WebCore/inspector/InjectedScriptManager.h \
Source/WebCore/inspector/InjectedScriptModule.cpp \
Source/WebCore/inspector/InjectedScriptModule.h \
- Source/WebCore/inspector/InjectedScriptWebGLModule.cpp \
- Source/WebCore/inspector/InjectedScriptWebGLModule.h \
Source/WebCore/inspector/InspectorAgent.cpp \
Source/WebCore/inspector/InspectorAgent.h \
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp \
Source/WebCore/inspector/InspectorApplicationCacheAgent.h \
Source/WebCore/inspector/InspectorBaseAgent.cpp \
Source/WebCore/inspector/InspectorBaseAgent.h \
+ Source/WebCore/inspector/InspectorCanvasAgent.cpp \
+ Source/WebCore/inspector/InspectorCanvasAgent.h \
+ Source/WebCore/inspector/InspectorCanvasInstrumentation.h \
Source/WebCore/inspector/InspectorClient.cpp \
Source/WebCore/inspector/InspectorClient.h \
Source/WebCore/inspector/InspectorController.cpp \
@@ -3710,9 +3713,6 @@ webcore_sources += \
Source/WebCore/inspector/InspectorTimelineAgent.h \
Source/WebCore/inspector/InspectorValues.cpp \
Source/WebCore/inspector/InspectorValues.h \
- Source/WebCore/inspector/InspectorWebGLAgent.cpp \
- Source/WebCore/inspector/InspectorWebGLAgent.h \
- Source/WebCore/inspector/InspectorWebGLInstrumentation.h \
Source/WebCore/inspector/InspectorWorkerAgent.cpp \
Source/WebCore/inspector/InspectorWorkerAgent.h \
Source/WebCore/inspector/InspectorWorkerResource.h \
diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
index f060e72ef..11b511fc3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
@@ -44,18 +44,20 @@ class SecurityOrigin;
class IDBBackingStore : public RefCounted<IDBBackingStore> {
public:
+ class Transaction;
+
virtual ~IDBBackingStore() {};
virtual void getDatabaseNames(Vector<String>& foundNames) = 0;
virtual bool getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId) = 0;
virtual bool createIDBDatabaseMetaData(const String& name, const String& stringVersion, int64_t intVersion, int64_t& rowId) = 0;
- virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion) = 0;
- virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version) = 0;
+ virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t intVersion) = 0;
+ virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) = 0;
virtual bool deleteDatabase(const String& name) = 0;
virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags) = 0;
- virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId) = 0;
- virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId) = 0;
+ virtual bool createObjectStore(Transaction*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId) = 0;
+ virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
class ObjectStoreRecordIdentifier : public RefCounted<ObjectStoreRecordIdentifier> {
public:
@@ -64,28 +66,28 @@ public:
};
virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() = 0;
- virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0;
- virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0;
- virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId) = 0;
- virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0;
- virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId) = 0;
- virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) = 0;
- virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0;
+ virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0;
+ virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0;
+ virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
+ virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0;
+ virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
+ virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) = 0;
+ virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0;
class ObjectStoreRecordCallback {
public:
virtual bool callback(const ObjectStoreRecordIdentifier*, const String& value) = 0;
virtual ~ObjectStoreRecordCallback() {};
};
- virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0;
+ virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0;
virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags) = 0;
- virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId) = 0;
- virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0;
- virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0;
- virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0;
- virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0;
- virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) = 0;
+ virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId) = 0;
+ virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0;
+ virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0;
+ virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0;
+ virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0;
+ virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) = 0;
class Cursor : public RefCounted<Cursor> {
public:
@@ -105,10 +107,10 @@ public:
virtual ~Cursor() { };
};
- virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
- virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
- virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
- virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
+ virtual PassRefPtr<Cursor> openObjectStoreCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
+ virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
+ virtual PassRefPtr<Cursor> openIndexKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
+ virtual PassRefPtr<Cursor> openIndexCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
class Transaction : public RefCounted<Transaction> {
public:
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index c51f7f565..34fb0ff28 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -254,9 +254,11 @@ void IDBCursor::postSuccessHandlerCallback()
void IDBCursor::close()
{
- ASSERT(m_request);
- m_request->finishCursor();
- m_request.clear();
+ m_transactionNotifier.cursorFinished();
+ if (m_request) {
+ m_request->finishCursor();
+ m_request.clear();
+ }
}
void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, ScriptValue& value)
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index 8e0c3ad56..43e0bdeee 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -63,6 +63,7 @@ IDBDatabase::IDBDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabase
, m_closePending(false)
, m_contextStopped(false)
, m_databaseCallbacks(callbacks)
+ , m_didSpamConsole(false)
{
// We pass a reference of this object before it can be adopted.
relaxAdoptionRequirement();
@@ -198,6 +199,12 @@ void IDBDatabase::deleteObjectStore(const String& name, ExceptionCode& ec)
PassRefPtr<IDBVersionChangeRequest> IDBDatabase::setVersion(ScriptExecutionContext* context, const String& version, ExceptionCode& ec)
{
+ if (!m_didSpamConsole) {
+ String consoleMessage = ASCIILiteral("The setVersion() method is non-standard and will be removed. Use the \"upgradeneeded\" event instead.");
+ context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
+ m_didSpamConsole = true;
+ }
+
if (version.isNull()) {
ec = NATIVE_TYPE_ERR;
return 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index 112b90a99..3f1da0bc3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -124,6 +124,8 @@ private:
Vector<RefPtr<Event> > m_enqueuedEvents;
RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
+
+ bool m_didSpamConsole;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
index 73e9aaa6f..b92979f1c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
@@ -39,11 +39,11 @@
namespace WebCore {
-class IDBDatabaseBackendImpl::PendingOpenCall : public RefCounted<PendingOpenCall> {
+class IDBDatabaseBackendImpl::PendingOpenCall {
public:
- static PassRefPtr<PendingOpenCall> create(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
+ static PassOwnPtr<PendingOpenCall> create(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
{
- return adoptRef(new PendingOpenCall(callbacks, databaseCallbacks));
+ return adoptPtr(new PendingOpenCall(callbacks, databaseCallbacks));
}
PassRefPtr<IDBCallbacks> callbacks() { return m_callbacks; }
PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks() { return m_databaseCallbacks; }
@@ -59,11 +59,11 @@ private:
RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
};
-class IDBDatabaseBackendImpl::PendingOpenWithVersionCall : public RefCounted<PendingOpenWithVersionCall> {
+class IDBDatabaseBackendImpl::PendingOpenWithVersionCall {
public:
- static PassRefPtr<PendingOpenWithVersionCall> create(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, int64_t version)
+ static PassOwnPtr<PendingOpenWithVersionCall> create(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, int64_t version)
{
- return adoptRef(new PendingOpenWithVersionCall(callbacks, databaseCallbacks, version));
+ return adoptPtr(new PendingOpenWithVersionCall(callbacks, databaseCallbacks, version));
}
PassRefPtr<IDBCallbacks> callbacks() { return m_callbacks; }
PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks() { return m_databaseCallbacks; }
@@ -81,11 +81,11 @@ private:
int64_t m_version;
};
-class IDBDatabaseBackendImpl::PendingDeleteCall : public RefCounted<PendingDeleteCall> {
+class IDBDatabaseBackendImpl::PendingDeleteCall {
public:
- static PassRefPtr<PendingDeleteCall> create(PassRefPtr<IDBCallbacks> callbacks)
+ static PassOwnPtr<PendingDeleteCall> create(PassRefPtr<IDBCallbacks> callbacks)
{
- return adoptRef(new PendingDeleteCall(callbacks));
+ return adoptPtr(new PendingDeleteCall(callbacks));
}
PassRefPtr<IDBCallbacks> callbacks() { return m_callbacks; }
@@ -97,11 +97,11 @@ private:
RefPtr<IDBCallbacks> m_callbacks;
};
-class IDBDatabaseBackendImpl::PendingSetVersionCall : public RefCounted<PendingSetVersionCall> {
+class IDBDatabaseBackendImpl::PendingSetVersionCall {
public:
- static PassRefPtr<PendingSetVersionCall> create(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
+ static PassOwnPtr<PendingSetVersionCall> create(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
{
- return adoptRef(new PendingSetVersionCall(version, callbacks, databaseCallbacks));
+ return adoptPtr(new PendingSetVersionCall(version, callbacks, databaseCallbacks));
}
String version() { return m_version; }
PassRefPtr<IDBCallbacks> callbacks() { return m_callbacks; }
@@ -127,11 +127,15 @@ PassRefPtr<IDBDatabaseBackendImpl> IDBDatabaseBackendImpl::create(const String&
return backend.release();
}
+namespace {
+const char* NoStringVersion = "";
+}
+
IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, IDBBackingStore* backingStore, IDBTransactionCoordinator* coordinator, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
: m_backingStore(backingStore)
, m_id(InvalidId)
, m_name(name)
- , m_version("")
+ , m_version(NoStringVersion)
, m_intVersion(IDBDatabaseMetadata::NoIntVersion)
, m_identifier(uniqueIdentifier)
, m_factory(factory)
@@ -190,11 +194,11 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObjectS
return objectStore.release();
}
-void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendImpl> transaction)
+void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
int64_t objectStoreId;
- if (!database->m_backingStore->createObjectStore(database->id(), objectStore->name(), objectStore->keyPath(), objectStore->autoIncrement(), objectStoreId)) {
+ if (!database->m_backingStore->createObjectStore(transaction->backingStoreTransaction(), database->id(), objectStore->name(), objectStore->keyPath(), objectStore->autoIncrement(), objectStoreId)) {
transaction->abort();
return;
}
@@ -228,7 +232,7 @@ void IDBDatabaseBackendImpl::deleteObjectStore(const String& name, IDBTransactio
void IDBDatabaseBackendImpl::deleteObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
- database->m_backingStore->deleteObjectStore(database->id(), objectStore->id());
+ database->m_backingStore->deleteObjectStore(transaction->backingStoreTransaction(), database->id(), objectStore->id());
transaction->didCompleteTaskEvents();
}
@@ -240,10 +244,6 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Connection was closed before set version transaction was created"));
return;
}
- if (m_intVersion != IDBDatabaseMetadata::NoIntVersion) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, String::format("You can't use the setVersion function if you've already set the version through an open call. The current integer version is %lld", static_cast<long long>(m_intVersion))));
- return;
- }
for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
// Front end ensures the event is not fired at connections that have closePending set.
if (*it != databaseCallbacks)
@@ -254,13 +254,13 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
// https://bugs.webkit.org/show_bug.cgi?id=71130
if (connectionCount() > 1) {
callbacks->onBlocked();
- RefPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
- m_pendingSetVersionCalls.append(pendingSetVersionCall);
+ OwnPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
+ m_pendingSetVersionCalls.append(pendingSetVersionCall.release());
return;
}
if (m_runningVersionChangeTransaction) {
- RefPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
- m_pendingSetVersionCalls.append(pendingSetVersionCall);
+ OwnPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
+ m_pendingSetVersionCalls.append(pendingSetVersionCall.release());
return;
}
@@ -272,7 +272,7 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
RefPtr<IDBDatabaseBackendImpl> database = this;
if (!transaction->scheduleTask(
createCallbackTask(&IDBDatabaseBackendImpl::setVersionInternal, database, version, callbacks, transaction),
- createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version))) {
+ createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion))) {
// FIXME: Remove one of the following lines.
ASSERT_NOT_REACHED();
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
@@ -284,7 +284,8 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef
RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction;
int64_t databaseId = database->id();
database->m_version = version;
- if (!database->m_backingStore->updateIDBDatabaseMetaData(databaseId, database->m_version)) {
+ database->m_intVersion = IDBDatabaseMetadata::NoIntVersion;
+ if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
return;
@@ -292,13 +293,13 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef
callbacks->onSuccess(PassRefPtr<IDBTransactionBackendInterface>(transaction));
}
-void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
+void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
int64_t databaseId = database->id();
int64_t oldVersion = database->m_intVersion;
ASSERT(version > oldVersion);
database->m_intVersion = version;
- if (!database->m_backingStore->updateIDBDatabaseIntVersion(databaseId, database->m_intVersion)) {
+ if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
return;
@@ -333,9 +334,9 @@ void IDBDatabaseBackendImpl::transactionFinishedAndAbortFired(PassRefPtr<IDBTran
// If this was an open-with-version call, there will be a "second
// half" open call waiting for us in processPendingCalls.
// FIXME: When we no longer support setVersion, assert such a thing.
- if (m_pendingSecondHalfOpenWithVersionCalls.size() == 1) {
- RefPtr<PendingOpenWithVersionCall> pendingOpenWithVersionCall = m_pendingSecondHalfOpenWithVersionCalls.takeFirst();
- pendingOpenWithVersionCall->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Version change transaction was aborted in upgradeneeded event handler."));
+ if (m_pendingSecondHalfOpenWithVersion) {
+ m_pendingSecondHalfOpenWithVersion->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Version change transaction was aborted in upgradeneeded event handler."));
+ m_pendingSecondHalfOpenWithVersion.release();
}
processPendingCalls();
}
@@ -356,22 +357,20 @@ size_t IDBDatabaseBackendImpl::connectionCount()
void IDBDatabaseBackendImpl::processPendingCalls()
{
- // FIXME: Change from queue to just a single place holder.
- ASSERT(m_pendingSecondHalfOpenWithVersionCalls.size() <= 1);
- while (!m_pendingSecondHalfOpenWithVersionCalls.isEmpty()) {
- RefPtr<PendingOpenWithVersionCall> pendingOpenWithVersionCall = m_pendingSecondHalfOpenWithVersionCalls.takeFirst();
- ASSERT(pendingOpenWithVersionCall->version() == m_intVersion);
+ if (m_pendingSecondHalfOpenWithVersion) {
+ ASSERT(m_pendingSecondHalfOpenWithVersion->version() == m_intVersion);
ASSERT(m_id != InvalidId);
- pendingOpenWithVersionCall->callbacks()->onSuccess(this);
+ m_pendingSecondHalfOpenWithVersion->callbacks()->onSuccess(this);
+ m_pendingSecondHalfOpenWithVersion.release();
// Fall through when complete, as pending deletes may be (partially) unblocked.
}
// Pending calls may be requeued or aborted
- Deque<RefPtr<PendingSetVersionCall> > pendingSetVersionCalls;
+ Deque<OwnPtr<PendingSetVersionCall> > pendingSetVersionCalls;
m_pendingSetVersionCalls.swap(pendingSetVersionCalls);
while (!pendingSetVersionCalls.isEmpty()) {
ExceptionCode ec = 0;
- RefPtr<PendingSetVersionCall> pendingSetVersionCall = pendingSetVersionCalls.takeFirst();
+ OwnPtr<PendingSetVersionCall> pendingSetVersionCall = pendingSetVersionCalls.takeFirst();
setVersion(pendingSetVersionCall->version(), pendingSetVersionCall->callbacks(), pendingSetVersionCall->databaseCallbacks(), ec);
ASSERT(!ec);
}
@@ -391,10 +390,10 @@ void IDBDatabaseBackendImpl::processPendingCalls()
return;
// Pending calls may be requeued.
- Deque<RefPtr<PendingDeleteCall> > pendingDeleteCalls;
+ Deque<OwnPtr<PendingDeleteCall> > pendingDeleteCalls;
m_pendingDeleteCalls.swap(pendingDeleteCalls);
while (!pendingDeleteCalls.isEmpty()) {
- RefPtr<PendingDeleteCall> pendingDeleteCall = pendingDeleteCalls.takeFirst();
+ OwnPtr<PendingDeleteCall> pendingDeleteCall = pendingDeleteCalls.takeFirst();
deleteDatabase(pendingDeleteCall->callbacks());
}
@@ -402,19 +401,19 @@ void IDBDatabaseBackendImpl::processPendingCalls()
if (m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty() || !m_pendingDeleteCalls.isEmpty())
return;
- Deque<RefPtr<PendingOpenWithVersionCall> > pendingOpenWithVersionCalls;
+ Deque<OwnPtr<PendingOpenWithVersionCall> > pendingOpenWithVersionCalls;
m_pendingOpenWithVersionCalls.swap(pendingOpenWithVersionCalls);
while (!pendingOpenWithVersionCalls.isEmpty()) {
- RefPtr<PendingOpenWithVersionCall> pendingOpenWithVersionCall = pendingOpenWithVersionCalls.takeFirst();
+ OwnPtr<PendingOpenWithVersionCall> pendingOpenWithVersionCall = pendingOpenWithVersionCalls.takeFirst();
openConnectionWithVersion(pendingOpenWithVersionCall->callbacks(), pendingOpenWithVersionCall->databaseCallbacks(), pendingOpenWithVersionCall->version());
}
// Given the check above, it appears that calls cannot be requeued by
// openConnection, but use a different queue for iteration to be safe.
- Deque<RefPtr<PendingOpenCall> > pendingOpenCalls;
+ Deque<OwnPtr<PendingOpenCall> > pendingOpenCalls;
m_pendingOpenCalls.swap(pendingOpenCalls);
while (!pendingOpenCalls.isEmpty()) {
- RefPtr<PendingOpenCall> pendingOpenCall = pendingOpenCalls.takeFirst();
+ OwnPtr<PendingOpenCall> pendingOpenCall = pendingOpenCalls.takeFirst();
openConnection(pendingOpenCall->callbacks(), pendingOpenCall->databaseCallbacks());
}
ASSERT(m_pendingOpenCalls.isEmpty());
@@ -437,16 +436,23 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::transaction(D
void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
{
ASSERT(m_backingStore.get());
- if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty())
+ if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty()) {
m_pendingOpenCalls.append(PendingOpenCall::create(callbacks, databaseCallbacks));
- else {
- if (m_id == InvalidId && !openInternal())
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
- else {
- m_databaseCallbacksSet.add(RefPtr<IDBDatabaseCallbacks>(databaseCallbacks));
- callbacks->onSuccess(this);
- }
+ return;
}
+ if (m_id == InvalidId && !openInternal()) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
+ return;
+ }
+ if (m_version == NoStringVersion && m_intVersion == IDBDatabaseMetadata::NoIntVersion) {
+ // Spec says: If no version is specified and no database exists, set
+ // database version to 1. We infer that the database didn't exist from
+ // its lack of either type of version.
+ openConnectionWithVersion(callbacks, databaseCallbacks, 1);
+ return;
+ }
+ m_databaseCallbacksSet.add(RefPtr<IDBDatabaseCallbacks>(databaseCallbacks));
+ callbacks->onSuccess(this);
}
void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVersion, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks)
@@ -482,14 +488,14 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer
RefPtr<IDBDatabaseBackendImpl> database = this;
OwnPtr<ScriptExecutionContext::Task> intVersionTask = createCallbackTask(&IDBDatabaseBackendImpl::setIntVersionInternal, database, requestedVersion, callbacks, transaction);
- OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetIntVersion, database, m_intVersion);
+ OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion);
if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release())) {
// FIXME: Remove one of the following lines.
ASSERT_NOT_REACHED();
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
- ASSERT_WITH_MESSAGE(!m_pendingSecondHalfOpenWithVersionCalls.size(), "m_pendingSecondHalfOpenWithVersionCalls.size = %zu", m_pendingSecondHalfOpenWithVersionCalls.size());
- m_pendingSecondHalfOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, requestedVersion));
+ ASSERT(!m_pendingSecondHalfOpenWithVersion);
+ m_pendingSecondHalfOpenWithVersion = PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, requestedVersion);
m_databaseCallbacksSet.add(databaseCallbacks);
}
@@ -531,7 +537,7 @@ void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallback
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
// Front end ensures the event is not fired at connections that have closePending set.
- (*it)->onVersionChange("");
+ (*it)->onVersionChange(NoStringVersion);
}
// FIXME: Only fire onBlocked if there are open connections after the
// VersionChangeEvents are received, not just set up to fire.
@@ -546,7 +552,7 @@ void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallback
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
return;
}
- m_version = "";
+ m_version = NoStringVersion;
m_id = InvalidId;
m_intVersion = IDBDatabaseMetadata::NoIntVersion;
m_objectStores.clear();
@@ -559,12 +565,9 @@ void IDBDatabaseBackendImpl::close(PassRefPtr<IDBDatabaseCallbacks> prpCallbacks
ASSERT(m_databaseCallbacksSet.contains(callbacks));
m_databaseCallbacksSet.remove(callbacks);
- for (Deque<RefPtr<PendingOpenWithVersionCall> >::iterator it = m_pendingSecondHalfOpenWithVersionCalls.begin(); it != m_pendingSecondHalfOpenWithVersionCalls.end(); ++it) {
- if ((*it)->databaseCallbacks() == callbacks) {
- (*it)->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "The connection was closed."));
- m_pendingSecondHalfOpenWithVersionCalls.remove(it);
- break;
- }
+ if (m_pendingSecondHalfOpenWithVersion && m_pendingSecondHalfOpenWithVersion->databaseCallbacks() == callbacks) {
+ m_pendingSecondHalfOpenWithVersion->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "The connection was closed."));
+ m_pendingSecondHalfOpenWithVersion.release();
}
if (connectionCount() > 1)
@@ -617,17 +620,12 @@ void IDBDatabaseBackendImpl::addObjectStoreToMap(ScriptExecutionContext*, PassRe
database->m_objectStores.set(objectStorePtr->name(), objectStorePtr);
}
-void IDBDatabaseBackendImpl::resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version)
+void IDBDatabaseBackendImpl::resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& previousVersion, int64_t previousIntVersion)
{
- database->m_version = version;
+ database->m_version = previousVersion;
+ database->m_intVersion = previousIntVersion;
}
-void IDBDatabaseBackendImpl::resetIntVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t oldVersion)
-{
- database->m_intVersion = oldVersion;
-}
-
-
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
index 22ccc4322..112ba3de6 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
@@ -86,13 +86,12 @@ private:
static void createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
static void deleteObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
static void setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
- static void setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
+ static void setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
// These are used as setVersion transaction abort tasks.
static void removeObjectStoreFromMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>);
static void addObjectStoreToMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>);
- static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version);
- static void resetIntVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t intVersion);
+ static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, int64_t intVersion);
RefPtr<IDBBackingStore> m_backingStore;
int64_t m_id;
@@ -114,17 +113,17 @@ private:
TransactionSet m_transactions;
class PendingSetVersionCall;
- Deque<RefPtr<PendingSetVersionCall> > m_pendingSetVersionCalls;
+ Deque<OwnPtr<PendingSetVersionCall> > m_pendingSetVersionCalls;
class PendingOpenCall;
- Deque<RefPtr<PendingOpenCall> > m_pendingOpenCalls;
+ Deque<OwnPtr<PendingOpenCall> > m_pendingOpenCalls;
class PendingOpenWithVersionCall;
- Deque<RefPtr<PendingOpenWithVersionCall> > m_pendingOpenWithVersionCalls;
- Deque<RefPtr<PendingOpenWithVersionCall> > m_pendingSecondHalfOpenWithVersionCalls;
+ Deque<OwnPtr<PendingOpenWithVersionCall> > m_pendingOpenWithVersionCalls;
+ OwnPtr<PendingOpenWithVersionCall> m_pendingSecondHalfOpenWithVersion;
class PendingDeleteCall;
- Deque<RefPtr<PendingDeleteCall> > m_pendingDeleteCalls;
+ Deque<OwnPtr<PendingDeleteCall> > m_pendingDeleteCalls;
typedef ListHashSet<RefPtr<IDBDatabaseCallbacks> > DatabaseCallbacksSet;
DatabaseCallbacksSet m_databaseCallbacksSet;
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
index 38cfcec97..a2b85b5e5 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
@@ -83,10 +83,10 @@ void IDBIndexBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr
switch (cursorType) {
case IDBCursorBackendInterface::IndexKeyCursor:
- backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
+ backingStoreCursor = index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
break;
case IDBCursorBackendInterface::IndexCursor:
- backingStoreCursor = index->backingStore()->openIndexCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
+ backingStoreCursor = index->backingStore()->openIndexCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
break;
case IDBCursorBackendInterface::ObjectStoreCursor:
case IDBCursorBackendInterface::InvalidCursorType:
@@ -127,12 +127,12 @@ void IDBIndexBackendImpl::openKeyCursor(PassRefPtr<IDBKeyRange> prpKeyRange, uns
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks)
+void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBIndexBackendImpl::countInternal");
uint32_t count = 0;
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
if (!backingStoreCursor) {
callbacks->onSuccess(SerializedScriptValue::numberValue(count));
return;
@@ -145,15 +145,16 @@ void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBI
callbacks->onSuccess(SerializedScriptValue::numberValue(count));
}
-void IDBIndexBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBIndexBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBIndexBackendImpl::count");
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&countInternal, this, range, callbacks)))
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ if (!transaction->scheduleTask(
+ createCallbackTask(&countInternal, this, range, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBIndexBackendImpl::getInternal");
@@ -162,7 +163,7 @@ void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBInd
if (keyRange->isOnlyKey())
key = keyRange->lower();
else {
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
if (!backingStoreCursor) {
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
@@ -172,9 +173,9 @@ void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBInd
backingStoreCursor->close();
}
- RefPtr<IDBKey> primaryKey = index->backingStore()->getPrimaryKeyViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
+ RefPtr<IDBKey> primaryKey = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
- String value = index->backingStore()->getObjectStoreRecord(index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey);
+ String value = index->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey);
if (value.isNull()) {
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
@@ -188,19 +189,19 @@ void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBInd
callbacks->onSuccess(SerializedScriptValue::createFromWire(value));
}
-void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBIndexBackendImpl::getInternal");
RefPtr<IDBBackingStore::Cursor> backingStoreCursor =
- index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
+ index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
if (!backingStoreCursor) {
callbacks->onSuccess(static_cast<IDBKey*>(0));
return;
}
- RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *backingStoreCursor->key());
+ RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *backingStoreCursor->key());
if (!keyResult) {
callbacks->onSuccess(static_cast<IDBKey*>(0));
backingStoreCursor->close();
@@ -211,25 +212,26 @@ void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRe
}
-void IDBIndexBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBIndexBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBIndexBackendImpl::get");
RefPtr<IDBIndexBackendImpl> index = this;
RefPtr<IDBKeyRange> keyRange = prpKeyRange;
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&getInternal, index, keyRange, callbacks)))
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ if (!transaction->scheduleTask(createCallbackTask(&getInternal, index, keyRange, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBIndexBackendImpl::getKey(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBIndexBackendImpl::getKey(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBIndexBackendImpl::getKey");
RefPtr<IDBIndexBackendImpl> index = this;
RefPtr<IDBKeyRange> keyRange = prpKeyRange;
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&getKeyInternal, index, keyRange, callbacks)))
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ if (!transaction->scheduleTask(
+ createCallbackTask(&getKeyInternal, index, keyRange, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
index e1174579d..173c32d08 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h
@@ -79,9 +79,9 @@ private:
IDBIndexBackendImpl(const IDBDatabaseBackendImpl*, IDBObjectStoreBackendImpl*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, IDBCursorBackendInterface::CursorType, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
- static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
- static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
- static void getKeyInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
+ static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
+ static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
+ static void getKeyInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
static const int64_t InvalidId = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
index 930e20b3b..50edfd46c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
@@ -336,22 +336,20 @@ bool IDBLevelDBBackingStore::createIDBDatabaseMetaData(const String& name, const
return true;
}
-bool IDBLevelDBBackingStore::updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion)
+bool IDBLevelDBBackingStore::updateIDBDatabaseIntVersion(IDBBackingStore::Transaction* transaction, int64_t rowId, int64_t intVersion)
{
- ASSERT(m_currentTransaction);
- // FIXME: Change this to strictly greater than 0 once we throw TypeError for
- // bad versions.
+ if (intVersion == IDBDatabaseMetadata::NoIntVersion)
+ intVersion = IDBDatabaseMetadata::DefaultIntVersion;
ASSERT_WITH_MESSAGE(intVersion >= 0, "intVersion was %lld", static_cast<long long>(intVersion));
- if (!putVarInt(m_currentTransaction.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))
+ if (!putVarInt(Transaction::levelDBTransactionFrom(transaction), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))
return false;
return true;
}
-bool IDBLevelDBBackingStore::updateIDBDatabaseMetaData(int64_t rowId, const String& version)
+bool IDBLevelDBBackingStore::updateIDBDatabaseMetaData(IDBBackingStore::Transaction* transaction, int64_t rowId, const String& version)
{
- ASSERT(m_currentTransaction);
- if (!putString(m_currentTransaction.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserVersion), version))
+ if (!putString(Transaction::levelDBTransactionFrom(transaction), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserVersion), version))
return false;
return true;
@@ -519,11 +517,11 @@ static int64_t getNewObjectStoreId(LevelDBTransaction* transaction, int64_t data
return objectStoreId;
}
-bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId)
+bool IDBLevelDBBackingStore::createObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId)
{
IDB_TRACE("IDBLevelDBBackingStore::createObjectStore");
- ASSERT(m_currentTransaction);
- int64_t objectStoreId = getNewObjectStoreId(m_currentTransaction.get(), databaseId);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
+ int64_t objectStoreId = getNewObjectStoreId(levelDBTransaction, databaseId);
if (objectStoreId < 0)
return false;
@@ -537,55 +535,55 @@ bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String&
const Vector<char> keyGeneratorCurrentNumberKey = ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber);
const Vector<char> namesKey = ObjectStoreNamesKey::encode(databaseId, name);
- bool ok = putString(m_currentTransaction.get(), nameKey, name);
+ bool ok = putString(levelDBTransaction, nameKey, name);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putIDBKeyPath(m_currentTransaction.get(), keyPathKey, keyPath);
+ ok = putIDBKeyPath(levelDBTransaction, keyPathKey, keyPath);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), autoIncrementKey, autoIncrement);
+ ok = putInt(levelDBTransaction, autoIncrementKey, autoIncrement);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), evictableKey, false);
+ ok = putInt(levelDBTransaction, evictableKey, false);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), lastVersionKey, 1);
+ ok = putInt(levelDBTransaction, lastVersionKey, 1);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), maxIndexIdKey, MinimumIndexId);
+ ok = putInt(levelDBTransaction, maxIndexIdKey, MinimumIndexId);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putBool(m_currentTransaction.get(), hasKeyPathKey, !keyPath.isNull());
+ ok = putBool(levelDBTransaction, hasKeyPathKey, !keyPath.isNull());
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), keyGeneratorCurrentNumberKey, KeyGeneratorInitialNumber);
+ ok = putInt(levelDBTransaction, keyGeneratorCurrentNumberKey, KeyGeneratorInitialNumber);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putInt(m_currentTransaction.get(), namesKey, objectStoreId);
+ ok = putInt(levelDBTransaction, namesKey, objectStoreId);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
@@ -596,35 +594,36 @@ bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String&
return true;
}
-void IDBLevelDBBackingStore::deleteObjectStore(int64_t databaseId, int64_t objectStoreId)
+void IDBLevelDBBackingStore::deleteObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
{
IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStore");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
String objectStoreName;
- getString(m_currentTransaction.get(), ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::Name), objectStoreName);
+ getString(levelDBTransaction, ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::Name), objectStoreName);
- if (!deleteRange(m_currentTransaction.get(), ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, 0), ObjectStoreMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
+ if (!deleteRange(levelDBTransaction, ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, 0), ObjectStoreMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
return; // FIXME: Report error.
- m_currentTransaction->remove(ObjectStoreNamesKey::encode(databaseId, objectStoreName));
+ levelDBTransaction->remove(ObjectStoreNamesKey::encode(databaseId, objectStoreName));
- if (!deleteRange(m_currentTransaction.get(), IndexFreeListKey::encode(databaseId, objectStoreId, 0), IndexFreeListKey::encodeMaxKey(databaseId, objectStoreId)))
+ if (!deleteRange(levelDBTransaction, IndexFreeListKey::encode(databaseId, objectStoreId, 0), IndexFreeListKey::encodeMaxKey(databaseId, objectStoreId)))
return; // FIXME: Report error.
- if (!deleteRange(m_currentTransaction.get(), IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0), IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
+ if (!deleteRange(levelDBTransaction, IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0), IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
return; // FIXME: Report error.
- clearObjectStore(databaseId, objectStoreId);
+ clearObjectStore(transaction, databaseId, objectStoreId);
}
-String IDBLevelDBBackingStore::getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key)
+String IDBLevelDBBackingStore::getObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key)
{
IDB_TRACE("IDBLevelDBBackingStore::getObjectStoreRecord");
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
+
const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
Vector<char> data;
- ASSERT(m_currentTransaction);
- if (!m_currentTransaction->get(leveldbKey, data))
+ if (!levelDBTransaction->get(leveldbKey, data))
return String();
int64_t version;
@@ -676,23 +675,23 @@ static int64_t getNewVersionNumber(LevelDBTransaction* transaction, int64_t data
return version;
}
-bool IDBLevelDBBackingStore::putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier)
+bool IDBLevelDBBackingStore::putObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier)
{
IDB_TRACE("IDBLevelDBBackingStore::putObjectStoreRecord");
ASSERT(key.isValid());
- ASSERT(m_currentTransaction);
- int64_t version = getNewVersionNumber(m_currentTransaction.get(), databaseId, objectStoreId);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
+ int64_t version = getNewVersionNumber(levelDBTransaction, databaseId, objectStoreId);
const Vector<char> objectStoredataKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
Vector<char> v;
v.append(encodeVarInt(version));
v.append(encodeString(value));
- if (!m_currentTransaction->put(objectStoredataKey, v))
+ if (!levelDBTransaction->put(objectStoredataKey, v))
return false;
const Vector<char> existsEntryKey = ExistsEntryKey::encode(databaseId, objectStoreId, key);
- if (!m_currentTransaction->put(existsEntryKey, encodeInt(version)))
+ if (!levelDBTransaction->put(existsEntryKey, encodeInt(version)))
return false;
LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<LevelDBRecordIdentifier*>(recordIdentifier);
@@ -701,14 +700,14 @@ bool IDBLevelDBBackingStore::putObjectStoreRecord(int64_t databaseId, int64_t ob
return true;
}
-void IDBLevelDBBackingStore::clearObjectStore(int64_t databaseId, int64_t objectStoreId)
+void IDBLevelDBBackingStore::clearObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
{
IDB_TRACE("IDBLevelDBBackingStore::clearObjectStore");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> startKey = KeyPrefix(databaseId, objectStoreId, 0).encode();
const Vector<char> stopKey = KeyPrefix(databaseId, objectStoreId + 1, 0).encode();
- deleteRange(m_currentTransaction.get(), startKey, stopKey);
+ deleteRange(levelDBTransaction, startKey, stopKey);
}
PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> IDBLevelDBBackingStore::createInvalidRecordIdentifier()
@@ -716,30 +715,30 @@ PassRefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> IDBLevelDBBackingStore:
return LevelDBRecordIdentifier::create();
}
-void IDBLevelDBBackingStore::deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier)
+void IDBLevelDBBackingStore::deleteObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier)
{
IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStoreRecord");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
const Vector<char> objectStoreDataKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, levelDBRecordIdentifier->primaryKey());
- m_currentTransaction->remove(objectStoreDataKey);
+ levelDBTransaction->remove(objectStoreDataKey);
const Vector<char> existsEntryKey = ExistsEntryKey::encode(databaseId, objectStoreId, levelDBRecordIdentifier->primaryKey());
- m_currentTransaction->remove(existsEntryKey);
+ levelDBTransaction->remove(existsEntryKey);
}
-int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId)
+int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
{
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> keyGeneratorCurrentNumberKey = ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber);
int64_t keyGeneratorCurrentNumber = -1;
Vector<char> data;
- if (m_currentTransaction->get(keyGeneratorCurrentNumberKey, data))
+ if (levelDBTransaction->get(keyGeneratorCurrentNumberKey, data))
keyGeneratorCurrentNumber = decodeInt(data.begin(), data.end());
else {
// Previously, the key generator state was not stored explicitly but derived from the
@@ -748,7 +747,7 @@ int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(int64_t databaseId,
const Vector<char> startKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, minIDBKey());
const Vector<char> stopKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, maxIDBKey());
- OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
+ OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
int64_t maxNumericKey = 0;
for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next()) {
@@ -772,18 +771,18 @@ int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(int64_t databaseId,
return keyGeneratorCurrentNumber;
}
-bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent)
+bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent)
{
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
if (checkCurrent) {
- int64_t currentNumber = getKeyGeneratorCurrentNumber(databaseId, objectStoreId);
+ int64_t currentNumber = getKeyGeneratorCurrentNumber(transaction, databaseId, objectStoreId);
if (newNumber <= currentNumber)
return true;
}
const Vector<char> keyGeneratorCurrentNumberKey = ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber);
- bool ok = putInt(m_currentTransaction.get(), keyGeneratorCurrentNumberKey, newNumber);
+ bool ok = putInt(levelDBTransaction, keyGeneratorCurrentNumberKey, newNumber);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
@@ -791,14 +790,14 @@ bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(int64_t databa
return true;
}
-bool IDBLevelDBBackingStore::keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier)
+bool IDBLevelDBBackingStore::keyExistsInObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier)
{
IDB_TRACE("IDBLevelDBBackingStore::keyExistsInObjectStore");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
Vector<char> data;
- if (!m_currentTransaction->get(leveldbKey, data))
+ if (!levelDBTransaction->get(leveldbKey, data))
return false;
int64_t version;
@@ -811,13 +810,13 @@ bool IDBLevelDBBackingStore::keyExistsInObjectStore(int64_t databaseId, int64_t
return true;
}
-bool IDBLevelDBBackingStore::forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback& callback)
+bool IDBLevelDBBackingStore::forEachObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback& callback)
{
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> startKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, minIDBKey());
const Vector<char> stopKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, maxIDBKey());
- OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
+ OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next()) {
const char* p = it->key().begin();
const char* limit = it->key().end();
@@ -935,11 +934,11 @@ static int64_t getNewIndexId(LevelDBTransaction* transaction, int64_t databaseId
return indexId;
}
-bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId)
+bool IDBLevelDBBackingStore::createIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId)
{
IDB_TRACE("IDBLevelDBBackingStore::createIndex");
- ASSERT(m_currentTransaction);
- indexId = getNewIndexId(m_currentTransaction.get(), databaseId, objectStoreId);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
+ indexId = getNewIndexId(levelDBTransaction, databaseId, objectStoreId);
if (indexId < 0)
return false;
@@ -948,25 +947,25 @@ bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStore
const Vector<char> keyPathKey = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, IndexMetaDataKey::KeyPath);
const Vector<char> multiEntryKey = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, IndexMetaDataKey::MultiEntry);
- bool ok = putString(m_currentTransaction.get(), nameKey, name);
+ bool ok = putString(levelDBTransaction, nameKey, name);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putBool(m_currentTransaction.get(), uniqueKey, isUnique);
+ ok = putBool(levelDBTransaction, uniqueKey, isUnique);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putIDBKeyPath(m_currentTransaction.get(), keyPathKey, keyPath);
+ ok = putIDBKeyPath(levelDBTransaction, keyPathKey, keyPath);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
}
- ok = putBool(m_currentTransaction.get(), multiEntryKey, isMultiEntry);
+ ok = putBool(levelDBTransaction, multiEntryKey, isMultiEntry);
if (!ok) {
LOG_ERROR("Internal Indexed DB error.");
return false;
@@ -975,15 +974,15 @@ bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStore
return true;
}
-void IDBLevelDBBackingStore::deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId)
+void IDBLevelDBBackingStore::deleteIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId)
{
IDB_TRACE("IDBLevelDBBackingStore::deleteIndex");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> indexMetaDataStart = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, 0);
const Vector<char> indexMetaDataEnd = IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId, indexId);
- if (!deleteRange(m_currentTransaction.get(), indexMetaDataStart, indexMetaDataEnd)) {
+ if (!deleteRange(levelDBTransaction, indexMetaDataStart, indexMetaDataEnd)) {
LOG_ERROR("Internal Indexed DB error.");
return;
}
@@ -991,27 +990,27 @@ void IDBLevelDBBackingStore::deleteIndex(int64_t databaseId, int64_t objectStore
const Vector<char> indexDataStart = IndexDataKey::encodeMinKey(databaseId, objectStoreId, indexId);
const Vector<char> indexDataEnd = IndexDataKey::encodeMaxKey(databaseId, objectStoreId, indexId);
- if (!deleteRange(m_currentTransaction.get(), indexDataStart, indexDataEnd)) {
+ if (!deleteRange(levelDBTransaction, indexDataStart, indexDataEnd)) {
LOG_ERROR("Internal Indexed DB error.");
return;
}
}
-bool IDBLevelDBBackingStore::putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier)
+bool IDBLevelDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier)
{
IDB_TRACE("IDBLevelDBBackingStore::putIndexDataForRecord");
ASSERT(key.isValid());
ASSERT(indexId >= MinimumIndexId);
const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> indexDataKey = IndexDataKey::encode(databaseId, objectStoreId, indexId, encodeIDBKey(key), levelDBRecordIdentifier->primaryKey());
Vector<char> data;
data.append(encodeVarInt(levelDBRecordIdentifier->version()));
data.append(levelDBRecordIdentifier->primaryKey());
- return m_currentTransaction->put(indexDataKey, data);
+ return levelDBTransaction->put(indexDataKey, data);
}
static bool findGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction, const Vector<char>& target, Vector<char>& foundKey)
@@ -1042,7 +1041,7 @@ static bool findGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction, cons
return true;
}
-bool IDBLevelDBBackingStore::deleteIndexDataForRecord(int64_t, int64_t, int64_t, const ObjectStoreRecordIdentifier*)
+bool IDBLevelDBBackingStore::deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t, int64_t, int64_t, const ObjectStoreRecordIdentifier*)
{
// FIXME: This isn't needed since we invalidate index data via the version number mechanism.
return true;
@@ -1059,13 +1058,14 @@ static bool versionExists(LevelDBTransaction* transaction, int64_t databaseId, i
return decodeInt(data.begin(), data.end()) == version;
}
-bool IDBLevelDBBackingStore::findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
+bool IDBLevelDBBackingStore::findKeyInIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
{
IDB_TRACE("IDBLevelDBBackingStore::findKeyInIndex");
ASSERT(foundEncodedPrimaryKey.isEmpty());
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
const Vector<char> leveldbKey = IndexDataKey::encode(databaseId, objectStoreId, indexId, key);
- OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
+ OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
it->seek(leveldbKey);
for (;;) {
@@ -1080,9 +1080,9 @@ bool IDBLevelDBBackingStore::findKeyInIndex(int64_t databaseId, int64_t objectSt
return false;
foundEncodedPrimaryKey.append(p, it->value().end() - p);
- if (!versionExists(m_currentTransaction.get(), databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
+ if (!versionExists(levelDBTransaction, databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
// Delete stale index data entry and continue.
- m_currentTransaction->remove(it->key());
+ levelDBTransaction->remove(it->key());
it->next();
continue;
}
@@ -1091,13 +1091,12 @@ bool IDBLevelDBBackingStore::findKeyInIndex(int64_t databaseId, int64_t objectSt
}
}
-PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key)
+PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key)
{
IDB_TRACE("IDBLevelDBBackingStore::getPrimaryKeyViaIndex");
- ASSERT(m_currentTransaction);
Vector<char> foundEncodedPrimaryKey;
- if (findKeyInIndex(databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
+ if (findKeyInIndex(transaction, databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
RefPtr<IDBKey> primaryKey;
decodeIDBKey(foundEncodedPrimaryKey.begin(), foundEncodedPrimaryKey.end(), primaryKey);
return primaryKey.release();
@@ -1106,13 +1105,12 @@ PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(int64_t databas
return 0;
}
-bool IDBLevelDBBackingStore::keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey)
+bool IDBLevelDBBackingStore::keyExistsInIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey)
{
IDB_TRACE("IDBLevelDBBackingStore::keyExistsInIndex");
- ASSERT(m_currentTransaction);
Vector<char> foundEncodedPrimaryKey;
- if (!findKeyInIndex(databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
+ if (!findKeyInIndex(transaction, databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
return false;
decodeIDBKey(foundEncodedPrimaryKey.begin(), foundEncodedPrimaryKey.end(), foundPrimaryKey);
@@ -1689,56 +1687,56 @@ bool indexCursorOptions(LevelDBTransaction* transaction, int64_t databaseId, int
}
-PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
+PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
IDB_TRACE("IDBLevelDBBackingStore::openObjectStoreCursor");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
CursorOptions cursorOptions;
- if (!objectStoreCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, range, direction, cursorOptions))
+ if (!objectStoreCursorOptions(levelDBTransaction, databaseId, objectStoreId, range, direction, cursorOptions))
return 0;
- RefPtr<ObjectStoreCursorImpl> cursor = ObjectStoreCursorImpl::create(m_currentTransaction.get(), cursorOptions);
+ RefPtr<ObjectStoreCursorImpl> cursor = ObjectStoreCursorImpl::create(levelDBTransaction, cursorOptions);
if (!cursor->firstSeek())
return 0;
return cursor.release();
}
-PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
+PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreKeyCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
IDB_TRACE("IDBLevelDBBackingStore::openObjectStoreKeyCursor");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
CursorOptions cursorOptions;
- if (!objectStoreCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, range, direction, cursorOptions))
+ if (!objectStoreCursorOptions(levelDBTransaction, databaseId, objectStoreId, range, direction, cursorOptions))
return 0;
- RefPtr<ObjectStoreKeyCursorImpl> cursor = ObjectStoreKeyCursorImpl::create(m_currentTransaction.get(), cursorOptions);
+ RefPtr<ObjectStoreKeyCursorImpl> cursor = ObjectStoreKeyCursorImpl::create(levelDBTransaction, cursorOptions);
if (!cursor->firstSeek())
return 0;
return cursor.release();
}
-PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
+PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
IDB_TRACE("IDBLevelDBBackingStore::openIndexKeyCursor");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
CursorOptions cursorOptions;
- if (!indexCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, indexId, range, direction, cursorOptions))
+ if (!indexCursorOptions(levelDBTransaction, databaseId, objectStoreId, indexId, range, direction, cursorOptions))
return 0;
- RefPtr<IndexKeyCursorImpl> cursor = IndexKeyCursorImpl::create(m_currentTransaction.get(), cursorOptions);
+ RefPtr<IndexKeyCursorImpl> cursor = IndexKeyCursorImpl::create(levelDBTransaction, cursorOptions);
if (!cursor->firstSeek())
return 0;
return cursor.release();
}
-PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
+PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
{
IDB_TRACE("IDBLevelDBBackingStore::openIndexCursor");
- ASSERT(m_currentTransaction);
+ LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
CursorOptions cursorOptions;
- if (!indexCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, indexId, range, direction, cursorOptions))
+ if (!indexCursorOptions(levelDBTransaction, databaseId, objectStoreId, indexId, range, direction, cursorOptions))
return 0;
- RefPtr<IndexCursorImpl> cursor = IndexCursorImpl::create(m_currentTransaction.get(), cursorOptions);
+ RefPtr<IndexCursorImpl> cursor = IndexCursorImpl::create(levelDBTransaction, cursorOptions);
if (!cursor->firstSeek())
return 0;
@@ -1762,25 +1760,26 @@ IDBLevelDBBackingStore::Transaction::Transaction(IDBLevelDBBackingStore* backing
void IDBLevelDBBackingStore::Transaction::begin()
{
- ASSERT(!m_backingStore->m_currentTransaction);
- m_backingStore->m_currentTransaction = LevelDBTransaction::create(m_backingStore->m_db.get());
+ IDB_TRACE("IDBLevelDBBackingStore::Transaction::begin");
+ ASSERT(!m_transaction);
+ m_transaction = LevelDBTransaction::create(m_backingStore->m_db.get());
}
bool IDBLevelDBBackingStore::Transaction::commit()
{
IDB_TRACE("IDBLevelDBBackingStore::Transaction::commit");
- ASSERT(m_backingStore->m_currentTransaction);
- bool result = m_backingStore->m_currentTransaction->commit();
- m_backingStore->m_currentTransaction.clear();
+ ASSERT(m_transaction);
+ bool result = m_transaction->commit();
+ m_transaction.clear();
return result;
}
void IDBLevelDBBackingStore::Transaction::rollback()
{
IDB_TRACE("IDBLevelDBBackingStore::Transaction::rollback");
- ASSERT(m_backingStore->m_currentTransaction);
- m_backingStore->m_currentTransaction->rollback();
- m_backingStore->m_currentTransaction.clear();
+ ASSERT(m_transaction);
+ m_transaction->rollback();
+ m_transaction.clear();
}
bool IDBLevelDBBackingStore::backingStoreExists(SecurityOrigin* securityOrigin, const String&, const String& pathBaseArg)
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
index 733922690..77cb06e78 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
@@ -47,36 +47,36 @@ public:
virtual void getDatabaseNames(Vector<String>& foundNames);
virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId);
virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId);
- virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version);
- virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion);
+ virtual bool updateIDBDatabaseMetaData(IDBBackingStore::Transaction*, int64_t rowId, const String& version);
+ virtual bool updateIDBDatabaseIntVersion(IDBBackingStore::Transaction*, int64_t rowId, int64_t intVersion);
virtual bool deleteDatabase(const String& name);
virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags);
- virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId);
- virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId);
+ virtual bool createObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId);
+ virtual void deleteObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier();
- virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&);
- virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*);
- virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId);
- virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*);
- virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId);
- virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent);
- virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier);
+ virtual String getObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&);
+ virtual bool putObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*);
+ virtual void clearObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
+ virtual void deleteObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*);
+ virtual int64_t getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
+ virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent);
+ virtual bool keyExistsInObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier);
- virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&);
+ virtual bool forEachObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&);
virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags);
- virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId);
- virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId);
- virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*);
- virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*);
- virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&);
- virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey);
-
- virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
- virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
- virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
- virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
+ virtual bool createIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId);
+ virtual void deleteIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId);
+ virtual bool putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*);
+ virtual bool deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*);
+ virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&);
+ virtual bool keyExistsInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey);
+
+ virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
+ virtual PassRefPtr<Cursor> openObjectStoreCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
+ virtual PassRefPtr<Cursor> openIndexKeyCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
+ virtual PassRefPtr<Cursor> openIndexCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
virtual PassRefPtr<Transaction> createTransaction();
@@ -86,13 +86,12 @@ protected:
IDBLevelDBBackingStore(const String& identifier, IDBFactoryBackendImpl*, PassOwnPtr<LevelDBDatabase>);
private:
- bool findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey);
+ bool findKeyInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey);
String m_identifier;
RefPtr<IDBFactoryBackendImpl> m_factory;
OwnPtr<LevelDBDatabase> m_db;
OwnPtr<LevelDBComparator> m_comparator;
- RefPtr<LevelDBTransaction> m_currentTransaction;
class Transaction : public IDBBackingStore::Transaction {
public:
@@ -101,9 +100,15 @@ private:
virtual bool commit();
virtual void rollback();
+ static LevelDBTransaction* levelDBTransactionFrom(IDBBackingStore::Transaction* transaction)
+ {
+ return static_cast<IDBLevelDBBackingStore::Transaction*>(transaction)->m_transaction.get();
+ }
+
private:
Transaction(IDBLevelDBBackingStore*);
IDBLevelDBBackingStore* m_backingStore;
+ RefPtr<LevelDBTransaction> m_transaction;
};
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
index 2fa5c084c..805b71524 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
@@ -86,18 +86,18 @@ void IDBObjectStoreBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRef
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
if (!transaction->scheduleTask(
- createCallbackTask(&IDBObjectStoreBackendImpl::getInternal, objectStore, keyRange, callbacks)))
+ createCallbackTask(&IDBObjectStoreBackendImpl::getInternal, objectStore, keyRange, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBObjectStoreBackendImpl::getInternal");
RefPtr<IDBKey> key;
if (keyRange->isOnlyKey())
key = keyRange->lower();
else {
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
if (!backingStoreCursor) {
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
return;
@@ -106,7 +106,7 @@ void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<
backingStoreCursor->close();
}
- String wireData = objectStore->backingStore()->getObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key);
+ String wireData = objectStore->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key);
if (wireData.isNull()) {
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
return;
@@ -154,12 +154,12 @@ public:
, m_indexKeys(indexKeys)
{ }
- bool verifyIndexKeys(IDBBackingStore& backingStore,
+ bool verifyIndexKeys(IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction,
int64_t databaseId, int64_t objectStoreId, int64_t indexId,
const IDBKey* primaryKey = 0, String* errorMessage = 0)
{
for (size_t i = 0; i < m_indexKeys.size(); ++i) {
- if (!addingKeyAllowed(backingStore, databaseId, objectStoreId, indexId,
+ if (!addingKeyAllowed(backingStore, transaction, databaseId, objectStoreId, indexId,
(m_indexKeys)[i].get(), primaryKey)) {
if (errorMessage)
*errorMessage = String::format("Unable to add key to index '%s': at least one key does not satisfy the uniqueness requirements.",
@@ -170,12 +170,12 @@ public:
return true;
}
- bool writeIndexKeys(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId) const
+ bool writeIndexKeys(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId) const
{
for (size_t i = 0; i < m_indexKeys.size(); ++i) {
- if (!backingStore.deleteIndexDataForRecord(databaseId, objectStoreId, indexId, recordIdentifier))
+ if (!backingStore.deleteIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, recordIdentifier))
return false;
- if (!backingStore.putIndexDataForRecord(databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier))
+ if (!backingStore.putIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier))
return false;
}
return true;
@@ -185,7 +185,7 @@ public:
private:
- bool addingKeyAllowed(IDBBackingStore& backingStore,
+ bool addingKeyAllowed(IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction,
int64_t databaseId, int64_t objectStoreId, int64_t indexId,
const IDBKey* indexKey, const IDBKey* primaryKey) const
{
@@ -193,7 +193,7 @@ private:
return true;
RefPtr<IDBKey> foundPrimaryKey;
- bool found = backingStore.keyExistsInIndex(databaseId, objectStoreId, indexId, *indexKey, foundPrimaryKey);
+ bool found = backingStore.keyExistsInIndex(transaction, databaseId, objectStoreId, indexId, *indexKey, foundPrimaryKey);
if (!found)
return true;
if (primaryKey && foundPrimaryKey->isEqual(primaryKey))
@@ -206,7 +206,7 @@ private:
};
}
-static bool makeIndexWriters(IDBObjectStoreBackendImpl* objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<String> indexNames, const Vector<IDBObjectStoreBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter> >* indexWriters, String* errorMessage)
+static bool makeIndexWriters(PassRefPtr<IDBTransactionBackendImpl> transaction, IDBObjectStoreBackendImpl* objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<String> indexNames, const Vector<IDBObjectStoreBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter> >* indexWriters, String* errorMessage)
{
ASSERT(indexNames.size() == indexKeys.size());
@@ -230,6 +230,7 @@ static bool makeIndexWriters(IDBObjectStoreBackendImpl* objectStore, PassRefPtr<
OwnPtr<IndexWriter> indexWriter(adoptPtr(new IndexWriter(index->metadata(), keys)));
if (!indexWriter->verifyIndexKeys(*objectStore->backingStore(),
+ transaction->backingStoreTransaction(),
objectStore->databaseId(),
objectStore->id(),
index->id(), primaryKey.get(), errorMessage)) {
@@ -242,21 +243,22 @@ static bool makeIndexWriters(IDBObjectStoreBackendImpl* objectStore, PassRefPtr<
return true;
}
-void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction)
+void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transactionPtr)
{
IDB_TRACE("IDBObjectStoreBackendImpl::setIndexKeys");
RefPtr<IDBKey> primaryKey = prpPrimaryKey;
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
// FIXME: This method could be asynchronous, but we need to evaluate if it's worth the extra complexity.
RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = backingStore()->createInvalidRecordIdentifier();
- if (!backingStore()->keyExistsInObjectStore(databaseId(), id(), *primaryKey, recordIdentifier.get())) {
+ if (!backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), databaseId(), id(), *primaryKey, recordIdentifier.get())) {
transaction->abort();
return;
}
Vector<OwnPtr<IndexWriter> > indexWriters;
String errorMessage;
- if (!makeIndexWriters(this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
+ if (!makeIndexWriters(transaction, this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
// FIXME: Need to deal with errorMessage here. makeIndexWriters only fails on uniqueness constraint errors.
transaction->abort();
return;
@@ -266,6 +268,7 @@ void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, c
IndexWriter* indexWriter = indexWriters[i].get();
if (!indexWriter->writeIndexKeys(recordIdentifier.get(),
*backingStore(),
+ transaction->backingStoreTransaction(),
databaseId(),
m_id,
m_indexes.get(indexWriter->indexName())->id())) {
@@ -298,9 +301,10 @@ void IDBObjectStoreBackendImpl::setIndexesReadyInternal(ScriptExecutionContext*,
transaction->didCompleteTaskEvents();
}
-void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> > popIndexKeys)
+void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> prpTransaction, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> > popIndexKeys)
{
IDB_TRACE("IDBObjectStoreBackendImpl::putInternal");
+ RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction;
ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
RefPtr<SerializedScriptValue> value = prpValue;
RefPtr<IDBKey> key = prpKey;
@@ -311,7 +315,7 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
bool keyWasGenerated = false;
if (putMode != CursorUpdate && autoIncrement && !key) {
- RefPtr<IDBKey> autoIncKey = objectStore->generateKey();
+ RefPtr<IDBKey> autoIncKey = objectStore->generateKey(transaction);
keyWasGenerated = true;
if (!autoIncKey->isValid()) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "Maximum key generator value reached."));
@@ -323,21 +327,21 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
ASSERT(key && key->isValid());
RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = objectStore->backingStore()->createInvalidRecordIdentifier();
- if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) {
+ if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Key already exists in the object store."));
return;
}
Vector<OwnPtr<IndexWriter> > indexWriters;
String errorMessage;
- if (!makeIndexWriters(objectStore.get(), key, keyWasGenerated, *indexNames, *indexKeys, &indexWriters, &errorMessage)) {
+ if (!makeIndexWriters(transaction, objectStore.get(), key, keyWasGenerated, *indexNames, *indexKeys, &indexWriters, &errorMessage)) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, errorMessage));
return;
}
// Before this point, don't do any mutation. After this point, rollback the transaction in case of error.
- if (!objectStore->backingStore()->putObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
+ if (!objectStore->backingStore()->putObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
return;
@@ -347,6 +351,7 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
IndexWriter* indexWriter = indexWriters[i].get();
if (!indexWriter->writeIndexKeys(recordIdentifier.get(),
*objectStore->backingStore(),
+ transaction->backingStoreTransaction(),
objectStore->databaseId(),
objectStore->m_id,
objectStore->m_indexes.get(indexWriter->indexName())->id())) {
@@ -358,32 +363,33 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
}
if (autoIncrement && putMode != CursorUpdate && key->type() == IDBKey::NumberType)
- objectStore->updateKeyGenerator(key.get(), !keyWasGenerated);
+ objectStore->updateKeyGenerator(transaction, key.get(), !keyWasGenerated);
callbacks->onSuccess(key.release());
}
-void IDBObjectStoreBackendImpl::deleteFunction(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBObjectStoreBackendImpl::deleteFunction(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStoreBackendImpl::delete");
- ASSERT(IDBTransactionBackendImpl::from(transaction)->mode() != IDBTransaction::READ_ONLY);
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
RefPtr<IDBKeyRange> keyRange = prpKeyRange;
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&IDBObjectStoreBackendImpl::deleteInternal, objectStore, keyRange, callbacks)))
+ if (!transaction->scheduleTask(
+ createCallbackTask(&IDBObjectStoreBackendImpl::deleteInternal, objectStore, keyRange, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBObjectStoreBackendImpl::deleteInternal");
RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier;
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
if (backingStoreCursor) {
do {
@@ -393,11 +399,11 @@ void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefP
if (!it->second->hasValidId())
continue; // The index object has been created, but does not exist in the database yet.
- bool success = objectStore->backingStore()->deleteIndexDataForRecord(objectStore->databaseId(), objectStore->id(), it->second->id(), recordIdentifier.get());
+ bool success = objectStore->backingStore()->deleteIndexDataForRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), it->second->id(), recordIdentifier.get());
ASSERT_UNUSED(success, success);
}
- objectStore->backingStore()->deleteObjectStoreRecord(objectStore->databaseId(), objectStore->id(), recordIdentifier.get());
+ objectStore->backingStore()->deleteObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), recordIdentifier.get());
} while (backingStoreCursor->continueFunction(0));
@@ -407,23 +413,24 @@ void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefP
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
}
-void IDBObjectStoreBackendImpl::clear(PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBObjectStoreBackendImpl::clear(PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStoreBackendImpl::clear");
- ASSERT(IDBTransactionBackendImpl::from(transaction)->mode() != IDBTransaction::READ_ONLY);
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
RefPtr<IDBCallbacks> callbacks = prpCallbacks;
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&IDBObjectStoreBackendImpl::clearInternal, objectStore, callbacks)))
+ if (!transaction->scheduleTask(
+ createCallbackTask(&IDBObjectStoreBackendImpl::clearInternal, objectStore, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
- objectStore->backingStore()->clearObjectStore(objectStore->databaseId(), objectStore->id());
+ objectStore->backingStore()->clearObjectStore(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id());
callbacks->onSuccess(SerializedScriptValue::undefinedValue());
}
@@ -452,7 +459,7 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(cons
void IDBObjectStoreBackendImpl::createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
int64_t id;
- if (!objectStore->backingStore()->createIndex(objectStore->databaseId(), objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
+ if (!objectStore->backingStore()->createIndex(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
transaction->abort();
return;
}
@@ -492,7 +499,7 @@ void IDBObjectStoreBackendImpl::deleteIndex(const String& name, IDBTransactionBa
void IDBObjectStoreBackendImpl::deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
- objectStore->backingStore()->deleteIndex(objectStore->databaseId(), objectStore->id(), index->id());
+ objectStore->backingStore()->deleteIndex(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), index->id());
transaction->didCompleteTaskEvents();
}
@@ -513,7 +520,7 @@ void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, Pass
{
IDB_TRACE("IDBObjectStoreBackendImpl::openCursorInternal");
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), range.get(), direction);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), range.get(), direction);
// The frontend has begun indexing, so this pauses the transaction
// until the indexing is complete. This can't happen any earlier
// because we don't want to switch to early mode in case multiple
@@ -529,19 +536,20 @@ void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, Pass
callbacks->onSuccess(cursor, cursor->key(), cursor->primaryKey(), cursor->value());
}
-void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStoreBackendImpl::count");
- if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
- createCallbackTask(&IDBObjectStoreBackendImpl::countInternal, this, range, callbacks)))
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
+ if (!transaction->scheduleTask(
+ createCallbackTask(&IDBObjectStoreBackendImpl::countInternal, this, range, callbacks, transaction)))
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
}
-void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
IDB_TRACE("IDBObjectStoreBackendImpl::countInternal");
uint32_t count = 0;
- RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreKeyCursor(objectStore->databaseId(), objectStore->id(), range.get(), IDBCursor::NEXT);
+ RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreKeyCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), range.get(), IDBCursor::NEXT);
if (!backingStoreCursor) {
callbacks->onSuccess(SerializedScriptValue::numberValue(count));
return;
@@ -586,20 +594,20 @@ void IDBObjectStoreBackendImpl::addIndexToMap(ScriptExecutionContext*, PassRefPt
objectStore->m_indexes.set(indexPtr->name(), indexPtr);
}
-PassRefPtr<IDBKey> IDBObjectStoreBackendImpl::generateKey()
+PassRefPtr<IDBKey> IDBObjectStoreBackendImpl::generateKey(PassRefPtr<IDBTransactionBackendImpl> transaction)
{
const int64_t maxGeneratorValue = 9007199254740992LL; // Maximum integer storable as ECMAScript number.
- int64_t currentNumber = backingStore()->getKeyGeneratorCurrentNumber(databaseId(), id());
+ int64_t currentNumber = backingStore()->getKeyGeneratorCurrentNumber(transaction->backingStoreTransaction(), databaseId(), id());
if (currentNumber < 0 || currentNumber > maxGeneratorValue)
return IDBKey::createInvalid();
return IDBKey::createNumber(currentNumber);
}
-void IDBObjectStoreBackendImpl::updateKeyGenerator(const IDBKey* key, bool checkCurrent)
+void IDBObjectStoreBackendImpl::updateKeyGenerator(PassRefPtr<IDBTransactionBackendImpl> transaction, const IDBKey* key, bool checkCurrent)
{
ASSERT(key && key->type() == IDBKey::NumberType);
- backingStore()->maybeUpdateKeyGeneratorCurrentNumber(databaseId(), id(), static_cast<int64_t>(floor(key->number())) + 1, checkCurrent);
+ backingStore()->maybeUpdateKeyGeneratorCurrentNumber(transaction->backingStoreTransaction(), databaseId(), id(), static_cast<int64_t>(floor(key->number())) + 1, checkCurrent);
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
index 2811ca1ba..bd95bbebe 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
@@ -100,18 +100,18 @@ private:
IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, const String& name, const IDBKeyPath&, bool autoIncrement);
void loadIndexes();
- PassRefPtr<IDBKey> generateKey();
- void updateKeyGenerator(const IDBKey*, bool checkCurrent);
+ PassRefPtr<IDBKey> generateKey(PassRefPtr<IDBTransactionBackendImpl>);
+ void updateKeyGenerator(PassRefPtr<IDBTransactionBackendImpl>, const IDBKey*, bool checkCurrent);
- static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
+ static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> >);
- static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
+ static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
static void setIndexesReadyInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassRefPtr<IDBTransactionBackendImpl>);
- static void clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBCallbacks>);
+ static void clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
static void deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface::TaskType, PassRefPtr<IDBTransactionBackendImpl>);
- static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
+ static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
// These are used as setVersion transaction abort tasks.
static void removeIndexFromMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
index 752613c5e..09f6909b4 100644
--- a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
@@ -88,9 +88,11 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassRefPtr<IDBTransac
m_result = IDBAny::create(idbDatabase.release());
if (oldVersion == IDBDatabaseMetadata::NoIntVersion) {
- // This database hasn't had an integer version before.
- oldVersion = IDBDatabaseMetadata::DefaultIntVersion;
+ // This database hasn't had an integer version before.
+ oldVersion = IDBDatabaseMetadata::DefaultIntVersion;
}
+ if (m_version == IDBDatabaseMetadata::NoIntVersion)
+ m_version = 1;
enqueueEvent(IDBUpgradeNeededEvent::create(oldVersion, m_version, eventNames().upgradeneededEvent));
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index 14072aed9..54bcbdecc 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -379,7 +379,10 @@ void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> prpSerializedScript
void IDBRequest::onSuccessInternal(const ScriptValue& value)
{
m_result = IDBAny::create(value);
- m_pendingCursor.clear();
+ if (m_pendingCursor) {
+ m_pendingCursor->close();
+ m_pendingCursor.clear();
+ }
enqueueEvent(createSuccessEvent());
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index e1e05f1f2..a71c1ab69 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -232,7 +232,17 @@ IDBTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<IDBTransaction
IDBTransaction::OpenCursorNotifier::~OpenCursorNotifier()
{
- m_transaction->unregisterOpenCursor(m_cursor);
+ if (m_cursor)
+ m_transaction->unregisterOpenCursor(m_cursor);
+}
+
+void IDBTransaction::OpenCursorNotifier::cursorFinished()
+{
+ if (m_cursor) {
+ m_transaction->unregisterOpenCursor(m_cursor);
+ m_cursor = 0;
+ m_transaction.clear();
+ }
}
void IDBTransaction::registerOpenCursor(IDBCursor* cursor)
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 75f5d908e..b2f48ff1d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -86,6 +86,7 @@ public:
public:
OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*);
~OpenCursorNotifier();
+ void cursorFinished();
private:
RefPtr<IDBTransaction> m_transaction;
IDBCursor* m_cursor;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
index 24c4fee04..d6e3c88a5 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
@@ -65,6 +65,7 @@ public:
void addPendingEvents(int);
void addPreemptiveEvent() { m_pendingPreemptiveEvents++; }
void didCompletePreemptiveEvent() { m_pendingPreemptiveEvents--; ASSERT(m_pendingPreemptiveEvents >= 0); }
+ IDBBackingStore::Transaction* backingStoreTransaction() { return m_transaction.get(); }
private:
IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, IDBDatabaseBackendImpl*);
diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
index da2bb5845..78896a796 100644
--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
@@ -83,13 +83,13 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
return 0;
}
- String uri, credential;
- ok = iceServer.get("uri", uri);
+ String urlString, credential;
+ ok = iceServer.get("url", urlString);
if (!ok) {
ec = TYPE_MISMATCH_ERR;
return 0;
}
- KURL url(KURL(), uri);
+ KURL url(KURL(), urlString);
if (!url.isValid() || !(url.protocolIs("turn") || url.protocolIs("stun"))) {
ec = TYPE_MISMATCH_ERR;
return 0;
diff --git a/Source/WebCore/Resources/pagepopups/calendarPicker.js b/Source/WebCore/Resources/pagepopups/calendarPicker.js
index dd1921106..8acc42b28 100644
--- a/Source/WebCore/Resources/pagepopups/calendarPicker.js
+++ b/Source/WebCore/Resources/pagepopups/calendarPicker.js
@@ -72,7 +72,6 @@ var ClassNames = {
*/
var global = {
argumentsReceived: false,
- hadKeyEvent: false,
params: null
};
@@ -267,11 +266,9 @@ function validateArguments(args) {
* @param {!Object} args
*/
function initialize(args) {
- var main = $("main");
- main.classList.add(ClassNames.NoFocusRing);
-
var errorString = validateArguments(args);
if (errorString) {
+ var main = $("main");
main.textContent = "Internal error: " + errorString;
resizeWindow(main.offsetWidth, main.offsetHeight);
} else {
@@ -305,6 +302,7 @@ function CalendarPicker(element, config) {
this.step = (typeof this._config.step !== undefined) ? this._config.step * CalendarPicker.BaseStep : CalendarPicker.BaseStep;
this.yearMonthController = new YearMonthController(this);
this.daysTable = new DaysTable(this);
+ this._hadKeyEvent = false;
this._layout();
var initialDate = parseDateString(this._config.currentValue);
if (initialDate < this.minimumDate)
@@ -328,6 +326,8 @@ CalendarPicker.prototype._layout = function() {
this.yearMonthController.attachTo(this._element);
this.daysTable.attachTo(this._element);
this._layoutButtons();
+ // DaysTable will have focus but we don't want to show its focus ring until the first key event.
+ this._element.classList.add(ClassNames.NoFocusRing);
};
CalendarPicker.prototype.handleToday = function() {
@@ -985,10 +985,10 @@ DaysTable.prototype.selectDate = function(date) {
* @return {!boolean}
*/
DaysTable.prototype._maybeSetPreviousMonth = function() {
- var year = global.yearMonthController.year();
- var month = global.yearMonthController.month();
+ var year = this.picker.yearMonthController.year();
+ var month = this.picker.yearMonthController.month();
var thisMonthStartTime = createUTCDate(year, month, 1).getTime();
- if (this.minimumDate.getTime() >= thisMonthStartTime)
+ if (this.picker.minimumDate.getTime() >= thisMonthStartTime)
return false;
if (month == 0) {
year--;
@@ -1003,8 +1003,8 @@ DaysTable.prototype._maybeSetPreviousMonth = function() {
* @return {!boolean}
*/
DaysTable.prototype._maybeSetNextMonth = function() {
- var year = global.yearMonthController.year();
- var month = global.yearMonthController.month();
+ var year = this.picker.yearMonthController.year();
+ var month = this.picker.yearMonthController.month();
if (month == 11) {
year++;
month = 0;
@@ -1056,7 +1056,7 @@ DaysTable.prototype._handleMouseOut = function(event) {
* @param {Event} event
*/
DaysTable.prototype._handleKey = function(event) {
- maybeUpdateFocusStyle();
+ this.picker.maybeUpdateFocusStyle();
var x = this._x;
var y = this._y;
var key = event.keyIdentifier;
@@ -1156,7 +1156,7 @@ DaysTable.prototype.updateSelection = function(event, x, y) {
* @param {!Event} event
*/
CalendarPicker.prototype._handleBodyKeyDown = function(event) {
- maybeUpdateFocusStyle();
+ this.maybeUpdateFocusStyle();
var key = event.keyIdentifier;
if (key == "U+0009") {
if (!event.shiftKey && document.activeElement == global.lastFocusableControl) {
@@ -1178,11 +1178,11 @@ CalendarPicker.prototype._handleBodyKeyDown = function(event) {
this.handleCancel();
}
-function maybeUpdateFocusStyle() {
- if (global.hadKeyEvent)
+CalendarPicker.prototype.maybeUpdateFocusStyle = function() {
+ if (this._hadKeyEvent)
return;
- global.hadKeyEvent = true;
- $("main").classList.remove(ClassNames.NoFocusRing);
+ this._hadKeyEvent = true;
+ this._element.classList.remove(ClassNames.NoFocusRing);
}
if (window.dialogArguments) {
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index 2cca21e94..7465d4405 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -732,14 +732,15 @@ SOURCES += \
inspector/IdentifiersFactory.cpp \
inspector/InjectedScript.cpp \
inspector/InjectedScriptBase.cpp \
+ inspector/InjectedScriptCanvasModule.cpp \
inspector/InjectedScriptHost.cpp \
inspector/InjectedScriptManager.cpp \
inspector/InjectedScriptModule.cpp \
- inspector/InjectedScriptWebGLModule.cpp \
inspector/InspectorAgent.cpp \
inspector/InspectorApplicationCacheAgent.cpp \
inspector/InspectorBaseAgent.cpp \
inspector/InspectorCSSAgent.cpp \
+ inspector/InspectorCanvasAgent.cpp \
inspector/InspectorClient.cpp \
inspector/InspectorConsoleAgent.cpp \
inspector/InspectorController.cpp \
@@ -766,7 +767,6 @@ SOURCES += \
inspector/InspectorStyleTextEditor.cpp \
inspector/InspectorTimelineAgent.cpp \
inspector/InspectorValues.cpp \
- inspector/InspectorWebGLAgent.cpp \
inspector/InspectorWorkerAgent.cpp \
inspector/InstrumentingAgents.cpp \
inspector/MemoryInstrumentationImpl.cpp \
@@ -1857,13 +1857,15 @@ HEADERS += \
inspector/IdentifiersFactory.h \
inspector/InjectedScript.h \
inspector/InjectedScriptBase.h \
+ inspector/InjectedScriptCanvasModule.h \
inspector/InjectedScriptHost.h \
inspector/InjectedScriptManager.h \
inspector/InjectedScriptModule.h \
- inspector/InjectedScriptWebGLModule.h \
inspector/InspectorAgent.h \
inspector/InspectorApplicationCacheAgent.h \
inspector/InspectorBaseAgent.h \
+ inspector/InspectorCanvasAgent.h \
+ inspector/InspectorCanvasInstrumentation.h \
inspector/InspectorConsoleAgent.h \
inspector/InspectorConsoleInstrumentation.h \
inspector/InspectorController.h \
@@ -1892,8 +1894,6 @@ HEADERS += \
inspector/InspectorStyleSheet.h \
inspector/InspectorStyleTextEditor.h \
inspector/InspectorTimelineAgent.h \
- inspector/InspectorWebGLAgent.h \
- inspector/InspectorWebGLInstrumentation.h \
inspector/InspectorWorkerAgent.h \
inspector/InstrumentingAgents.h \
inspector/MemoryInstrumentationImpl.h \
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index e78411831..dff830d50 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -271,7 +271,10 @@ __ZN7WebCore14ResourceHandle35createPrivateBrowsingStorageSessionEPK10__CFString
__ZN7WebCore14ResourceLoader14cancelledErrorEv
__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
+__ZN7WebCore14SchemeRegistry27registerURLSchemeAsNoAccessERKN3WTF6StringE
+__ZN7WebCore14SchemeRegistry30registerURLSchemeAsCORSEnabledERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKN3WTF6StringE
+__ZN7WebCore14SchemeRegistry34registerURLSchemeAsDisplayIsolatedERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry34shouldLoadURLSchemeAsEmptyDocumentERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE
__ZN7WebCore14SchemeRegistry58registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsingERKN3WTF6StringE
@@ -849,7 +852,6 @@ __ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEiNS0_10AnchorTypeE
__ZN7WebCore8Settings14setJavaEnabledEb
__ZN7WebCore8Settings15setWebGLEnabledEb
-__ZN7WebCore8Settings16setImagesEnabledEb
__ZN7WebCore8Settings16setScriptEnabledEb
__ZN7WebCore8Settings16setUsesPageCacheEb
__ZN7WebCore8Settings17setPluginsEnabledEb
@@ -882,6 +884,7 @@ __ZN7WebCore8Settings23setUsesEncodingDetectorEb
__ZN7WebCore8Settings24setApplicationChromeModeEb
__ZN7WebCore8Settings24setDNSPrefetchingEnabledEb
__ZN7WebCore8Settings24setMockScrollbarsEnabledEb
+__ZN7WebCore8Settings24setUsesOverlayScrollbarsEb
__ZN7WebCore8Settings24setStorageBlockingPolicyENS_14SecurityOrigin21StorageBlockingPolicyE
__ZN7WebCore8Settings24setTextAreasAreResizableEb
__ZN7WebCore8Settings25setDeveloperExtrasEnabledEb
@@ -911,6 +914,7 @@ __ZN7WebCore8Settings31setJavaScriptExperimentsEnabledEb
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb
__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
+__ZN7WebCore8Settings32setScreenFontSubstitutionEnabledEb
__ZN7WebCore8Settings32setShowsToolTipOverTruncatedTextEb
__ZN7WebCore8Settings33setDownloadableBinaryFontsEnabledEb
__ZN7WebCore8Settings34setLocalFileContentSniffingEnabledEb
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index 4b1e4df19..171223314 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -461,50 +461,50 @@
]
},
{
- 'target_name': 'injected_script_source',
+ 'target_name': 'injected_canvas_script_source',
'type': 'none',
'actions': [
{
- 'action_name': 'generateInjectedScriptSource',
+ 'action_name': 'generateInjectedScriptCanvasModuleSource',
'inputs': [
- '../inspector/InjectedScriptSource.js',
+ '../inspector/InjectedScriptCanvasModuleSource.js',
],
'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptCanvasModuleSource.h',
],
'msvs_cygwin_shell': 0,
'action': [
'<(perl_exe)',
'../inspector/xxd.pl',
- 'InjectedScriptSource_js',
+ 'InjectedScriptCanvasModuleSource_js',
'<@(_inputs)',
'<@(_outputs)'
],
- 'message': 'Generating InjectedScriptSource.h from InjectedScriptSource.js',
+ 'message': 'Generating InjectedScriptCanvasModuleSource.h from InjectedScriptCanvasModuleSource.js',
},
]
},
{
- 'target_name': 'injected_webgl_script_source',
+ 'target_name': 'injected_script_source',
'type': 'none',
'actions': [
{
- 'action_name': 'generateInjectedScriptWebGLModuleSource',
+ 'action_name': 'generateInjectedScriptSource',
'inputs': [
- '../inspector/InjectedScriptWebGLModuleSource.js',
+ '../inspector/InjectedScriptSource.js',
],
'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptWebGLModuleSource.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h',
],
'msvs_cygwin_shell': 0,
'action': [
'<(perl_exe)',
'../inspector/xxd.pl',
- 'InjectedScriptWebGLModuleSource_js',
+ 'InjectedScriptSource_js',
'<@(_inputs)',
'<@(_outputs)'
],
- 'message': 'Generating InjectedScriptWebGLModuleSource.h from InjectedScriptWebGLModuleSource.js',
+ 'message': 'Generating InjectedScriptSource.h from InjectedScriptSource.js',
},
]
},
@@ -1200,8 +1200,8 @@
'webcore_bindings_sources',
'inspector_overlay_page',
'inspector_protocol_sources',
+ 'injected_canvas_script_source',
'injected_script_source',
- 'injected_webgl_script_source',
'debugger_script_source',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
'../../WTF/WTF.gyp/WTF.gyp:wtf',
@@ -1327,8 +1327,8 @@
'type': 'none',
'dependencies': [
'debugger_script_source',
+ 'injected_canvas_script_source',
'injected_script_source',
- 'injected_webgl_script_source',
'inspector_overlay_page',
'inspector_protocol_sources',
'webcore_bindings_sources',
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index d6ff77575..4d43c4165 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -2855,20 +2855,23 @@
'inspector/InjectedScript.h',
'inspector/InjectedScriptBase.cpp',
'inspector/InjectedScriptBase.h',
+ 'inspector/InjectedScriptCanvasModule.cpp',
+ 'inspector/InjectedScriptCanvasModule.h',
'inspector/InjectedScriptHost.cpp',
'inspector/InjectedScriptHost.h',
'inspector/InjectedScriptManager.cpp',
'inspector/InjectedScriptManager.h',
'inspector/InjectedScriptModule.cpp',
'inspector/InjectedScriptModule.h',
- 'inspector/InjectedScriptWebGLModule.cpp',
- 'inspector/InjectedScriptWebGLModule.h',
'inspector/InspectorAgent.cpp',
'inspector/InspectorApplicationCacheAgent.cpp',
'inspector/InspectorApplicationCacheAgent.h',
'inspector/InspectorBaseAgent.cpp',
'inspector/InspectorCSSAgent.cpp',
'inspector/InspectorCSSAgent.h',
+ 'inspector/InspectorCanvasAgent.cpp',
+ 'inspector/InspectorCanvasAgent.h',
+ 'inspector/InspectorCanvasInstrumentation.h',
'inspector/InspectorClient.cpp',
'inspector/InspectorConsoleAgent.cpp',
'inspector/InspectorConsoleAgent.h',
@@ -2925,9 +2928,6 @@
'inspector/InspectorTimelineAgent.h',
'inspector/InspectorValues.cpp',
'inspector/InspectorWorkerResource.h',
- 'inspector/InspectorWebGLAgent.cpp',
- 'inspector/InspectorWebGLAgent.h',
- 'inspector/InspectorWebGLInstrumentation.h',
'inspector/InspectorWorkerAgent.cpp',
'inspector/InspectorWorkerAgent.h',
'inspector/InstrumentingAgents.cpp',
@@ -6495,7 +6495,7 @@
'inspector/front-end/textEditor.css',
'inspector/front-end/textPrompt.css',
'inspector/front-end/timelinePanel.css',
- 'inspector/front-end/webGLProfiler.css',
+ 'inspector/front-end/canvasProfiler.css',
],
'webinspector_elements_js_files': [
'inspector/front-end/CSSNamedFlowCollectionsView.js',
@@ -6574,7 +6574,7 @@
'inspector/front-end/ProfilesPanel.js',
'inspector/front-end/ProfileLauncherView.js',
'inspector/front-end/TopDownProfileDataGridTree.js',
- 'inspector/front-end/WebGLProfileView.js',
+ 'inspector/front-end/CanvasProfileView.js',
],
'webinspector_audits_js_files': [
@@ -7273,8 +7273,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/HTMLEntityTable.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/HTMLNames.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/HeaderDetection.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InjectedScriptSource.h',
- '<(PRODUCT_DIR)/DerivedSources/WebCore/InjectedScriptWebGLModuleSource.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendDispatcher.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendDispatcher.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendCommands.js',
diff --git a/Source/WebCore/WebCore.order b/Source/WebCore/WebCore.order
index 5744c07ef..768a7fa35 100644
--- a/Source/WebCore/WebCore.order
+++ b/Source/WebCore/WebCore.order
@@ -1459,6 +1459,7 @@ __ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE
__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
__ZN7WebCore8Settings44setLoadsSiteIconsIgnoringImageLoadingSettingEb
__ZN7WebCore8Settings25setShouldPrintBackgroundsEb
+__ZN7WebCore8Settings24setUsesOverlayScrollbarsEb
__ZN7WebCore8Settings24setTextAreasAreResizableEb
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings23setEditableLinkBehaviorENS_20EditableLinkBehaviorE
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index 542b85fe0..4a1b0d830 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -130,7 +130,7 @@ enable?(NETSCAPE_PLUGIN_API) {
# Note: XP_MACOSX is defined in npapi.h
} else {
xlibAvailable() {
- CONFIG += x11
+ CONFIG *= x11
LIBS += -lXrender
DEFINES += MOZ_X11
}
@@ -167,7 +167,7 @@ enable?(GAMEPAD) {
use?(GSTREAMER) {
DEFINES += ENABLE_GLIB_SUPPORT=1
- PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10
+ PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
}
enable?(VIDEO) {
@@ -193,7 +193,6 @@ enable?(VIDEO) {
}
} else:use?(GSTREAMER) {
INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer
- PKGCONFIG += gstreamer-video-0.10
} else:use?(QT_MULTIMEDIA) {
CONFIG *= mobility
MOBILITY *= multimedia
@@ -212,9 +211,12 @@ use?(3D_GRAPHICS) {
contains(QT_CONFIG, opengles2):!win32: LIBS += -lEGL
}
-use?(graphics_surface) {
+use?(GRAPHICS_SURFACE) {
mac: LIBS += -framework IOSurface -framework CoreFoundation
- linux-*: LIBS += -lXcomposite -lXrender
+ linux-*: {
+ LIBS += -lXcomposite -lXrender
+ CONFIG *= x11
+ }
}
!system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 44e694ad1..ce26603d8 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -590,11 +590,11 @@
>
</File>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InjectedScriptSource.h"
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InjectedScriptCanvasModuleSource.h"
>
</File>
<File
- RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InjectedScriptWebGLModuleSource.h"
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InjectedScriptSource.h"
>
</File>
<File
@@ -74587,7 +74587,7 @@
>
</File>
<File
- RelativePath="..\inspector\InjectedScriptHost.cpp"
+ RelativePath="..\inspector\InjectedScriptCanvasModule.cpp"
>
<FileConfiguration
Name="Release|Win32"
@@ -74607,11 +74607,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\inspector\InjectedScriptHost.h"
+ RelativePath="..\inspector\InjectedScriptCanvasModule.h"
>
</File>
<File
- RelativePath="..\inspector\InjectedScriptManager.cpp"
+ RelativePath="..\inspector\InjectedScriptHost.cpp"
>
<FileConfiguration
Name="Release|Win32"
@@ -74631,11 +74631,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\inspector\InjectedScriptManager.h"
+ RelativePath="..\inspector\InjectedScriptHost.h"
>
</File>
<File
- RelativePath="..\inspector\InjectedScriptModule.cpp"
+ RelativePath="..\inspector\InjectedScriptManager.cpp"
>
<FileConfiguration
Name="Release|Win32"
@@ -74655,11 +74655,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\inspector\InjectedScriptModule.h"
+ RelativePath="..\inspector\InjectedScriptManager.h"
>
</File>
<File
- RelativePath="..\inspector\InjectedScriptWebGLModule.cpp"
+ RelativePath="..\inspector\InjectedScriptModule.cpp"
>
<FileConfiguration
Name="Release|Win32"
@@ -74679,7 +74679,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\inspector\InjectedScriptWebGLModule.h"
+ RelativePath="..\inspector\InjectedScriptModule.h"
>
</File>
<File
@@ -74791,6 +74791,34 @@
>
</File>
<File
+ RelativePath="..\inspector\InspectorCanvasAgent.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\inspector\InspectorCanvasAgent.h"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\InspectorCanvasInstrumentation.h"
+ >
+ </File>
+ <File
RelativePath="..\inspector\InspectorClient.cpp"
>
<FileConfiguration
@@ -75507,34 +75535,6 @@
>
</File>
<File
- RelativePath="..\inspector\InspectorWebGLAgent.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Production|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\inspector\InspectorWebGLAgent.h"
- >
- </File>
- <File
- RelativePath="..\inspector\InspectorWebGLInstrumentation.h"
- >
- </File>
- <File
RelativePath="..\inspector\InspectorWorkerAgent.cpp"
>
<FileConfiguration
@@ -75970,6 +75970,14 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\canvasProfiler.css"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\CanvasProfileView.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\Checkbox.js"
>
</File>
@@ -76874,14 +76882,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\webGLProfiler.css"
- >
- </File>
- <File
- RelativePath="..\inspector\front-end\WebGLProfileView.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\WorkersSidebarPane.js"
>
</File>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 20db8f444..7a25eaa88 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4539,15 +4539,15 @@
AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA4C3A740B2B1679002334A2 /* StyleElement.cpp */; };
AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AA4C3A750B2B1679002334A2 /* StyleElement.h */; };
- AA73183E159255B900A93E6E /* InjectedScriptWebGLModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */; };
- AA73183F159255B900A93E6E /* InjectedScriptWebGLModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */; };
+ AA73183E159255B900A93E6E /* InjectedScriptCanvasModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA73183C159255B900A93E6E /* InjectedScriptCanvasModule.cpp */; };
+ AA73183F159255B900A93E6E /* InjectedScriptCanvasModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AA73183D159255B900A93E6E /* InjectedScriptCanvasModule.h */; };
AAB6054E15874C58007B5031 /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */; };
AAB6054F15874C58007B5031 /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB6054B15874C58007B5031 /* InjectedScriptBase.h */; };
AAB6055015874C58007B5031 /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */; };
AAB6055115874C58007B5031 /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB6054D15874C58007B5031 /* InjectedScriptModule.h */; };
- AAD766EB157E502F00E85423 /* InspectorWebGLAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD766E8157E502F00E85423 /* InspectorWebGLAgent.cpp */; };
- AAD766EC157E502F00E85423 /* InspectorWebGLAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD766E9157E502F00E85423 /* InspectorWebGLAgent.h */; };
- AAD766ED157E502F00E85423 /* InspectorWebGLInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD766EA157E502F00E85423 /* InspectorWebGLInstrumentation.h */; };
+ AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD766E8157E502F00E85423 /* InspectorCanvasAgent.cpp */; };
+ AAD766EC157E502F00E85423 /* InspectorCanvasAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD766E9157E502F00E85423 /* InspectorCanvasAgent.h */; };
+ AAD766ED157E502F00E85423 /* InspectorCanvasInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD766EA157E502F00E85423 /* InspectorCanvasInstrumentation.h */; };
AAF5B7B71524B6C50004CB49 /* WebSocketFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */; };
AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */; };
AB23A32809BBA7D00067CC53 /* BeforeTextInsertedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */; };
@@ -11674,17 +11674,17 @@
AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSCursorImageValue.h; sourceTree = "<group>"; };
AA4C3A740B2B1679002334A2 /* StyleElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleElement.cpp; sourceTree = "<group>"; };
AA4C3A750B2B1679002334A2 /* StyleElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleElement.h; sourceTree = "<group>"; };
- AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptWebGLModule.cpp; sourceTree = "<group>"; };
- AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptWebGLModule.h; sourceTree = "<group>"; };
- AA9030FE157E16A000276247 /* InjectedScriptWebGLModuleSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedScriptWebGLModuleSource.js; sourceTree = "<group>"; };
- AA912750157E35A500454E54 /* InjectedScriptWebGLModuleSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptWebGLModuleSource.h; sourceTree = "<group>"; };
+ AA73183C159255B900A93E6E /* InjectedScriptCanvasModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptCanvasModule.cpp; sourceTree = "<group>"; };
+ AA73183D159255B900A93E6E /* InjectedScriptCanvasModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptCanvasModule.h; sourceTree = "<group>"; };
+ AA9030FE157E16A000276247 /* InjectedScriptCanvasModuleSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedScriptCanvasModuleSource.js; sourceTree = "<group>"; };
+ AA912750157E35A500454E54 /* InjectedScriptCanvasModuleSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptCanvasModuleSource.h; sourceTree = "<group>"; };
AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptBase.cpp; sourceTree = "<group>"; };
AAB6054B15874C58007B5031 /* InjectedScriptBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptBase.h; sourceTree = "<group>"; };
AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptModule.cpp; sourceTree = "<group>"; };
AAB6054D15874C58007B5031 /* InjectedScriptModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptModule.h; sourceTree = "<group>"; };
- AAD766E8157E502F00E85423 /* InspectorWebGLAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorWebGLAgent.cpp; sourceTree = "<group>"; };
- AAD766E9157E502F00E85423 /* InspectorWebGLAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebGLAgent.h; sourceTree = "<group>"; };
- AAD766EA157E502F00E85423 /* InspectorWebGLInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebGLInstrumentation.h; sourceTree = "<group>"; };
+ AAD766E8157E502F00E85423 /* InspectorCanvasAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCanvasAgent.cpp; sourceTree = "<group>"; };
+ AAD766E9157E502F00E85423 /* InspectorCanvasAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCanvasAgent.h; sourceTree = "<group>"; };
+ AAD766EA157E502F00E85423 /* InspectorCanvasInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCanvasInstrumentation.h; sourceTree = "<group>"; };
AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketFrame.cpp; path = Modules/websockets/WebSocketFrame.cpp; sourceTree = "<group>"; };
AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = "<group>"; };
AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BeforeTextInsertedEvent.h; sourceTree = "<group>"; };
@@ -14615,7 +14615,7 @@
isa = PBXGroup;
children = (
7A563E5412DE32B000F4536D /* InjectedScriptSource.h */,
- AA912750157E35A500454E54 /* InjectedScriptWebGLModuleSource.h */,
+ AA912750157E35A500454E54 /* InjectedScriptCanvasModuleSource.h */,
4F707A9711EF679400ACDA69 /* InspectorBackendDispatcher.cpp */,
4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */,
4F4F5FFA11CBD2D200A186BF /* InspectorFrontend.cpp */,
@@ -14663,9 +14663,9 @@
AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */,
AAB6054D15874C58007B5031 /* InjectedScriptModule.h */,
7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */,
- AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */,
- AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */,
- AA9030FE157E16A000276247 /* InjectedScriptWebGLModuleSource.js */,
+ AA73183C159255B900A93E6E /* InjectedScriptCanvasModule.cpp */,
+ AA73183D159255B900A93E6E /* InjectedScriptCanvasModule.h */,
+ AA9030FE157E16A000276247 /* InjectedScriptCanvasModuleSource.js */,
1C435CD414E8545B004E10EA /* Inspector-0.1.json */,
1C435CD514E8545B004E10EA /* Inspector-1.0.json */,
1C435CD314E8544F004E10EA /* Inspector.json */,
@@ -14740,9 +14740,9 @@
754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */,
4F3289B411A42AAB005ABE7E /* InspectorValues.h */,
- AAD766E8157E502F00E85423 /* InspectorWebGLAgent.cpp */,
- AAD766E9157E502F00E85423 /* InspectorWebGLAgent.h */,
- AAD766EA157E502F00E85423 /* InspectorWebGLInstrumentation.h */,
+ AAD766E8157E502F00E85423 /* InspectorCanvasAgent.cpp */,
+ AAD766E9157E502F00E85423 /* InspectorCanvasAgent.h */,
+ AAD766EA157E502F00E85423 /* InspectorCanvasInstrumentation.h */,
F3810C191365A49600ED6E33 /* InspectorWorkerAgent.cpp */,
F3810C1A1365A49600ED6E33 /* InspectorWorkerAgent.h */,
F375CC061150D300008DDB81 /* InspectorWorkerResource.h */,
@@ -23757,7 +23757,7 @@
7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */,
F316396C1329481A00A649CB /* InjectedScriptManager.h in Headers */,
AAB6055115874C58007B5031 /* InjectedScriptModule.h in Headers */,
- AA73183F159255B900A93E6E /* InjectedScriptWebGLModule.h in Headers */,
+ AA73183F159255B900A93E6E /* InjectedScriptCanvasModule.h in Headers */,
A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
@@ -23810,8 +23810,8 @@
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
578DA20F1520EBA3006141C1 /* InspectorTypeBuilder.h in Headers */,
4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */,
- AAD766EC157E502F00E85423 /* InspectorWebGLAgent.h in Headers */,
- AAD766ED157E502F00E85423 /* InspectorWebGLInstrumentation.h in Headers */,
+ AAD766EC157E502F00E85423 /* InspectorCanvasAgent.h in Headers */,
+ AAD766ED157E502F00E85423 /* InspectorCanvasInstrumentation.h in Headers */,
F3810C1C1365A49600ED6E33 /* InspectorWorkerAgent.h in Headers */,
F375CC071150D300008DDB81 /* InspectorWorkerResource.h in Headers */,
F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */,
@@ -26964,7 +26964,7 @@
7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */,
F316396B1329481A00A649CB /* InjectedScriptManager.cpp in Sources */,
AAB6055015874C58007B5031 /* InjectedScriptModule.cpp in Sources */,
- AA73183E159255B900A93E6E /* InjectedScriptWebGLModule.cpp in Sources */,
+ AA73183E159255B900A93E6E /* InjectedScriptCanvasModule.cpp in Sources */,
A8CFF5E60A155A05000A4234 /* InlineBox.cpp in Sources */,
A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */,
BCEA4859097D93020094C9E4 /* InlineTextBox.cpp in Sources */,
@@ -27012,7 +27012,7 @@
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
573D134714CE39FF0057ABCA /* InspectorTypeBuilder.cpp in Sources */,
4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */,
- AAD766EB157E502F00E85423 /* InspectorWebGLAgent.cpp in Sources */,
+ AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */,
F3810C1B1365A49600ED6E33 /* InspectorWorkerAgent.cpp in Sources */,
F350B73513F1377D00880C43 /* InstrumentingAgents.cpp in Sources */,
B27535600B053814002CE64F /* IntPointCG.cpp in Sources */,
diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
index a07380f47..0f94838e7 100644
--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
@@ -634,8 +634,11 @@ bool AccessibilityNodeObject::isReadOnly() const
if (node->hasTagName(textareaTag))
return static_cast<HTMLTextAreaElement*>(node)->readOnly();
- if (node->hasTagName(inputTag))
- return static_cast<HTMLInputElement*>(node)->readOnly();
+ if (node->hasTagName(inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ if (input->isTextField())
+ return input->readOnly();
+ }
return !node->rendererIsEditable();
}
diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 98618c777..5a99ed670 100644
--- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -64,6 +64,7 @@ bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false;
#if ENABLE(MEDIA_STREAM)
bool RuntimeEnabledFeatures::isMediaStreamEnabled = false;
bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true;
+bool RuntimeEnabledFeatures::isDeprecatedPeerConnectionEnabled = true;
#endif
#if ENABLE(GAMEPAD)
diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index f906ce611..fa5945843 100644
--- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -185,7 +185,9 @@ public:
static bool peerConnectionEnabled() { return isMediaStreamEnabled && isPeerConnectionEnabled; }
static void setPeerConnectionEnabled(bool isEnabled) { isPeerConnectionEnabled = isEnabled; }
- static bool webkitPeerConnection00Enabled() { return peerConnectionEnabled(); }
+ static bool deprecatedPeerConnectionEnabled() { return isMediaStreamEnabled && isDeprecatedPeerConnectionEnabled; }
+ static void setDeprecatedPeerConnectionEnabled(bool isEnabled) { isDeprecatedPeerConnectionEnabled = isEnabled; }
+ static bool webkitPeerConnection00Enabled() { return deprecatedPeerConnectionEnabled(); }
static bool webkitRTCPeerConnectionEnabled() { return peerConnectionEnabled(); }
#endif
@@ -298,6 +300,7 @@ private:
#if ENABLE(MEDIA_STREAM)
static bool isMediaStreamEnabled;
static bool isPeerConnectionEnabled;
+ static bool isDeprecatedPeerConnectionEnabled;
#endif
#if ENABLE(GAMEPAD)
diff --git a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
index 80212a9ee..556bdf75f 100644
--- a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
@@ -31,7 +31,7 @@
#include "HTMLCanvasElement.h"
#include "JSCanvasRenderingContext2D.h"
#if ENABLE(WEBGL)
-#include "InspectorWebGLInstrumentation.h"
+#include "InspectorCanvasInstrumentation.h"
#include "JSWebGLRenderingContext.h"
#include "ScriptObject.h"
#include "WebGLContextAttributes.h"
diff --git a/Source/WebCore/bindings/js/ScriptEventListener.cpp b/Source/WebCore/bindings/js/ScriptEventListener.cpp
index c0e9c3e39..8f4577bad 100644
--- a/Source/WebCore/bindings/js/ScriptEventListener.cpp
+++ b/Source/WebCore/bindings/js/ScriptEventListener.cpp
@@ -106,7 +106,7 @@ String eventListenerHandlerBody(Document* document, EventListener* eventListener
return jsFunction->toString(scriptState)->value(scriptState);
}
-bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, int& lineNumber)
+bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, String& scriptId, int& lineNumber)
{
const JSEventListener* jsListener = JSEventListener::cast(eventListener);
ASSERT(jsListener);
@@ -122,7 +122,9 @@ bool eventListenerHandlerLocation(Document* document, EventListener* eventListen
JSC::FunctionExecutable* funcExecutable = jsFunction->jsExecutable();
if (!funcExecutable)
return false;
- lineNumber = funcExecutable->lineNo();
+ lineNumber = funcExecutable->lineNo() - 1;
+ intptr_t funcSourceId = funcExecutable->sourceID();
+ scriptId = funcSourceId == SourceProvider::nullID ? "" : String::number(funcSourceId);
sourceName = funcExecutable->sourceURL();
return true;
}
diff --git a/Source/WebCore/bindings/js/ScriptEventListener.h b/Source/WebCore/bindings/js/ScriptEventListener.h
index 78a9776a1..8c0b453dd 100644
--- a/Source/WebCore/bindings/js/ScriptEventListener.h
+++ b/Source/WebCore/bindings/js/ScriptEventListener.h
@@ -46,7 +46,7 @@ namespace WebCore {
PassRefPtr<JSLazyEventListener> createAttributeEventListener(Node*, const Attribute&);
PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame*, const Attribute&);
String eventListenerHandlerBody(Document*, EventListener*);
- bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, int& lineNumber);
+ bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, String& scriptId, int& lineNumber);
} // namespace WebCore
#endif // ScriptEventListener_h
diff --git a/Source/WebCore/bindings/v8/NPV8Object.cpp b/Source/WebCore/bindings/v8/NPV8Object.cpp
index eb854da98..f85c8453e 100644
--- a/Source/WebCore/bindings/v8/NPV8Object.cpp
+++ b/Source/WebCore/bindings/v8/NPV8Object.cpp
@@ -28,7 +28,6 @@
#include "NPV8Object.h"
-#include "PlatformSupport.h"
#include "DOMWindow.h"
#include "Frame.h"
#include "NPObjectWrapper.h"
@@ -296,7 +295,8 @@ bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments,
bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result)
{
- bool popupsAllowed = PlatformSupport::popupsAllowed(npp);
+ // FIXME: Give the embedder a way to control this.
+ bool popupsAllowed = false;
return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result);
}
diff --git a/Source/WebCore/bindings/v8/ScriptController.cpp b/Source/WebCore/bindings/v8/ScriptController.cpp
index fb9d557e9..4800ade91 100644
--- a/Source/WebCore/bindings/v8/ScriptController.cpp
+++ b/Source/WebCore/bindings/v8/ScriptController.cpp
@@ -281,6 +281,7 @@ v8::Local<v8::Value> ScriptController::compileAndRunScript(const ScriptSourceCod
// Keep Frame (and therefore ScriptController) alive.
RefPtr<Frame> protect(m_frame);
result = ScriptRunner::runCompiledScript(script, m_frame->document());
+ ASSERT(!tryCatch.HasCaught() || result.IsEmpty());
}
InspectorInstrumentation::didEvaluateScript(cookie);
diff --git a/Source/WebCore/bindings/v8/ScriptEventListener.cpp b/Source/WebCore/bindings/v8/ScriptEventListener.cpp
index f42e5fb00..ec898d298 100644
--- a/Source/WebCore/bindings/v8/ScriptEventListener.cpp
+++ b/Source/WebCore/bindings/v8/ScriptEventListener.cpp
@@ -104,7 +104,7 @@ String eventListenerHandlerBody(Document* document, EventListener* listener)
return toWebCoreStringWithNullCheck(function);
}
-bool eventListenerHandlerLocation(Document* document, EventListener* listener, String& sourceName, int& lineNumber)
+bool eventListenerHandlerLocation(Document* document, EventListener* listener, String& sourceName, String& scriptId, int& lineNumber)
{
if (listener->type() != EventListener::JSEventListenerType)
return false;
@@ -118,13 +118,15 @@ bool eventListenerHandlerLocation(Document* document, EventListener* listener, S
return false;
v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(object);
+ v8::Handle<v8::Value> scriptIdValue = function->GetScriptId();
+ scriptId = toWebCoreStringWithNullOrUndefinedCheck(scriptIdValue);
v8::ScriptOrigin origin = function->GetScriptOrigin();
- if (!origin.ResourceName().IsEmpty()) {
+ if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty())
sourceName = toWebCoreString(origin.ResourceName());
- lineNumber = function->GetScriptLineNumber() + 1;
- return true;
- }
- return false;
+ else
+ sourceName = "";
+ lineNumber = function->GetScriptLineNumber();
+ return true;
}
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/ScriptEventListener.h b/Source/WebCore/bindings/v8/ScriptEventListener.h
index 81157b2a0..b2e66319c 100644
--- a/Source/WebCore/bindings/v8/ScriptEventListener.h
+++ b/Source/WebCore/bindings/v8/ScriptEventListener.h
@@ -46,7 +46,7 @@ namespace WebCore {
PassRefPtr<V8LazyEventListener> createAttributeEventListener(Node*, const Attribute&);
PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame*, const Attribute&);
String eventListenerHandlerBody(Document*, EventListener*);
- bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, int& lineNumber);
+ bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, String& scriptId, int& lineNumber);
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/ScriptRunner.cpp b/Source/WebCore/bindings/v8/ScriptRunner.cpp
index 04f8ea304..b453baa0b 100644
--- a/Source/WebCore/bindings/v8/ScriptRunner.cpp
+++ b/Source/WebCore/bindings/v8/ScriptRunner.cpp
@@ -47,8 +47,6 @@ v8::Local<v8::Value> ScriptRunner::runCompiledScript(v8::Handle<v8::Script> scri
// Run the script and keep track of the current recursion depth.
v8::Local<v8::Value> result;
- v8::TryCatch tryCatch;
- tryCatch.SetVerbose(true);
{
V8RecursionScope recursionScope(context);
result = script->Run();
@@ -57,12 +55,6 @@ v8::Local<v8::Value> ScriptRunner::runCompiledScript(v8::Handle<v8::Script> scri
if (handleOutOfMemory())
ASSERT(result.IsEmpty());
- // Handle V8 internal error situation.
- if (tryCatch.HasCaught()) {
- ASSERT(result.IsEmpty());
- return v8::Local<v8::Value>();
- }
-
if (result.IsEmpty())
return v8::Local<v8::Value>();
diff --git a/Source/WebCore/bindings/v8/ScriptSourceCode.cpp b/Source/WebCore/bindings/v8/ScriptSourceCode.cpp
index efff63e17..8c78b64a2 100644
--- a/Source/WebCore/bindings/v8/ScriptSourceCode.cpp
+++ b/Source/WebCore/bindings/v8/ScriptSourceCode.cpp
@@ -49,6 +49,9 @@ PassOwnPtr<v8::ScriptData> ScriptSourceCode::precompileScript(v8::Handle<v8::Str
return adoptPtr(v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size()));
OwnPtr<v8::ScriptData> scriptData = adoptPtr(v8::ScriptData::PreCompile(code));
+ if (!scriptData)
+ return nullptr;
+
cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length());
return scriptData.release();
diff --git a/Source/WebCore/bindings/v8/V8Binding.cpp b/Source/WebCore/bindings/v8/V8Binding.cpp
index 5c9046fdf..d22e77507 100644
--- a/Source/WebCore/bindings/v8/V8Binding.cpp
+++ b/Source/WebCore/bindings/v8/V8Binding.cpp
@@ -35,7 +35,8 @@
#include "DOMStringList.h"
#include "Element.h"
#include "Frame.h"
-#include "PlatformSupport.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
#include "QualifiedName.h"
#include "Settings.h"
#include "V8DOMStringList.h"
@@ -332,7 +333,7 @@ bool handleOutOfMemory()
frame->script()->windowShell()->destroyGlobal();
#if PLATFORM(CHROMIUM)
- PlatformSupport::notifyJSOutOfMemory(frame);
+ frame->loader()->client()->didExhaustMemoryAvailableForScript();
#endif
if (Settings* settings = frame->settings())
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 9fe6d7cea..81ea21a3b 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -41,7 +41,6 @@
#include "MemoryUsageSupport.h"
#include "Page.h"
#include "PageGroup.h"
-#include "PlatformSupport.h"
#include "RuntimeEnabledFeatures.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
diff --git a/Source/WebCore/bindings/v8/V8GCController.cpp b/Source/WebCore/bindings/v8/V8GCController.cpp
index f3e217993..0b3dade8f 100644
--- a/Source/WebCore/bindings/v8/V8GCController.cpp
+++ b/Source/WebCore/bindings/v8/V8GCController.cpp
@@ -39,7 +39,6 @@
#include "HTMLNames.h"
#include "MemoryUsageSupport.h"
#include "MessagePort.h"
-#include "PlatformSupport.h"
#include "RetainedDOMInfo.h"
#include "RetainedObjectInfo.h"
#include "V8AbstractEventListener.h"
diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index 676faed06..9611d47f3 100644
--- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -38,6 +38,7 @@
#include "DedicatedWorkerContext.h"
#include "Event.h"
#include "ScriptCallStack.h"
+#include "ScriptRunner.h"
#include "ScriptSourceCode.h"
#include "SharedWorker.h"
#include "SharedWorkerContext.h"
@@ -223,7 +224,7 @@ ScriptValue WorkerContextExecutionProxy::evaluate(const String& script, const St
v8::Local<v8::String> scriptString = v8ExternalString(script);
v8::Handle<v8::Script> compiledScript = ScriptSourceCode::compileScript(scriptString, fileName, scriptStartPosition);
- v8::Local<v8::Value> result = runScript(compiledScript);
+ v8::Local<v8::Value> result = ScriptRunner::runCompiledScript(compiledScript, m_workerContext);
if (!exceptionCatcher.CanContinue()) {
m_workerContext->script()->forbidExecution();
@@ -256,37 +257,6 @@ void WorkerContextExecutionProxy::setEvalAllowed(bool enable)
m_disableEvalPending = !enable;
}
-v8::Local<v8::Value> WorkerContextExecutionProxy::runScript(v8::Handle<v8::Script> script)
-{
- if (script.IsEmpty())
- return v8::Local<v8::Value>();
-
- // Compute the source string and prevent against infinite recursion.
- if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth) {
- v8::Local<v8::String> code = v8ExternalString("throw RangeError('Recursion too deep')");
- script = ScriptSourceCode::compileScript(code, "", TextPosition::minimumPosition());
- }
-
- if (handleOutOfMemory())
- ASSERT(script.IsEmpty());
-
- if (script.IsEmpty())
- return v8::Local<v8::Value>();
-
- // Run the script and keep track of the current recursion depth.
- v8::Local<v8::Value> result;
- {
- V8RecursionScope recursionScope(m_workerContext);
- result = script->Run();
- }
-
- // Handle V8 internal error situation (Out-of-memory).
- if (result.IsEmpty())
- return v8::Local<v8::Value>();
-
- return result;
-}
-
void WorkerContextExecutionProxy::trackEvent(Event* event)
{
m_events.append(event);
diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h
index 8128ab87a..5ce3f2ca4 100644
--- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h
+++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h
@@ -82,9 +82,6 @@ namespace WebCore {
bool initializeIfNeeded();
void dispose();
- // Run an already compiled script.
- v8::Local<v8::Value> runScript(v8::Handle<v8::Script>);
-
static bool forgetV8EventObject(Event*);
static const int kWorkerMaxStackSize = 500 * 1024;
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
index ab6c75ab9..0b157279c 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
@@ -40,7 +40,7 @@
#include "V8CanvasRenderingContext2D.h"
#include "V8Node.h"
#if ENABLE(WEBGL)
-#include "InspectorWebGLInstrumentation.h"
+#include "InspectorCanvasInstrumentation.h"
#include "V8WebGLRenderingContext.h"
#endif
#include <wtf/MathExtras.h>
diff --git a/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp
index c1f142ce9..151c62987 100644
--- a/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp
@@ -44,9 +44,7 @@ v8::Handle<v8::Value> V8Notification::requestPermissionCallback(const v8::Argume
return v8::Undefined();
ASSERT(callback);
- Notification* notification = V8Notification::toNative(args.Holder());
- ScriptExecutionContext* context = notification->scriptExecutionContext();
- Notification::requestPermission(context, callback.release());
+ Notification::requestPermission(getScriptExecutionContext(), callback.release());
return v8::Undefined();
}
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 8f9418c00..d10d738a3 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -377,6 +377,7 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyMarkerEnd,
CSSPropertyMarkerMid,
CSSPropertyMarkerStart,
+ CSSPropertyMaskType,
CSSPropertyShapeRendering,
CSSPropertyStroke,
CSSPropertyStrokeDasharray,
@@ -2613,6 +2614,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyMarkerEnd:
case CSSPropertyMarkerMid:
case CSSPropertyMarkerStart:
+ case CSSPropertyMaskType:
case CSSPropertyShapeRendering:
case CSSPropertyStroke:
case CSSPropertyStrokeDasharray:
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index 2df502050..3dd09a660 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -4277,6 +4277,33 @@ template<> inline CSSPrimitiveValue::operator EVectorEffect() const
return VE_NONE;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMaskType e)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_IDENT;
+ switch (e) {
+ case MT_LUMINANCE:
+ m_value.ident = CSSValueLuminance;
+ break;
+ case MT_ALPHA:
+ m_value.ident = CSSValueAlpha;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator EMaskType() const
+{
+ switch (m_value.ident) {
+ case CSSValueLuminance:
+ return MT_LUMINANCE;
+ case CSSValueAlpha:
+ return MT_ALPHA;
+ }
+
+ ASSERT_NOT_REACHED();
+ return MT_LUMINANCE;
+}
+
#endif // ENABLE(SVG)
#if ENABLE(CSS_IMAGE_ORIENTATION)
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index c7633f8db..b5a9d3f4f 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -683,6 +683,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
#if ENABLE(SVG)
case CSSPropertyClipPath:
case CSSPropertyMask:
+ case CSSPropertyMaskType:
case CSSPropertyEnableBackground:
case CSSPropertyFilter:
case CSSPropertyFloodColor:
diff --git a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
index 1cd8fa0aa..271dd2b3c 100644
--- a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
@@ -192,6 +192,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(CSSProp
return valueForShadow(svgStyle->shadow(), propertyID, style);
case CSSPropertyVectorEffect:
return CSSPrimitiveValue::create(svgStyle->vectorEffect());
+ case CSSPropertyMaskType:
+ return CSSPrimitiveValue::create(svgStyle->maskType());
case CSSPropertyMarker:
case CSSPropertyEnableBackground:
case CSSPropertyColorProfile:
diff --git a/Source/WebCore/css/SVGCSSParser.cpp b/Source/WebCore/css/SVGCSSParser.cpp
index c7ec6d9f9..26d44e462 100644
--- a/Source/WebCore/css/SVGCSSParser.cpp
+++ b/Source/WebCore/css/SVGCSSParser.cpp
@@ -270,6 +270,11 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
return false;
}
+ case CSSPropertyMaskType: // luminance | alpha | inherit
+ if (id == CSSValueLuminance || id == CSSValueAlpha)
+ valid_primitive = true;
+ break;
+
/* shorthand properties */
case CSSPropertyMarker:
{
diff --git a/Source/WebCore/css/SVGCSSPropertyNames.in b/Source/WebCore/css/SVGCSSPropertyNames.in
index 34e4ca33c..f0188f266 100644
--- a/Source/WebCore/css/SVGCSSPropertyNames.in
+++ b/Source/WebCore/css/SVGCSSPropertyNames.in
@@ -30,6 +30,7 @@ marker
marker-end
marker-mid
marker-start
+mask-type
shape-rendering
stroke
stroke-dasharray
diff --git a/Source/WebCore/css/SVGCSSStyleSelector.cpp b/Source/WebCore/css/SVGCSSStyleSelector.cpp
index 5b3547f4d..eaedc1065 100644
--- a/Source/WebCore/css/SVGCSSStyleSelector.cpp
+++ b/Source/WebCore/css/SVGCSSStyleSelector.cpp
@@ -582,6 +582,14 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
svgstyle->setVectorEffect(*primitiveValue);
break;
}
+ case CSSPropertyMaskType: {
+ HANDLE_INHERIT_AND_INITIAL(maskType, MaskType)
+ if (!primitiveValue)
+ break;
+
+ svgstyle->setMaskType(*primitiveValue);
+ break;
+ }
default:
// If you crash here, it's because you added a css property and are not handling it
// in either this switch statement or the one in StyleResolver::applyProperty
diff --git a/Source/WebCore/css/SVGCSSValueKeywords.in b/Source/WebCore/css/SVGCSSValueKeywords.in
index e11516510..6f769b678 100644
--- a/Source/WebCore/css/SVGCSSValueKeywords.in
+++ b/Source/WebCore/css/SVGCSSValueKeywords.in
@@ -4,6 +4,7 @@
// CSS_PROP_*_COLOR
//
aliceblue
+alpha
antiquewhite
// aqua
aquamarine
@@ -88,6 +89,7 @@ lightyellow
// lime
limegreen
linen
+luminance
magenta
// maroon
mediumaquamarine
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 517bdb6b2..cf20687c8 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -1712,9 +1712,9 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF
return documentStyle.release();
FontDescription fontDescription;
- fontDescription.setUsePrinterFont(document->printing());
fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale()));
if (Settings* settings = document->settings()) {
+ fontDescription.setUsePrinterFont(document->printing() || !settings->screenFontSubstitutionEnabled());
fontDescription.setRenderingMode(settings->fontRenderingMode());
const AtomicString& standardFont = settings->standardFontFamily(fontDescription.script());
if (!standardFont.isEmpty()) {
@@ -1727,7 +1727,8 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF
fontDescription.setSpecifiedSize(size);
bool useSVGZoomRules = document->isSVGDocument();
fontDescription.setComputedSize(StyleResolver::getComputedSizeFromSpecifiedSize(document, documentStyle.get(), fontDescription.isAbsoluteSize(), size, useSVGZoomRules));
- }
+ } else
+ fontDescription.setUsePrinterFont(document->printing());
documentStyle->setFontDescription(fontDescription);
documentStyle->font().update(fontSelector);
@@ -3728,7 +3729,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
if (!settings)
return;
fontDescription.setRenderingMode(settings->fontRenderingMode());
- fontDescription.setUsePrinterFont(m_checker.document()->printing());
+ fontDescription.setUsePrinterFont(m_checker.document()->printing() || !settings->screenFontSubstitutionEnabled());
// Handle the zoom factor.
fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(m_checker.document(), m_style.get(), fontDescription.isAbsoluteSize(), fontDescription.specifiedSize(), useSVGZoomRules()));
@@ -4609,7 +4610,7 @@ void StyleResolver::initializeFontStyle(Settings* settings)
FontDescription fontDescription;
fontDescription.setGenericFamily(FontDescription::StandardFamily);
fontDescription.setRenderingMode(settings->fontRenderingMode());
- fontDescription.setUsePrinterFont(m_checker.document()->printing());
+ fontDescription.setUsePrinterFont(m_checker.document()->printing() || !settings->screenFontSubstitutionEnabled());
const AtomicString& standardFontFamily = documentSettings()->standardFontFamily();
if (!standardFontFamily.isEmpty()) {
fontDescription.firstFamily().setFamily(standardFontFamily);
diff --git a/Source/WebCore/css/StyleRule.cpp b/Source/WebCore/css/StyleRule.cpp
index 59ed9e58f..5ece1b4a2 100644
--- a/Source/WebCore/css/StyleRule.cpp
+++ b/Source/WebCore/css/StyleRule.cpp
@@ -81,7 +81,10 @@ void StyleRuleBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
case Unknown:
case Charset:
case Keyframe:
- MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
+#if !ENABLE(CSS_REGIONS)
+ case Region:
+#endif
+ ASSERT_NOT_REACHED();
return;
}
ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 0d448e111..3a7c54196 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -2033,6 +2033,8 @@ RenderRegion* Element::renderRegion() const
return 0;
}
+#if ENABLE(CSS_REGIONS)
+
const AtomicString& Element::webkitRegionOverset() const
{
document()->updateLayoutIgnorePendingStylesheets();
@@ -2062,8 +2064,6 @@ const AtomicString& Element::webkitRegionOverset() const
return undefinedState;
}
-#if ENABLE(CSS_REGIONS)
-
Vector<RefPtr<Range> > Element::webkitGetRegionFlowRanges() const
{
document()->updateLayoutIgnorePendingStylesheets();
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index 2f4e92564..0cd209df8 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -426,8 +426,8 @@ public:
PassRefPtr<RenderStyle> styleForRenderer();
RenderRegion* renderRegion() const;
- const AtomicString& webkitRegionOverset() const;
#if ENABLE(CSS_REGIONS)
+ const AtomicString& webkitRegionOverset() const;
Vector<RefPtr<Range> > webkitGetRegionFlowRanges() const;
#endif
diff --git a/Source/WebCore/dom/Element.idl b/Source/WebCore/dom/Element.idl
index 33c11dfae..4bd64ed4e 100644
--- a/Source/WebCore/dom/Element.idl
+++ b/Source/WebCore/dom/Element.idl
@@ -143,7 +143,7 @@ module core {
[Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] void webkitRequestPointerLock();
// CSS Regions API
- readonly attribute DOMString webkitRegionOverset;
+ readonly attribute [Conditional=CSS_REGIONS] DOMString webkitRegionOverset;
[Conditional=CSS_REGIONS] sequence<Range> webkitGetRegionFlowRanges();
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
diff --git a/Source/WebCore/fileapi/Blob.cpp b/Source/WebCore/fileapi/Blob.cpp
index 431f1764b..291a22729 100644
--- a/Source/WebCore/fileapi/Blob.cpp
+++ b/Source/WebCore/fileapi/Blob.cpp
@@ -89,21 +89,6 @@ Blob::~Blob()
#if ENABLE(BLOB)
PassRefPtr<Blob> Blob::slice(long long start, long long end, const String& contentType) const
{
- HistogramSupport::histogramEnumeration("WebCore.Blob.slice", SliceWithoutPrefix, SliceHistogramEnumMax);
- return sliceInternal(start, end, contentType);
-}
-
-PassRefPtr<Blob> Blob::webkitSlice(ScriptExecutionContext* context, long long start, long long end, const String& contentType) const
-{
- String message("Blob.webkitSlice() is deprecated. Use Blob.slice() instead.");
- context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, message);
-
- HistogramSupport::histogramEnumeration("WebCore.Blob.slice", SliceWithPrefix, SliceHistogramEnumMax);
- return sliceInternal(start, end, contentType);
-}
-
-PassRefPtr<Blob> Blob::sliceInternal(long long start, long long end, const String& contentType) const
-{
// When we slice a file for the first time, we obtain a snapshot of the file by capturing its current size and modification time.
// The modification time will be used to verify if the file has been changed or not, when the underlying data are accessed.
long long size;
diff --git a/Source/WebCore/fileapi/Blob.h b/Source/WebCore/fileapi/Blob.h
index 9cd80008a..9898e238b 100644
--- a/Source/WebCore/fileapi/Blob.h
+++ b/Source/WebCore/fileapi/Blob.h
@@ -71,10 +71,6 @@ public:
#if ENABLE(BLOB)
PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const;
-
- // Prefixed version is deprecated. This internally calls sliceInternal() (as slice() does) after showing a deprecation message.
- PassRefPtr<Blob> webkitSlice(ScriptExecutionContext*, long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const;
-
#endif
protected:
@@ -84,10 +80,6 @@ protected:
// For deserialization.
Blob(const KURL& srcURL, const String& type, long long size);
-#if ENABLE(BLOB)
- PassRefPtr<Blob> sliceInternal(long long start, long long end, const String& contentType) const;
-#endif
-
// This is an internal URL referring to the blob data associated with this object. It serves
// as an identifier for this blob. The internal URL is never used to source the blob's content
// into an HTML or for FileRead'ing, public blob URLs must be used for those purposes.
diff --git a/Source/WebCore/fileapi/Blob.idl b/Source/WebCore/fileapi/Blob.idl
index b44eb4375..95872aa3d 100644
--- a/Source/WebCore/fileapi/Blob.idl
+++ b/Source/WebCore/fileapi/Blob.idl
@@ -43,10 +43,6 @@ module html {
#if !defined(LANGUAGE_OBJECTIVE_C)
#if defined(ENABLE_BLOB) && ENABLE_BLOB
Blob slice(in [Optional] long long start, in [Optional] long long end, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString contentType);
-#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
- // Prefixed version is going to be deprecated.
- [CallWith=ScriptExecutionContext] Blob webkitSlice(in [Optional] long long start, in [Optional] long long end, in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString contentType);
-#endif
#endif
#endif
};
diff --git a/Source/WebCore/fileapi/File.h b/Source/WebCore/fileapi/File.h
index c8096d1c5..d466adce8 100644
--- a/Source/WebCore/fileapi/File.h
+++ b/Source/WebCore/fileapi/File.h
@@ -123,7 +123,7 @@ private:
#if ENABLE(FILE_SYSTEM)
KURL m_fileSystemURL;
- // If m_snapshotSize is negative (initialized to -1 by default), the snapshot metadata is invalid and we retrieve the latest metadata synchronously in size(), lastModifiedTime() and webkitSlice().
+ // If m_snapshotSize is negative (initialized to -1 by default), the snapshot metadata is invalid and we retrieve the latest metadata synchronously in size(), lastModifiedTime() and slice().
// Otherwise, the snapshot metadata are used directly in those methods.
const long long m_snapshotSize;
const double m_snapshotModificationTime;
diff --git a/Source/WebCore/html/BaseButtonInputType.cpp b/Source/WebCore/html/BaseButtonInputType.cpp
index 5fde8d799..d1ed27ba5 100644
--- a/Source/WebCore/html/BaseButtonInputType.cpp
+++ b/Source/WebCore/html/BaseButtonInputType.cpp
@@ -36,11 +36,62 @@
#include "HTMLNames.h"
#include "KeyboardEvent.h"
#include "RenderButton.h"
+#include "RenderTextFragment.h"
+#include "ShadowRoot.h"
+#include "Text.h"
namespace WebCore {
using namespace HTMLNames;
+class TextForButtonInputType : public Text {
+public:
+ static PassRefPtr<TextForButtonInputType> create(Document*, const String&);
+
+private:
+ TextForButtonInputType(Document*, const String&);
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+};
+
+PassRefPtr<TextForButtonInputType> TextForButtonInputType::create(Document* document, const String& data)
+{
+ return adoptRef(new TextForButtonInputType(document, data));
+}
+
+TextForButtonInputType::TextForButtonInputType(Document* document, const String& data)
+ : Text(document, data)
+{
+}
+
+RenderObject* TextForButtonInputType::createRenderer(RenderArena* arena, RenderStyle*)
+{
+ return new (arena) RenderTextFragment(document(), dataImpl());
+}
+
+BaseButtonInputType::BaseButtonInputType(HTMLInputElement* element)
+ : BaseClickableWithKeyInputType(element)
+{
+}
+
+void BaseButtonInputType::createShadowSubtree()
+{
+ ASSERT(element()->userAgentShadowRoot());
+
+ RefPtr<TextForButtonInputType> text = TextForButtonInputType::create(element()->document(), defaultValue());
+ element()->userAgentShadowRoot()->appendChild(text);
+}
+
+void BaseButtonInputType::destroyShadowSubtree()
+{
+ InputType::destroyShadowSubtree();
+}
+
+void BaseButtonInputType::valueAttributeChanged()
+{
+ String value = element()->valueWithDefault();
+ toText(element()->userAgentShadowRoot()->firstChild())->setData(value, ASSERT_NO_EXCEPTION);
+}
+
bool BaseButtonInputType::shouldSaveAndRestoreFormControlState() const
{
return false;
diff --git a/Source/WebCore/html/BaseButtonInputType.h b/Source/WebCore/html/BaseButtonInputType.h
index 4dfbb043f..3b8384c4e 100644
--- a/Source/WebCore/html/BaseButtonInputType.h
+++ b/Source/WebCore/html/BaseButtonInputType.h
@@ -38,9 +38,14 @@ namespace WebCore {
// Base of button, file, image, reset, and submit types.
class BaseButtonInputType : public BaseClickableWithKeyInputType {
protected:
- BaseButtonInputType(HTMLInputElement* element) : BaseClickableWithKeyInputType(element) { }
+ BaseButtonInputType(HTMLInputElement*);
private:
+ virtual void createShadowSubtree() OVERRIDE;
+ virtual void destroyShadowSubtree() OVERRIDE;
+
+ virtual void valueAttributeChanged() OVERRIDE;
+
virtual bool shouldSaveAndRestoreFormControlState() const OVERRIDE;
virtual bool appendFormData(FormDataList&, bool) const OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const OVERRIDE;
diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp
index 89fcc878e..cc19f2a35 100644
--- a/Source/WebCore/html/FileInputType.cpp
+++ b/Source/WebCore/html/FileInputType.cpp
@@ -62,6 +62,7 @@ private:
PassRefPtr<UploadButtonElement> UploadButtonElement::create(Document* document)
{
RefPtr<UploadButtonElement> button = adoptRef(new UploadButtonElement(document));
+ button->createShadowSubtree();
button->setType("button");
button->setValue(fileButtonChooseFileLabel());
return button.release();
@@ -70,6 +71,7 @@ PassRefPtr<UploadButtonElement> UploadButtonElement::create(Document* document)
PassRefPtr<UploadButtonElement> UploadButtonElement::createForMultiple(Document* document)
{
RefPtr<UploadButtonElement> button = adoptRef(new UploadButtonElement(document));
+ button->createShadowSubtree();
button->setType("button");
button->setValue(fileButtonChooseMultipleFilesLabel());
return button.release();
diff --git a/Source/WebCore/html/HTMLFormControlElementWithState.cpp b/Source/WebCore/html/HTMLFormControlElementWithState.cpp
index f96d264c0..66f21b34e 100644
--- a/Source/WebCore/html/HTMLFormControlElementWithState.cpp
+++ b/Source/WebCore/html/HTMLFormControlElementWithState.cpp
@@ -25,8 +25,12 @@
#include "config.h"
#include "HTMLFormControlElementWithState.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
#include "FormController.h"
+#include "Frame.h"
#include "HTMLFormElement.h"
+#include "Page.h"
namespace WebCore {
@@ -56,6 +60,16 @@ bool HTMLFormControlElementWithState::shouldAutocomplete() const
return form()->shouldAutocomplete();
}
+void HTMLFormControlElementWithState::notifyFormStateChanged()
+{
+ Frame* frame = document()->frame();
+ if (!frame)
+ return;
+
+ if (Page* page = frame->page())
+ page->chrome()->client()->formStateDidChange(this);
+}
+
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
{
// We don't save/restore control state in a form with autocomplete=off.
diff --git a/Source/WebCore/html/HTMLFormControlElementWithState.h b/Source/WebCore/html/HTMLFormControlElementWithState.h
index 5e7bb1acd..92165e52a 100644
--- a/Source/WebCore/html/HTMLFormControlElementWithState.h
+++ b/Source/WebCore/html/HTMLFormControlElementWithState.h
@@ -40,6 +40,7 @@ public:
virtual FormControlState saveFormControlState() const;
// The specified FormControlState must have at least one string value.
virtual void restoreFormControlState(const FormControlState&) { }
+ void notifyFormStateChanged();
protected:
HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index d1ea76cae..4cfc2b7d8 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -677,6 +677,7 @@ void HTMLInputElement::parseAttribute(const Attribute& attribute)
updatePlaceholderVisibility(false);
setNeedsStyleRecalc();
}
+ m_inputType->valueAttributeChanged();
setFormControlValueMatchesRenderer(false);
setNeedsValidityCheck();
m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress;
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 9261d52b6..914b55de8 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -632,6 +632,7 @@ void HTMLSelectElement::updateListBoxSelection(bool deselectOtherOptions)
scrollToSelection();
setNeedsValidityCheck();
+ notifyFormStateChanged();
}
void HTMLSelectElement::listBoxOnChange()
@@ -864,8 +865,7 @@ void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)
}
setNeedsValidityCheck();
- if (Frame* frame = document()->frame())
- frame->page()->chrome()->client()->formStateDidChange(this);
+ notifyFormStateChanged();
}
int HTMLSelectElement::optionToListIndex(int optionIndex) const
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index 2ec5f09b1..70c06191e 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -27,7 +27,6 @@
#include "AXObjectCache.h"
#include "Attribute.h"
-#include "Chrome.h"
#include "ChromeClient.h"
#include "Document.h"
#include "Event.h"
@@ -38,7 +37,6 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "NodeRenderingContext.h"
-#include "Page.h"
#include "RenderBox.h"
#include "RenderTextControl.h"
#include "RenderTheme.h"
@@ -459,16 +457,6 @@ void HTMLTextFormControlElement::parseAttribute(const Attribute& attribute)
HTMLFormControlElementWithState::parseAttribute(attribute);
}
-void HTMLTextFormControlElement::notifyFormStateChanged()
-{
- Frame* frame = document()->frame();
- if (!frame)
- return;
-
- if (Page* page = frame->page())
- page->chrome()->client()->formStateDidChange(this);
-}
-
bool HTMLTextFormControlElement::lastChangeWasUserEdit() const
{
if (!isTextFormControl())
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.h b/Source/WebCore/html/HTMLTextFormControlElement.h
index 8ebe66ac6..f843d6dee 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.h
+++ b/Source/WebCore/html/HTMLTextFormControlElement.h
@@ -77,7 +77,6 @@ public:
virtual HTMLElement* innerTextElement() const = 0;
void selectionChanged(bool userTriggered);
- void notifyFormStateChanged();
bool lastChangeWasUserEdit() const;
void setInnerTextValue(const String&);
String innerTextValue() const;
diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp
index 38d79eea8..1a078f250 100644
--- a/Source/WebCore/html/InputType.cpp
+++ b/Source/WebCore/html/InputType.cpp
@@ -889,6 +889,10 @@ void InputType::updatePlaceholderText()
{
}
+void InputType::valueAttributeChanged()
+{
+}
+
void InputType::multipleAttributeChanged()
{
}
diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h
index 87a4c12a8..29d8cc30c 100644
--- a/Source/WebCore/html/InputType.h
+++ b/Source/WebCore/html/InputType.h
@@ -278,6 +278,7 @@ public:
virtual String fixedPlaceholder();
virtual void updateInnerTextValue();
virtual void updatePlaceholderText();
+ virtual void valueAttributeChanged();
virtual void multipleAttributeChanged();
virtual void disabledAttributeChanged();
virtual void readonlyAttributeChanged();
diff --git a/Source/WebCore/html/TimeInputType.cpp b/Source/WebCore/html/TimeInputType.cpp
index 880e44719..c1597ecbb 100644
--- a/Source/WebCore/html/TimeInputType.cpp
+++ b/Source/WebCore/html/TimeInputType.cpp
@@ -152,6 +152,7 @@ void TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged()
input->setNeedsStyleRecalc();
input->dispatchFormControlInputEvent();
input->dispatchFormControlChangeEvent();
+ input->notifyFormStateChanged();
}
bool TimeInputType::hasCustomFocusLogic() const
diff --git a/Source/WebCore/html/shadow/ContentDistributor.cpp b/Source/WebCore/html/shadow/ContentDistributor.cpp
index b3c8eb0e4..076a723c8 100644
--- a/Source/WebCore/html/shadow/ContentDistributor.cpp
+++ b/Source/WebCore/html/shadow/ContentDistributor.cpp
@@ -59,6 +59,8 @@ void ContentDistributor::distribute(Element* host)
ContentDistribution pool;
for (Node* node = host->firstChild(); node; node = node->nextSibling())
pool.append(node);
+ Vector<bool> distributed(pool.size());
+ distributed.fill(false);
for (ShadowRoot* root = host->youngestShadowRoot(); root; root = root->olderShadowRoot()) {
for (Node* node = root; node; node = node->traverseNextNode(root)) {
@@ -69,7 +71,7 @@ void ContentDistributor::distribute(Element* host)
continue;
ShadowRoot* older = root->olderShadowRoot();
if (point->doesSelectFromHostChildren())
- distributeSelectionsTo(point, pool);
+ distributeSelectionsTo(point, pool, distributed);
else if (older && !older->assignedTo()) {
distributeNodeChildrenTo(point, older);
older->setAssignedTo(point);
@@ -106,21 +108,22 @@ void ContentDistributor::finishInivalidation()
m_validity = Invalidated;
}
-void ContentDistributor::distributeSelectionsTo(InsertionPoint* insertionPoint, ContentDistribution& pool)
+void ContentDistributor::distributeSelectionsTo(InsertionPoint* insertionPoint, const ContentDistribution& pool, Vector<bool>& distributed)
{
ContentDistribution distribution;
ContentSelectorQuery query(insertionPoint);
for (size_t i = 0; i < pool.size(); ++i) {
- Node* child = pool[i].get();
- if (!child)
+ if (distributed[i])
continue;
+
+ Node* child = pool[i].get();
if (!query.matches(child))
continue;
distribution.append(child);
m_nodeToInsertionPoint.add(child, insertionPoint);
- pool[i] = 0;
+ distributed[i] = true;
}
insertionPoint->setDistribution(distribution);
diff --git a/Source/WebCore/html/shadow/ContentDistributor.h b/Source/WebCore/html/shadow/ContentDistributor.h
index 08cb543f8..bee92a56a 100644
--- a/Source/WebCore/html/shadow/ContentDistributor.h
+++ b/Source/WebCore/html/shadow/ContentDistributor.h
@@ -69,7 +69,7 @@ public:
bool needsDistribution() const;
bool needsInvalidation() const { return m_validity != Invalidated; }
- void distributeSelectionsTo(InsertionPoint*, ContentDistribution& pool);
+ void distributeSelectionsTo(InsertionPoint*, const ContentDistribution& pool, Vector<bool>& distributed);
void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*);
void invalidateDistributionIn(ContentDistribution*);
diff --git a/Source/WebCore/inspector/CodeGeneratorInspector.py b/Source/WebCore/inspector/CodeGeneratorInspector.py
index dd9cb11a1..6f4d1f701 100755
--- a/Source/WebCore/inspector/CodeGeneratorInspector.py
+++ b/Source/WebCore/inspector/CodeGeneratorInspector.py
@@ -46,7 +46,6 @@ DOMAIN_DEFINE_NAME_MAP = {
"IndexedDB": "INDEXED_DATABASE",
"Profiler": "JAVASCRIPT_DEBUGGER",
"Worker": "WORKERS",
- "WebGL": "WEBGL",
}
@@ -58,7 +57,7 @@ TYPE_NAME_FIX_MAP = {
TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor",
- "Debugger.FunctionDetails", "Debugger.CallFrame", "WebGL.TraceLog",
+ "Debugger.FunctionDetails", "Debugger.CallFrame", "Canvas.TraceLog",
# This should be a temporary hack. TimelineEvent should be created via generated C++ API.
"Timeline.TimelineEvent"])
diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp b/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp
index b53be9214..db278d976 100644
--- a/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp
+++ b/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp
@@ -30,36 +30,37 @@
#include "config.h"
-#if ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#if ENABLE(INSPECTOR)
-#include "InjectedScriptWebGLModule.h"
+#include "InjectedScriptCanvasModule.h"
#include "InjectedScript.h"
+#include "InjectedScriptCanvasModuleSource.h"
#include "InjectedScriptManager.h"
-#include "InjectedScriptWebGLModuleSource.h"
#include "ScriptFunctionCall.h"
#include "ScriptObject.h"
namespace WebCore {
-InjectedScriptWebGLModule::InjectedScriptWebGLModule()
- : InjectedScriptModule("InjectedScriptWebGLModule")
+InjectedScriptCanvasModule::InjectedScriptCanvasModule()
+ : InjectedScriptModule("InjectedScriptCanvasModule")
{
}
-InjectedScriptWebGLModule InjectedScriptWebGLModule::moduleForState(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState)
+InjectedScriptCanvasModule InjectedScriptCanvasModule::moduleForState(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState)
{
- InjectedScriptWebGLModule result;
+ InjectedScriptCanvasModule result;
result.ensureInjected(injectedScriptManager, scriptState);
return result;
}
-String InjectedScriptWebGLModule::source() const
+String InjectedScriptCanvasModule::source() const
{
- return String(reinterpret_cast<const char*>(InjectedScriptWebGLModuleSource_js), sizeof(InjectedScriptWebGLModuleSource_js));
+ return String(reinterpret_cast<const char*>(InjectedScriptCanvasModuleSource_js), sizeof(InjectedScriptCanvasModuleSource_js));
}
-ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glContext)
+#if ENABLE(WEBGL)
+ScriptObject InjectedScriptCanvasModule::wrapWebGLContext(const ScriptObject& glContext)
{
ScriptFunctionCall function(injectedScriptObject(), "wrapWebGLContext");
function.appendArgument(glContext);
@@ -71,8 +72,9 @@ ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glC
}
return ScriptObject(glContext.scriptState(), resultValue);
}
+#endif // ENABLE(WEBGL)
-void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* traceLogId)
+void InjectedScriptCanvasModule::captureFrame(ErrorString* errorString, String* traceLogId)
{
ScriptFunctionCall function(injectedScriptObject(), "captureFrame");
RefPtr<InspectorValue> resultValue;
@@ -81,7 +83,7 @@ void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* t
*errorString = "Internal error: captureFrame";
}
-void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const String& traceLogId)
+void InjectedScriptCanvasModule::dropTraceLog(ErrorString* errorString, const String& traceLogId)
{
ScriptFunctionCall function(injectedScriptObject(), "dropTraceLog");
function.appendArgument(traceLogId);
@@ -92,7 +94,7 @@ void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const Str
*errorString = "Internal error: dropTraceLog";
}
-void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>* traceLog)
+void InjectedScriptCanvasModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::Canvas::TraceLog>* traceLog)
{
ScriptFunctionCall function(injectedScriptObject(), "traceLog");
function.appendArgument(traceLogId);
@@ -103,10 +105,10 @@ void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String&
*errorString = "Internal error: traceLog";
return;
}
- *traceLog = TypeBuilder::WebGL::TraceLog::runtimeCast(resultValue);
+ *traceLog = TypeBuilder::Canvas::TraceLog::runtimeCast(resultValue);
}
-void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
+void InjectedScriptCanvasModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
{
ScriptFunctionCall function(injectedScriptObject(), "replayTraceLog");
function.appendArgument(traceLogId);
@@ -119,4 +121,4 @@ void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const S
} // namespace WebCore
-#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModule.h b/Source/WebCore/inspector/InjectedScriptCanvasModule.h
index cff857fd8..4de223660 100644
--- a/Source/WebCore/inspector/InjectedScriptWebGLModule.h
+++ b/Source/WebCore/inspector/InjectedScriptCanvasModule.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InjectedScriptWebGLModule_h
-#define InjectedScriptWebGLModule_h
+#ifndef InjectedScriptCanvasModule_h
+#define InjectedScriptCanvasModule_h
#include "InjectedScriptModule.h"
#include "ScriptState.h"
@@ -40,20 +40,23 @@ namespace WebCore {
class InjectedScriptManager;
class ScriptObject;
-#if ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#if ENABLE(INSPECTOR)
-class InjectedScriptWebGLModule : public InjectedScriptModule {
+class InjectedScriptCanvasModule : public InjectedScriptModule {
public:
- InjectedScriptWebGLModule();
+ InjectedScriptCanvasModule();
virtual String source() const;
- static InjectedScriptWebGLModule moduleForState(InjectedScriptManager*, ScriptState*);
+ static InjectedScriptCanvasModule moduleForState(InjectedScriptManager*, ScriptState*);
+#if ENABLE(WEBGL)
ScriptObject wrapWebGLContext(const ScriptObject& glContext);
+#endif
+
void captureFrame(ErrorString*, String*);
void dropTraceLog(ErrorString*, const String&);
- void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>*);
+ void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::TraceLog>*);
void replayTraceLog(ErrorString*, const String&, int, String*);
};
@@ -61,4 +64,4 @@ public:
} // namespace WebCore
-#endif
+#endif // !defined(InjectedScriptCanvasModule_h)
diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js b/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js
index 6780af3c4..6780af3c4 100644
--- a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js
+++ b/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js
diff --git a/Source/WebCore/inspector/Inspector.json b/Source/WebCore/inspector/Inspector.json
index f1137c78d..5c18dad95 100644
--- a/Source/WebCore/inspector/Inspector.json
+++ b/Source/WebCore/inspector/Inspector.json
@@ -1588,7 +1588,8 @@
{ "name": "isAttribute", "type": "boolean", "description": "<code>EventListener</code>'s isAttribute." },
{ "name": "nodeId", "$ref": "NodeId", "description": "Target <code>DOMNode</code> id." },
{ "name": "handlerBody", "type": "string", "description": "Event handler function body." },
- { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." }
+ { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." },
+ { "name": "sourceName", "type": "string", "optional": true, "description": "Source script URL." }
],
"description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type."
},
@@ -3068,7 +3069,7 @@
]
},
{
- "domain": "WebGL",
+ "domain": "Canvas",
"hidden": true,
"types": [
{
@@ -3100,11 +3101,11 @@
"commands": [
{
"name": "enable",
- "description": "Enables WebGL inspection."
+ "description": "Enables Canvas inspection."
},
{
"name": "disable",
- "description": "Disables WebGL inspection."
+ "description": "Disables Canvas inspection."
},
{
"name": "dropTraceLog",
diff --git a/Source/WebCore/inspector/InspectorAllInOne.cpp b/Source/WebCore/inspector/InspectorAllInOne.cpp
index db3f82cbe..d19ad2e0a 100644
--- a/Source/WebCore/inspector/InspectorAllInOne.cpp
+++ b/Source/WebCore/inspector/InspectorAllInOne.cpp
@@ -32,12 +32,15 @@
#include "IdentifiersFactory.cpp"
#include "InjectedScript.cpp"
#include "InjectedScriptBase.cpp"
+#include "InjectedScriptCanvasModule.cpp"
#include "InjectedScriptHost.cpp"
#include "InjectedScriptManager.cpp"
+#include "InjectedScriptModule.cpp"
#include "InspectorAgent.cpp"
#include "InspectorApplicationCacheAgent.cpp"
#include "InspectorBaseAgent.cpp"
#include "InspectorCSSAgent.cpp"
+#include "InspectorCanvasAgent.cpp"
#include "InspectorClient.cpp"
#include "InspectorConsoleAgent.cpp"
#include "InspectorController.cpp"
@@ -66,7 +69,6 @@
#include "InspectorStyleTextEditor.cpp"
#include "InspectorTimelineAgent.cpp"
#include "InspectorValues.cpp"
-#include "InspectorWebGLAgent.cpp"
#include "InspectorWorkerAgent.cpp"
#include "InstrumentingAgents.cpp"
#include "MemoryInstrumentationImpl.cpp"
diff --git a/Source/WebCore/inspector/InspectorWebGLAgent.cpp b/Source/WebCore/inspector/InspectorCanvasAgent.cpp
index 16ffbcfa4..dff293845 100644
--- a/Source/WebCore/inspector/InspectorWebGLAgent.cpp
+++ b/Source/WebCore/inspector/InspectorCanvasAgent.cpp
@@ -30,13 +30,13 @@
#include "config.h"
-#if ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#if ENABLE(INSPECTOR)
-#include "InspectorWebGLAgent.h"
+#include "InspectorCanvasAgent.h"
#include "InjectedScript.h"
+#include "InjectedScriptCanvasModule.h"
#include "InjectedScriptManager.h"
-#include "InjectedScriptWebGLModule.h"
#include "InspectorFrontend.h"
#include "InspectorState.h"
#include "InstrumentingAgents.h"
@@ -46,69 +46,69 @@
namespace WebCore {
-namespace WebGLAgentState {
-static const char webGLAgentEnabled[] = "webGLAgentEnabled";
+namespace CanvasAgentState {
+static const char canvasAgentEnabled[] = "canvasAgentEnabled";
};
-InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
- : InspectorBaseAgent<InspectorWebGLAgent>("WebGL", instrumentingAgents, state)
+InspectorCanvasAgent::InspectorCanvasAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
+ : InspectorBaseAgent<InspectorCanvasAgent>("Canvas", instrumentingAgents, state)
, m_inspectedPage(page)
, m_injectedScriptManager(injectedScriptManager)
, m_frontend(0)
, m_enabled(false)
{
- m_instrumentingAgents->setInspectorWebGLAgent(this);
+ m_instrumentingAgents->setInspectorCanvasAgent(this);
}
-InspectorWebGLAgent::~InspectorWebGLAgent()
+InspectorCanvasAgent::~InspectorCanvasAgent()
{
- m_instrumentingAgents->setInspectorWebGLAgent(0);
+ m_instrumentingAgents->setInspectorCanvasAgent(0);
}
-void InspectorWebGLAgent::setFrontend(InspectorFrontend* frontend)
+void InspectorCanvasAgent::setFrontend(InspectorFrontend* frontend)
{
ASSERT(frontend);
- m_frontend = frontend->webgl();
+ m_frontend = frontend->canvas();
}
-void InspectorWebGLAgent::clearFrontend()
+void InspectorCanvasAgent::clearFrontend()
{
m_frontend = 0;
disable(0);
}
-void InspectorWebGLAgent::restore()
+void InspectorCanvasAgent::restore()
{
- m_enabled = m_state->getBoolean(WebGLAgentState::webGLAgentEnabled);
+ m_enabled = m_state->getBoolean(CanvasAgentState::canvasAgentEnabled);
}
-void InspectorWebGLAgent::enable(ErrorString*)
+void InspectorCanvasAgent::enable(ErrorString*)
{
if (m_enabled)
return;
m_enabled = true;
- m_state->setBoolean(WebGLAgentState::webGLAgentEnabled, m_enabled);
+ m_state->setBoolean(CanvasAgentState::canvasAgentEnabled, m_enabled);
}
-void InspectorWebGLAgent::disable(ErrorString*)
+void InspectorCanvasAgent::disable(ErrorString*)
{
if (!m_enabled)
return;
m_enabled = false;
- m_state->setBoolean(WebGLAgentState::webGLAgentEnabled, m_enabled);
+ m_state->setBoolean(CanvasAgentState::canvasAgentEnabled, m_enabled);
}
-void InspectorWebGLAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId)
+void InspectorCanvasAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId)
{
- InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
+ InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.dropTraceLog(errorString, traceLogId);
}
-void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLogId)
+void InspectorCanvasAgent::captureFrame(ErrorString* errorString, String* traceLogId)
{
ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame());
- InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, scriptState);
+ InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, scriptState);
if (module.hasNoValue()) {
*errorString = "Inspected frame has gone";
return;
@@ -116,50 +116,52 @@ void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLo
module.captureFrame(errorString, traceLogId);
}
-void InspectorWebGLAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>& traceLog)
+void InspectorCanvasAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::Canvas::TraceLog>& traceLog)
{
- InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
+ InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.traceLog(errorString, traceLogId, &traceLog);
}
-void InspectorWebGLAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
+void InspectorCanvasAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
{
- InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
+ InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.replayTraceLog(errorString, traceLogId, stepNo, result);
}
-ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext)
+#if ENABLE(WEBGL)
+ScriptObject InspectorCanvasAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext)
{
if (glContext.hasNoValue()) {
ASSERT_NOT_REACHED();
return ScriptObject();
}
- InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, glContext.scriptState());
+ InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, glContext.scriptState());
if (module.hasNoValue()) {
ASSERT_NOT_REACHED();
return ScriptObject();
}
return module.wrapWebGLContext(glContext);
}
+#endif
-InjectedScriptWebGLModule InspectorWebGLAgent::injectedScriptWebGLModuleForTraceLogId(ErrorString* errorString, const String& traceLogId)
+InjectedScriptCanvasModule InspectorCanvasAgent::injectedScriptCanvasModuleForTraceLogId(ErrorString* errorString, const String& traceLogId)
{
InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(traceLogId);
if (injectedScript.hasNoValue()) {
*errorString = "Inspected frame has gone";
- return InjectedScriptWebGLModule();
+ return InjectedScriptCanvasModule();
}
- InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState());
+ InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState());
if (module.hasNoValue()) {
ASSERT_NOT_REACHED();
- *errorString = "Internal error: no WebGL module";
- return InjectedScriptWebGLModule();
+ *errorString = "Internal error: no Canvas module";
+ return InjectedScriptCanvasModule();
}
return module;
}
} // namespace WebCore
-#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InspectorWebGLAgent.h b/Source/WebCore/inspector/InspectorCanvasAgent.h
index 31b7afcf3..f460c6410 100644
--- a/Source/WebCore/inspector/InspectorWebGLAgent.h
+++ b/Source/WebCore/inspector/InspectorCanvasAgent.h
@@ -28,10 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InspectorWebGLAgent_h
-#define InspectorWebGLAgent_h
+#ifndef InspectorCanvasAgent_h
+#define InspectorCanvasAgent_h
-#if ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#if ENABLE(INSPECTOR)
#include "InspectorBaseAgent.h"
#include "InspectorFrontend.h"
@@ -43,8 +43,8 @@
namespace WebCore {
+class InjectedScriptCanvasModule;
class InjectedScriptManager;
-class InjectedScriptWebGLModule;
class InspectorState;
class InstrumentingAgents;
class Page;
@@ -52,13 +52,13 @@ class ScriptObject;
typedef String ErrorString;
-class InspectorWebGLAgent : public InspectorBaseAgent<InspectorWebGLAgent>, public InspectorBackendDispatcher::WebGLCommandHandler {
+class InspectorCanvasAgent : public InspectorBaseAgent<InspectorCanvasAgent>, public InspectorBackendDispatcher::CanvasCommandHandler {
public:
- static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
+ static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
{
- return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, page, injectedScriptManager));
+ return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, state, page, injectedScriptManager));
}
- ~InspectorWebGLAgent();
+ ~InspectorCanvasAgent();
virtual void setFrontend(InspectorFrontend*);
virtual void clearFrontend();
@@ -66,14 +66,16 @@ public:
bool enabled() { return m_enabled; }
+#if ENABLE(WEBGL)
ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&);
+#endif
// Called from the front-end.
virtual void enable(ErrorString*);
virtual void disable(ErrorString*);
virtual void dropTraceLog(ErrorString*, const String&);
virtual void captureFrame(ErrorString*, String*);
- virtual void getTraceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>&);
+ virtual void getTraceLog(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::TraceLog>&);
virtual void replayTraceLog(ErrorString*, const String&, int, String*);
// Called from the injected script.
@@ -81,18 +83,18 @@ public:
// Called from InspectorInstrumentation
private:
- InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*);
+ InspectorCanvasAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*);
- InjectedScriptWebGLModule injectedScriptWebGLModuleForTraceLogId(ErrorString*, const String&);
+ InjectedScriptCanvasModule injectedScriptCanvasModuleForTraceLogId(ErrorString*, const String&);
Page* m_inspectedPage;
InjectedScriptManager* m_injectedScriptManager;
- InspectorFrontend::WebGL* m_frontend;
+ InspectorFrontend::Canvas* m_frontend;
bool m_enabled;
};
} // namespace WebCore
-#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL)
+#endif // ENABLE(INSPECTOR)
-#endif // !defined(InspectorWebGLAgent_h)
+#endif // !defined(InspectorCanvasAgent_h)
diff --git a/Source/WebCore/inspector/InspectorWebGLInstrumentation.h b/Source/WebCore/inspector/InspectorCanvasInstrumentation.h
index 35675224b..5904b8789 100644
--- a/Source/WebCore/inspector/InspectorWebGLInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorCanvasInstrumentation.h
@@ -28,11 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InspectorWebGLInstrumentation_h
-#define InspectorWebGLInstrumentation_h
+#ifndef InspectorCanvasInstrumentation_h
+#define InspectorCanvasInstrumentation_h
+#include "InspectorCanvasAgent.h"
#include "InspectorInstrumentation.h"
-#include "InspectorWebGLAgent.h"
#include "InstrumentingAgents.h"
#include "ScriptObject.h"
@@ -43,9 +43,9 @@ ScriptObject InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentati
{
#if ENABLE(INSPECTOR)
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) {
- InspectorWebGLAgent* webGLAgent = instrumentingAgents->inspectorWebGLAgent();
- if (webGLAgent && webGLAgent->enabled())
- return webGLAgent->wrapWebGLRenderingContextForInstrumentation(glContext);
+ InspectorCanvasAgent* canvasAgent = instrumentingAgents->inspectorCanvasAgent();
+ if (canvasAgent && canvasAgent->enabled())
+ return canvasAgent->wrapWebGLRenderingContextForInstrumentation(glContext);
}
#endif
return ScriptObject();
@@ -54,4 +54,4 @@ ScriptObject InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentati
} // namespace WebCore
-#endif // !defined(InspectorWebGLInstrumentation_h)
+#endif // !defined(InspectorCanvasInstrumentation_h)
diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp
index c85f4d4ca..9bd43311f 100644
--- a/Source/WebCore/inspector/InspectorController.cpp
+++ b/Source/WebCore/inspector/InspectorController.cpp
@@ -44,6 +44,7 @@
#include "InspectorBackendDispatcher.h"
#include "InspectorBaseAgent.h"
#include "InspectorCSSAgent.h"
+#include "InspectorCanvasAgent.h"
#include "InspectorClient.h"
#include "InspectorDOMAgent.h"
#include "InspectorDOMDebuggerAgent.h"
@@ -62,7 +63,6 @@
#include "InspectorResourceAgent.h"
#include "InspectorState.h"
#include "InspectorTimelineAgent.h"
-#include "InspectorWebGLAgent.h"
#include "InspectorWorkerAgent.h"
#include "InstrumentingAgents.h"
#include "PageConsoleAgent.h"
@@ -147,9 +147,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_state.get()));
#endif
-#if ENABLE(WEBGL)
- m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get()));
-#endif
+ m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get()));
ASSERT_ARG(inspectorClient, inspectorClient);
m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp
index 817f1df3b..4491487b3 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1304,12 +1304,15 @@ PassRefPtr<TypeBuilder::DOM::EventListener> InspectorDOMAgent::buildObjectForEve
.setNodeId(pushNodePathToFrontend(node))
.setHandlerBody(eventListenerHandlerBody(node->document(), eventListener.get()));
String sourceName;
+ String scriptId;
int lineNumber;
- if (eventListenerHandlerLocation(node->document(), eventListener.get(), sourceName, lineNumber)) {
+ if (eventListenerHandlerLocation(node->document(), eventListener.get(), sourceName, scriptId, lineNumber)) {
RefPtr<TypeBuilder::Debugger::Location> location = TypeBuilder::Debugger::Location::create()
- .setScriptId(sourceName)
+ .setScriptId(scriptId)
.setLineNumber(lineNumber);
value->setLocation(location);
+ if (!sourceName.isEmpty())
+ value->setSourceName(sourceName);
}
return value.release();
}
diff --git a/Source/WebCore/inspector/InstrumentingAgents.h b/Source/WebCore/inspector/InstrumentingAgents.h
index 1334dc7d6..2306e7a1e 100644
--- a/Source/WebCore/inspector/InstrumentingAgents.h
+++ b/Source/WebCore/inspector/InstrumentingAgents.h
@@ -38,21 +38,21 @@ namespace WebCore {
class InspectorAgent;
class InspectorApplicationCacheAgent;
-class InspectorPageAgent;
-class InspectorDOMDebuggerAgent;
class InspectorCSSAgent;
+class InspectorCanvasAgent;
class InspectorConsoleAgent;
class InspectorDOMAgent;
+class InspectorDOMDebuggerAgent;
class InspectorDOMStorageAgent;
class InspectorDatabaseAgent;
class InspectorDebuggerAgent;
class InspectorFileSystemAgent;
+class InspectorPageAgent;
class InspectorProfilerAgent;
class InspectorResourceAgent;
class InspectorRuntimeAgent;
class InspectorTimelineAgent;
class InspectorWorkerAgent;
-class InspectorWebGLAgent;
class Page;
class PageRuntimeAgent;
class WorkerContext;
@@ -87,9 +87,7 @@ public:
#if ENABLE(WORKERS)
, m_inspectorWorkerAgent(0)
#endif
-#if ENABLE(WEBGL)
- , m_inspectorWebGLAgent(0)
-#endif
+ , m_inspectorCanvasAgent(0)
{ }
~InstrumentingAgents() { }
@@ -152,10 +150,8 @@ public:
void setInspectorWorkerAgent(InspectorWorkerAgent* agent) { m_inspectorWorkerAgent = agent; }
#endif
-#if ENABLE(WEBGL)
- InspectorWebGLAgent* inspectorWebGLAgent() const { return m_inspectorWebGLAgent; }
- void setInspectorWebGLAgent(InspectorWebGLAgent* agent) { m_inspectorWebGLAgent = agent; }
-#endif
+ InspectorCanvasAgent* inspectorCanvasAgent() const { return m_inspectorCanvasAgent; }
+ void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; }
private:
InspectorAgent* m_inspectorAgent;
@@ -183,9 +179,7 @@ private:
#if ENABLE(WORKERS)
InspectorWorkerAgent* m_inspectorWorkerAgent;
#endif
-#if ENABLE(WEBGL)
- InspectorWebGLAgent* m_inspectorWebGLAgent;
-#endif
+ InspectorCanvasAgent* m_inspectorCanvasAgent;
};
InstrumentingAgents* instrumentationForPage(Page*);
diff --git a/Source/WebCore/inspector/compile-front-end.py b/Source/WebCore/inspector/compile-front-end.py
index 03eaeee1b..76dcaef34 100755
--- a/Source/WebCore/inspector/compile-front-end.py
+++ b/Source/WebCore/inspector/compile-front-end.py
@@ -332,7 +332,7 @@ modules = [
"ProfilesPanel.js",
"ProfileLauncherView.js",
"TopDownProfileDataGridTree.js",
- "WebGLProfileView.js",
+ "CanvasProfileView.js",
]
},
{
@@ -407,15 +407,15 @@ if not process_recursively:
os.system(command)
os.system("rm " + inspector_path + "/" + "InjectedScriptSourceTmp.js")
- print "Compiling InjectedScriptWebGLModuleSource.js..."
- os.system("echo \"var injectedScriptWebGLModuleValue = \" > " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js")
- os.system("cat " + inspector_path + "/" + "InjectedScriptWebGLModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js")
+ print "Compiling InjectedScriptCanvasModuleSource.js..."
+ os.system("echo \"var injectedScriptCanvasModuleValue = \" > " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js")
+ os.system("cat " + inspector_path + "/" + "InjectedScriptCanvasModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js")
command = compiler_command
command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n"
command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n"
- command += " --js " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js" + " \\\n"
+ command += " --js " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js" + " \\\n"
command += "\n"
os.system(command)
- os.system("rm " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js")
+ os.system("rm " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js")
shutil.rmtree(modules_dir)
diff --git a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 0c2cf344b..4bdd4af7b 100644
--- a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -72,9 +72,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(this, breakpoint), false);
element.appendChild(checkbox);
- var url = uiLocation.uiSourceCode.url;
- var displayName = url ? WebInspector.displayNameForURL(url) : WebInspector.UIString("(program)");
- var labelElement = document.createTextNode(displayName + ":" + (uiLocation.lineNumber + 1));
+ var labelElement = document.createTextNode(WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber));
element.appendChild(labelElement);
var snippetElement = document.createElement("div");
diff --git a/Source/WebCore/inspector/front-end/CallStackSidebarPane.js b/Source/WebCore/inspector/front-end/CallStackSidebarPane.js
index 6ab3ec862..5d543f734 100644
--- a/Source/WebCore/inspector/front-end/CallStackSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/CallStackSidebarPane.js
@@ -178,7 +178,7 @@ WebInspector.CallStackSidebarPane.Placard = function(callFrame, pane)
WebInspector.CallStackSidebarPane.Placard.prototype = {
_update: function(uiLocation)
{
- this.subtitle = WebInspector.displayNameForURL(uiLocation.uiSourceCode.url) + ":" + (uiLocation.lineNumber + 1);
+ this.subtitle = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
},
_placardContextMenu: function(event)
diff --git a/Source/WebCore/inspector/front-end/WebGLProfileView.js b/Source/WebCore/inspector/front-end/CanvasProfileView.js
index 6028536c8..061ad8a37 100644
--- a/Source/WebCore/inspector/front-end/WebGLProfileView.js
+++ b/Source/WebCore/inspector/front-end/CanvasProfileView.js
@@ -32,24 +32,24 @@
* @constructor
* @extends {WebInspector.View}
*/
-WebInspector.WebGLProfileView = function(profile)
+WebInspector.CanvasProfileView = function(profile)
{
WebInspector.View.call(this);
- this.registerRequiredCSS("webGLProfiler.css");
+ this.registerRequiredCSS("canvasProfiler.css");
this._profile = profile;
- this.element.addStyleClass("webgl-profile-view");
+ this.element.addStyleClass("canvas-profile-view");
this._traceLogElement = document.createElement("div");
- this._traceLogElement.className = "webgl-trace-log";
+ this._traceLogElement.className = "canvas-trace-log";
this._traceLogElement.addEventListener("click", this._onTraceLogItemClick.bind(this), false);
this.element.appendChild(this._traceLogElement);
var replayImageContainer = document.createElement("div");
- replayImageContainer.id = "webgl-replay-image-container";
+ replayImageContainer.id = "canvas-replay-image-container";
this.element.appendChild(replayImageContainer);
this._replayImageElement = document.createElement("image");
- this._replayImageElement.id = "webgl-replay-image";
+ this._replayImageElement.id = "canvas-replay-image";
replayImageContainer.appendChild(this._replayImageElement);
this._debugInfoElement = document.createElement("div");
@@ -60,11 +60,11 @@ WebInspector.WebGLProfileView = function(profile)
this._showTraceLog();
}
-WebInspector.WebGLProfileView.prototype = {
+WebInspector.CanvasProfileView.prototype = {
dispose: function()
{
this._linkifier.reset();
- WebGLAgent.dropTraceLog(this._profile.traceLogId());
+ CanvasAgent.dropTraceLog(this._profile.traceLogId());
},
get statusBarItems()
@@ -126,7 +126,7 @@ WebInspector.WebGLProfileView.prototype = {
this._traceLogElement.appendChild(traceLogItem);
}
}
- WebGLAgent.getTraceLog(this._profile.traceLogId(), didReceiveTraceLog.bind(this));
+ CanvasAgent.getTraceLog(this._profile.traceLogId(), didReceiveTraceLog.bind(this));
},
_onTraceLogItemClick: function(e)
@@ -144,30 +144,30 @@ WebInspector.WebGLProfileView.prototype = {
this._activeTraceLogItem.style.backgroundColor = "yellow";
this._replayImageElement.src = dataURL;
}
- WebGLAgent.replayTraceLog(item.traceLogId, item.stepNo, didReplayTraceLog.bind(this));
+ CanvasAgent.replayTraceLog(item.traceLogId, item.stepNo, didReplayTraceLog.bind(this));
}
}
-WebInspector.WebGLProfileView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.CanvasProfileView.prototype.__proto__ = WebInspector.View.prototype;
/**
* @constructor
* @extends {WebInspector.ProfileType}
*/
-WebInspector.WebGLProfileType = function()
+WebInspector.CanvasProfileType = function()
{
- WebInspector.ProfileType.call(this, WebInspector.WebGLProfileType.TypeId, WebInspector.UIString("Capture WebGL Frame"));
+ WebInspector.ProfileType.call(this, WebInspector.CanvasProfileType.TypeId, WebInspector.UIString("Capture Canvas Frame"));
this._nextProfileUid = 1;
// FIXME: enable/disable by a UI action?
- WebGLAgent.enable();
+ CanvasAgent.enable();
}
-WebInspector.WebGLProfileType.TypeId = "WEBGL_PROFILE";
+WebInspector.CanvasProfileType.TypeId = "CANVAS_PROFILE";
-WebInspector.WebGLProfileType.prototype = {
+WebInspector.CanvasProfileType.prototype = {
get buttonTooltip()
{
- return WebInspector.UIString("Capture WebGL frame.");
+ return WebInspector.UIString("Capture Canvas Frame.");
},
/**
@@ -177,7 +177,7 @@ WebInspector.WebGLProfileType.prototype = {
*/
buttonClicked: function(profilesPanel)
{
- var profileHeader = new WebInspector.WebGLProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid);
+ var profileHeader = new WebInspector.CanvasProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid);
++this._nextProfileUid;
profileHeader.isTemporary = true;
profilesPanel.addProfileHeader(profileHeader);
@@ -186,18 +186,18 @@ WebInspector.WebGLProfileType.prototype = {
profileHeader._traceLogId = traceLogId;
profileHeader.isTemporary = false;
}
- WebGLAgent.captureFrame(didStartCapturingFrame.bind(this));
+ CanvasAgent.captureFrame(didStartCapturingFrame.bind(this));
return false;
},
get treeItemTitle()
{
- return WebInspector.UIString("WEBGL PROFILE");
+ return WebInspector.UIString("CANVAS PROFILE");
},
get description()
{
- return WebInspector.UIString("WebGL calls instrumentation");
+ return WebInspector.UIString("Canvas calls instrumentation");
},
/**
@@ -216,7 +216,7 @@ WebInspector.WebGLProfileType.prototype = {
createTemporaryProfile: function(title)
{
title = title || WebInspector.UIString("Capturing\u2026");
- return new WebInspector.WebGLProfileHeader(this, title);
+ return new WebInspector.CanvasProfileHeader(this, title);
},
/**
@@ -226,20 +226,20 @@ WebInspector.WebGLProfileType.prototype = {
*/
createProfile: function(profile)
{
- return new WebInspector.WebGLProfileHeader(this, profile.title, -1);
+ return new WebInspector.CanvasProfileHeader(this, profile.title, -1);
}
}
-WebInspector.WebGLProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
+WebInspector.CanvasProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
/**
* @constructor
* @extends {WebInspector.ProfileHeader}
- * @param {WebInspector.WebGLProfileType} type
+ * @param {WebInspector.CanvasProfileType} type
* @param {string} title
* @param {number=} uid
*/
-WebInspector.WebGLProfileHeader = function(type, title, uid)
+WebInspector.CanvasProfileHeader = function(type, title, uid)
{
WebInspector.ProfileHeader.call(this, type, title, uid);
@@ -249,7 +249,7 @@ WebInspector.WebGLProfileHeader = function(type, title, uid)
this._traceLogId = null;
}
-WebInspector.WebGLProfileHeader.prototype = {
+WebInspector.CanvasProfileHeader.prototype = {
/**
* @return {string?}
*/
@@ -271,8 +271,8 @@ WebInspector.WebGLProfileHeader.prototype = {
*/
createView: function(profilesPanel)
{
- return new WebInspector.WebGLProfileView(this);
+ return new WebInspector.CanvasProfileView(this);
}
}
-WebInspector.WebGLProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype;
+WebInspector.CanvasProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype;
diff --git a/Source/WebCore/inspector/front-end/CookieParser.js b/Source/WebCore/inspector/front-end/CookieParser.js
index 3c3f379a1..ebb31bbf9 100644
--- a/Source/WebCore/inspector/front-end/CookieParser.js
+++ b/Source/WebCore/inspector/front-end/CookieParser.js
@@ -231,7 +231,7 @@ WebInspector.Cookie.prototype = {
{
// RFC 2965 suggests using Discard attribute to mark session cookies, but this does not seem to be widely used.
// Check for absence of explicity max-age or expiry date instead.
- return !("expries" in this._attributes || "max-age" in this._attributes);
+ return !("expires" in this._attributes || "max-age" in this._attributes);
},
/**
diff --git a/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js b/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js
index 9324a5467..55ebdb084 100644
--- a/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -204,10 +204,10 @@ WebInspector.EventListenerBar.prototype = {
properties.push(new WebInspector.RemoteObjectProperty("node", nodeObject));
if (typeof this.eventListener.handlerBody !== "undefined")
properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("listenerBody", this.eventListener.handlerBody));
- if (this.eventListener.location) {
- properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("sourceName", this.eventListener.location.scriptId));
- properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("lineNumber", this.eventListener.location.lineNumber));
- }
+ if (this.eventListener.sourceName)
+ properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("sourceName", this.eventListener.sourceName));
+ if (this.eventListener.location)
+ properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("lineNumber", this.eventListener.location.lineNumber + 1));
this.updateProperties(properties);
}
@@ -239,11 +239,15 @@ WebInspector.EventListenerBar.prototype = {
// Requires that Function.toString() return at least the function's signature.
if (this.eventListener.location) {
this.subtitleElement.removeChildren();
- // FIXME(62725): eventListener.location should be a debugger Location.
- var url = this.eventListener.location.scriptId;
- var lineNumber = this.eventListener.location.lineNumber - 1;
- var columnNumber = 0;
- var urlElement = linkifier.linkifyLocation(url, lineNumber, columnNumber);
+ var urlElement;
+ if (this.eventListener.location.scriptId)
+ urlElement = linkifier.linkifyRawLocation(this.eventListener.location);
+ if (!urlElement) {
+ var url = this.eventListener.sourceName;
+ var lineNumber = this.eventListener.location.lineNumber;
+ var columnNumber = 0;
+ urlElement = linkifier.linkifyLocation(url, lineNumber, columnNumber);
+ }
this.subtitleElement.appendChild(urlElement);
} else {
var match = this.eventListener.handlerBody.match(/function ([^\(]+?)\(/);
diff --git a/Source/WebCore/inspector/front-end/ExtensionPanel.js b/Source/WebCore/inspector/front-end/ExtensionPanel.js
index 46cdb117f..f96d9e99e 100644
--- a/Source/WebCore/inspector/front-end/ExtensionPanel.js
+++ b/Source/WebCore/inspector/front-end/ExtensionPanel.js
@@ -41,12 +41,13 @@ WebInspector.ExtensionPanel = function(id, pageURL)
this._statusBarItems = [];
var extensionView = new WebInspector.ExtensionView(id, pageURL, "extension panel");
extensionView.show(this.element);
+ this.setDefaultFocusedElement(extensionView.defaultFocusedElement());
}
WebInspector.ExtensionPanel.prototype = {
defaultFocusedElement: function()
{
- return this.sidebarTreeElement || this.element;
+ return WebInspector.View.prototype.defaultFocusedElement.call(this);
},
get statusBarItems()
diff --git a/Source/WebCore/inspector/front-end/ExtensionServer.js b/Source/WebCore/inspector/front-end/ExtensionServer.js
index 3b660d0ab..149c8b8c2 100644
--- a/Source/WebCore/inspector/front-end/ExtensionServer.js
+++ b/Source/WebCore/inspector/front-end/ExtensionServer.js
@@ -610,6 +610,11 @@ WebInspector.ExtensionServer.prototype = {
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged,
this._inspectedURLChanged, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
+ this._initDone = true;
+ if (this._pendingExtensions) {
+ this._pendingExtensions.forEach(this._innerAddExtension, this);
+ delete this._pendingExtensions;
+ }
InspectorExtensionRegistry.getExtensionsAsync();
},
@@ -652,12 +657,23 @@ WebInspector.ExtensionServer.prototype = {
*/
_addExtensions: function(extensions)
{
- for (var i = 0; i < extensions.length; ++i)
- this._addExtension(extensions[i]);
+ extensions.forEach(this._addExtension, this);
},
_addExtension: function(extensionInfo)
{
+ if (this._initDone) {
+ this._innerAddExtension(extensionInfo);
+ return;
+ }
+ if (this._pendingExtensions)
+ this._pendingExtensions.push(extensionInfo);
+ else
+ this._pendingExtensions = [extensionInfo];
+ },
+
+ _innerAddExtension: function(extensionInfo)
+ {
const urlOriginRegExp = new RegExp("([^:]+:\/\/[^/]*)\/"); // Can't use regexp literal here, MinJS chokes on it.
var startPage = extensionInfo.startPage;
var name = extensionInfo.name;
diff --git a/Source/WebCore/inspector/front-end/ExtensionView.js b/Source/WebCore/inspector/front-end/ExtensionView.js
index d4cd72c4d..170db0b6b 100644
--- a/Source/WebCore/inspector/front-end/ExtensionView.js
+++ b/Source/WebCore/inspector/front-end/ExtensionView.js
@@ -45,6 +45,7 @@ WebInspector.ExtensionView = function(id, src, className)
this._iframe.addEventListener("load", this._onLoad.bind(this), false);
this._iframe.src = src;
this._iframe.className = className;
+ this.setDefaultFocusedElement(this._iframe);
this.element.appendChild(this._iframe);
}
diff --git a/Source/WebCore/inspector/front-end/FileUtils.js b/Source/WebCore/inspector/front-end/FileUtils.js
index 9d95a531f..65b49cb91 100644
--- a/Source/WebCore/inspector/front-end/FileUtils.js
+++ b/Source/WebCore/inspector/front-end/FileUtils.js
@@ -151,7 +151,7 @@ WebInspector.ChunkedFileReader.prototype = {
{
var chunkStart = this._loadedSize;
var chunkEnd = Math.min(this._fileSize, chunkStart + this._chunkSize)
- var nextPart = this._file.webkitSlice(chunkStart, chunkEnd);
+ var nextPart = this._file.slice(chunkStart, chunkEnd);
this._reader.readAsText(nextPart);
}
}
diff --git a/Source/WebCore/inspector/front-end/Linkifier.js b/Source/WebCore/inspector/front-end/Linkifier.js
index d08280b4c..91986bdae 100644
--- a/Source/WebCore/inspector/front-end/Linkifier.js
+++ b/Source/WebCore/inspector/front-end/Linkifier.js
@@ -121,8 +121,6 @@ WebInspector.Linkifier.DefaultFormatter.prototype = {
*/
formatLiveAnchor: function(anchor, uiLocation)
{
- anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
-
var text = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
if (this._maxLength)
text = text.trimMiddle(this._maxLength);
diff --git a/Source/WebCore/inspector/front-end/NetworkRequest.js b/Source/WebCore/inspector/front-end/NetworkRequest.js
index 7f8995a87..464d9fbeb 100644
--- a/Source/WebCore/inspector/front-end/NetworkRequest.js
+++ b/Source/WebCore/inspector/front-end/NetworkRequest.js
@@ -420,9 +420,9 @@ WebInspector.NetworkRequest.prototype = {
*/
get requestHeadersText()
{
- if (this._requestHeadersText === undefined) {
+ if (typeof this._requestHeadersText === "undefined") {
this._requestHeadersText = this.requestMethod + " " + this.url + " HTTP/1.1\r\n";
- for (var i = 0; i < this.requestHeaders; ++i)
+ for (var i = 0; i < this.requestHeaders.length; ++i)
this._requestHeadersText += this.requestHeaders[i].name + ": " + this.requestHeaders[i].value + "\r\n";
}
return this._requestHeadersText;
@@ -522,9 +522,9 @@ WebInspector.NetworkRequest.prototype = {
*/
get responseHeadersText()
{
- if (this._responseHeadersText === undefined) {
+ if (typeof this._responseHeadersText === "undefined") {
this._responseHeadersText = "HTTP/1.1 " + this.statusCode + " " + this.statusText + "\r\n";
- for (var i = 0; i < this.requestHeaders; ++i)
+ for (var i = 0; i < this.responseHeaders.length; ++i)
this._responseHeadersText += this.responseHeaders[i].name + ": " + this.responseHeaders[i].value + "\r\n";
}
return this._responseHeadersText;
diff --git a/Source/WebCore/inspector/front-end/ProfilesPanel.js b/Source/WebCore/inspector/front-end/ProfilesPanel.js
index 6a8b4d89f..d0d20aa69 100644
--- a/Source/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/Source/WebCore/inspector/front-end/ProfilesPanel.js
@@ -248,8 +248,8 @@ WebInspector.ProfilesPanel = function()
this._registerProfileType(new WebInspector.HeapSnapshotProfileType());
if (WebInspector.experimentsSettings.nativeMemorySnapshots.isEnabled())
this._registerProfileType(new WebInspector.NativeMemoryProfileType());
- if (WebInspector.experimentsSettings.webGLInspection.isEnabled())
- this._registerProfileType(new WebInspector.WebGLProfileType());
+ if (WebInspector.experimentsSettings.canvasInspection.isEnabled())
+ this._registerProfileType(new WebInspector.CanvasProfileType());
InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this));
@@ -1319,4 +1319,4 @@ importScript("HeapSnapshotWorkerDispatcher.js");
importScript("NativeMemorySnapshotView.js");
importScript("ProfileLauncherView.js");
importScript("TopDownProfileDataGridTree.js");
-importScript("WebGLProfileView.js");
+importScript("CanvasProfileView.js");
diff --git a/Source/WebCore/inspector/front-end/ResourceUtils.js b/Source/WebCore/inspector/front-end/ResourceUtils.js
index 16a62676e..5c3f49de6 100644
--- a/Source/WebCore/inspector/front-end/ResourceUtils.js
+++ b/Source/WebCore/inspector/front-end/ResourceUtils.js
@@ -192,7 +192,7 @@ WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too
*/
WebInspector.formatLinkText = function(url, lineNumber)
{
- var text = WebInspector.displayNameForURL(url);
+ var text = url ? WebInspector.displayNameForURL(url) : WebInspector.UIString("(program)");
if (typeof lineNumber === "number")
text += ":" + (lineNumber + 1);
return text;
diff --git a/Source/WebCore/inspector/front-end/Settings.js b/Source/WebCore/inspector/front-end/Settings.js
index e35384b04..a138cb658 100644
--- a/Source/WebCore/inspector/front-end/Settings.js
+++ b/Source/WebCore/inspector/front-end/Settings.js
@@ -191,7 +191,7 @@ WebInspector.ExperimentsSettings = function()
this.nativeMemorySnapshots = this._createExperiment("nativeMemorySnapshots", "Native memory profiling");
this.liveNativeMemoryChart = this._createExperiment("liveNativeMemoryChart", "Live native memory chart");
this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection");
- this.webGLInspection = this._createExperiment("webGLInspection ", "WebGL inspection");
+ this.canvasInspection = this._createExperiment("canvasInspection ", "Canvas inspection");
this.mainThreadMonitoring = this._createExperiment("mainThreadMonitoring", "Show CPU activity in Timeline");
this.geolocationOverride = this._createExperiment("geolocationOverride", "Override Device Geolocation");
this.deviceOrientationOverride = this._createExperiment("deviceOrientationOverride", "Override Device Orientation");
diff --git a/Source/WebCore/inspector/front-end/WebKit.qrc b/Source/WebCore/inspector/front-end/WebKit.qrc
index cfeb194e4..ac64947a3 100644
--- a/Source/WebCore/inspector/front-end/WebKit.qrc
+++ b/Source/WebCore/inspector/front-end/WebKit.qrc
@@ -14,6 +14,7 @@
<file>BreakpointManager.js</file>
<file>BreakpointsSidebarPane.js</file>
<file>CallStackSidebarPane.js</file>
+ <file>CanvasProfileView.js</file>
<file>Checkbox.js</file>
<file>CodeMirrorTextEditor.js</file>
<file>Color.js</file>
@@ -210,13 +211,13 @@
<file>utilities.js</file>
<file>View.js</file>
<file>WatchExpressionsSidebarPane.js</file>
- <file>WebGLProfileView.js</file>
<file>WorkerManager.js</file>
<file>WorkersSidebarPane.js</file>
<file>Workspace.js</file>
<file>UglifyJS/parse-js.js</file>
<file>auditsPanel.css</file>
<file>breadcrumbList.css</file>
+ <file>canvasProfiler.css</file>
<file>cssNamedFlows.css</file>
<file>dataGrid.css</file>
<file>cmdevtools.css</file>
@@ -245,7 +246,6 @@
<file>textEditor.css</file>
<file>textPrompt.css</file>
<file>timelinePanel.css</file>
- <file>webGLProfiler.css</file>
<file>Images/applicationCache.png</file>
<file>Images/back.png</file>
<file>Images/breakpointBorder.png</file>
diff --git a/Source/WebCore/inspector/front-end/webGLProfiler.css b/Source/WebCore/inspector/front-end/canvasProfiler.css
index ba1681a63..cb4b4a530 100644
--- a/Source/WebCore/inspector/front-end/webGLProfiler.css
+++ b/Source/WebCore/inspector/front-end/canvasProfiler.css
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-.webgl-profile-view {
+.canvas-profile-view {
overflow: hidden;
position: absolute;
top: 0;
@@ -37,7 +37,7 @@
bottom: 0;
}
-.webgl-trace-log {
+.canvas-trace-log {
position: absolute;
top: 10px;
left: 0;
@@ -48,11 +48,11 @@
padding: 0 20px;
}
-.webgl-trace-log div {
+.canvas-trace-log div {
padding-bottom: 4px;
}
-#webgl-replay-image-container {
+#canvas-replay-image-container {
position: absolute;
right: 0;
top: 0;
@@ -60,7 +60,7 @@
background-color: white;
}
-#webgl-replay-image {
+#canvas-replay-image {
width: 400px;
height: 400px;
display: block;
diff --git a/Source/WebCore/inspector/front-end/inspector.css b/Source/WebCore/inspector/front-end/inspector.css
index 710171500..d5b13097b 100644
--- a/Source/WebCore/inspector/front-end/inspector.css
+++ b/Source/WebCore/inspector/front-end/inspector.css
@@ -44,7 +44,7 @@ input[type="search"]:focus, input[type="text"]:focus {
}
.nowrap {
- white-space: nowrap;
+ white-space: nowrap !important;
}
#toolbar {
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index 88b7fe83b..8368041cf 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -737,14 +737,12 @@ void DocumentLoader::stopRecordingResponses()
void DocumentLoader::setTitle(const StringWithDirection& title)
{
- if (title.isEmpty())
+ if (m_pageTitle == title)
return;
- if (m_pageTitle != title) {
- frameLoader()->willChangeTitle(this);
- m_pageTitle = title;
- frameLoader()->didChangeTitle(this);
- }
+ frameLoader()->willChangeTitle(this);
+ m_pageTitle = title;
+ frameLoader()->didChangeTitle(this);
}
KURL DocumentLoader::urlForHistory() const
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 41772caee..b26b6d4cc 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -647,7 +647,6 @@ void FrameLoader::didBeginDocument(bool dispatch)
m_frame->document()->initContentSecurityPolicy();
Settings* settings = m_frame->document()->settings();
- m_frame->document()->cachedResourceLoader()->setImagesEnabled(!settings || settings->areImagesEnabled());
m_frame->document()->cachedResourceLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
if (m_documentLoader) {
diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h
index 668edbc5c..6ec3d7986 100644
--- a/Source/WebCore/loader/FrameLoaderClient.h
+++ b/Source/WebCore/loader/FrameLoaderClient.h
@@ -278,6 +278,8 @@ namespace WebCore {
virtual void documentElementAvailable() = 0;
virtual void didPerformFirstNavigation() const = 0; // "Navigation" here means a transition from one page to another that ends up in the back/forward list.
+ virtual void didExhaustMemoryAvailableForScript() { };
+
#if USE(V8)
virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) = 0;
virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId) = 0;
diff --git a/Source/WebCore/loader/ResourceLoadScheduler.cpp b/Source/WebCore/loader/ResourceLoadScheduler.cpp
index 8004d8f2e..a1b23c99d 100644
--- a/Source/WebCore/loader/ResourceLoadScheduler.cpp
+++ b/Source/WebCore/loader/ResourceLoadScheduler.cpp
@@ -39,7 +39,11 @@
#include <wtf/MainThread.h>
#include <wtf/text/CString.h>
+#if PLATFORM(CHROMIUM)
+#define REQUEST_MANAGEMENT_ENABLED 0
+#else
#define REQUEST_MANAGEMENT_ENABLED 1
+#endif
namespace WebCore {
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp
index 56de0d341..ff3be6edf 100644
--- a/Source/WebCore/loader/SubresourceLoader.cpp
+++ b/Source/WebCore/loader/SubresourceLoader.cpp
@@ -167,13 +167,11 @@ void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
ResourceLoader::willSendRequest(newRequest, redirectResponse);
if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url()) {
- if (m_document->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
- if (m_resource->type() != CachedResource::ImageResource || !m_document->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
- m_resource->willSendRequest(newRequest, redirectResponse);
- return;
- }
+ if (!m_document->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
+ cancel();
+ return;
}
- cancel();
+ m_resource->willSendRequest(newRequest, redirectResponse);
}
}
diff --git a/Source/WebCore/loader/cache/CachedImage.cpp b/Source/WebCore/loader/cache/CachedImage.cpp
index fa83a54f6..4316616b3 100644
--- a/Source/WebCore/loader/cache/CachedImage.cpp
+++ b/Source/WebCore/loader/cache/CachedImage.cpp
@@ -79,7 +79,7 @@ CachedImage::~CachedImage()
void CachedImage::load(CachedResourceLoader* cachedResourceLoader, const ResourceLoaderOptions& options)
{
- if (!cachedResourceLoader || !cachedResourceLoader->shouldDeferImageLoad(m_resourceRequest.url()))
+ if (!cachedResourceLoader || cachedResourceLoader->autoLoadImages())
CachedResource::load(cachedResourceLoader, options);
else
setLoading(false);
diff --git a/Source/WebCore/loader/cache/CachedImage.h b/Source/WebCore/loader/cache/CachedImage.h
index 0c452c44a..4865c7e24 100644
--- a/Source/WebCore/loader/cache/CachedImage.h
+++ b/Source/WebCore/loader/cache/CachedImage.h
@@ -82,7 +82,7 @@ public:
virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return true; }
virtual bool isImage() const { return true; }
- virtual bool stillNeedsLoad() const OVERRIDE { return !errorOccurred() && status() == Unknown && !isLoading(); }
+ bool stillNeedsLoad() const { return !errorOccurred() && status() == Unknown && !isLoading(); }
void load();
// ImageObserver
diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp
index aa6c5a7fa..43c3d144f 100755
--- a/Source/WebCore/loader/cache/CachedResource.cpp
+++ b/Source/WebCore/loader/cache/CachedResource.cpp
@@ -390,7 +390,7 @@ void CachedResource::didAddClient(CachedResourceClient* c)
m_clients.add(c);
m_clientsAwaitingCallback.remove(c);
}
- if (!isLoading() && !stillNeedsLoad())
+ if (!isLoading())
c->notifyFinished(this);
}
diff --git a/Source/WebCore/loader/cache/CachedResource.h b/Source/WebCore/loader/cache/CachedResource.h
index 7edafd508..0cad3ee7c 100644
--- a/Source/WebCore/loader/cache/CachedResource.h
+++ b/Source/WebCore/loader/cache/CachedResource.h
@@ -144,7 +144,6 @@ public:
bool isLoading() const { return m_loading; }
void setLoading(bool b) { m_loading = b; }
- virtual bool stillNeedsLoad() const { return false; }
SubresourceLoader* loader() { return m_loader.get(); }
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 0e8c3f6a2..353a62aa6 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -46,7 +46,6 @@
#include "MemoryCache.h"
#include "PingLoader.h"
#include "ResourceLoadScheduler.h"
-#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include "Settings.h"
#include <wtf/UnusedParam.h>
@@ -116,7 +115,6 @@ CachedResourceLoader::CachedResourceLoader(Document* document)
, m_requestCount(0)
, m_garbageCollectDocumentResourcesTimer(this, &CachedResourceLoader::garbageCollectDocumentResourcesTimerFired)
, m_autoLoadImages(true)
- , m_imagesEnabled(true)
, m_allowStaleResources(false)
{
}
@@ -162,7 +160,7 @@ CachedResourceHandle<CachedImage> CachedResourceLoader::requestImage(ResourceReq
}
}
CachedResourceHandle<CachedImage> resource(static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String(), defaultCachedResourceOptions()).get()));
- if (!shouldDeferImageLoad(request.url()) && resource && resource->stillNeedsLoad())
+ if (autoLoadImages() && resource && resource->stillNeedsLoad())
resource->load(this, defaultCachedResourceOptions());
return resource;
}
@@ -364,6 +362,12 @@ bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url
case CachedResource::ImageResource:
if (!m_document->contentSecurityPolicy()->allowImageFromSource(url))
return false;
+
+ if (frame()) {
+ Settings* settings = frame()->settings();
+ if (!frame()->loader()->client()->allowImage(!settings || settings->areImagesEnabled(), url))
+ return false;
+ }
break;
case CachedResource::FontResource: {
if (!m_document->contentSecurityPolicy()->allowFontFromSource(url))
@@ -510,11 +514,11 @@ CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalida
{
if (!existingResource)
return Load;
-
+
// We already have a preload going for this URL.
if (forPreload && existingResource->isPreloaded())
return Use;
-
+
// If the same URL has been loaded as a different type, we need to reload.
if (existingResource->type() != type) {
LOG(ResourceLoading, "CachedResourceLoader::determineRevalidationPolicy reloading due to type mismatch.");
@@ -529,11 +533,6 @@ CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalida
// of things about how revalidation works that manual headers violate, so punt to Reload instead.
if (request.isConditional())
return Reload;
-
- // Do not load from cache if images are not enabled. The load for this image will be blocked
- // in requestImage.
- if (existingResource->type() == CachedResource::ImageResource && !clientAllowsImage(existingResource->url()))
- return Reload;
// Don't reload resources while pasting.
if (m_allowStaleResources)
@@ -630,41 +629,13 @@ void CachedResourceLoader::setAutoLoadImages(bool enable)
if (!m_autoLoadImages)
return;
- reloadImagesIfNotDeferred();
-}
-
-void CachedResourceLoader::setImagesEnabled(bool enable)
-{
- if (enable == m_imagesEnabled)
- return;
-
- m_imagesEnabled = enable;
-
- if (!m_imagesEnabled)
- return;
-
- reloadImagesIfNotDeferred();
-}
-
-bool CachedResourceLoader::clientAllowsImage(const KURL& url) const
-{
- return !frame() || frame()->loader()->client()->allowImage(m_imagesEnabled, url);
-}
-
-bool CachedResourceLoader::shouldDeferImageLoad(const KURL& url) const
-{
- return !clientAllowsImage(url) || !m_autoLoadImages;
-}
-
-void CachedResourceLoader::reloadImagesIfNotDeferred()
-{
DocumentResourceMap::iterator end = m_documentResources.end();
for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
- if (image->stillNeedsLoad() && !shouldDeferImageLoad(image->url()))
+ if (image->stillNeedsLoad())
image->load(this, defaultCachedResourceOptions());
}
}
@@ -762,7 +733,7 @@ void CachedResourceLoader::preload(CachedResource::Type type, ResourceRequest& r
UNUSED_PARAM(referencedFromBody);
bool delaySubresourceLoad = true;
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || PLATFORM(CHROMIUM)
delaySubresourceLoad = false;
#endif
if (delaySubresourceLoad) {
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.h b/Source/WebCore/loader/cache/CachedResourceLoader.h
index 21e4f391d..f4755c22f 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.h
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.h
@@ -97,10 +97,6 @@ public:
bool autoLoadImages() const { return m_autoLoadImages; }
void setAutoLoadImages(bool);
-
- void setImagesEnabled(bool);
-
- bool shouldDeferImageLoad(const KURL&) const;
CachePolicy cachePolicy() const;
@@ -139,9 +135,6 @@ private:
void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*);
void performPostLoadActions();
-
- bool clientAllowsImage(const KURL&) const;
- void reloadImagesIfNotDeferred();
HashSet<String> m_validatedURLs;
mutable DocumentResourceMap m_documentResources;
@@ -159,9 +152,8 @@ private:
Timer<CachedResourceLoader> m_garbageCollectDocumentResourcesTimer;
- // 29 bits left
+ // 30 bits left
bool m_autoLoadImages : 1;
- bool m_imagesEnabled : 1;
bool m_allowStaleResources : 1;
};
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 919f8e45c..32d238ce3 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -2414,10 +2414,15 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
if (gestureEvent.type() == PlatformEvent::GestureScrollEnd || gestureEvent.type() == PlatformEvent::GestureScrollUpdate)
eventTarget = m_scrollGestureHandlingNode.get();
+ IntPoint adjustedPoint = gestureEvent.position();
HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent;
- if (gestureEvent.type() == PlatformEvent::GestureTapDown)
+ if (gestureEvent.type() == PlatformEvent::GestureTapDown) {
+#if ENABLE(TOUCH_ADJUSTMENT)
+ if (!gestureEvent.area().isEmpty())
+ adjustGesturePosition(gestureEvent, adjustedPoint);
+#endif
hitType |= HitTestRequest::Active;
- else if (gestureEvent.type() == PlatformEvent::GestureTap || gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
+ } else if (gestureEvent.type() == PlatformEvent::GestureTap || gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
hitType |= HitTestRequest::Release;
else
hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
@@ -2426,7 +2431,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
hitType |= HitTestRequest::ReadOnly;
if (!eventTarget || !(hitType & HitTestRequest::ReadOnly)) {
- IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(adjustedPoint);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, false, false, DontHitTestScrollbars, hitType);
eventTarget = result.targetNode();
}
@@ -2574,6 +2579,7 @@ bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEven
Node* targetNode = 0;
switch (gestureEvent.type()) {
case PlatformEvent::GestureTap:
+ case PlatformEvent::GestureTapDown:
bestClickableNodeForTouchPoint(gestureEvent.position(), IntSize(gestureEvent.area().width() / 2, gestureEvent.area().height() / 2), adjustedPoint, targetNode);
break;
case PlatformEvent::GestureLongPress:
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index 2a4c7b4f0..df425964d 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -46,12 +46,10 @@ using namespace std;
namespace WebCore {
-static void setImageLoadingSettings(Page* page)
+static void setLoadsImagesAutomaticallyInAllFrames(Page* page)
{
- for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- frame->document()->cachedResourceLoader()->setImagesEnabled(page->settings()->areImagesEnabled());
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
frame->document()->cachedResourceLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically());
- }
}
// Sets the entry in the font map for the given script. If family is the empty string, removes the entry instead.
@@ -90,6 +88,7 @@ bool Settings::gAVFoundationEnabled(false);
#endif
bool Settings::gMockScrollbarsEnabled = false;
+bool Settings::gUsesOverlayScrollbars = false;
#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
bool Settings::gShouldUseHighResolutionTimers = true;
@@ -131,6 +130,7 @@ Settings::Settings(Page* page)
, m_minimumLogicalFontSize(0)
, m_defaultFontSize(0)
, m_defaultFixedFontSize(0)
+ , m_screenFontSubstitutionEnabled(true)
, m_validationMessageTimerMagnification(50)
, m_minimumAccelerated2dCanvasSize(257 * 256)
, m_layoutFallbackWidth(980)
@@ -291,7 +291,7 @@ Settings::Settings(Page* page)
, m_windowFocusRestricted(true)
, m_diagnosticLoggingEnabled(false)
, m_scrollingPerformanceLoggingEnabled(false)
- , m_setImageLoadingSettingsTimer(this, &Settings::imageLoadingSettingsTimerFired)
+ , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
, m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
{
// A Frame may not have been created yet, so we initialize the AtomicString
@@ -419,6 +419,15 @@ void Settings::setDefaultFixedFontSize(int defaultFontSize)
m_page->setNeedsRecalcStyleInAllFrames();
}
+void Settings::setScreenFontSubstitutionEnabled(bool screenFontSubstitutionEnabled)
+{
+ if (m_screenFontSubstitutionEnabled == screenFontSubstitutionEnabled)
+ return;
+
+ m_screenFontSubstitutionEnabled = screenFontSubstitutionEnabled;
+ m_page->setNeedsRecalcStyleInAllFrames();
+}
+
#if ENABLE(TEXT_AUTOSIZING)
void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
{
@@ -457,12 +466,12 @@ void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
// Starting these loads synchronously is not important. By putting it on a 0-delay, properly closing the Page cancels them
// before they have a chance to really start.
// See http://webkit.org/b/60572 for more discussion.
- m_setImageLoadingSettingsTimer.startOneShot(0);
+ m_loadsImagesAutomaticallyTimer.startOneShot(0);
}
-void Settings::imageLoadingSettingsTimerFired(Timer<Settings>*)
+void Settings::loadsImagesAutomaticallyTimerFired(Timer<Settings>*)
{
- setImageLoadingSettings(m_page);
+ setLoadsImagesAutomaticallyInAllFrames(m_page);
}
void Settings::setLoadsSiteIconsIgnoringImageLoadingSetting(bool loadsSiteIcons)
@@ -508,9 +517,6 @@ void Settings::setJavaEnabledForLocalFiles(bool isJavaEnabledForLocalFiles)
void Settings::setImagesEnabled(bool areImagesEnabled)
{
m_areImagesEnabled = areImagesEnabled;
-
- // See comment in setLoadsImagesAutomatically.
- m_setImageLoadingSettingsTimer.startOneShot(0);
}
void Settings::setMediaEnabled(bool isMediaEnabled)
@@ -975,6 +981,16 @@ bool Settings::mockScrollbarsEnabled()
return gMockScrollbarsEnabled;
}
+void Settings::setUsesOverlayScrollbars(bool flag)
+{
+ gUsesOverlayScrollbars = flag;
+}
+
+bool Settings::usesOverlayScrollbars()
+{
+ return gUsesOverlayScrollbars;
+}
+
#if USE(JSC)
void Settings::setShouldRespectPriorityInCSSAttributeSetters(bool flag)
{
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index 6247f8564..83986f697 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -108,6 +108,9 @@ namespace WebCore {
void setDefaultFixedFontSize(int);
int defaultFixedFontSize() const { return m_defaultFixedFontSize; }
+ void setScreenFontSubstitutionEnabled(bool);
+ bool screenFontSubstitutionEnabled() const { return m_screenFontSubstitutionEnabled; }
+
#if ENABLE(TEXT_AUTOSIZING)
void setTextAutosizingEnabled(bool);
bool textAutosizingEnabled() const { return m_textAutosizingEnabled; }
@@ -548,6 +551,9 @@ namespace WebCore {
static void setMockScrollbarsEnabled(bool flag);
static bool mockScrollbarsEnabled();
+ static void setUsesOverlayScrollbars(bool flag);
+ static bool usesOverlayScrollbars();
+
void setVisualWordMovementEnabled(bool enabled) { m_visualWordMovementEnabled = enabled; }
bool visualWordMovementEnabled() const { return m_visualWordMovementEnabled; }
@@ -652,6 +658,7 @@ namespace WebCore {
int m_minimumLogicalFontSize;
int m_defaultFontSize;
int m_defaultFixedFontSize;
+ bool m_screenFontSubstitutionEnabled;
int m_validationMessageTimerMagnification;
int m_minimumAccelerated2dCanvasSize;
int m_layoutFallbackWidth;
@@ -811,8 +818,8 @@ namespace WebCore {
bool m_scrollingPerformanceLoggingEnabled : 1;
- Timer<Settings> m_setImageLoadingSettingsTimer;
- void imageLoadingSettingsTimerFired(Timer<Settings>*);
+ Timer<Settings> m_loadsImagesAutomaticallyTimer;
+ void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
double m_incrementalRenderingSuppressionTimeoutInSeconds;
@@ -820,6 +827,7 @@ namespace WebCore {
static bool gAVFoundationEnabled;
#endif
static bool gMockScrollbarsEnabled;
+ static bool gUsesOverlayScrollbars;
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/Source/WebCore/page/TouchAdjustment.cpp b/Source/WebCore/page/TouchAdjustment.cpp
index 4aeb343af..9663f68e8 100644
--- a/Source/WebCore/page/TouchAdjustment.cpp
+++ b/Source/WebCore/page/TouchAdjustment.cpp
@@ -285,23 +285,6 @@ void compileZoomableSubtargets(const NodeList& intersectedNodes, SubtargetGeomet
}
}
-
-float distanceSquaredToTargetCenterLine(const IntPoint& touchHotspot, const IntRect& touchArea, const SubtargetGeometry& subtarget)
-{
- UNUSED_PARAM(touchArea);
- // For a better center of a line-box we use the center-line instead of the center-point.
- // We use the center-line of the bounding box of the quad though, since it is much faster
- // and gives the same result in all untransformed cases, and in transformed cases still
- // gives a better distance-function than the distance to the center-point.
- IntRect rect = subtarget.boundingBox();
- ASSERT(subtarget.node()->document());
- ASSERT(subtarget.node()->document()->view());
- // Convert from frame coordinates to window coordinates.
- rect = subtarget.node()->document()->view()->contentsToWindow(rect);
-
- return rect.distanceSquaredFromCenterLineToPoint(touchHotspot);
-}
-
// This returns quotient of the target area and its intersection with the touch area.
// This will prioritize largest intersection and smallest area, while balancing the two against each other.
float zoomableIntersectionQuotient(const IntPoint& touchHotspot, const IntRect& touchArea, const SubtargetGeometry& subtarget)
@@ -321,32 +304,30 @@ float zoomableIntersectionQuotient(const IntPoint& touchHotspot, const IntRect&
return rect.size().area() / (float)intersection.size().area();
}
-// Uses a hybrid of distance to center and intersect ratio, normalizing each
-// score between 0 and 1 and choosing the better score. The distance to
-// centerline works best for disambiguating clicks on targets such as links,
-// where the width may be significantly larger than the touch width. Using
-// area of overlap in such cases can lead to a bias towards shorter links.
-// Conversely, percentage of overlap can provide strong confidence in tapping
-// on a small target, where the overlap is often quite high, and works well
-// for tightly packed controls.
-float hybridDistanceFunction(const IntPoint& touchHotspot, const IntRect& touchArea, const SubtargetGeometry& subtarget)
+// Uses a hybrid of distance to adjust and intersect ratio, normalizing each score between 0 and 1
+// and combining them. The distance to adjust works best for disambiguating clicks on targets such
+// as links, where the width may be significantly larger than the touch width. Using area of overlap
+// in such cases can lead to a bias towards shorter links. Conversely, percentage of overlap can
+// provide strong confidence in tapping on a small target, where the overlap is often quite high,
+// and works well for tightly packed controls.
+float hybridDistanceFunction(const IntPoint& touchHotspot, const IntRect& touchRect, const SubtargetGeometry& subtarget)
{
IntRect rect = subtarget.boundingBox();
// Convert from frame coordinates to window coordinates.
rect = subtarget.node()->document()->view()->contentsToWindow(rect);
- float touchWidth = touchArea.width();
- float touchHeight = touchArea.height();
- float distanceScale = touchWidth * touchWidth + touchHeight * touchHeight;
- float distanceToCenterScore = rect.distanceSquaredFromCenterLineToPoint(touchHotspot) / distanceScale;
+ float radiusSquared = 0.25f * (touchRect.size().diagonalLengthSquared());
+ float distanceToAdjustScore = rect.distanceSquaredToPoint(touchHotspot) / radiusSquared;
float targetArea = rect.size().area();
- rect.intersect(touchArea);
+ rect.intersect(touchRect);
float intersectArea = rect.size().area();
float intersectionScore = 1 - intersectArea / targetArea;
- return intersectionScore < distanceToCenterScore ? intersectionScore : distanceToCenterScore;
+ float hybridScore = intersectionScore + distanceToAdjustScore;
+
+ return hybridScore;
}
FloatPoint contentsToWindow(FrameView *view, FloatPoint pt)
@@ -446,19 +427,6 @@ bool findNodeWithLowestDistanceMetric(Node*& targetNode, IntPoint& targetPoint,
targetPoint = adjustedPoint;
targetNode = node;
targetArea = it->boundingBox();
- } else {
- // Minimize adjustment distance.
- float dx = targetPoint.x() - touchHotspot.x();
- float dy = targetPoint.y() - touchHotspot.y();
- float bestDistance = dx * dx + dy * dy;
- dx = adjustedPoint.x() - touchHotspot.x();
- dy = adjustedPoint.y() - touchHotspot.y();
- float distance = dx * dx + dy * dy;
- if (distance < bestDistance) {
- targetPoint = adjustedPoint;
- targetNode = node;
- targetArea = it->boundingBox();
- }
}
}
}
diff --git a/Source/WebCore/platform/Scrollbar.cpp b/Source/WebCore/platform/Scrollbar.cpp
index 75a8c2cf0..8fa417c6b 100644
--- a/Source/WebCore/platform/Scrollbar.cpp
+++ b/Source/WebCore/platform/Scrollbar.cpp
@@ -86,6 +86,7 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient
, m_scrollTimer(this, &Scrollbar::autoscrollTimerFired)
, m_overlapsResizer(false)
, m_suppressInvalidation(false)
+ , m_isAlphaLocked(false)
{
if (!m_theme)
m_theme = ScrollbarTheme::theme();
diff --git a/Source/WebCore/platform/Scrollbar.h b/Source/WebCore/platform/Scrollbar.h
index 171413a85..578f70985 100644
--- a/Source/WebCore/platform/Scrollbar.h
+++ b/Source/WebCore/platform/Scrollbar.h
@@ -150,6 +150,9 @@ public:
void moveThumb(int pos, bool draggingDocument = false);
+ virtual bool isAlphaLocked() const { return m_isAlphaLocked; }
+ virtual void setIsAlphaLocked(bool flag) { m_isAlphaLocked = flag; }
+
protected:
Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
@@ -190,6 +193,8 @@ protected:
bool m_suppressInvalidation;
+ bool m_isAlphaLocked;
+
private:
virtual bool isScrollbar() const { return true; }
virtual AXObjectCache* axObjectCache() const;
diff --git a/Source/WebCore/platform/ScrollbarThemeClient.h b/Source/WebCore/platform/ScrollbarThemeClient.h
index eba409469..64026bf94 100644
--- a/Source/WebCore/platform/ScrollbarThemeClient.h
+++ b/Source/WebCore/platform/ScrollbarThemeClient.h
@@ -85,6 +85,9 @@ public:
virtual bool isOverlayScrollbar() const = 0;
+ virtual bool isAlphaLocked() const = 0;
+ virtual void setIsAlphaLocked(bool) = 0;
+
protected:
virtual ~ScrollbarThemeClient() { }
};
diff --git a/Source/WebCore/platform/blackberry/PageClientBlackBerry.h b/Source/WebCore/platform/blackberry/PageClientBlackBerry.h
index b237d39dc..bdb2f1607 100644
--- a/Source/WebCore/platform/blackberry/PageClientBlackBerry.h
+++ b/Source/WebCore/platform/blackberry/PageClientBlackBerry.h
@@ -49,6 +49,7 @@ public:
SaveCredentialYes
};
+ virtual int playerID() const = 0;
virtual void setCursor(WebCore::PlatformCursor) = 0;
virtual BlackBerry::Platform::NetworkStreamFactory* networkStreamFactory() = 0;
virtual BlackBerry::Platform::Graphics::Window* platformWindow() const = 0;
diff --git a/Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp b/Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp
index d15b65873..ce9b73e9c 100644
--- a/Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp
+++ b/Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp
@@ -22,11 +22,11 @@
#include "config.h"
#include "PlatformTouchEvent.h"
-#include <BlackBerryPlatformTouchEvent.h>
+#if ENABLE(TOUCH_EVENTS)
+#include <BlackBerryPlatformTouchEvent.h>
#include <wtf/CurrentTime.h>
-
-#if ENABLE(TOUCH_EVENTS)
+#include <wtf/MathExtras.h>
namespace WebCore {
@@ -66,7 +66,7 @@ PlatformTouchEvent::PlatformTouchEvent(BlackBerry::Platform::TouchEvent* event)
if (event->hasGesture(BlackBerry::Platform::Gesture::Pinch, &pinch)) {
BlackBerry::Platform::PinchGestureData* data = static_cast<BlackBerry::Platform::PinchGestureData*>(pinch.m_data);
if (data) {
- m_rotation = data->m_angle * 180 / M_PI;
+ m_rotation = rad2deg(data->m_angle);
m_scale = data->m_scale;
}
} else if (event->hasGesture(BlackBerry::Platform::Gesture::DoubleTap))
diff --git a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
index 0688da847..a9c09a119 100644
--- a/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
+++ b/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
@@ -332,28 +332,42 @@ bool RenderThemeBlackBerry::paintSearchField(RenderObject* object, const PaintIn
return paintTextFieldOrTextAreaOrSearchField(object, info, rect);
}
-bool RenderThemeBlackBerry::paintSearchFieldCancelButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+IntRect RenderThemeBlackBerry::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const
{
- ASSERT(object->parent());
- if (!object->parent() || !object->parent()->isBox())
- return false;
+ // Compute an offset between the part renderer and the input renderer.
+ LayoutSize offsetFromInputRenderer = -partRenderer->offsetFromAncestorContainer(inputRenderer);
+ // Move the rect into partRenderer's coords.
+ partRect.move(offsetFromInputRenderer);
+ // Account for the local drawing offset.
+ partRect.move(localOffset.x(), localOffset.y());
+
+ return pixelSnappedIntRect(partRect);
+}
+
- RenderBox* parentRenderBox = toRenderBox(object->parent());
+bool RenderThemeBlackBerry::paintSearchFieldCancelButton(RenderObject* cancelButtonObject, const PaintInfo& paintInfo, const IntRect& r)
+{
+ Node* input = cancelButtonObject->node()->shadowAncestorNode();
+ if (!input->renderer()->isBox())
+ return false;
- IntRect parentBox = parentRenderBox->absoluteContentBox();
- IntRect bounds = rect;
- // Make sure the scaled button stays square and fits in its parent's box.
- bounds.setHeight(std::min(parentBox.width(), std::min(parentBox.height(), bounds.height())));
- bounds.setWidth(bounds.height());
+ RenderBox* inputRenderBox = toRenderBox(input->renderer());
+ LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
- // Put the button in the middle vertically, and round up the value.
- // So if it has to be one pixel off-center, it would be one pixel closer
- // to the bottom of the field. This would look better with the text.
- bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
+ // Make sure the scaled button stays square and will fit in its parent's box.
+ LayoutUnit cancelButtonSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), r.height()));
+ // Calculate cancel button's coordinates relative to the input element.
+ // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will
+ // be one pixel closer to the bottom of the field. This tends to look better with the text.
+ LayoutRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
+ inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
+ cancelButtonSize, cancelButtonSize);
+ IntRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
- paintInfo.context->drawImage(isPressed(object) ? cancelPressedImage : cancelImage, object->style()->colorSpace(), bounds);
+ paintInfo.context->drawImage(isPressed(cancelButtonObject) ? cancelPressedImage : cancelImage,
+ cancelButtonObject->style()->colorSpace(), paintingRect);
return false;
}
@@ -921,12 +935,7 @@ bool RenderThemeBlackBerry::paintMediaSliderTrack(RenderObject* object, const Pa
return false;
float fullScreenMultiplier = determineFullScreenMultiplier(mediaElement);
- float loaded = 0;
- // FIXME: replace loaded with commented out one when buffer bug is fixed (see comment in
- // MediaPlayerPrivateMMrenderer::percentLoaded).
- // loaded = mediaElement->percentLoaded();
- if (mediaElement->player() && mediaElement->player()->implementation())
- loaded = static_cast<MediaPlayerPrivate *>(mediaElement->player()->implementation())->percentLoaded();
+ float loaded = mediaElement->percentLoaded();
float position = mediaElement->duration() > 0 ? (mediaElement->currentTime() / mediaElement->duration()) : 0;
int x = ceil(rect.x() + 2 * fullScreenMultiplier - fullScreenMultiplier / 2);
diff --git a/Source/WebCore/platform/chromium/PlatformSupport.h b/Source/WebCore/platform/chromium/PlatformSupport.h
index 6bd1cd1c4..366a35cb9 100644
--- a/Source/WebCore/platform/chromium/PlatformSupport.h
+++ b/Source/WebCore/platform/chromium/PlatformSupport.h
@@ -113,13 +113,9 @@ public:
// IndexedDB ----------------------------------------------------------
static PassRefPtr<IDBFactoryBackendInterface> idbFactory();
- // JavaScript ---------------------------------------------------------
- static void notifyJSOutOfMemory(Frame*);
-
// Plugin -------------------------------------------------------------
static bool plugins(bool refresh, Vector<PluginInfo>*);
static NPObject* pluginScriptableObject(Widget*);
- static bool popupsAllowed(NPP);
// Screen -------------------------------------------------------------
static int screenHorizontalDPI(Widget*);
diff --git a/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm b/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
index 73d79b0bc..9fe8a900e 100644
--- a/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
+++ b/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
@@ -126,6 +126,7 @@ bool ScrollbarThemeChromiumMac::paint(ScrollbarThemeClient* scrollbar, GraphicsC
bool hasTickmarks = tickmarks.size() > 0 && scrollbar->orientation() == VerticalScrollbar;
ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
if (hasTickmarks) {
+ scrollbar->setIsAlphaLocked(true);
oldKnobAlpha = [scrollbarPainter knobAlpha];
[scrollbarPainter setKnobAlpha:1.0];
oldTrackAlpha = [scrollbarPainter trackAlpha];
@@ -134,7 +135,8 @@ bool ScrollbarThemeChromiumMac::paint(ScrollbarThemeClient* scrollbar, GraphicsC
oldIsExpanded = [scrollbarPainter isExpanded];
[scrollbarPainter setExpanded:YES];
}
- }
+ } else
+ scrollbar->setIsAlphaLocked(false);
GraphicsContextStateSaver stateSaver(*context);
context->clip(damageRect);
diff --git a/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp b/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp
index ec6d57bbc..5d4af358a 100644
--- a/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp
+++ b/Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp
@@ -123,4 +123,14 @@ bool WebScrollbarImpl::isCustomScrollbar() const
return m_scrollbar->isCustomScrollbar();
}
+bool WebScrollbarImpl::isAlphaLocked() const
+{
+ return m_scrollbar->isAlphaLocked();
+}
+
+void WebScrollbarImpl::setIsAlphaLocked(bool flag)
+{
+ m_scrollbar->setIsAlphaLocked(flag);
+}
+
} // namespace WebKit
diff --git a/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h b/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h
index 9b6b77476..c469349a2 100644
--- a/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h
+++ b/Source/WebCore/platform/chromium/support/WebScrollbarImpl.h
@@ -54,6 +54,8 @@ public:
virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
virtual Orientation orientation() const OVERRIDE;
virtual bool isCustomScrollbar() const OVERRIDE;
+ virtual bool isAlphaLocked() const OVERRIDE;
+ virtual void setIsAlphaLocked(bool) OVERRIDE;
private:
RefPtr<WebCore::Scrollbar> m_scrollbar;
diff --git a/Source/WebCore/platform/graphics/IntRect.cpp b/Source/WebCore/platform/graphics/IntRect.cpp
index fd1e50949..fadceab78 100644
--- a/Source/WebCore/platform/graphics/IntRect.cpp
+++ b/Source/WebCore/platform/graphics/IntRect.cpp
@@ -148,19 +148,6 @@ IntSize IntRect::differenceToPoint(const IntPoint& point) const
return IntSize(xdistance, ydistance);
}
-IntSize IntRect::differenceFromCenterLineToPoint(const IntPoint& point) const
-{
- // The center-line is the natural center of a rectangle. It has an equal distance to all sides of the rectangle.
- IntPoint centerPoint = center();
- int xdistance = centerPoint.x() - point.x();
- int ydistance = centerPoint.y() - point.y();
- if (width() > height())
- xdistance = distanceToInterval(point.x(), x() + (height() / 2), maxX() - (height() / 2));
- else
- ydistance = distanceToInterval(point.y(), y() + (width() / 2), maxY() - (width() / 2));
- return IntSize(xdistance, ydistance);
-}
-
IntRect unionRect(const Vector<IntRect>& rects)
{
IntRect result;
diff --git a/Source/WebCore/platform/graphics/IntRect.h b/Source/WebCore/platform/graphics/IntRect.h
index 257412ed8..04996e60a 100644
--- a/Source/WebCore/platform/graphics/IntRect.h
+++ b/Source/WebCore/platform/graphics/IntRect.h
@@ -190,9 +190,7 @@ public:
void scale(float s);
IntSize differenceToPoint(const IntPoint&) const;
- IntSize differenceFromCenterLineToPoint(const IntPoint&) const;
int distanceSquaredToPoint(const IntPoint& p) const { return differenceToPoint(p).diagonalLengthSquared(); }
- int distanceSquaredFromCenterLineToPoint(const IntPoint& p) const { return differenceFromCenterLineToPoint(p).diagonalLengthSquared(); }
IntRect transposedRect() const { return IntRect(m_location.transposedPoint(), m_size.transposedSize()); }
diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp
index 30ee94872..47834d5ab 100644
--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp
@@ -210,7 +210,7 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines()
enginesQueried = true;
#if USE(AVFOUNDATION)
- if (1 /* @@Settings::isAVFoundationEnabled() @@ */) {
+ if (Settings::isAVFoundationEnabled()) {
#if PLATFORM(MAC)
MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
#elif PLATFORM(WIN)
diff --git a/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp
index 7a80d98c7..8793298d1 100644
--- a/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp
@@ -27,40 +27,11 @@ namespace WebCore {
PassRefPtr<Image> Image::loadPlatformResource(const char *name)
{
- if (!strcmp(name, "searchCancel") || !strcmp(name, "searchCancelPressed")) {
- OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(IntSize(16, 16));
- if (!imageBuffer)
- return 0;
-
- // Draw a more subtle, gray x-shaped icon.
- GraphicsContext* context = imageBuffer->context();
- context->save();
-
- context->fillRect(FloatRect(0, 0, 16, 16), Color::white, ColorSpaceDeviceRGB);
-
- if (!strcmp(name, "searchCancel"))
- context->setFillColor(Color(128, 128, 128), ColorSpaceDeviceRGB);
- else
- context->setFillColor(Color(64, 64, 64), ColorSpaceDeviceRGB);
-
- context->translate(8, 8);
-
- context->rotate(piDouble / 4.0);
- context->fillRect(FloatRect(-1, -7, 2, 14));
-
- context->rotate(-piDouble / 2.0);
- context->fillRect(FloatRect(-1, -7, 2, 14));
-
- context->restore();
- return imageBuffer->copyImage();
- }
-
// RESOURCE_PATH is set by CMake in OptionsBlackBerry.cmake
String fullPath(RESOURCE_PATH);
String extension(".png");
- fullPath += name;
- fullPath += extension;
+ fullPath = fullPath + name + extension;
RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(fullPath);
if (!buffer)
diff --git a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
index f28967c51..d50886801 100644
--- a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
+++ b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
@@ -42,6 +42,7 @@
#import <objc/objc-runtime.h>
#import <QuartzCore/QuartzCore.h>
#import <wtf/CurrentTime.h>
+#import <wtf/MathExtras.h>
#import <wtf/UnusedParam.h>
using std::min;
@@ -755,7 +756,7 @@ void PlatformCALayer::setFilters(const FilterOperations& filters)
[caFilter setDefaults];
// The CIHueAdjust value is in radians
- [caFilter setValue:[NSNumber numberWithFloat:op->amount() * M_PI * 2 / 360] forKey:@"inputAngle"];
+ [caFilter setValue:[NSNumber numberWithFloat:deg2rad(op->amount())] forKey:@"inputAngle"];
[caFilter setName:filterName];
[array.get() addObject:caFilter];
break;
diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index bd0b97f84..3edbb88aa 100644
--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -65,10 +65,6 @@
using namespace std;
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
namespace WebCore {
// A helper which quickly fills a rectangle with a simple color fill.
@@ -353,7 +349,7 @@ void GraphicsContext::drawEllipse(const IntRect& rect)
float xRadius = .5 * rect.width();
cairo_translate(cr, rect.x() + xRadius, rect.y() + yRadius);
cairo_scale(cr, xRadius, yRadius);
- cairo_arc(cr, 0., 0., 1., 0., 2 * M_PI);
+ cairo_arc(cr, 0., 0., 1., 0., 2 * piFloat);
cairo_restore(cr);
if (fillColor().alpha()) {
@@ -392,7 +388,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
if (w != h)
cairo_scale(cr, 1., scaleFactor);
- cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, -fa * M_PI/180, -falen * M_PI/180);
+ cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, deg2rad(-fa), deg2rad(-falen));
if (w != h)
cairo_scale(cr, 1., reverseScaleFactor);
diff --git a/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp b/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp
index a5155e272..a06ac666e 100644
--- a/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp
+++ b/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp
@@ -52,6 +52,10 @@ OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate(
void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, WebFloatRect& opaque)
{
PlatformContextSkia platformContext(canvas);
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+ if (canvas)
+ platformContext.setHintingScaleFactor(canvas->getTotalMatrix().getScaleX());
+#endif
platformContext.setTrackOpaqueRegion(!m_opaque);
GraphicsContext context(&platformContext);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
index 804d6ffd8..9f375b8df 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
@@ -59,6 +59,7 @@ CCScrollbarLayerImpl::CCScrollbarLayerImpl(int id)
, m_enabled(false)
, m_isCustomScrollbar(false)
, m_isOverlayScrollbar(false)
+ , m_isAlphaLocked(false)
{
}
@@ -212,5 +213,15 @@ bool CCScrollbarLayerImpl::CCScrollbar::isCustomScrollbar() const
return m_owner->m_isCustomScrollbar;
}
+bool CCScrollbarLayerImpl::CCScrollbar::isAlphaLocked() const
+{
+ return m_owner->m_isAlphaLocked;
+}
+
+void CCScrollbarLayerImpl::CCScrollbar::setIsAlphaLocked(bool flag)
+{
+ m_owner->m_isAlphaLocked = flag;
+}
+
}
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
index 3e628673b..9923ce4cb 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
@@ -91,6 +91,8 @@ private:
virtual WebScrollbar::ScrollbarOverlayStyle scrollbarOverlayStyle() const;
virtual WebScrollbar::Orientation orientation() const;
virtual bool isCustomScrollbar() const;
+ virtual bool isAlphaLocked() const OVERRIDE;
+ virtual void setIsAlphaLocked(bool) OVERRIDE;
private:
CCScrollbarLayerImpl* m_owner;
@@ -122,6 +124,7 @@ private:
bool m_enabled;
bool m_isCustomScrollbar;
bool m_isOverlayScrollbar;
+ bool m_isAlphaLocked;
};
}
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp
index b9ba7d362..53acb292c 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp
@@ -68,11 +68,11 @@ static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, hb_codepoint_t codepoint
if (width)
*width = SkiaScalarToHarfbuzzPosition(skWidth);
if (extents) {
+ // Invert y-axis because Skia is y-grows-down but we set up harfbuzz to be y-grows-up.
extents->x_bearing = SkiaScalarToHarfbuzzPosition(skBounds.fLeft);
- // The extents are unused in harfbuzz now so we're unsure whether a negation is needed here. Revisit when we're sure.
- extents->y_bearing = SkiaScalarToHarfbuzzPosition(skBounds.fTop);
+ extents->y_bearing = SkiaScalarToHarfbuzzPosition(-skBounds.fTop);
extents->width = SkiaScalarToHarfbuzzPosition(skBounds.width());
- extents->height = SkiaScalarToHarfbuzzPosition(skBounds.height());
+ extents->height = SkiaScalarToHarfbuzzPosition(-skBounds.height());
}
}
@@ -171,8 +171,6 @@ hb_font_t* HarfBuzzNGFace::createFont()
m_platformData->setupPaint(paint);
hb_font_set_funcs(font, harfbuzzSkiaGetFontFuncs(), paint, destroyPaint);
float size = m_platformData->size();
- if (floorf(size) == size)
- hb_font_set_ppem(font, size, size);
int scale = SkiaScalarToHarfbuzzPosition(size);
hb_font_set_scale(font, scale, scale);
hb_font_make_immutable(font);
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
index 4e327fcaa..9d65f0fda 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
@@ -85,12 +85,13 @@ void HarfBuzzShaper::HarfBuzzRun::applyShapeResult(hb_buffer_t* harfbuzzBuffer)
m_numGlyphs = hb_buffer_get_length(harfbuzzBuffer);
m_glyphs.resize(m_numGlyphs);
m_advances.resize(m_numGlyphs);
- m_glyphToCharacterIndex.resize(m_numGlyphs);
+ m_glyphToCharacterIndexes.resize(m_numGlyphs);
m_logClusters.resize(m_numCharacters);
+ m_offsets.resize(m_numGlyphs);
hb_glyph_info_t* infos = hb_buffer_get_glyph_infos(harfbuzzBuffer, 0);
for (unsigned i = 0; i < m_numGlyphs; ++i)
- m_glyphToCharacterIndex[i] = infos[i].cluster;
+ m_glyphToCharacterIndexes[i] = infos[i].cluster;
// Fill logical clusters
unsigned index = 0;
@@ -111,10 +112,11 @@ void HarfBuzzShaper::HarfBuzzRun::applyShapeResult(hb_buffer_t* harfbuzzBuffer)
}
}
-void HarfBuzzShaper::HarfBuzzRun::setGlyphAndAdvance(unsigned index, uint16_t glyphId, float advance)
+void HarfBuzzShaper::HarfBuzzRun::setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY)
{
m_glyphs[index] = glyphId;
m_advances[index] = advance;
+ m_offsets[index] = FloatPoint(offsetX, offsetY);
}
int HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX)
@@ -126,7 +128,7 @@ int HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX)
float currentAdvance = m_advances[i] / 2.0;
float nextX = currentX + prevAdvance + currentAdvance;
if (currentX <= targetX && targetX <= nextX)
- return m_glyphToCharacterIndex[i] + (rtl() ? 1 : 0);
+ return m_glyphToCharacterIndexes[i] + (rtl() ? 1 : 0);
currentX = nextX;
prevAdvance = currentAdvance;
}
@@ -155,7 +157,8 @@ static void normalizeCharacters(const UChar* source, UChar* destination, int len
UChar32 character;
int nextPosition = position;
U16_NEXT(source, nextPosition, length, character);
- if (Font::treatAsSpace(character))
+ // Don't normalize tabs as they are not treated as spaces for word-end
+ if (Font::treatAsSpace(character) && character != '\t')
character = ' ';
else if (Font::treatAsZeroWidthSpaceInComplexScript(character))
character = zeroWidthSpace;
@@ -189,11 +192,6 @@ void HarfBuzzShaper::setDrawRange(int from, int to)
m_toIndex = to;
}
-bool HarfBuzzShaper::shouldDrawCharacterAt(int index)
-{
- return m_fromIndex <= index && index < m_toIndex;
-}
-
void HarfBuzzShaper::setFontFeatures()
{
FontFeatureSettings* settings = m_font->fontDescription().featureSettings();
@@ -217,9 +215,13 @@ bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
return false;
m_totalWidth = 0;
- if (!shapeHarfBuzzRuns(glyphBuffer))
+ if (!shapeHarfBuzzRuns())
return false;
m_totalWidth = roundf(m_totalWidth);
+
+ if (glyphBuffer)
+ fillGlyphBuffer(glyphBuffer);
+
return true;
}
@@ -228,8 +230,23 @@ FloatPoint HarfBuzzShaper::adjustStartPoint(const FloatPoint& point)
return point + m_startOffset;
}
+static const SimpleFontData* fontDataForCombiningCharacterSequence(const Font* font, const UChar* characters, size_t length)
+{
+ UErrorCode error = U_ZERO_ERROR;
+ Vector<UChar, 4> normalizedCharacters(length);
+ int32_t normalizedLength = unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], length, &error);
+ // Should fallback if we have an error or no composition occurred.
+ if (U_FAILURE(error) || (static_cast<size_t>(normalizedLength) == length))
+ return 0;
+ UChar32 normalizedCharacter;
+ size_t index = 0;
+ U16_NEXT(&normalizedCharacters[0], index, static_cast<size_t>(normalizedLength), normalizedCharacter);
+ return font->glyphDataForCharacter(normalizedCharacter, false).fontData;
+}
+
bool HarfBuzzShaper::collectHarfBuzzRuns()
{
+ const UChar* normalizedBufferEnd = m_normalizedBuffer.get() + m_normalizedBufferLength;
SurrogatePairAwareTextIterator iterator(m_normalizedBuffer.get(), 0, m_normalizedBufferLength, m_normalizedBufferLength);
UChar32 character;
unsigned clusterLength = 0;
@@ -244,18 +261,40 @@ bool HarfBuzzShaper::collectHarfBuzzRuns()
return false;
do {
+ const UChar* currentCharacterPosition = iterator.characters();
const SimpleFontData* currentFontData = nextFontData;
UScriptCode currentScript = nextScript;
for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
- nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
- if (nextFontData != currentFontData)
- break;
+ if (Font::treatAsZeroWidthSpace(character))
+ continue;
+ if (U_GET_GC_MASK(character) & U_GC_M_MASK) {
+ int markLength = clusterLength;
+ const UChar* markCharactersEnd = iterator.characters() + clusterLength;
+ while (markCharactersEnd < normalizedBufferEnd) {
+ UChar32 nextCharacter;
+ int nextCharacterLength = 0;
+ U16_NEXT(markCharactersEnd, nextCharacterLength, normalizedBufferEnd - markCharactersEnd, nextCharacter);
+ if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
+ break;
+ markLength += nextCharacterLength;
+ markCharactersEnd += nextCharacterLength;
+ }
+ nextFontData = fontDataForCombiningCharacterSequence(m_font, currentCharacterPosition, markCharactersEnd - currentCharacterPosition);
+ if (nextFontData)
+ clusterLength = markLength;
+ else
+ nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
+ } else
+ nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
+
nextScript = uscript_getScript(character, &errorCode);
if (U_FAILURE(errorCode))
return false;
- if ((currentScript != nextScript) && (currentScript != USCRIPT_INHERITED))
+ if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED)))
break;
+ if (nextScript == USCRIPT_INHERITED)
+ nextScript = currentScript;
}
unsigned numCharactersOfCurrentRun = iterator.currentCharacter() - startIndexOfCurrentRun;
m_harfbuzzRuns.append(HarfBuzzRun::create(currentFontData, startIndexOfCurrentRun, numCharactersOfCurrentRun, m_run.direction()));
@@ -266,14 +305,12 @@ bool HarfBuzzShaper::collectHarfBuzzRuns()
return !m_harfbuzzRuns.isEmpty();
}
-bool HarfBuzzShaper::shapeHarfBuzzRuns(GlyphBuffer* glyphBuffer)
+bool HarfBuzzShaper::shapeHarfBuzzRuns()
{
HarfBuzzScopedPtr<hb_buffer_t> harfbuzzBuffer(hb_buffer_create(), hb_buffer_destroy);
- float pendingGlyphAdvanceX = 0;
- float pendingGlyphAdvanceY = 0;
hb_buffer_set_unicode_funcs(harfbuzzBuffer.get(), hb_icu_get_unicode_funcs());
- if (m_run.directionalOverride())
+ if (m_run.rtl() || m_run.directionalOverride())
hb_buffer_set_direction(harfbuzzBuffer.get(), m_run.rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
for (unsigned i = 0; i < m_harfbuzzRuns.size(); ++i) {
@@ -297,16 +334,17 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns(GlyphBuffer* glyphBuffer)
hb_shape(harfbuzzFont.get(), harfbuzzBuffer.get(), m_features.isEmpty() ? 0 : m_features.data(), m_features.size());
currentRun->applyShapeResult(harfbuzzBuffer.get());
- setGlyphPositionsForHarfBuzzRun(currentRun, i, harfbuzzBuffer.get(), glyphBuffer, pendingGlyphAdvanceX, pendingGlyphAdvanceY);
+ setGlyphPositionsForHarfBuzzRun(currentRun, harfbuzzBuffer.get());
hb_buffer_reset(harfbuzzBuffer.get());
- if (m_run.directionalOverride())
+ if (m_run.rtl() || m_run.directionalOverride())
hb_buffer_set_direction(harfbuzzBuffer.get(), m_run.rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
}
+
return true;
}
-void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, unsigned runIndexInVisualOrder, hb_buffer_t* harfbuzzBuffer, GlyphBuffer* glyphBuffer, float& pendingGlyphAdvanceX, float& pendingGlyphAdvanceY)
+void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb_buffer_t* harfbuzzBuffer)
{
const SimpleFontData* currentFontData = currentRun->fontData();
hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfbuzzBuffer, 0);
@@ -314,58 +352,93 @@ void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, un
unsigned numGlyphs = currentRun->numGlyphs();
float totalAdvance = 0;
- float nextOffsetX = harfbuzzPositionToFloat(glyphPositions[0].x_offset);
- float nextOffsetY = -harfbuzzPositionToFloat(glyphPositions[0].y_offset);
- // HarfBuzz returns the shaping result in visual order. We need not to flip them for RTL.
+
+ // HarfBuzz returns the shaping result in visual order. We need not to flip for RTL.
for (size_t i = 0; i < numGlyphs; ++i) {
bool runEnd = i + 1 == numGlyphs;
uint16_t glyph = glyphInfos[i].codepoint;
- float offsetX = nextOffsetX;
- float offsetY = nextOffsetY;
+ float offsetX = harfbuzzPositionToFloat(glyphPositions[i].x_offset);
+ float offsetY = -harfbuzzPositionToFloat(glyphPositions[i].y_offset);
float advance = harfbuzzPositionToFloat(glyphPositions[i].x_advance);
- nextOffsetX = runEnd ? 0 : harfbuzzPositionToFloat(glyphPositions[i + 1].x_offset);
- nextOffsetY = runEnd ? 0 : -harfbuzzPositionToFloat(glyphPositions[i + 1].y_offset);
unsigned currentCharacterIndex = currentRun->startIndex() + glyphInfos[i].cluster;
bool isClusterEnd = runEnd || glyphInfos[i].cluster != glyphInfos[i + 1].cluster;
- float spacing = isClusterEnd ? m_letterSpacing : 0;
+ float spacing = 0;
+ if (isClusterEnd && !Font::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))
+ spacing += m_letterSpacing;
if (isClusterEnd && isWordEnd(currentCharacterIndex))
spacing += determineWordBreakSpacing();
if (currentFontData->isZeroWidthSpaceGlyph(glyph)) {
- currentRun->setGlyphAndAdvance(i, glyph, 0);
- if (glyphBuffer && shouldDrawCharacterAt(currentCharacterIndex))
- glyphBuffer->add(glyph, currentFontData, createGlyphBufferAdvance(0, 0));
+ currentRun->setGlyphAndPositions(i, glyph, 0, 0, 0);
continue;
}
advance += spacing;
-
- currentRun->setGlyphAndAdvance(i, glyph, advance);
- if (glyphBuffer) {
- if (!i && !runIndexInVisualOrder)
- m_startOffset.set(offsetX, offsetY);
- float glyphAdvanceX = advance + nextOffsetX - offsetX;
- float glyphAdvanceY = nextOffsetY - offsetY;
- if (shouldDrawCharacterAt(currentCharacterIndex)) {
- glyphAdvanceX += pendingGlyphAdvanceX;
- glyphAdvanceY += pendingGlyphAdvanceY;
- pendingGlyphAdvanceX = 0;
- pendingGlyphAdvanceY = 0;
- glyphBuffer->add(glyph, currentFontData, createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
- } else {
- pendingGlyphAdvanceX += glyphAdvanceX;
- pendingGlyphAdvanceY += glyphAdvanceY;
- }
+ if (m_run.rtl()) {
+ // In RTL, spacing should be added to left side of glyphs.
+ offsetX += spacing;
+ if (!isClusterEnd)
+ offsetX += m_letterSpacing;
}
+ currentRun->setGlyphAndPositions(i, glyph, advance, offsetX, offsetY);
+
totalAdvance += advance;
}
currentRun->setWidth(totalAdvance > 0.0 ? totalAdvance : 0.0);
m_totalWidth += currentRun->width();
}
+void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, HarfBuzzRun* currentRun, FloatPoint& firstOffsetOfNextRun)
+{
+ FloatPoint* offsets = currentRun->offsets();
+ uint16_t* glyphs = currentRun->glyphs();
+ float* advances = currentRun->advances();
+ unsigned numGlyphs = currentRun->numGlyphs();
+ uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
+
+ for (unsigned i = 0; i < numGlyphs; ++i) {
+ uint16_t currentCharacterIndex = currentRun->startIndex() + glyphToCharacterIndexes[i];
+ FloatPoint& currentOffset = offsets[i];
+ FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1];
+ float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x();
+ float glyphAdvanceY = nextOffset.y() - currentOffset.y();
+ if (m_run.rtl()) {
+ if (currentCharacterIndex > m_toIndex)
+ m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
+ else if (currentCharacterIndex >= m_fromIndex)
+ glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
+ } else {
+ if (currentCharacterIndex < m_fromIndex)
+ m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
+ else if (currentCharacterIndex < m_toIndex)
+ glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
+ }
+ }
+}
+
+void HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
+{
+ unsigned numRuns = m_harfbuzzRuns.size();
+ if (m_run.rtl()) {
+ m_startOffset = m_harfbuzzRuns.last()->offsets()[0];
+ for (int runIndex = numRuns - 1; runIndex >= 0; --runIndex) {
+ HarfBuzzRun* currentRun = m_harfbuzzRuns[runIndex].get();
+ FloatPoint firstOffsetOfNextRun = !runIndex ? FloatPoint() : m_harfbuzzRuns[runIndex - 1]->offsets()[0];
+ fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
+ }
+ } else {
+ m_startOffset = m_harfbuzzRuns.first()->offsets()[0];
+ for (unsigned runIndex = 0; runIndex < numRuns; ++runIndex) {
+ HarfBuzzRun* currentRun = m_harfbuzzRuns[runIndex].get();
+ FloatPoint firstOffsetOfNextRun = runIndex == numRuns - 1 ? FloatPoint() : m_harfbuzzRuns[runIndex + 1]->offsets()[0];
+ fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
+ }
+ }
+}
+
int HarfBuzzShaper::offsetForPosition(float targetX)
{
int charactersSoFar = 0;
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
index 8260fc96c..946d0c089 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
@@ -67,7 +67,7 @@ private:
}
void applyShapeResult(hb_buffer_t*);
- void setGlyphAndAdvance(unsigned index, uint16_t glyphId, float advance);
+ void setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY);
void setWidth(float width) { m_width = width; }
int characterIndexForXPosition(float targetX);
@@ -79,6 +79,8 @@ private:
unsigned numGlyphs() const { return m_numGlyphs; }
uint16_t* glyphs() { return &m_glyphs[0]; }
float* advances() { return &m_advances[0]; }
+ FloatPoint* offsets() { return &m_offsets[0]; }
+ uint16_t* glyphToCharacterIndexes() { return &m_glyphToCharacterIndexes[0]; }
float width() { return m_width; }
private:
@@ -93,16 +95,18 @@ private:
Vector<uint16_t, 256> m_glyphs;
Vector<float, 256> m_advances;
Vector<uint16_t, 256> m_logClusters;
- Vector<uint16_t, 256> m_glyphToCharacterIndex;
+ Vector<uint16_t, 256> m_glyphToCharacterIndexes;
+ Vector<FloatPoint, 256> m_offsets;
float m_width;
};
- bool shouldDrawCharacterAt(int index);
void setFontFeatures();
bool collectHarfBuzzRuns();
- bool shapeHarfBuzzRuns(GlyphBuffer*);
- void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, unsigned runIndexInVisualOrder, hb_buffer_t*, GlyphBuffer*, float& pendingGlyphAdvanceX, float& pendingGlyphAdvanceY);
+ bool shapeHarfBuzzRuns();
+ void fillGlyphBuffer(GlyphBuffer*);
+ void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, HarfBuzzRun*, FloatPoint& firstOffsetOfNextRun);
+ void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*);
GlyphBufferAdvance createGlyphBufferAdvance(float, float);
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 3cfbd35eb..a508a6e29 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -188,6 +188,9 @@ PlatformContextSkia::PlatformContextSkia(SkCanvas* canvas)
, m_accelerated(false)
, m_deferred(false)
, m_drawingToImageBuffer(false)
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+ , m_hintingScaleFactor(SK_Scalar1)
+#endif
{
m_stateStack.append(State());
m_state = &m_stateStack.last();
@@ -357,6 +360,9 @@ void PlatformContextSkia::setupPaintCommon(SkPaint* paint) const
paint->setAntiAlias(m_state->m_useAntialiasing);
paint->setXfermodeMode(m_state->m_xferMode);
paint->setLooper(m_state->m_looper);
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+ paint->setHintingScaleFactor(m_hintingScaleFactor);
+#endif
}
void PlatformContextSkia::setupShader(SkPaint* paint, Gradient* grad, Pattern* pat, SkColor color) const
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 9da1fbaaf..8bc5f32e7 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -203,6 +203,11 @@ public:
void adjustTextRenderMode(SkPaint*);
bool couldUseLCDRenderedText();
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+ void setHintingScaleFactor(SkScalar factor) { m_hintingScaleFactor = factor; }
+ SkScalar hintingScaleFactor() const { return m_hintingScaleFactor; }
+#endif
+
private:
// Used when restoring and the state has an image clip. Only shows the pixels in
// m_canvas that are also in imageBuffer.
@@ -234,6 +239,9 @@ private:
bool m_accelerated;
bool m_deferred;
bool m_drawingToImageBuffer;
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+ SkScalar m_hintingScaleFactor;
+#endif
};
}
diff --git a/Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm b/Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm
index 4290f0447..efc43e51f 100644
--- a/Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm
+++ b/Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm
@@ -29,6 +29,7 @@
#include "config.h"
#include "FontPlatformData.h"
+#include <wtf/MathExtras.h>
#include <wx/defs.h>
#include <wx/font.h>
#include <wx/fontutil.h>
@@ -41,12 +42,7 @@
#if !wxCHECK_VERSION(2,9,0) || !wxOSX_USE_COCOA
-static inline double DegToRad(double deg)
-{
- return (deg * M_PI) / 180.0;
-}
-
-static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, tan(DegToRad(11)), 1, 0, 0 };
+static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, tan(deg2rad(11)), 1, 0, 0 };
NSFont* OSXCreateNSFont(const wxNativeFontInfo* info)
{
diff --git a/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp b/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp
index 1572a59b4..0d7bdba43 100644
--- a/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp
+++ b/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp
@@ -44,7 +44,8 @@ PassOwnPtr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(const
}
RedirectedXCompositeWindow::RedirectedXCompositeWindow(const IntSize& size)
- : m_window(0)
+ : m_usableSize(size)
+ , m_window(0)
, m_parentWindow(0)
, m_pixmap(0)
, m_surface(0)
@@ -91,7 +92,6 @@ RedirectedXCompositeWindow::RedirectedXCompositeWindow(const IntSize& size)
XCompositeRedirectWindow(display, m_window, CompositeRedirectManual);
resize(size);
- resizeLater(); // Force update of the usable area.
}
RedirectedXCompositeWindow::~RedirectedXCompositeWindow()
@@ -137,6 +137,8 @@ void RedirectedXCompositeWindow::resize(const IntSize& size)
Display* display = GLContextGLX::sharedDisplay();
XResizeWindow(display, m_window, size.width(), size.height());
+
+ XFlush(display);
glXWaitX();
// This swap is based on code in Chromium. It tries to work-around a bug in the Intel drivers
diff --git a/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h b/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h
index d6cd74723..e5db0fa7e 100644
--- a/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h
+++ b/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h
@@ -49,6 +49,7 @@ public:
void resize(const IntSize& newSize);
GLContext* context();
cairo_surface_t* cairoSurfaceForWidget(GtkWidget*);
+ Window windowId() { return m_window; }
private:
RedirectedXCompositeWindow(const IntSize&);
diff --git a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm
index 0f4440723..0568146e6 100644
--- a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm
+++ b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm
@@ -27,6 +27,7 @@
#include "config.h"
#include "NSScrollerImpDetails.h"
+#include "Settings.h"
namespace WebCore {
@@ -47,6 +48,8 @@ bool isScrollbarOverlayAPIAvailable()
#endif
NSScrollerStyle recommendedScrollerStyle() {
+ if (Settings::usesOverlayScrollbars())
+ return NSScrollerStyleOverlay;
if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)])
return [NSScroller preferredScrollerStyle];
return NSScrollerStyleLegacy;
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
index a0fe1b51c..24e4462e9 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
@@ -956,6 +956,9 @@ bool ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting(Scrollbar* scroll
if (!isScrollbarOverlayAPIAvailable())
return true;
+ if (scrollbar->isAlphaLocked())
+ return true;
+
// Overlay scrollbars should participate in hit testing whenever they are at all visible.
ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
if (!painter)
diff --git a/Source/WebCore/platform/mac/WebWindowAnimation.mm b/Source/WebCore/platform/mac/WebWindowAnimation.mm
index b068965e2..f89f0e33e 100644
--- a/Source/WebCore/platform/mac/WebWindowAnimation.mm
+++ b/Source/WebCore/platform/mac/WebWindowAnimation.mm
@@ -30,6 +30,7 @@
#import "FloatConversion.h"
#import "WebCoreSystemInterface.h"
#import <wtf/Assertions.h>
+#import <wtf/MathExtras.h>
#import <wtf/UnusedParam.h>
using namespace WebCore;
@@ -101,7 +102,7 @@ static CGFloat squaredDistance(NSPoint point1, NSPoint point2)
- (float)currentValue
{
- return narrowPrecisionToFloat(0.5 - 0.5 * cos(M_PI * (1 - [self currentProgress])));
+ return narrowPrecisionToFloat(0.5 - 0.5 * cos(piDouble * (1 - [self currentProgress])));
}
- (NSRect)currentFrame
diff --git a/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp b/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp
index 0d3ec69e9..f60c6c212 100644
--- a/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp
+++ b/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp
@@ -253,6 +253,32 @@ bool CredentialBackingStore::hasLogin(const KURL& url, const ProtectionSpace& pr
return false;
}
+ProtectionSpace CredentialBackingStore::getProtectionSpace(const KURL& url)
+{
+ ASSERT(m_database.isOpen());
+ ASSERT(m_database.tableExists("logins"));
+
+ if (!m_getLoginByURLStatement)
+ return ProtectionSpace();
+
+ m_getLoginByURLStatement->bindText(1, url.string());
+
+ int result = m_getLoginByURLStatement->step();
+ String username = m_getLoginByURLStatement->getColumnText(0);
+ String password = m_usingCertManager ? "" : m_getLoginByURLStatement->getColumnBlobAsString(1);
+ String host = m_getLoginByURLStatement->getColumnText(2);
+ int port = m_getLoginByURLStatement->getColumnInt(3);
+ int serviceType = m_getLoginByURLStatement->getColumnInt(4);
+ String realm = m_getLoginByURLStatement->getColumnText(5);
+ int authenticationScheme = m_getLoginByURLStatement->getColumnInt(6);
+ m_getLoginByURLStatement->reset();
+ HANDLE_SQL_EXEC_FAILURE(result != SQLResultRow, ProtectionSpace(),
+ "Failed to execute select login info from table logins in getLoginByURL - %i", result);
+
+ return ProtectionSpace (host, port, static_cast<ProtectionSpaceServerType>(serviceType),
+ realm, static_cast<ProtectionSpaceAuthenticationScheme>(authenticationScheme));
+}
+
Credential CredentialBackingStore::getLogin(const ProtectionSpace& protectionSpace)
{
ASSERT(m_database.isOpen());
diff --git a/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h b/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h
index 471a06971..cc5392480 100644
--- a/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h
+++ b/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h
@@ -44,6 +44,7 @@ public:
bool addLogin(const KURL&, const ProtectionSpace&, const Credential&);
bool updateLogin(const KURL&, const ProtectionSpace&, const Credential&);
bool hasLogin(const KURL&, const ProtectionSpace&);
+ ProtectionSpace getProtectionSpace(const KURL&);
Credential getLogin(const ProtectionSpace&);
Credential getLogin(const KURL&);
bool removeLogin(const KURL&, const ProtectionSpace&);
diff --git a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
index f29abcfb2..98ebe6059 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
@@ -294,9 +294,10 @@ void NetworkJob::notifyAuthReceived(BlackBerry::Platform::NetworkRequest::AuthTy
}
storeCredentials();
return;
- } else if (serverType != ProtectionSpaceProxyHTTP)
- // If a wifi proxy auth failed, there is no point of trying anymore because the credentials are wrong.
+ } else {
+ purgeCredentials();
m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
+ }
}
void NetworkJob::notifyStringHeaderReceived(const String& key, const String& value)
diff --git a/Source/WebCore/platform/network/blackberry/NetworkManager.cpp b/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
index 531af3155..5d036b501 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
@@ -20,12 +20,18 @@
#include "NetworkManager.h"
#include "Chrome.h"
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+#include "CredentialBackingStore.h"
+#endif
#include "CredentialStorage.h"
#include "Frame.h"
#include "FrameLoaderClientBlackBerry.h"
#include "NetworkJob.h"
#include "Page.h"
#include "ReadOnlyLatin1String.h"
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+#include "ResourceHandleClient.h"
+#endif
#include "ResourceHandleInternal.h"
#include "ResourceRequest.h"
#include "SecurityOrigin.h"
@@ -129,6 +135,14 @@ bool NetworkManager::startJob(int playerId, const String& pageGroupName, PassRef
// For URLs that match the paths of those previously challenged for HTTP Basic authentication,
// try and reuse the credential preemptively, as allowed by RFC 2617.
Credential credential = CredentialStorage::get(url);
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+ // FIXME: needs to refactor the credentialBackingStore to get credential and protection space at one time.
+ if (credential.isEmpty() && guardJob->client()->shouldUseCredentialStorage(guardJob.get())) {
+ credential = credentialBackingStore().getLogin(url);
+ if (!credential.isEmpty())
+ CredentialStorage::set(credential, credentialBackingStore().getProtectionSpace(url), url);
+ }
+#endif
if (!credential.isEmpty())
platformRequest.setCredentials(credential.user().utf8().data(), credential.password().utf8().data(), BlackBerry::Platform::NetworkRequest::AuthHTTPBasic);
}
diff --git a/Source/WebCore/platform/win/BString.cpp b/Source/WebCore/platform/win/BString.cpp
index d13f01ce7..3c4d2e796 100644
--- a/Source/WebCore/platform/win/BString.cpp
+++ b/Source/WebCore/platform/win/BString.cpp
@@ -106,7 +106,7 @@ BString::BString(CFStringRef cfstr)
BString::~BString()
{
- SysFreeString(m_bstr);
+ clear();
}
BString::BString(const BString& other)
@@ -119,11 +119,15 @@ BString::BString(const BString& other)
void BString::adoptBSTR(BSTR bstr)
{
- if (m_bstr)
- SysFreeString(m_bstr);
+ clear();
m_bstr = bstr;
}
+void BString::clear()
+{
+ SysFreeString(m_bstr);
+}
+
BString& BString::operator=(const BString& other)
{
if (this != &other)
diff --git a/Source/WebCore/platform/win/BString.h b/Source/WebCore/platform/win/BString.h
index 7373eedad..dc1c27d8c 100644
--- a/Source/WebCore/platform/win/BString.h
+++ b/Source/WebCore/platform/win/BString.h
@@ -52,11 +52,13 @@ namespace WebCore {
~BString();
void adoptBSTR(BSTR);
+ void clear();
BString(const BString&);
BString& operator=(const BString&);
BString& operator=(const BSTR&);
+ BSTR* operator&() { ASSERT(!m_bstr); return &m_bstr; }
operator BSTR() const { return m_bstr; }
BSTR release() { BSTR result = m_bstr; m_bstr = 0; return result; }
diff --git a/Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp b/Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp
index b5276d652..34cee23a4 100644
--- a/Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp
+++ b/Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp
@@ -29,7 +29,7 @@
#include "GlyphBuffer.h"
#include "GraphicsContext.h"
#include "SimpleFontData.h"
-
+#include <wtf/MathExtras.h>
#include <wx/defs.h>
#if 1 // !wxUSE_CAIRO
@@ -45,7 +45,7 @@ using namespace std;
// constants
//-----------------------------------------------------------------------------
-const double RAD2DEG = 180.0 / M_PI;
+const double RAD2DEG = 180.0 / piDouble;
//-----------------------------------------------------------------------------
// Local functions
@@ -54,8 +54,8 @@ const double RAD2DEG = 180.0 / M_PI;
static inline double dmin(double a, double b) { return a < b ? a : b; }
static inline double dmax(double a, double b) { return a > b ? a : b; }
-static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
-static inline double RadToDeg(double deg) { return (deg * 180.0) / M_PI; }
+static inline double DegToRad(double deg) { return deg2rad(deg); }
+static inline double RadToDeg(double rad) { return rad2deg(rad); }
#include "wx/msw/private.h"
diff --git a/Source/WebCore/plugins/win/PluginViewWin.cpp b/Source/WebCore/plugins/win/PluginViewWin.cpp
index 05ff30ba4..bd14cd948 100644
--- a/Source/WebCore/plugins/win/PluginViewWin.cpp
+++ b/Source/WebCore/plugins/win/PluginViewWin.cpp
@@ -640,9 +640,9 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
ASSERT(parent()->isFrameView());
- // In the GTK port we draw in an offscreen buffer and don't want to use the window
+ // In the GTK and Qt ports we draw in an offscreen buffer and don't want to use the window
// coordinates.
-#if PLATFORM(GTK)
+#if PLATFORM(GTK) || PLATFORM(QT)
IntRect rectInWindow(rect);
rectInWindow.intersect(frameRect());
#else
@@ -831,9 +831,9 @@ void PluginView::setNPWindowRect(const IntRect& rect)
m_npWindow.clipRect.right = r.width();
m_npWindow.clipRect.bottom = r.height();
#else
- // In the GTK port we draw in an offscreen buffer and don't want to use the window
+ // In the GTK and Qt ports we draw in an offscreen buffer and don't want to use the window
// coordinates.
-# if PLATFORM(GTK)
+# if PLATFORM(GTK) || PLATFORM(QT)
IntPoint p = rect.location();
# else
IntPoint p = static_cast<FrameView*>(parent())->contentsToWindow(rect.location());
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 40dfe1539..8b580e112 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -543,6 +543,8 @@ public:
return 0;
}
+ bool hasSameDirectionAs(const RenderBox* object) const { return style()->direction() == object->style()->direction(); }
+
protected:
virtual void willBeDestroyed();
diff --git a/Source/WebCore/rendering/RenderButton.cpp b/Source/WebCore/rendering/RenderButton.cpp
index 7103e6e50..c59c82216 100644
--- a/Source/WebCore/rendering/RenderButton.cpp
+++ b/Source/WebCore/rendering/RenderButton.cpp
@@ -35,7 +35,6 @@ using namespace HTMLNames;
RenderButton::RenderButton(Node* node)
: RenderDeprecatedFlexibleBox(node)
- , m_buttonText(0)
, m_inner(0)
, m_default(false)
{
@@ -83,8 +82,6 @@ void RenderButton::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
{
RenderBlock::styleDidChange(diff, oldStyle);
- if (m_buttonText)
- m_buttonText->setStyle(style());
if (m_inner) // RenderBlock handled updating the anonymous block's style.
setupInnerStyle(m_inner->style());
@@ -108,39 +105,6 @@ void RenderButton::setupInnerStyle(RenderStyle* innerStyle)
innerStyle->setBoxOrient(style()->boxOrient());
}
-void RenderButton::updateFromElement()
-{
- // If we're an input element, we may need to change our button text.
- if (node()->hasTagName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
- String value = input->valueWithDefault();
- setText(value);
- }
-}
-
-void RenderButton::setText(const String& str)
-{
- if (str.isEmpty()) {
- if (m_buttonText) {
- m_buttonText->destroy();
- m_buttonText = 0;
- }
- } else {
- if (m_buttonText)
- m_buttonText->setText(str.impl());
- else {
- m_buttonText = new (renderArena()) RenderTextFragment(document(), str.impl());
- m_buttonText->setStyle(style());
- addChild(m_buttonText);
- }
- }
-}
-
-String RenderButton::text() const
-{
- return m_buttonText ? m_buttonText->text() : 0;
-}
-
bool RenderButton::canHaveGeneratedChildren() const
{
// Input elements can't have generated children, but button elements can. We'll
diff --git a/Source/WebCore/rendering/RenderButton.h b/Source/WebCore/rendering/RenderButton.h
index 5be62b012..9dde45392 100644
--- a/Source/WebCore/rendering/RenderButton.h
+++ b/Source/WebCore/rendering/RenderButton.h
@@ -48,7 +48,6 @@ public:
virtual bool createsAnonymousWrapper() const { return true; }
void setupInnerStyle(RenderStyle*);
- virtual void updateFromElement();
virtual void updateBeforeAfterContent(PseudoId);
@@ -56,9 +55,6 @@ public:
virtual bool hasControlClip() const { return true; }
virtual LayoutRect controlClipRect(const LayoutPoint&) const;
- void setText(const String&);
- String text() const;
-
private:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
@@ -69,9 +65,7 @@ private:
void timerFired(Timer<RenderButton>*);
- RenderTextFragment* m_buttonText;
RenderBlock* m_inner;
-
OwnPtr<Timer<RenderButton> > m_timer;
bool m_default;
};
diff --git a/Source/WebCore/rendering/RenderIFrame.cpp b/Source/WebCore/rendering/RenderIFrame.cpp
index c45e8059a..6649d5610 100644
--- a/Source/WebCore/rendering/RenderIFrame.cpp
+++ b/Source/WebCore/rendering/RenderIFrame.cpp
@@ -43,46 +43,6 @@ RenderIFrame::RenderIFrame(Element* element)
{
}
-void RenderIFrame::updateLogicalHeight()
-{
- RenderPart::updateLogicalHeight();
- if (!flattenFrame())
- return;
-
- HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
- bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;
-
- if (isScrollable || !style()->height().isFixed()) {
- FrameView* view = static_cast<FrameView*>(widget());
- if (!view)
- return;
- int border = borderTop() + borderBottom();
- setHeight(max<LayoutUnit>(height(), view->contentsHeight() + border));
- }
-}
-
-void RenderIFrame::updateLogicalWidth()
-{
- // When we're seamless, we behave like a block. Thankfully RenderBox has all the right logic for this.
- if (isSeamless())
- return RenderBox::updateLogicalWidth();
-
- RenderPart::updateLogicalWidth();
- if (!flattenFrame())
- return;
-
- HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
- bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;
-
- if (isScrollable || !style()->width().isFixed()) {
- FrameView* view = static_cast<FrameView*>(widget());
- if (!view)
- return;
- LayoutUnit border = borderLeft() + borderRight();
- setWidth(max<LayoutUnit>(width(), view->contentsWidth() + border));
- }
-}
-
bool RenderIFrame::shouldComputeSizeAsReplaced() const
{
// When we're seamless, we use normal block/box sizing code except when inline.
@@ -189,19 +149,16 @@ void RenderIFrame::layout()
{
ASSERT(needsLayout());
- if (flattenFrame()) {
- RenderPart::updateLogicalWidth();
- RenderPart::updateLogicalHeight();
- layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed());
- // FIXME: Is early return really OK here? What about transform/overflow code below?
- return;
- } else if (isSeamless()) {
+ if (isSeamless()) {
layoutSeamlessly();
// Do not return so as to share the layer and overflow updates below.
} else {
updateLogicalWidth();
// No kids to layout as a replaced element.
updateLogicalHeight();
+
+ if (flattenFrame())
+ layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed());
}
m_overflow.clear();
diff --git a/Source/WebCore/rendering/RenderIFrame.h b/Source/WebCore/rendering/RenderIFrame.h
index 69e438213..74163eb79 100644
--- a/Source/WebCore/rendering/RenderIFrame.h
+++ b/Source/WebCore/rendering/RenderIFrame.h
@@ -40,9 +40,6 @@ public:
bool isSeamless() const;
private:
- virtual void updateLogicalWidth() OVERRIDE;
- virtual void updateLogicalHeight() OVERRIDE;
-
virtual LayoutUnit minPreferredLogicalWidth() const OVERRIDE;
virtual LayoutUnit maxPreferredLogicalWidth() const OVERRIDE;
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 9b247306a..be0046611 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -1316,7 +1316,7 @@ RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject*
const BorderValue& RenderTable::tableStartBorderAdjoiningCell(const RenderTableCell* cell) const
{
ASSERT(cell->isFirstOrLastCellInRow());
- if (cell->section()->hasSameDirectionAsTable())
+ if (hasSameDirectionAs(cell->section()))
return style()->borderStart();
return style()->borderEnd();
@@ -1325,7 +1325,7 @@ const BorderValue& RenderTable::tableStartBorderAdjoiningCell(const RenderTableC
const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCell* cell) const
{
ASSERT(cell->isFirstOrLastCellInRow());
- if (cell->section()->hasSameDirectionAsTable())
+ if (hasSameDirectionAs(cell->section()))
return style()->borderEnd();
return style()->borderStart();
diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h
index 2e9ce21fa..5878017db 100644
--- a/Source/WebCore/rendering/RenderTable.h
+++ b/Source/WebCore/rendering/RenderTable.h
@@ -47,6 +47,8 @@ public:
int getColumnPos(unsigned col) const { return m_columnPos[col]; }
+ // Per CSS 3 writing-mode: "The first and second values of the 'border-spacing' property represent spacing between columns
+ // and rows respectively, not necessarily the horizontal and vertical spacing respectively".
int hBorderSpacing() const { return m_hSpacing; }
int vBorderSpacing() const { return m_vSpacing; }
@@ -178,10 +180,19 @@ public:
return c;
}
+ LayoutUnit borderSpacingInRowDirection() const
+ {
+ if (unsigned effectiveColumnCount = numEffCols())
+ return static_cast<LayoutUnit>(effectiveColumnCount + 1) * hBorderSpacing();
+
+ return ZERO_LAYOUT_UNIT;
+ }
+
LayoutUnit bordersPaddingAndSpacingInRowDirection() const
{
+ // 'border-spacing' only applies to separate borders (see 17.6.1 The separated borders model).
return borderStart() + borderEnd() +
- (collapseBorders() ? ZERO_LAYOUT_UNIT : (paddingStart() + paddingEnd() + static_cast<LayoutUnit>(numEffCols() + 1) * hBorderSpacing()));
+ (collapseBorders() ? ZERO_LAYOUT_UNIT : (paddingStart() + paddingEnd() + borderSpacingInRowDirection()));
}
// Return the first column or column-group.
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index e49ac10af..8e0cd6ef2 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -422,18 +422,18 @@ CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderC
// (2) The end border of the preceding cell.
if (RenderTableCell* prevCell = table->cellBefore(this)) {
- CollapsedBorderValue prevCellBorder = CollapsedBorderValue(prevCell->style()->borderEnd(), includeColor ? prevCell->style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
+ CollapsedBorderValue prevCellBorder = CollapsedBorderValue(prevCell->borderAdjoiningCellAfter(this), includeColor ? prevCell->style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
result = chooseBorder(prevCellBorder, result);
if (!result.exists())
return result;
} else if (isStartColumn) {
// (3) Our row's start border.
- result = chooseBorder(result, CollapsedBorderValue(parent()->style()->borderStart(), includeColor ? parent()->style()->visitedDependentColor(startColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningStartCell(this), includeColor ? parent()->style()->visitedDependentColor(startColorProperty) : Color(), BROW));
if (!result.exists())
return result;
-
+
// (4) Our row group's start border.
- result = chooseBorder(result, CollapsedBorderValue(section()->style()->borderStart(), includeColor ? section()->style()->visitedDependentColor(startColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningStartCell(this), includeColor ? section()->style()->visitedDependentColor(startColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
}
@@ -443,11 +443,11 @@ CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderC
bool endColEdge;
RenderTableCol* colElt = table->colElement(col(), &startColEdge, &endColEdge);
if (colElt && startColEdge) {
- result = chooseBorder(result, CollapsedBorderValue(colElt->style()->borderStart(), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellStartBorder(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentBefore()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style()->borderStart(), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellStartBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -457,7 +457,7 @@ CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderC
if (!isStartColumn) {
colElt = table->colElement(col() -1, &startColEdge, &endColEdge);
if (colElt && endColEdge) {
- CollapsedBorderValue endBorder = CollapsedBorderValue(colElt->style()->borderEnd(), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL);
+ CollapsedBorderValue endBorder = CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL);
result = chooseBorder(endBorder, result);
if (!result.exists())
return result;
@@ -495,19 +495,19 @@ CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderCol
if (!isEndColumn) {
RenderTableCell* nextCell = table->cellAfter(this);
if (nextCell && nextCell->style()) {
- CollapsedBorderValue startBorder = CollapsedBorderValue(nextCell->style()->borderStart(), includeColor ? nextCell->style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
+ CollapsedBorderValue startBorder = CollapsedBorderValue(nextCell->borderAdjoiningCellBefore(this), includeColor ? nextCell->style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
result = chooseBorder(result, startBorder);
if (!result.exists())
return result;
}
} else {
// (3) Our row's end border.
- result = chooseBorder(result, CollapsedBorderValue(parent()->style()->borderEnd(), includeColor ? parent()->style()->visitedDependentColor(endColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningEndCell(this), includeColor ? parent()->style()->visitedDependentColor(endColorProperty) : Color(), BROW));
if (!result.exists())
return result;
// (4) Our row group's end border.
- result = chooseBorder(result, CollapsedBorderValue(section()->style()->borderEnd(), includeColor ? section()->style()->visitedDependentColor(endColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningEndCell(this), includeColor ? section()->style()->visitedDependentColor(endColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
}
@@ -517,11 +517,11 @@ CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderCol
bool endColEdge;
RenderTableCol* colElt = table->colElement(col() + colSpan() - 1, &startColEdge, &endColEdge);
if (colElt && endColEdge) {
- result = chooseBorder(result, CollapsedBorderValue(colElt->style()->borderEnd(), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellEndBorder(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentAfter()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style()->borderEnd(), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellEndBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -531,7 +531,7 @@ CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderCol
if (!isEndColumn) {
colElt = table->colElement(col() + colSpan(), &startColEdge, &endColEdge);
if (colElt && startColEdge) {
- CollapsedBorderValue startBorder = CollapsedBorderValue(colElt->style()->borderStart(), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL);
+ CollapsedBorderValue startBorder = CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL);
result = chooseBorder(result, startBorder);
if (!result.exists())
return result;
diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h
index f0cb33e51..713f2c0aa 100644
--- a/Source/WebCore/rendering/RenderTableCell.h
+++ b/Source/WebCore/rendering/RenderTableCell.h
@@ -144,7 +144,7 @@ public:
const BorderValue& borderAdjoiningTableStart() const
{
ASSERT(isFirstOrLastCellInRow());
- if (section()->hasSameDirectionAsTable())
+ if (section()->hasSameDirectionAs(table()))
return style()->borderStart();
return style()->borderEnd();
@@ -153,12 +153,26 @@ public:
const BorderValue& borderAdjoiningTableEnd() const
{
ASSERT(isFirstOrLastCellInRow());
- if (section()->hasSameDirectionAsTable())
+ if (section()->hasSameDirectionAs(table()))
return style()->borderEnd();
return style()->borderStart();
}
+ const BorderValue& borderAdjoiningCellBefore(const RenderTableCell* cell)
+ {
+ ASSERT_UNUSED(cell, table()->cellAfter(cell) == this);
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderStart();
+ }
+
+ const BorderValue& borderAdjoiningCellAfter(const RenderTableCell* cell)
+ {
+ ASSERT_UNUSED(cell, table()->cellBefore(cell) == this);
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderEnd();
+ }
+
#ifndef NDEBUG
bool isFirstOrLastCellInRow() const
{
diff --git a/Source/WebCore/rendering/RenderTableCol.cpp b/Source/WebCore/rendering/RenderTableCol.cpp
index 7c5e9ed10..baf191431 100644
--- a/Source/WebCore/rendering/RenderTableCol.cpp
+++ b/Source/WebCore/rendering/RenderTableCol.cpp
@@ -30,6 +30,7 @@
#include "HTMLNames.h"
#include "HTMLTableColElement.h"
#include "RenderTable.h"
+#include "RenderTableCell.h"
namespace WebCore {
@@ -162,4 +163,26 @@ RenderTableCol* RenderTableCol::nextColumn() const
return toRenderTableCol(next);
}
+const BorderValue& RenderTableCol::borderAdjoiningCellStartBorder(const RenderTableCell*) const
+{
+ return style()->borderStart();
+}
+
+const BorderValue& RenderTableCol::borderAdjoiningCellEndBorder(const RenderTableCell*) const
+{
+ return style()->borderEnd();
+}
+
+const BorderValue& RenderTableCol::borderAdjoiningCellBefore(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, table()->colElement(cell->col() + cell->colSpan()) == this);
+ return style()->borderStart();
+}
+
+const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this);
+ return style()->borderEnd();
+}
+
}
diff --git a/Source/WebCore/rendering/RenderTableCol.h b/Source/WebCore/rendering/RenderTableCol.h
index 887afd6c8..61f8fa346 100644
--- a/Source/WebCore/rendering/RenderTableCol.h
+++ b/Source/WebCore/rendering/RenderTableCol.h
@@ -31,6 +31,7 @@
namespace WebCore {
class RenderTable;
+class RenderTableCell;
class RenderTableCol : public RenderBox {
public:
@@ -67,6 +68,11 @@ public:
// Returns the next column or column-group.
RenderTableCol* nextColumn() const;
+ const BorderValue& borderAdjoiningCellStartBorder(const RenderTableCell*) const;
+ const BorderValue& borderAdjoiningCellEndBorder(const RenderTableCell*) const;
+ const BorderValue& borderAdjoiningCellBefore(const RenderTableCell*) const;
+ const BorderValue& borderAdjoiningCellAfter(const RenderTableCell*) const;
+
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp
index 2b83faa5a..1f2bd0689 100644
--- a/Source/WebCore/rendering/RenderTableRow.cpp
+++ b/Source/WebCore/rendering/RenderTableRow.cpp
@@ -82,6 +82,20 @@ void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* old
}
}
+const BorderValue& RenderTableRow::borderAdjoiningStartCell(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, !table()->cellBefore(cell));
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderStart();
+}
+
+const BorderValue& RenderTableRow::borderAdjoiningEndCell(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, !table()->cellAfter(cell));
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderEnd();
+}
+
void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
diff --git a/Source/WebCore/rendering/RenderTableRow.h b/Source/WebCore/rendering/RenderTableRow.h
index 0136c58a2..12f833baf 100644
--- a/Source/WebCore/rendering/RenderTableRow.h
+++ b/Source/WebCore/rendering/RenderTableRow.h
@@ -68,7 +68,7 @@ public:
const BorderValue& borderAdjoiningTableStart() const
{
- if (section()->hasSameDirectionAsTable())
+ if (section()->hasSameDirectionAs(table()))
return style()->borderStart();
return style()->borderEnd();
@@ -76,12 +76,15 @@ public:
const BorderValue& borderAdjoiningTableEnd() const
{
- if (section()->hasSameDirectionAsTable())
+ if (section()->hasSameDirectionAs(table()))
return style()->borderEnd();
return style()->borderStart();
}
+ const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
+ const BorderValue& borderAdjoiningEndCell(const RenderTableCell*) const;
+
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 8f084779a..eb6948921 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -1317,15 +1317,29 @@ unsigned RenderTableSection::numColumns() const
return result + 1;
}
+const BorderValue& RenderTableSection::borderAdjoiningStartCell(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, !table()->cellBefore(cell));
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderStart();
+}
+
+const BorderValue& RenderTableSection::borderAdjoiningEndCell(const RenderTableCell* cell) const
+{
+ ASSERT_UNUSED(cell, !table()->cellAfter(cell));
+ // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
+ return style()->borderEnd();
+}
+
const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableStart() const
{
- unsigned adjoiningStartCellColumnIndex = hasSameDirectionAsTable() ? 0 : table()->lastColumnIndex();
+ unsigned adjoiningStartCellColumnIndex = hasSameDirectionAs(table()) ? 0 : table()->lastColumnIndex();
return cellAt(0, adjoiningStartCellColumnIndex).primaryCell();
}
const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableEnd() const
{
- unsigned adjoiningEndCellColumnIndex = hasSameDirectionAsTable() ? table()->lastColumnIndex() : 0;
+ unsigned adjoiningEndCellColumnIndex = hasSameDirectionAs(table()) ? table()->lastColumnIndex() : 0;
return cellAt(0, adjoiningEndCellColumnIndex).primaryCell();
}
diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h
index 7054938e9..ce21a9ef1 100644
--- a/Source/WebCore/rendering/RenderTableSection.h
+++ b/Source/WebCore/rendering/RenderTableSection.h
@@ -117,14 +117,9 @@ public:
Length logicalHeight;
};
- bool hasSameDirectionAsTable() const
- {
- return table()->style()->direction() == style()->direction();
- }
-
const BorderValue& borderAdjoiningTableStart() const
{
- if (hasSameDirectionAsTable())
+ if (hasSameDirectionAs(table()))
return style()->borderStart();
return style()->borderEnd();
@@ -132,12 +127,15 @@ public:
const BorderValue& borderAdjoiningTableEnd() const
{
- if (hasSameDirectionAsTable())
+ if (hasSameDirectionAs(table()))
return style()->borderEnd();
return style()->borderStart();
}
+ const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
+ const BorderValue& borderAdjoiningEndCell(const RenderTableCell*) const;
+
const RenderTableCell* firstRowCellAdjoiningTableStart() const;
const RenderTableCell* firstRowCellAdjoiningTableEnd() const;
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index 7edad3b06..7761fc1e1 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -966,7 +966,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
// Non-zero only when kerning is enabled, in which case we measure words with their trailing
// space, then subtract its width.
- float wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(RenderBlock::constructTextRun(this, f, &space, 1, styleToUse)) : 0;
+ float wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(RenderBlock::constructTextRun(this, f, &space, 1, styleToUse)) + wordSpacing : 0;
// If automatic hyphenation is allowed, we keep track of the width of the widest word (or word
// fragment) encountered so far, and only try hyphenating words that are wider.
diff --git a/Source/WebCore/rendering/TextAutosizer.cpp b/Source/WebCore/rendering/TextAutosizer.cpp
index 598bbd7df..c4503a13b 100644
--- a/Source/WebCore/rendering/TextAutosizer.cpp
+++ b/Source/WebCore/rendering/TextAutosizer.cpp
@@ -86,8 +86,13 @@ static bool contentHeightIsConstrained(const RenderBox* box)
RenderStyle* style = container->style();
if (style->overflowY() >= OSCROLL)
return false;
- if (style->height().isSpecified() || style->maxHeight().isSpecified())
- return true;
+ if (style->height().isSpecified() || style->maxHeight().isSpecified()) {
+ // Some sites (e.g. wikipedia) set their html and/or body elements to height:100%,
+ // without intending to constrain the height of the content within them.
+ return !container->isRoot() && !container->isBody();
+ }
+ if (container->isFloatingOrOutOfFlowPositioned())
+ return false;
}
return false;
}
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.cpp b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
index edb45cd4b..d74019d1c 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -223,6 +223,9 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
return StyleDifferenceRepaint;
+ if (svg_noninherited_flags.f.maskType != other->svg_noninherited_flags.f.maskType)
+ return StyleDifferenceRepaint;
+
return StyleDifferenceEqual;
}
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.h b/Source/WebCore/rendering/style/SVGRenderStyle.h
index e8984c048..be0a479bc 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.h
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.h
@@ -92,6 +92,7 @@ public:
static String initialMarkerStartResource() { return String(); }
static String initialMarkerMidResource() { return String(); }
static String initialMarkerEndResource() { return String(); }
+ static EMaskType initialMaskType() { return MT_LUMINANCE; }
static SVGLength initialBaselineShiftValue()
{
@@ -146,7 +147,8 @@ public:
void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; }
void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; }
void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; }
-
+ void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
+
void setFillOpacity(float obj)
{
if (!(fill->opacity == obj))
@@ -348,7 +350,8 @@ public:
String markerStartResource() const { return inheritedResources->markerStart; }
String markerMidResource() const { return inheritedResources->markerMid; }
String markerEndResource() const { return inheritedResources->markerEnd; }
-
+ EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.maskType; }
+
const SVGPaint::SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedLinkPaintType; }
const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPaintColor; }
const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPaintUri; }
@@ -416,7 +419,8 @@ protected:
unsigned _dominantBaseline : 4; // EDominantBaseline
unsigned _baselineShift : 2; // EBaselineShift
unsigned _vectorEffect: 1; // EVectorEffect
- // 21 bits unused
+ unsigned maskType: 1; // EMaskType
+ // 20 bits unused
} f;
uint32_t _niflags;
};
@@ -461,6 +465,7 @@ private:
svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline();
svg_noninherited_flags.f._baselineShift = initialBaselineShift();
svg_noninherited_flags.f._vectorEffect = initialVectorEffect();
+ svg_noninherited_flags.f.maskType = initialMaskType();
}
};
diff --git a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h b/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
index 931dbe3f9..e7308ca99 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
+++ b/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
@@ -83,6 +83,11 @@ namespace WebCore {
VE_NON_SCALING_STROKE
};
+ enum EMaskType {
+ MT_LUMINANCE,
+ MT_ALPHA
+ };
+
class CSSValue;
class CSSValueList;
class SVGPaint;
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
index e6eb6afc2..1f501a88b 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
@@ -153,8 +153,12 @@ bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, C
UNUSED_PARAM(colorSpace);
#endif
+ ASSERT(style());
+ ASSERT(style()->svgStyle());
// Create the luminance mask.
- maskerData->maskImage->convertToLuminanceMask();
+ if (style()->svgStyle()->maskType() == MT_LUMINANCE)
+ maskerData->maskImage->convertToLuminanceMask();
+
return true;
}
diff --git a/Source/WebCore/svg/SVGStyledElement.cpp b/Source/WebCore/svg/SVGStyledElement.cpp
index 34fbdfddf..c765dc623 100644
--- a/Source/WebCore/svg/SVGStyledElement.cpp
+++ b/Source/WebCore/svg/SVGStyledElement.cpp
@@ -181,6 +181,7 @@ CSSPropertyID SVGStyledElement::cssPropertyIdForSVGAttributeName(const Qualified
mapAttributeToCSSProperty(propertyNameToIdMap, marker_midAttr);
mapAttributeToCSSProperty(propertyNameToIdMap, marker_startAttr);
mapAttributeToCSSProperty(propertyNameToIdMap, maskAttr);
+ mapAttributeToCSSProperty(propertyNameToIdMap, mask_typeAttr);
mapAttributeToCSSProperty(propertyNameToIdMap, opacityAttr);
mapAttributeToCSSProperty(propertyNameToIdMap, overflowAttr);
mapAttributeToCSSProperty(propertyNameToIdMap, pointer_eventsAttr);
@@ -251,6 +252,7 @@ static inline AttributeToPropertyTypeMap& cssPropertyToTypeMap()
s_cssPropertyMap.set(marker_midAttr, AnimatedString);
s_cssPropertyMap.set(marker_startAttr, AnimatedString);
s_cssPropertyMap.set(maskAttr, AnimatedString);
+ s_cssPropertyMap.set(mask_typeAttr, AnimatedString);
s_cssPropertyMap.set(opacityAttr, AnimatedNumber);
s_cssPropertyMap.set(overflowAttr, AnimatedString);
s_cssPropertyMap.set(pointer_eventsAttr, AnimatedString);
diff --git a/Source/WebCore/svg/svgattrs.in b/Source/WebCore/svg/svgattrs.in
index c220b67b8..8fbb7bd22 100644
--- a/Source/WebCore/svg/svgattrs.in
+++ b/Source/WebCore/svg/svgattrs.in
@@ -115,6 +115,7 @@ markerHeight
markerUnits
markerWidth
mask
+mask-type
maskContentUnits
maskUnits
mathematical
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp
index e088fbce2..bd2376607 100755
--- a/Source/WebCore/testing/InternalSettings.cpp
+++ b/Source/WebCore/testing/InternalSettings.cpp
@@ -80,6 +80,7 @@ InternalSettings::Backup::Backup(Page* page, Settings* settings)
, m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled())
#endif
, m_originalEditingBehavior(settings->editingBehaviorType())
+ , m_originalUnifiedSpellCheckerEnabled(settings->unifiedTextCheckerEnabled())
, m_originalFixedPositionCreatesStackingContext(settings->fixedPositionCreatesStackingContext())
, m_originalSyncXHRInDocumentsEnabled(settings->syncXHRInDocumentsEnabled())
#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
@@ -99,7 +100,6 @@ InternalSettings::Backup::Backup(Page* page, Settings* settings)
, m_canStartMedia(page->canStartMedia())
, m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled())
, m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled())
- , m_imagesEnabled(settings->areImagesEnabled())
{
}
@@ -114,6 +114,7 @@ void InternalSettings::Backup::restoreTo(Page* page, Settings* settings)
RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAuthorShadowDOMForAnyElementEnabled);
#endif
settings->setEditingBehaviorType(m_originalEditingBehavior);
+ settings->setUnifiedTextCheckerEnabled(m_originalUnifiedSpellCheckerEnabled);
settings->setFixedPositionCreatesStackingContext(m_originalFixedPositionCreatesStackingContext);
settings->setSyncXHRInDocumentsEnabled(m_originalSyncXHRInDocumentsEnabled);
#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
@@ -134,7 +135,6 @@ void InternalSettings::Backup::restoreTo(Page* page, Settings* settings)
page->setCanStartMedia(m_canStartMedia);
settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
- settings->setImagesEnabled(m_imagesEnabled);
}
InternalSettings* InternalSettings::from(Page* page)
@@ -168,6 +168,7 @@ void InternalSettings::reset()
setUserPreferredLanguages(Vector<String>());
page()->setPagination(Pagination());
page()->setPageScaleFactor(1, IntPoint(0, 0));
+ setUsesOverlayScrollbars(false);
#if ENABLE(PAGE_POPUP)
m_pagePopupDriver.clear();
if (page()->chrome())
@@ -236,6 +237,11 @@ void InternalSettings::setMockScrollbarsEnabled(bool enabled, ExceptionCode& ec)
settings()->setMockScrollbarsEnabled(enabled);
}
+void InternalSettings::setUsesOverlayScrollbars(bool flag)
+{
+ settings()->setUsesOverlayScrollbars(flag);
+}
+
void InternalSettings::setPasswordEchoEnabled(bool enabled, ExceptionCode& ec)
{
InternalSettingsGuardForSettings();
@@ -653,10 +659,4 @@ void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled);
}
-void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
-{
- InternalSettingsGuardForSettings();
- settings()->setImagesEnabled(enabled);
-}
-
}
diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h
index 0f94fb25f..2c073df6e 100755
--- a/Source/WebCore/testing/InternalSettings.h
+++ b/Source/WebCore/testing/InternalSettings.h
@@ -62,6 +62,7 @@ public:
bool m_originalAuthorShadowDOMForAnyElementEnabled;
#endif
EditingBehaviorType m_originalEditingBehavior;
+ bool m_originalUnifiedSpellCheckerEnabled;
bool m_originalFixedPositionCreatesStackingContext;
bool m_originalSyncXHRInDocumentsEnabled;
#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
@@ -81,7 +82,6 @@ public:
bool m_canStartMedia;
bool m_originalMockScrollbarsEnabled;
bool m_langAttributeAwareFormControlUIEnabled;
- bool m_imagesEnabled;
};
typedef RefCountedSupplement<Page, InternalSettings> SuperType;
@@ -100,6 +100,7 @@ public:
void setAcceleratedDrawingEnabled(bool enabled, ExceptionCode&);
void setAcceleratedFiltersEnabled(bool enabled, ExceptionCode&);
void setMockScrollbarsEnabled(bool enabled, ExceptionCode&);
+ void setUsesOverlayScrollbars(bool);
void setPasswordEchoEnabled(bool enabled, ExceptionCode&);
void setPasswordEchoDurationInSeconds(double durationInSeconds, ExceptionCode&);
void setFixedElementsLayoutRelativeToFrame(bool, ExceptionCode&);
@@ -146,8 +147,6 @@ public:
void setMemoryInfoEnabled(bool, ExceptionCode&);
void setStorageBlockingPolicy(const String&, ExceptionCode&);
void setLangAttributeAwareFormControlUIEnabled(bool);
- void setImagesEnabled(bool enabled, ExceptionCode&);
-
private:
explicit InternalSettings(Page*);
virtual void hostDestroyed() OVERRIDE { m_page = 0; }
diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl
index c7455fe16..9673d2f1c 100755
--- a/Source/WebCore/testing/InternalSettings.idl
+++ b/Source/WebCore/testing/InternalSettings.idl
@@ -34,6 +34,7 @@ module window {
void setAcceleratedDrawingEnabled(in boolean enabled) raises(DOMException);
void setAcceleratedFiltersEnabled(in boolean enabled) raises(DOMException);
void setMockScrollbarsEnabled(in boolean enabled) raises(DOMException);
+ void setUsesOverlayScrollbars(in boolean flag);
void setPasswordEchoEnabled(in boolean enabled) raises(DOMException);
void setPasswordEchoDurationInSeconds(in double durationInSeconds) raises(DOMException);
void setFixedElementsLayoutRelativeToFrame(in boolean enabled) raises(DOMException);
@@ -81,7 +82,6 @@ module window {
#endif
void setMemoryInfoEnabled(in boolean enabled) raises(DOMException);
void setStorageBlockingPolicy(in DOMString policy) raises(DOMException);
- void setImagesEnabled(in boolean enabled) raises(DOMException);
};
}
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp
index 7ad6ce859..5aacd73ea 100644
--- a/Source/WebKit/blackberry/Api/BackingStore.cpp
+++ b/Source/WebKit/blackberry/Api/BackingStore.cpp
@@ -360,6 +360,8 @@ void BackingStorePrivate::resumeScreenAndBackingStoreUpdates(BackingStore::Resum
--m_suspendScreenUpdates;
BlackBerry::Platform::userInterfaceThreadMessageClient()->syncToCurrentMessage();
+ if (op == BackingStore::None)
+ return;
#if USE(ACCELERATED_COMPOSITING)
// This will also blit since we set the OSDS flag above.
m_webPage->d->commitRootLayerIfNeeded();
@@ -531,6 +533,8 @@ void BackingStorePrivate::renderJob()
if (!shouldPerformRenderJobs())
return;
+ instrumentBeginFrame();
+
#if DEBUG_BACKINGSTORE
BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::renderJob");
#endif
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index 6b639bf46..b78bb93bd 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -2058,6 +2058,11 @@ bool WebPagePrivate::setViewMode(ViewMode mode)
return true; // Needs re-layout!
}
+int WebPagePrivate::playerID() const
+{
+ return m_client ? m_client->getInstanceId() : 0;
+}
+
void WebPagePrivate::setCursor(PlatformCursor handle)
{
if (m_currentCursor.type() != handle.type()) {
@@ -5668,6 +5673,8 @@ void WebPagePrivate::rootLayerCommitTimerFired(Timer<WebPagePrivate>*)
Platform::log(Platform::LogLevelCritical, "%s", WTF_PRETTY_FUNCTION);
#endif
+ m_backingStore->d->instrumentBeginFrame();
+
// The commit timer may have fired just before the layout timer, or for some
// other reason we need layout. It's not allowed to commit when a layout is
// pending, becaues a commit can cause parts of the web page to be rendered
diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h
index 15e1ab919..1c90dca6a 100644
--- a/Source/WebKit/blackberry/Api/WebPage_p.h
+++ b/Source/WebKit/blackberry/Api/WebPage_p.h
@@ -179,6 +179,7 @@ public:
WebCore::IntSize absoluteVisibleOverflowSize() const;
// Virtual functions inherited from PageClientBlackBerry.
+ virtual int playerID() const;
virtual void setCursor(WebCore::PlatformCursor);
virtual Platform::NetworkStreamFactory* networkStreamFactory();
virtual Platform::Graphics::Window* platformWindow() const;
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index 624acf7e3..63bc18276 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,187 @@
+2012-09-20 Peter Wang <peter.wang@torchmobile.com.cn>
+
+ [BlackBerry] To support "Frames View" of "TimeLine" panel in Inspector
+ https://bugs.webkit.org/show_bug.cgi?id=96077
+
+ Reviewed by Pavel Feldman.
+
+ A minor modification to make the inspecting results more accurate.
+ Internally reviewd by Arvid, Robin.C, and Konrad.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::renderJob):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):
+ * WebKitSupport/RenderQueue.cpp:
+ (BlackBerry::WebKit::RenderQueue::render):
+
+2012-09-19 Sean Wang <Xuewen.Wang@torchmobile.com.cn>
+
+ [BlackBerry] Basic authentication challenge credentials for stored credentials again after restarting browser
+ https://bugs.webkit.org/show_bug.cgi?id=96362
+
+ Reviewed by Rob Buis.
+
+ Make the FrameLoaderClient use credential storage according to the macro
+ BLACKBERRY_CREDENTIAL_PERSIST
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::shouldUseCredentialStorage):
+ (WebCore):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.h:
+ (FrameLoaderClientBlackBerry):
+
+2012-09-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] After zooming into an input field, zoom out when focus is lost.
+ https://bugs.webkit.org/show_bug.cgi?id=97128
+
+ Reviewed by Rob Buis.
+
+ When the page has automatically zoomed in for input
+ focus, unzoom it when input focus is lost or keyboard hidden.
+
+ Reviewed Internally by Gen Mak.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::InputHandler):
+ (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+
+2012-09-19 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Clean up the SpellingLog output
+ https://bugs.webkit.org/show_bug.cgi?id=97129
+
+ Reviewed by Rob Buis.
+
+ Internally reviewed by Mike Fenton.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestCancelled):
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+
+2012-09-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Add SpellingLog for spell checking options request.
+ https://bugs.webkit.org/show_bug.cgi?id=97125
+
+ Reviewed by Rob Buis.
+
+ Add spell checking log to indicate the calculated
+ text position for spell checking option requests.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
+
+2012-09-19 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] Add function playerId() in class PageClientBlackBerry
+ https://bugs.webkit.org/show_bug.cgi?id=97099
+
+ Reviewed by Yong Li.
+
+ Implemented PageClientBlackBerry::playerID() in class WebPagePrivate,
+ and replaced the implementation of FrameLoaderClientBlackBerry::playerId().
+
+ Internally reviewed by Charles Wei.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::playerID):
+ (WebKit):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::playerId):
+
+2012-09-19 Abbas Sherawala <asherawala@rim.com>
+
+ [BlackBerry] BackingStorePrivate::resumeScreenAndBackingStoreUpdates more atomic
+ Added a missing 'if' statement.
+ https://bugs.webkit.org/show_bug.cgi?id=96925
+
+ PR #180866
+
+ Internally Reviewed by Antonio Gomes.
+
+ Adding an 'if' statement which should have been in PR # 180866 (SHA:b9c06af395c22e)
+
+ Reviewed by Antonio Gomes.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::resumeScreenAndBackingStoreUpdates):
+
+2012-09-18 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Use didCancel and didSucceed instead of didCheckCancel and didCheckSucceed
+ https://bugs.webkit.org/show_bug.cgi?id=97033
+
+ Reviewed by Rob Buis.
+
+ Using these preferred public methods (the latter has a note to be made private) ensures that
+ the right SpellChecker object is being called during the callback in spellCheckingRequestProcessed
+ and spellCheckingRequestCancelled.
+
+ Internally reviewed by Mike Fenton.
+
+ By referencing the TextCheckingRequest object's methods, we don't need to keep track of the associated
+ SpellChecker for each request. Removing much of the code that was put in place incorrectly to achieve this.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::InputHandler):
+ (BlackBerry::WebKit::InputHandler::requestCheckingOfString):
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestCancelled):
+ (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+ (BlackBerry::WebKit::InputHandler::getSpellChecker):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+
+2012-09-18 Jessica Cao <jecao@rim.com>
+
+ [BlackBerry] Date picker isn't inputting after 'OK'
+ https://bugs.webkit.org/show_bug.cgi?id=97031
+
+ PR208052
+
+ Reviewed by Rob Buis
+
+ Checking for !values.contains("-1") will match valid strings like "2012-09-18". Use value != "-1" instead.
+
+ * WebCoreSupport/DatePickerClient.cpp:
+ (WebCore::DatePickerClient::setValueAndClosePopup):
+
+2012-09-18 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Popup page should reference the client with a weak pointer
+ https://bugs.webkit.org/show_bug.cgi?id=97028
+
+ Reviewed by Rob Buis.
+
+ RIM PR# 209847.
+ Internally reviewed by Mike Fenton.
+
+ Store the pointer in a ref-coutned shared object, and clear the pointer
+ when the client is going to be destroyed, so it won't be accessed by
+ the JS function afterwards.
+
+ * WebCoreSupport/PagePopupBlackBerry.cpp:
+ (WebCore::PagePopupBlackBerry::PagePopupBlackBerry):
+ (WebCore::PagePopupBlackBerry::~PagePopupBlackBerry):
+ (WebCore::PagePopupBlackBerry::init):
+ (WebCore::setValueAndClosePopupCallback):
+ (WebCore::popUpExtensionFinalize):
+ (WebCore::PagePopupBlackBerry::installDOMFunction):
+ (WebCore::PagePopupBlackBerry::closePopup):
+ * WebCoreSupport/PagePopupBlackBerry.h:
+ (PagePopupBlackBerry):
+ (SharedClientPointer):
+ (WebCore::PagePopupBlackBerry::SharedClientPointer::SharedClientPointer):
+ (WebCore::PagePopupBlackBerry::SharedClientPointer::clear):
+ (WebCore::PagePopupBlackBerry::SharedClientPointer::get):
+
2012-09-18 Arvid Nilsson <anilsson@rim.com>
[BlackBerry] Prevent scroll adjustment of input fields when region of interest mechanism active
diff --git a/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp b/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
index 50942ca73..439ebfbcf 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
@@ -123,7 +123,7 @@ void DatePickerClient::setValueAndClosePopup(int, const String& value)
// Return -1 if user cancel the selection.
ASSERT(m_element);
- if (!value.contains("-1"))
+ if (value != "-1")
m_element->setValue(value);
closePopup();
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index 8d1f64000..ab4c080bf 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -57,6 +57,9 @@
#include "ProgressTracker.h"
#include "ProtectionSpace.h"
#include "ScopePointer.h"
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+#include "Settings.h"
+#endif
#include "SharedBuffer.h"
#include "SkData.h"
#include "SkImageEncoder.h"
@@ -118,9 +121,7 @@ FrameLoaderClientBlackBerry::~FrameLoaderClientBlackBerry()
int FrameLoaderClientBlackBerry::playerId() const
{
- if (m_webPagePrivate && m_webPagePrivate->m_client)
- return m_webPagePrivate->m_client->getInstanceId();
- return 0;
+ return m_webPagePrivate ? m_webPagePrivate->playerID() : 0;
}
bool FrameLoaderClientBlackBerry::cookiesEnabled() const
@@ -1014,6 +1015,17 @@ void FrameLoaderClientBlackBerry::dispatchWillSendRequest(DocumentLoader* docLoa
}
}
+bool FrameLoaderClientBlackBerry::shouldUseCredentialStorage(DocumentLoader* loader, long unsigned identifier)
+{
+#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
+ if (m_frame->page()->settings()->privateBrowsingEnabled())
+ return false;
+ return true;
+#else
+ return false;
+#endif
+}
+
void FrameLoaderClientBlackBerry::loadIconExternally(const String& originalPageUrl, const String& finalPageUrl, const String& iconUrl)
{
m_webPagePrivate->m_client->setIconForUrl(originalPageUrl.utf8().data(), finalPageUrl.utf8().data(), iconUrl.utf8().data());
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
index b96967413..699d50dbe 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
@@ -56,7 +56,7 @@ public:
virtual void detachedFromParent3() { notImplemented(); }
virtual void assignIdentifierToInitialRequest(long unsigned int, DocumentLoader*, const ResourceRequest&) { notImplemented(); }
virtual void dispatchWillSendRequest(DocumentLoader*, long unsigned int, ResourceRequest&, const ResourceResponse&);
- virtual bool shouldUseCredentialStorage(DocumentLoader*, long unsigned int) { notImplemented(); return false; }
+ virtual bool shouldUseCredentialStorage(DocumentLoader*, long unsigned);
virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, long unsigned int, const AuthenticationChallenge&) { notImplemented(); }
virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, long unsigned int, const AuthenticationChallenge&) { notImplemented(); }
virtual void dispatchDidReceiveResponse(DocumentLoader*, long unsigned int, const ResourceResponse&);
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
index e00fb5809..984a21b98 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
@@ -50,12 +50,14 @@ namespace WebCore {
PagePopupBlackBerry::PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPage, PagePopupClient* client, const IntRect& rect)
: m_webPagePrivate(webPage)
, m_client(adoptPtr(client))
+ , m_sharedClientPointer(adoptRef(new PagePopupBlackBerry::SharedClientPointer(client)))
{
m_rect = IntRect(rect.x(), rect.y() - URL_BAR_HEIGHT, client->contentSize().width(), client->contentSize().height());
}
PagePopupBlackBerry::~PagePopupBlackBerry()
{
+ ASSERT(!m_sharedClientPointer->get());
}
bool PagePopupBlackBerry::sendCreatePopupWebViewRequest()
@@ -67,7 +69,7 @@ bool PagePopupBlackBerry::init(WebPage* webpage)
{
generateHTML(webpage);
- installDomFunction(webpage->d->mainFrame());
+ installDOMFunction(webpage->d->mainFrame());
return true;
}
@@ -107,11 +109,11 @@ static JSValueRef setValueAndClosePopupCallback(JSContextRef context,
JSStringRelease(string);
JSObjectRef popUpObject = JSValueToObject(context,
arguments[argumentCount - 1], 0);
- PagePopupClient* client =
- reinterpret_cast<PagePopupClient*>(JSObjectGetPrivate(popUpObject));
+ PagePopupBlackBerry::SharedClientPointer* client = reinterpret_cast<PagePopupBlackBerry::SharedClientPointer*>(JSObjectGetPrivate(popUpObject));
- ASSERT(client);
- client->setValueAndClosePopup(0, strArgs.data());
+ // Check the weak pointer as the owner page may have destroyed the popup.
+ if (client->get())
+ client->get()->setValueAndClosePopup(0, strArgs.data());
return jsRetVal;
}
@@ -124,7 +126,9 @@ static void popUpExtensionInitialize(JSContextRef context, JSObjectRef object)
static void popUpExtensionFinalize(JSObjectRef object)
{
- UNUSED_PARAM(object);
+ // Clear the reference. See installDOMFunction().
+ PagePopupBlackBerry::SharedClientPointer* client = reinterpret_cast<PagePopupBlackBerry::SharedClientPointer*>(JSObjectGetPrivate(object));
+ client->deref();
}
static JSStaticFunction popUpExtensionStaticFunctions[] =
@@ -138,7 +142,7 @@ static JSStaticValue popUpExtensionStaticValues[] =
{ 0, 0, 0, 0 }
};
-void PagePopupBlackBerry::installDomFunction(Frame* frame)
+void PagePopupBlackBerry::installDOMFunction(Frame* frame)
{
JSDOMWindow* window = toJSDOMWindow(frame, mainThreadNormalWorld());
ASSERT(window);
@@ -165,7 +169,10 @@ void PagePopupBlackBerry::installDomFunction(Frame* frame)
JSClassRef clientClass = JSClassCreate(&definition);
JSObjectRef clientClassObject = JSObjectMake(context, clientClass, 0);
- JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(m_client.get()));
+
+ // Add a reference. See popUpExtensionFinalize.
+ m_sharedClientPointer->ref();
+ JSObjectSetPrivate(clientClassObject, m_sharedClientPointer.get());
String name("popUp");
@@ -178,6 +185,9 @@ void PagePopupBlackBerry::installDomFunction(Frame* frame)
void PagePopupBlackBerry::closePopup()
{
+ // Prevent the popup page from accessing the client.
+ m_sharedClientPointer->clear();
+
m_client->didClosePopup();
m_webPagePrivate->client()->closePopupWebView();
m_webPagePrivate->m_webPage->popupClosed();
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
index 5d71e4c90..08c35a6d2 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
@@ -21,6 +21,8 @@
#include "IntRect.h"
#include "PagePopup.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
namespace BlackBerry {
@@ -44,13 +46,24 @@ public:
bool sendCreatePopupWebViewRequest();
bool init(BlackBerry::WebKit::WebPage*);
void closePopup();
- void installDomFunction(Frame*);
void setRect();
- void generateHTML(BlackBerry::WebKit::WebPage*);
+
+ class SharedClientPointer : public RefCounted<SharedClientPointer> {
+ public:
+ explicit SharedClientPointer(PagePopupClient* client) : m_client(client) { }
+ void clear() { m_client = 0; }
+ PagePopupClient* get() const { return m_client; }
+ private:
+ PagePopupClient* m_client;
+ };
private:
+ void generateHTML(BlackBerry::WebKit::WebPage*);
+ void installDOMFunction(Frame*);
+
BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate;
OwnPtr<PagePopupClient> m_client;
+ RefPtr<SharedClientPointer> m_sharedClientPointer;
IntRect m_rect;
};
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
index 0048a6430..5e64316aa 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
@@ -136,8 +136,10 @@ InputHandler::InputHandler(WebPagePrivate* page)
, m_composingTextEnd(0)
, m_pendingKeyboardVisibilityChange(NoChange)
, m_delayKeyboardVisibilityChange(false)
+ , m_request(0)
+ , m_processingTransactionId(-1)
+ , m_focusZoomScale(0.0)
{
- pthread_mutex_init(&m_sequenceMapMutex, 0);
}
InputHandler::~InputHandler()
@@ -545,32 +547,25 @@ void InputHandler::learnText()
void InputHandler::requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest> textCheckingRequest)
{
- RefPtr<WebCore::TextCheckingRequest> request = textCheckingRequest;
+ m_request = textCheckingRequest;
- int32_t sequenceId = request->sequence();
-
- if (!isActiveTextEdit()) {
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
- return;
- }
-
- // Check if the field should be spellchecked.
- if (!shouldSpellCheckElement(m_currentFocusElement.get())) {
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ if (!m_request) {
+ SpellingLog(LogLevelWarn, "InputHandler::requestCheckingOfString did not receive a valid request.");
return;
}
- unsigned requestLength = request->text().length();
+ unsigned requestLength = m_request->text().length();
- if (requestLength < 2) {
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ // Check if the field should be spellchecked.
+ if (!isActiveTextEdit() || !shouldSpellCheckElement(m_currentFocusElement.get()) || requestLength < 2) {
+ m_request->didCancel();
return;
}
if (requestLength > MaxSpellCheckingStringLength) {
// Cancel this request and send it off in newly created chunks.
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
- if (m_currentFocusElement && m_currentFocusElement->document() && m_currentFocusElement->document()->frame() && m_currentFocusElement->document()->frame()->selection()) {
+ m_request->didCancel();
+ if (m_currentFocusElement->document() && m_currentFocusElement->document()->frame() && m_currentFocusElement->document()->frame()->selection()) {
// Convert from position back to selection so we can expand the range to include the previous line. This should handle cases when the user hits
// enter to finish composing a word and create a new line.
VisiblePosition caretPosition = m_currentFocusElement->document()->frame()->selection()->start();
@@ -583,53 +578,52 @@ void InputHandler::requestCheckingOfString(PassRefPtr<WebCore::TextCheckingReque
wchar_t* checkingString = (wchar_t*)malloc(sizeof(wchar_t) * (requestLength + 1));
if (!checkingString) {
logAlways(LogLevelCritical, "InputHandler::requestCheckingOfString Cannot allocate memory for string.");
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ m_request->didCancel();
return;
}
int paragraphLength = 0;
- if (!convertStringToWchar(request->text(), checkingString, requestLength + 1, &paragraphLength)) {
+ if (!convertStringToWchar(m_request->text(), checkingString, requestLength + 1, &paragraphLength)) {
logAlways(LogLevelCritical, "InputHandler::requestCheckingOfString Failed to convert String to wchar type.");
free(checkingString);
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ m_request->didCancel();
return;
}
- BlackBerry::Platform::MutexLocker lock(&m_sequenceMapMutex);
- int32_t transactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, paragraphLength);
+ m_processingTransactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, paragraphLength);
free(checkingString);
// If the call to the input service did not go through, then cancel the request so we don't block endlessly.
// This should still take transactionId as a parameter to maintain the same behavior as if InputMethodSupport
// were to cancel a request during processing.
- if (transactionId == -1) { // Error before sending request to input service.
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
+ if (m_processingTransactionId == -1) { // Error before sending request to input service.
+ m_request->didCancel();
return;
}
-
- // map sequenceId to transactionId.
- m_sequenceMap[transactionId] = sequenceId;
}
-int32_t InputHandler::convertTransactionIdToSequenceId(int32_t transactionId)
+void InputHandler::spellCheckingRequestCancelled(int32_t transactionId)
{
- BlackBerry::Platform::MutexLocker lock(&m_sequenceMapMutex);
- std::map<int32_t, int32_t>::iterator it = m_sequenceMap.find(transactionId);
-
- if (it == m_sequenceMap.end())
- return 0;
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestCancelled Expected transaction id %d, received %d. %s"
+ , transactionId
+ , m_processingTransactionId
+ , transactionId == m_processingTransactionId ? "" : "We are out of sync with input service.");
- int32_t sequenceId = it->second;
- // We only convert this value when we have received its response, so its safe to remove it from the map.
- m_sequenceMap.erase(it);
-
- return sequenceId;
+ m_request->didCancel();
+ m_processingTransactionId = -1;
}
void InputHandler::spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t* spannableString)
{
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestProcessed Expected transaction id %d, received %d. %s"
+ , transactionId
+ , m_processingTransactionId
+ , transactionId == m_processingTransactionId ? "" : "We are out of sync with input service.");
+
if (!spannableString || !isActiveTextEdit()) {
- spellCheckingRequestCancelled(transactionId, false /* isSequenceId */);
+ SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestProcessed Cancelling request with transactionId %d.", transactionId);
+ m_request->didCancel();
+ m_processingTransactionId = -1;
return;
}
@@ -648,7 +642,7 @@ void InputHandler::spellCheckingRequestProcessed(int32_t transactionId, spannabl
if (!span)
break;
if (span->end < span->start) {
- spellCheckingRequestCancelled(transactionId, false /* isSequenceId */);
+ m_request->didCancel();
return;
}
if (span->attributes_mask & MISSPELLED_WORD_ATTRIB) {
@@ -662,44 +656,13 @@ void InputHandler::spellCheckingRequestProcessed(int32_t transactionId, spannabl
span++;
}
- // transactionId here is for use with the input service. We need to translate this to sequenceId used with SpellChecker.
- int32_t sequenceId = convertTransactionIdToSequenceId(transactionId);
-
- SpellChecker* spellChecker = getSpellChecker();
- if (!spellChecker || !sequenceId) {
- SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestProcessed Failed to process the request with sequenceId %d", sequenceId);
- spellCheckingRequestCancelled(sequenceId, true /* isSequenceId */);
- return;
- }
- spellChecker->didCheckSucceeded(sequenceId, results);
-}
-
-void InputHandler::cancelAllSpellCheckingRequests()
-{
- BlackBerry::Platform::MutexLocker lock(&m_sequenceMapMutex);
- for (std::map<int32_t, int32_t>::iterator it = m_sequenceMap.begin(); it != m_sequenceMap.end(); ++it)
- spellCheckingRequestCancelled(it->second, true /* isSequenceId */);
- m_sequenceMap.clear();
-}
-
-void InputHandler::spellCheckingRequestCancelled(int32_t id, bool isSequenceId)
-{
- if (!isActiveTextEdit())
- return;
-
- int32_t sequenceId = isSequenceId ? id : convertTransactionIdToSequenceId(id);
- SpellChecker* spellChecker = getSpellChecker();
- if (!spellChecker || !sequenceId) {
- SpellingLog(LogLevelWarn, "InputHandler::spellCheckingRequestCancelled failed to cancel the request with sequenceId %d", sequenceId);
- return;
- }
- spellChecker->didCheckCanceled(sequenceId);
+ m_request->didSucceed(results);
}
SpellChecker* InputHandler::getSpellChecker()
{
- ASSERT(m_currentFocusElement);
- ASSERT(m_currentFocusElement->document());
+ if (!m_currentFocusElement || !m_currentFocusElement->document())
+ return 0;
if (Frame* frame = m_currentFocusElement->document()->frame())
if (Editor* editor = frame->editor())
@@ -737,6 +700,11 @@ bool InputHandler::shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint&
spellCheckingOptionRequest.startTextPosition = marker->startOffset();
spellCheckingOptionRequest.endTextPosition = marker->endOffset();
+ SpellingLog(LogLevelInfo, "InputHandler::shouldRequestSpellCheckingOptionsForPoint spellCheckingOptionRequest\ntop %d, %d\nbottom %d %d\nMarker start %d end %d"
+ , spellCheckingOptionRequest.caret_rect.caret_top_x, spellCheckingOptionRequest.caret_rect.caret_top_y
+ , spellCheckingOptionRequest.caret_rect.caret_bottom_x, spellCheckingOptionRequest.caret_rect.caret_bottom_y
+ , spellCheckingOptionRequest.startTextPosition, spellCheckingOptionRequest.endTextPosition);
+
return true;
}
@@ -772,9 +740,6 @@ void InputHandler::setElementUnfocused(bool refocusOccuring)
// If the frame selection isn't focused, focus it.
if (!m_currentFocusElement->document()->frame()->selection()->isFocused())
m_currentFocusElement->document()->frame()->selection()->setFocused(true);
-
- // Cancel any spellcheck requests that might be ongoing.
- cancelAllSpellCheckingRequests();
}
// Clear the node details.
@@ -1161,8 +1126,14 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType)
// If the text is too small, zoom in to make it a minimum size.
// The minimum size being defined as 3 mm is a good value based on my observations.
static const int s_minimumTextHeightInPixels = Graphics::Screen::primaryScreen()->widthInMMToPixels(3);
- if (fontHeight && fontHeight < s_minimumTextHeightInPixels)
- m_webPage->zoomAboutPoint(s_minimumTextHeightInPixels / fontHeight, selectionFocusRect.location());
+ if (fontHeight && fontHeight < s_minimumTextHeightInPixels) {
+ m_focusZoomScale = s_minimumTextHeightInPixels / fontHeight;
+ m_focusZoomLocation = selectionFocusRect.location();
+ m_webPage->zoomAboutPoint(m_focusZoomScale, m_focusZoomLocation);
+ } else {
+ m_focusZoomScale = 0.0;
+ m_focusZoomLocation = WebCore::IntPoint();
+ }
}
void InputHandler::ensureFocusPluginElementVisible()
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
index c65b9916b..275bdf136 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
@@ -19,6 +19,7 @@
#ifndef InputHandler_h
#define InputHandler_h
+#include "FloatPoint.h"
#include "TextChecking.h"
#include <BlackBerryPlatformInputEvents.h>
@@ -137,7 +138,7 @@ public:
void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>);
void spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t*);
- void spellCheckingRequestCancelled(int32_t id, bool isSequenceId = false);
+ void spellCheckingRequestCancelled(int32_t transactionId);
bool shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint&, const WebCore::Element*, imf_sp_text_t&);
void requestSpellingCheckingOptions(imf_sp_text_t&);
@@ -197,10 +198,8 @@ private:
void learnText();
void sendLearnTextDetails(const WTF::String&);
- int32_t convertTransactionIdToSequenceId(int32_t transactionId);
void spellCheckBlock(WebCore::VisibleSelection&, WebCore::TextCheckingProcessType);
PassRefPtr<WebCore::Range> getRangeForSpellCheckWithFineGranularity(WebCore::VisiblePosition startPosition, WebCore::VisiblePosition endPosition);
- void cancelAllSpellCheckingRequests();
WebCore::SpellChecker* getSpellChecker();
bool shouldSpellCheckElement(const WebCore::Element*) const;
@@ -221,8 +220,11 @@ private:
PendingKeyboardStateChange m_pendingKeyboardVisibilityChange;
bool m_delayKeyboardVisibilityChange;
- std::map<int32_t, int32_t> m_sequenceMap;
- pthread_mutex_t m_sequenceMapMutex;
+ RefPtr<WebCore::TextCheckingRequest> m_request;
+ int32_t m_processingTransactionId;
+
+ double m_focusZoomScale;
+ WebCore::FloatPoint m_focusZoomLocation;
};
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp b/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp
index eb2593b21..110be1aa1 100644
--- a/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp
@@ -564,8 +564,6 @@ void RenderQueue::render(bool shouldPerformRegularRenderJobs)
double time = WTF::currentTime();
#endif
- m_parent->instrumentBeginFrame();
-
m_parent->requestLayoutIfNeeded();
#if DEBUG_RENDER_QUEUE
@@ -586,8 +584,6 @@ void RenderQueue::render(bool shouldPerformRegularRenderJobs)
renderRegularRenderJob();
} else if (!m_nonVisibleScrollJobs.empty())
renderNonVisibleScrollJob();
-
- m_parent->instrumentCancelFrame();
}
void RenderQueue::renderAllCurrentRegularRenderJobs()
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 851e43976..08b5cd5cf 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,308 @@
+2012-09-19 Adam Barth <abarth@webkit.org>
+
+ Remove webkitPostMessage
+ https://bugs.webkit.org/show_bug.cgi?id=96577
+
+ Reviewed by Ojan Vafai.
+
+ Actually disable webkitPostMessage. See
+ http://trac.webkit.org/changeset/128658 for more information.
+
+ * features.gypi:
+
+2012-09-19 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Remove "current transaction" concept from backing store
+ https://bugs.webkit.org/show_bug.cgi?id=96663
+
+ Reviewed by Tony Chang.
+
+ Update fake class with new method signatures.
+
+ * tests/IDBFakeBackingStore.h:
+
+2012-09-19 Terry Anderson <tdanderson@chromium.org>
+
+ [chromium] Store the contents scale factor in PlatformContextSkia on initialization
+ https://bugs.webkit.org/show_bug.cgi?id=96137
+
+ Reviewed by Stephen White.
+
+ Define SK_SUPPORT_HINTING_SCALE_FACTOR by default. This is also used
+ for the skia patch here: https://codereview.appspot.com/6506099/.
+ Also added two new unit tests.
+
+ * features.gypi:
+ * tests/OpaqueRectTrackingContentLayerDelegateTest.cpp:
+ (WebCore):
+ (WebCore::HintingScaleCallback::HintingScaleCallback):
+ (HintingScaleCallback):
+ (WebCore::HintingScaleCallback::operator()):
+ (WebCore::TEST_F):
+ * tests/PlatformContextSkiaTest.cpp:
+ (WebCore):
+ (WebCore::TEST):
+
+2012-09-19 David Grogan <dgrogan@chromium.org>
+
+ Disable some failing IDB tests
+ https://bugs.webkit.org/show_bug.cgi?id=97135
+
+ Reviewed by Nate Chapin.
+
+ They were broken in r129037.
+
+ * tests/IDBDatabaseBackendTest.cpp:
+
+2012-09-19 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Unreviewed. Build fix.
+
+ Not building WebImageTest.cpp for component build.
+
+ * WebKit.gyp:
+
+2012-09-19 Alpha Lam <hclam@chromium.org>
+
+ [chromium] WebImage should use ImageDecoder directly
+ https://bugs.webkit.org/show_bug.cgi?id=96135
+
+ Reviewed by Adam Barth.
+
+ This patch is for preparation of deferred image decoding.
+ ImageSource will be used as a portal to access deferred image decoder
+ by BitmapImage, it should not be accessible through WebKit APIs.
+
+ WebImage now calls ImageDecoder directly which is the actual
+ implementation of an image decoder.
+
+ Tests: WebImageTest.PNGImage
+ WebImageTest.ICOImage
+ WebImageTest.BadImage
+
+ * WebKit.gypi:
+ * src/WebImageSkia.cpp:
+ (WebKit::WebImage::fromData):
+ (WebKit::WebImage::framesFromData):
+ * tests/WebImageTest.cpp: Added.
+ (WebKit):
+ (WebKit::readFile):
+ (WebKit::TEST):
+ * tests/data/black-and-white.ico: Added.
+ * tests/data/white-1x1.png: Added.
+
+2012-09-19 Oli Lan <olilan@chromium.org>
+
+ [chromium] Add a method didHandleGestureEvent to WebViewClient, called from WebViewImpl::handleGestureEvent.
+ https://bugs.webkit.org/show_bug.cgi?id=96112
+
+ Reviewed by Adam Barth.
+
+ Adds a new method didHandleGestureEvent to WebViewClient, called from WebViewImpl::handleGestureEvent.
+
+ This will be used by the Android port to implement platform-specific gesture behaviour.
+
+ This is tested by the new test WebViewTest.ClientTapHandlers.
+
+ * public/WebViewClient.h:
+ (WebViewClient):
+ (WebKit::WebViewClient::didHandleGestureEvent):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+ * tests/WebViewTest.cpp:
+
+2012-09-19 Robert Flack <flackr@chromium.org>
+
+ [chromium] Support high DPI scroll bar on top level web frame.
+ https://bugs.webkit.org/show_bug.cgi?id=95134
+
+ Reviewed by Adrienne Walker.
+
+ Calls setAppliesPageScale(true) on root scrollbar layers as these are not scaled.
+
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::setScrollbarBoundsContainPageScale):
+ (WebKit):
+ (WebKit::NonCompositedContentHost::setViewport):
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move notifyJSOutOfMemory out of PlatformSupport
+ https://bugs.webkit.org/show_bug.cgi?id=97116
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::didExhaustMemoryAvailableForScript):
+ (WebKit):
+ * src/FrameLoaderClientImpl.h:
+ (FrameLoaderClientImpl):
+ * src/PlatformSupport.cpp:
+ (WebCore):
+
+2012-09-19 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove unused popupsAllowed function from PlatformSupport
+ https://bugs.webkit.org/show_bug.cgi?id=96521
+
+ Reviewed by Eric Seidel.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * src/PlatformSupport.cpp:
+ (WebCore):
+
+2012-09-19 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Fix crash in WebFrameImpl::loadHistoryItem
+ https://bugs.webkit.org/show_bug.cgi?id=96352
+
+ Reviewed by Adam Barth.
+
+ We have some crash reports with the following stack:
+ - HistoryItem::shouldDoSameDocumentNavigationTo.
+ - WebFrameImpl::loadHistoryItem
+ ...
+
+ We don't have reproducible steps, and not sure what's the root
+ cause. Anyway we should check nullness of currentItem because
+ HistoryController::m_currentItem can be 0.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::loadHistoryItem):
+ Check nullness of currentItem.
+
+2012-09-18 Sailesh Agrawal <sail@chromium.org>
+
+ Chromium: Scrollbar with tickmarks doesn't respond to clicks
+ https://bugs.webkit.org/show_bug.cgi?id=96049
+
+ Reviewed by Beth Dakin.
+
+ Pipe isAlphaLocked and setIsAlphaLocked.
+
+ * src/WebPluginScrollbarImpl.cpp:
+ (WebKit::WebPluginScrollbarImpl::isAlphaLocked):
+ (WebKit):
+ (WebKit::WebPluginScrollbarImpl::setIsAlphaLocked):
+ * src/WebPluginScrollbarImpl.h:
+ (WebPluginScrollbarImpl):
+ * src/WebScrollbarThemeClientImpl.cpp:
+ (WebKit::WebScrollbarThemeClientImpl::isAlphaLocked):
+ (WebKit):
+ (WebKit::WebScrollbarThemeClientImpl::setIsAlphaLocked):
+ * src/WebScrollbarThemeClientImpl.h:
+ (WebScrollbarThemeClientImpl):
+ * tests/ScrollbarLayerChromiumTest.cpp:
+
+2012-09-18 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed, rolling out r128939.
+ http://trac.webkit.org/changeset/128939
+ https://bugs.webkit.org/show_bug.cgi?id=96135
+
+ Failing test_shell_tests.
+
+ * WebKit.gypi:
+ * src/WebImageSkia.cpp:
+ (WebKit::WebImage::fromData):
+ (WebKit::WebImage::framesFromData):
+ * tests/WebImageTest.cpp: Removed.
+ * tests/data/black-and-white.ico: Removed.
+ * tests/data/white-1x1.png: Removed.
+
+2012-09-18 Alpha Lam <hclam@chromium.org>
+
+ [chromium] WebImage should use ImageDecoder directly
+ https://bugs.webkit.org/show_bug.cgi?id=96135
+
+ Reviewed by Adam Barth.
+
+ This patch is for preparation of deferred image decoding.
+ ImageSource will be used as a portal to access deferred image decoder
+ by BitmapImage, it should not be accessible through WebKit APIs.
+
+ WebImage now calls ImageDecoder directly which is the actual
+ implementation of an image decoder.
+
+ Tests: WebImageTest.PNGImage
+ WebImageTest.ICOImage
+
+ * WebKit.gypi:
+ * src/WebImageSkia.cpp:
+ (WebKit::WebImage::fromData):
+ (WebKit::WebImage::framesFromData):
+ * tests/WebImageTest.cpp: Added.
+ (WebKit):
+ (WebKit::readFile):
+ (WebKit::TEST):
+ * tests/data/black-and-white.ico: Added.
+ * tests/data/white-1x1.png: Added.
+
+2012-09-18 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Create a flag to enable PeerConnection00
+ https://bugs.webkit.org/show_bug.cgi?id=96989
+
+ Reviewed by Adam Barth.
+
+ Adding the functionality to separately enable/disable PeerConnection00.
+ For now it is enabled by default.
+
+ * public/WebRuntimeFeatures.h:
+ (WebRuntimeFeatures):
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableDeprecatedPeerConnection):
+ (WebKit):
+ (WebKit::WebRuntimeFeatures::isDeprecatedPeerConnectionEnabled):
+
+2012-09-18 Iain Merrick <husky@google.com>
+
+ [Chromium] Merge moveSelectionStart, moveSelectionEnd, and moveCaret into selectRange
+ https://bugs.webkit.org/show_bug.cgi?id=96508
+
+ Reviewed by Ryosuke Niwa.
+
+ These methods had "start" and "end" parameters, but this is incorrect.
+ selectRange() actually takes base and extent (where the user actually
+ touched), and selectionBounds() returns anchor and focus (base and extent
+ expanded to account for the selection granularity).
+
+ This patch fixes the parameter names, and updates selectRange, its test
+ and its documentation to reflect the correct usage. It also removes
+ moveSelectionStart/moveSelectionEnd/moveCaret (which aren't being used
+ yet), and updates WebFrameTest to show how these can be implemented via
+ selectRange.
+
+ * public/WebFrame.h:
+ (WebFrame):
+ * public/WebWidget.h:
+ (WebWidget):
+ (WebKit::WebWidget::selectionBounds):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::selectRange):
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::selectionBounds):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ * tests/WebFrameTest.cpp:
+
+2012-09-18 Terry Anderson <tdanderson@chromium.org>
+
+ Roll chromium DEPS to r157342
+ https://bugs.webkit.org/show_bug.cgi?id=96963
+
+ Reviewed by Stephen White.
+
+ Roll chromium DEPS to r157342. Also include the top-level directory
+ google_apis as a dependency, which was required for r157130.
+
+ * DEPS:
+
2012-09-17 Brian Anderson <brianderson@chromium.org>
[chromium] Add rendering commit statistics
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index c5ab4a936..77a0b0dfe 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '157063'
+ 'chromium_rev': '157342'
}
deps = {
@@ -91,6 +91,8 @@ deps = {
'cc':
Var('chromium_svn')+'/cc@'+Var('chromium_rev'),
+ 'google_apis':
+ Var('chromium_svn')+'/google_apis@' + Var('chromium_rev'),
'gpu':
Var('chromium_svn')+'/gpu@'+Var('chromium_rev'),
'ipc':
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index 179ad50ef..59ab2492d 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -720,6 +720,7 @@
'tests/RenderTableRowTest.cpp',
'tests/URLTestHelpers.cpp',
'tests/WebFrameTest.cpp',
+ 'tests/WebImageTest.cpp',
'tests/WebPageNewSerializerTest.cpp',
'tests/WebPageSerializerTest.cpp',
'tests/WebViewTest.cpp',
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index edebf1b3c..b16a6018a 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -103,6 +103,7 @@
'tests/WebCompositorInputHandlerImplTest.cpp',
'tests/WebFrameTest.cpp',
'tests/WebInputEventConversionTest.cpp',
+ 'tests/WebImageTest.cpp',
'tests/WebMediaPlayerClientImplTest.cpp',
'tests/WebPageNewSerializerTest.cpp',
'tests/WebPageSerializerTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index c51035d71..5b51e5391 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -77,7 +77,7 @@
'ENABLE_JAVASCRIPT_DEBUGGER=1',
'ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0',
'ENABLE_LEGACY_VIEWPORT_ADAPTION=1',
- 'ENABLE_LEGACY_VENDOR_PREFIXES=1',
+ 'ENABLE_LEGACY_VENDOR_PREFIXES=0',
'ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1',
'ENABLE_LINK_PREFETCH=1',
'ENABLE_LINK_PRERENDER=1',
@@ -119,6 +119,7 @@
'ENABLE_WORKERS=1',
'ENABLE_XHR_RESPONSE_BLOB=1',
'ENABLE_XSLT=1',
+ 'SK_SUPPORT_HINTING_SCALE_FACTOR',
'WTF_USE_LEVELDB=1',
'WTF_USE_BUILTIN_UTF8_CODEC=1',
# WTF_USE_DYNAMIC_ANNOTATIONS=1 may be defined in build/common.gypi
diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h
index 56cbe1ea4..f38c73934 100644
--- a/Source/WebKit/chromium/public/WebFrame.h
+++ b/Source/WebKit/chromium/public/WebFrame.h
@@ -472,30 +472,12 @@ public:
// there is ranged selection.
virtual bool selectWordAroundCaret() = 0;
- // DEPRECATED: Use moveSelectionStart / moveSelectionEnd / moveCaret
- // This method is intended for touch-based UIs, but it's missing some
- // functionality needed on Android, like preventing collapsed selections.
- virtual void selectRange(const WebPoint& start, const WebPoint& end) = 0;
+ // Select a range of text, as if by drag-selecting from base to extent
+ // with character granularity.
+ virtual void selectRange(const WebPoint& base, const WebPoint& extent) = 0;
virtual void selectRange(const WebRange&) = 0;
- // The methods below are for adjusting the start and/or end of the current
- // selection by direct manipulation on a touch-based UI. To enter selection
- // mode in the first place, call selectRange() or send a fake mouse event.
-
- // Moves the start of the current selection, keeping the end fixed.
- // Returns true on success, false if there is no selection to modify.
- virtual bool moveSelectionStart(const WebPoint&, bool allowCollapsedSelection) = 0;
-
- // Moves the end of the current selection, keeping the start fixed.
- // Returns true on success, false if there is no selection to modify.
- virtual bool moveSelectionEnd(const WebPoint&, bool allowCollapsedSelection) = 0;
-
- // Move both endpoints of the current selection to the given position.
- // The caret will remain pinned inside the current editable region.
- // Returns true on success, false if there is no selection or if we're not editing.
- virtual bool moveCaret(const WebPoint&) = 0;
-
// Printing ------------------------------------------------------------
// Reformats the WebFrame for printing. WebPrintParams specifies the printable
diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h
index 012efe82d..6d0629fea 100644
--- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -112,6 +112,8 @@ public:
WEBKIT_EXPORT static void enablePeerConnection(bool);
WEBKIT_EXPORT static bool isPeerConnectionEnabled();
+ WEBKIT_EXPORT static void enableDeprecatedPeerConnection(bool);
+ WEBKIT_EXPORT static bool isDeprecatedPeerConnectionEnabled();
WEBKIT_EXPORT static void enableFullScreenAPI(bool);
WEBKIT_EXPORT static bool isFullScreenAPIEnabled();
diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h
index 839ed0d17..88da1416b 100644
--- a/Source/WebKit/chromium/public/WebViewClient.h
+++ b/Source/WebKit/chromium/public/WebViewClient.h
@@ -142,6 +142,9 @@ public:
// Called to retrieve the provider of desktop notifications.
virtual WebNotificationPresenter* notificationPresenter() { return 0; }
+ // Called when a gesture event is handled.
+ virtual void didHandleGestureEvent(const WebGestureEvent& event, bool eventSwallowed) { }
+
// Called to request an icon for the specified filenames.
// The icon is shown in a file upload control.
virtual bool queryIconForFiles(const WebVector<WebString>& filenames, WebIconLoadingCompletion*) { return false; }
diff --git a/Source/WebKit/chromium/public/WebWidget.h b/Source/WebKit/chromium/public/WebWidget.h
index ac1658140..fa456238a 100644
--- a/Source/WebKit/chromium/public/WebWidget.h
+++ b/Source/WebKit/chromium/public/WebWidget.h
@@ -194,9 +194,9 @@ public:
// FIXME: Remove this method. It's redundant with textInputInfo().
virtual WebTextInputType textInputType() { return WebTextInputTypeNone; }
- // Returns the start and end bounds of the current selection.
+ // Returns the anchor and focus bounds of the current selection.
// If the selection range is empty, it returns the caret bounds.
- virtual bool selectionBounds(WebRect& start, WebRect& end) const { return false; }
+ virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const { return false; }
// Returns the text direction at the start and end bounds of the current selection.
// If the selection range is empty, it returns false.
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 5dd02b563..7a616c520 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -142,6 +142,12 @@ void FrameLoaderClientImpl::documentElementAvailable()
m_webFrame->client()->didCreateDocumentElement(m_webFrame);
}
+void FrameLoaderClientImpl::didExhaustMemoryAvailableForScript()
+{
+ if (m_webFrame->client())
+ m_webFrame->client()->didExhaustMemoryAvailableForScript(m_webFrame);
+}
+
#if USE(V8)
void FrameLoaderClientImpl::didCreateScriptContext(v8::Handle<v8::Context> context, int extensionGroup, int worldId)
{
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
index ecb20a2fb..1cf5cd1e1 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -61,6 +61,9 @@ public:
virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
virtual void documentElementAvailable();
+ // Script in the page tried to allocate too much memory.
+ virtual void didExhaustMemoryAvailableForScript();
+
#if USE(V8)
virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId);
virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId);
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index ae99ba889..9729d05ec 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -88,6 +88,20 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer)
ASSERT(haveScrollLayer());
}
+static void setScrollbarBoundsContainPageScale(WebCore::GraphicsLayer* layer, WebCore::GraphicsLayer* clipLayer)
+{
+ // Scrollbars are attached outside the root clip rect, so skip the
+ // clipLayer subtree.
+ if (layer == clipLayer)
+ return;
+
+ for (size_t i = 0; i < layer->children().size(); ++i)
+ setScrollbarBoundsContainPageScale(layer->children()[i], clipLayer);
+
+ if (layer->children().isEmpty())
+ layer->setAppliesPageScale(true);
+}
+
void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin)
{
if (!haveScrollLayer())
@@ -119,6 +133,12 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
m_graphicsLayer->setNeedsDisplay();
} else if (visibleRectChanged)
m_graphicsLayer->setNeedsDisplay();
+
+ WebCore::GraphicsLayer* clipLayer = m_graphicsLayer->parent()->parent();
+ WebCore::GraphicsLayer* rootLayer = clipLayer;
+ while (rootLayer->parent())
+ rootLayer = rootLayer->parent();
+ setScrollbarBoundsContainPageScale(rootLayer, clipLayer);
}
bool NonCompositedContentHost::haveScrollLayer()
diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp
index 762055497..2fb6f1059 100644
--- a/Source/WebKit/chromium/src/PlatformSupport.cpp
+++ b/Source/WebKit/chromium/src/PlatformSupport.cpp
@@ -499,17 +499,6 @@ void PlatformSupport::paintThemePart(
// Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
// methods will be deleted.
-void PlatformSupport::notifyJSOutOfMemory(Frame* frame)
-{
- if (!frame)
- return;
-
- WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
- if (!webFrame->client())
- return;
- webFrame->client()->didExhaustMemoryAvailableForScript(webFrame);
-}
-
int PlatformSupport::screenHorizontalDPI(Widget* widget)
{
WebWidgetClient* client = toWebWidgetClient(widget);
@@ -566,12 +555,6 @@ IntRect PlatformSupport::screenAvailableRect(Widget* widget)
return client->screenInfo().availableRect;
}
-bool PlatformSupport::popupsAllowed(NPP npp)
-{
- // FIXME: Give the embedder a way to control this.
- return false;
-}
-
#if ENABLE(WORKERS)
WorkerContextProxy* WorkerContextProxy::create(Worker* worker)
{
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index 7bb0efeea..6d68a6f23 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1029,7 +1029,7 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
m_frame->loader()->prepareForHistoryNavigation();
RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem();
- m_inSameDocumentHistoryLoad = currentItem->shouldDoSameDocumentNavigationTo(historyItem.get());
+ m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocumentNavigationTo(historyItem.get());
m_frame->page()->goToItem(historyItem.get(),
FrameLoadTypeIndexedBackForward);
m_inSameDocumentHistoryLoad = false;
@@ -1466,71 +1466,15 @@ bool WebFrameImpl::selectWordAroundCaret()
return true;
}
-void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end)
+void WebFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent)
{
- if (start == end && moveCaret(start))
- return;
-
- if (moveSelectionStart(start, true) && moveSelectionEnd(end, true))
- return;
-
- // Failed to move endpoints, probably because there's no current selection.
- // Just set the selection explicitly (but this won't handle editable boundaries correctly).
- VisibleSelection newSelection(visiblePositionForWindowPoint(start), visiblePositionForWindowPoint(end));
+ VisiblePosition basePos = visiblePositionForWindowPoint(base);
+ VisiblePosition extentPos = visiblePositionForWindowPoint(extent);
+ VisibleSelection newSelection = VisibleSelection(basePos, extentPos);
if (frame()->selection()->shouldChangeSelection(newSelection))
frame()->selection()->setSelection(newSelection, CharacterGranularity);
}
-bool WebFrameImpl::moveSelectionStart(const WebPoint& point, bool allowCollapsedSelection)
-{
- const VisibleSelection& selection = frame()->selection()->selection();
- if (selection.isNone())
- return false;
-
- VisiblePosition start = visiblePositionForWindowPoint(point);
- if (!allowCollapsedSelection) {
- VisiblePosition maxStart = selection.visibleEnd().previous();
- if (comparePositions(start, maxStart) > 0)
- start = maxStart;
- }
-
- // start is moving, so base=end, extent=start
- VisibleSelection newSelection = VisibleSelection(selection.visibleEnd(), start);
- frame()->selection()->setNonDirectionalSelectionIfNeeded(newSelection, CharacterGranularity);
- return true;
-}
-
-bool WebFrameImpl::moveSelectionEnd(const WebPoint& point, bool allowCollapsedSelection)
-{
- const VisibleSelection& selection = frame()->selection()->selection();
- if (selection.isNone())
- return false;
-
- VisiblePosition end = visiblePositionForWindowPoint(point);
- if (!allowCollapsedSelection) {
- VisiblePosition minEnd = selection.visibleStart().next();
- if (comparePositions(end, minEnd) < 0)
- end = minEnd;
- }
-
- // end is moving, so base=start, extent=end
- VisibleSelection newSelection = VisibleSelection(selection.visibleStart(), end);
- frame()->selection()->setNonDirectionalSelectionIfNeeded(newSelection, CharacterGranularity);
- return true;
-}
-
-bool WebFrameImpl::moveCaret(const WebPoint& point)
-{
- FrameSelection* frameSelection = frame()->selection();
- if (frameSelection->isNone() || !frameSelection->isContentEditable())
- return false;
-
- VisiblePosition pos = visiblePositionForWindowPoint(point);
- frameSelection->setExtent(pos, UserTriggered);
- frameSelection->setBase(frameSelection->extent(), UserTriggered);
- return true;
-}
-
void WebFrameImpl::selectRange(const WebRange& webRange)
{
RefPtr<Range> range = static_cast<PassRefPtr<Range> >(webRange);
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index 58525d701..a2fe797e3 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -184,11 +184,8 @@ public:
virtual WebString selectionAsText() const;
virtual WebString selectionAsMarkup() const;
virtual bool selectWordAroundCaret();
- virtual void selectRange(const WebPoint& start, const WebPoint& end);
+ virtual void selectRange(const WebPoint& base, const WebPoint& extent);
virtual void selectRange(const WebRange&);
- virtual bool moveSelectionStart(const WebPoint&, bool allowCollapsedSelection);
- virtual bool moveSelectionEnd(const WebPoint&, bool allowCollapsedSelection);
- virtual bool moveCaret(const WebPoint&);
virtual int printBegin(const WebPrintParams&,
const WebNode& constrainToNode,
bool* useBrowserOverlays);
diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp
index e1a926050..0198a6806 100644
--- a/Source/WebKit/chromium/src/WebImageSkia.cpp
+++ b/Source/WebKit/chromium/src/WebImageSkia.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "Image.h"
-#include "ImageSource.h"
+#include "ImageDecoder.h"
#include "NativeImageSkia.h"
#include "SharedBuffer.h"
@@ -51,19 +51,23 @@ namespace WebKit {
WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize)
{
- ImageSource source;
- source.setData(PassRefPtr<SharedBuffer>(data).get(), true);
- if (!source.isSizeAvailable())
+ RefPtr<SharedBuffer> buffer = PassRefPtr<SharedBuffer>(data);
+ OwnPtr<ImageDecoder> decoder(adoptPtr(ImageDecoder::create(*buffer.get(), ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied)));
+ if (!decoder)
+ return WebImage();
+
+ decoder->setData(buffer.get(), true);
+ if (!decoder->isSizeAvailable())
return WebImage();
// Frames are arranged by decreasing size, then decreasing bit depth.
// Pick the frame closest to |desiredSize|'s area without being smaller,
// which has the highest bit depth.
- const size_t frameCount = source.frameCount();
+ const size_t frameCount = decoder->frameCount();
size_t index = 0; // Default to first frame if none are large enough.
int frameAreaAtIndex = 0;
for (size_t i = 0; i < frameCount; ++i) {
- const IntSize frameSize = source.frameSizeAtIndex(i);
+ const IntSize frameSize = decoder->frameSizeAtIndex(i);
if (WebSize(frameSize) == desiredSize) {
index = i;
break; // Perfect match.
@@ -79,11 +83,15 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize)
}
}
- OwnPtr<NativeImageSkia> frame = adoptPtr(source.createFrameAtIndex(index));
+ ImageFrame* frame = decoder->frameBufferAtIndex(index);
if (!frame)
return WebImage();
- return WebImage(frame->bitmap());
+ OwnPtr<NativeImageSkia> image = adoptPtr(frame->asNewNativeImage());
+ if (!image)
+ return WebImage();
+
+ return WebImage(image->bitmap());
}
WebVector<WebImage> WebImage::framesFromData(const WebData& data)
@@ -91,26 +99,34 @@ WebVector<WebImage> WebImage::framesFromData(const WebData& data)
// This is to protect from malicious images. It should be big enough that it's never hit in pracice.
const size_t maxFrameCount = 8;
- ImageSource source;
- source.setData(PassRefPtr<SharedBuffer>(data).get(), true);
- if (!source.isSizeAvailable())
+ RefPtr<SharedBuffer> buffer = PassRefPtr<SharedBuffer>(data);
+ OwnPtr<ImageDecoder> decoder(adoptPtr(ImageDecoder::create(*buffer.get(), ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied)));
+ if (!decoder)
+ return WebVector<WebImage>();
+
+ decoder->setData(buffer.get(), true);
+ if (!decoder->isSizeAvailable())
return WebVector<WebImage>();
// Frames are arranged by decreasing size, then decreasing bit depth.
// Keep the first frame at every size, has the highest bit depth.
- const size_t frameCount = source.frameCount();
+ const size_t frameCount = decoder->frameCount();
IntSize lastSize;
Vector<WebImage> frames;
for (size_t i = 0; i < std::min(frameCount, maxFrameCount); ++i) {
- const IntSize frameSize = source.frameSizeAtIndex(i);
+ const IntSize frameSize = decoder->frameSizeAtIndex(i);
if (frameSize == lastSize)
continue;
lastSize = frameSize;
- OwnPtr<NativeImageSkia> frame = adoptPtr(source.createFrameAtIndex(i));
- if (frame)
- frames.append(WebImage(frame->bitmap()));
+ ImageFrame* frame = decoder->frameBufferAtIndex(i);
+ if (!frame)
+ continue;
+
+ OwnPtr<NativeImageSkia> image = adoptPtr(frame->asNewNativeImage());
+ if (image.get())
+ frames.append(WebImage(image->bitmap()));
}
return frames;
diff --git a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp
index f34dbfdc7..b993a1348 100644
--- a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp
@@ -268,6 +268,16 @@ bool WebPluginScrollbarImpl::handleInputEvent(const WebInputEvent& event)
return false;
}
+bool WebPluginScrollbarImpl::isAlphaLocked() const
+{
+ return m_scrollbar->isAlphaLocked();
+}
+
+void WebPluginScrollbarImpl::setIsAlphaLocked(bool flag)
+{
+ return m_scrollbar->setIsAlphaLocked(flag);
+}
+
bool WebPluginScrollbarImpl::onMouseDown(const WebInputEvent& event)
{
WebMouseEvent mousedown = *static_cast<const WebMouseEvent*>(&event);
diff --git a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h
index 43e3fd7b2..90ba94172 100644
--- a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h
+++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h
@@ -82,6 +82,8 @@ public:
virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier) OVERRIDE;
virtual void paint(WebCanvas*, const WebRect&) OVERRIDE;
virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE;
+ virtual bool isAlphaLocked() const OVERRIDE;
+ virtual void setIsAlphaLocked(bool) OVERRIDE;
private:
bool onMouseDown(const WebInputEvent&);
diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
index bbd71bc82..bcdba86c1 100644
--- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -368,6 +368,24 @@ bool WebRuntimeFeatures::isPeerConnectionEnabled()
#endif
}
+void WebRuntimeFeatures::enableDeprecatedPeerConnection(bool enable)
+{
+#if ENABLE(MEDIA_STREAM)
+ RuntimeEnabledFeatures::setDeprecatedPeerConnectionEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isDeprecatedPeerConnectionEnabled()
+{
+#if ENABLE(MEDIA_STREAM)
+ return RuntimeEnabledFeatures::deprecatedPeerConnectionEnabled();
+#else
+ return false;
+#endif
+}
+
void WebRuntimeFeatures::enableFullScreenAPI(bool enable)
{
#if ENABLE(FULLSCREEN_API)
diff --git a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp
index 68c9458d0..f160e5776 100644
--- a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp
@@ -218,4 +218,14 @@ bool WebScrollbarThemeClientImpl::isOverlayScrollbar() const
return m_scrollbar->isOverlay();
}
+bool WebScrollbarThemeClientImpl::isAlphaLocked() const
+{
+ return m_scrollbar->isAlphaLocked();
+}
+
+void WebScrollbarThemeClientImpl::setIsAlphaLocked(bool flag)
+{
+ m_scrollbar->setIsAlphaLocked(flag);
+}
+
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h
index b3a6ac956..48f967177 100644
--- a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h
+++ b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h
@@ -78,6 +78,8 @@ public:
virtual bool enabled() const OVERRIDE;
virtual void setEnabled(bool) OVERRIDE;
virtual bool isOverlayScrollbar() const OVERRIDE;
+ virtual bool isAlphaLocked() const OVERRIDE;
+ virtual void setIsAlphaLocked(bool) OVERRIDE;
private:
WebKit::WebScrollbar* m_scrollbar;
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 97416e024..764ae6dca 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -682,6 +682,7 @@ void WebViewImpl::scrollBy(const WebCore::IntPoint& delta)
#if ENABLE(GESTURE_EVENTS)
bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
{
+ bool eventSwallowed = false;
switch (event.type) {
case WebInputEvent::GestureFlingStart: {
m_client->cancelScheduledContentIntents();
@@ -692,18 +693,21 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
OwnPtr<PlatformGestureCurve> flingCurve = PlatformGestureCurveFactory::get()->createCurve(event.data.flingStart.sourceDevice, FloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY));
m_gestureAnimation = ActivePlatformGestureAnimation::create(flingCurve.release(), this);
scheduleAnimation();
- return true;
+ eventSwallowed = true;
+ break;
}
case WebInputEvent::GestureFlingCancel:
if (m_gestureAnimation) {
m_gestureAnimation.clear();
- return true;
+ eventSwallowed = true;
}
- return false;
+ break;
case WebInputEvent::GestureTap: {
m_client->cancelScheduledContentIntents();
- if (detectContentOnTouch(WebPoint(event.x, event.y), event.type))
- return true;
+ if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) {
+ eventSwallowed = true;
+ break;
+ }
RefPtr<WebCore::PopupContainer> selectPopup;
selectPopup = m_selectPopup;
@@ -716,12 +720,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScaleFactor(), goodTargets);
// FIXME: replace touch adjustment code when numberOfGoodTargets == 1?
// Single candidate case is currently handled by: https://bugs.webkit.org/show_bug.cgi?id=85101
- if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(event, goodTargets))
- return true;
+ if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(event, goodTargets)) {
+ eventSwallowed = true;
+ break;
+ }
}
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- bool gestureHandled = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
if (m_selectPopup && m_selectPopup == selectPopup) {
// That tap triggered a select popup which is the same as the one that
@@ -731,23 +737,26 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
hideSelectPopup();
}
- return gestureHandled;
+ break;
}
case WebInputEvent::GestureTwoFingerTap:
case WebInputEvent::GestureLongPress: {
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
- return false;
+ break;
m_client->cancelScheduledContentIntents();
- if (detectContentOnTouch(WebPoint(event.x, event.y), event.type))
- return true;
+ if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) {
+ eventSwallowed = true;
+ break;
+ }
m_page->contextMenuController()->clearContextMenu();
m_contextMenuAllowed = true;
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- bool handled = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent);
+ eventSwallowed = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent);
m_contextMenuAllowed = false;
- return handled;
+
+ break;
}
case WebInputEvent::GestureTapDown: {
m_client->cancelScheduledContentIntents();
@@ -757,7 +766,8 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
enableTouchHighlight(IntPoint(event.x, event.y));
#endif
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ break;
}
case WebInputEvent::GestureDoubleTap:
case WebInputEvent::GestureScrollBegin:
@@ -769,12 +779,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
case WebInputEvent::GesturePinchEnd:
case WebInputEvent::GesturePinchUpdate: {
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ break;
}
default:
ASSERT_NOT_REACHED();
}
- return false;
+ m_client->didHandleGestureEvent(event, eventSwallowed);
+ return eventSwallowed;
}
void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters& parameters)
@@ -2223,7 +2235,7 @@ WebTextInputType WebViewImpl::textInputType()
return WebTextInputTypeNone;
}
-bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const
+bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
{
const Frame* frame = focusedWebCoreFrame();
if (!frame)
@@ -2233,7 +2245,7 @@ bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const
return false;
if (selection->isCaret()) {
- start = end = frame->view()->contentsToWindow(selection->absoluteCaretBounds());
+ anchor = focus = frame->view()->contentsToWindow(selection->absoluteCaretBounds());
return true;
}
@@ -2246,20 +2258,20 @@ bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const
selectedRange->startOffset(),
selectedRange->startContainer(),
selectedRange->startOffset()));
- start = frame->editor()->firstRectForRange(range.get());
+ anchor = frame->editor()->firstRectForRange(range.get());
range = Range::create(selectedRange->endContainer()->document(),
selectedRange->endContainer(),
selectedRange->endOffset(),
selectedRange->endContainer(),
selectedRange->endOffset());
- end = frame->editor()->firstRectForRange(range.get());
+ focus = frame->editor()->firstRectForRange(range.get());
- start = frame->view()->contentsToWindow(start);
- end = frame->view()->contentsToWindow(end);
+ anchor = frame->view()->contentsToWindow(anchor);
+ focus = frame->view()->contentsToWindow(focus);
if (!frame->selection()->selection().isBaseFirst())
- std::swap(start, end);
+ std::swap(anchor, focus);
return true;
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 11a05d0de..865898608 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -167,7 +167,7 @@ public:
virtual void extendSelectionAndDelete(int before, int after);
virtual bool isSelectionEditable() const;
virtual WebColor backgroundColor() const;
- virtual bool selectionBounds(WebRect& start, WebRect& end) const;
+ virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const;
virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const;
virtual bool caretOrSelectionRange(size_t* location, size_t* length);
virtual void setTextDirection(WebTextDirection direction);
diff --git a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
index cb94243d0..6770bfe8a 100644
--- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
@@ -113,7 +113,7 @@ private:
FakeIDBDatabaseCallbacks() { }
};
-TEST(IDBDatabaseBackendTest, ConnectionLifecycle)
+TEST(IDBDatabaseBackendTest, DISABLED_ConnectionLifecycle)
{
RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore());
EXPECT_TRUE(backingStore->hasOneRef());
@@ -172,7 +172,7 @@ private:
WebIDBDatabaseImpl& m_webDatabase;
};
-TEST(IDBDatabaseBackendTest, ForcedClose)
+TEST(IDBDatabaseBackendTest, DISABLED_ForcedClose)
{
RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore());
EXPECT_TRUE(backingStore->hasOneRef());
diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
index e0a5a8fa5..457ae3745 100644
--- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
+++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
@@ -35,38 +35,38 @@ public:
virtual void getDatabaseNames(Vector<String>& foundNames) OVERRIDE { }
virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId) OVERRIDE { return false; }
virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId) OVERRIDE { return true; }
- virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version) OVERRIDE { return false; }
- virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t version) OVERRIDE { return false; }
+ virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) OVERRIDE { return false; }
+ virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t version) OVERRIDE { return false; }
virtual bool deleteDatabase(const String& name) OVERRIDE { return false; }
virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags) OVERRIDE { }
- virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId) OVERRIDE { return false; }
- virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
+ virtual bool createObjectStore(Transaction*, int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId) OVERRIDE { return false; }
+ virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<ObjectStoreRecordIdentifier>(); }
- virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
- virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
- virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
- virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { }
- virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; }
- virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; }
- virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
+ virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
+ virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
+ virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
+ virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { }
+ virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; }
+ virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; }
+ virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
- virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; }
+ virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; }
virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags) OVERRIDE { }
- virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId) OVERRIDE { return false; }
- virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
- virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
- virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
- virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
- virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
+ virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId) OVERRIDE { return false; }
+ virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
+ virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
+ virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
+ virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
+ virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
- virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
- virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
- virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
- virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
+ virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
+ virtual PassRefPtr<Cursor> openObjectStoreCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
+ virtual PassRefPtr<Cursor> openIndexKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
+ virtual PassRefPtr<Cursor> openIndexCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
virtual PassRefPtr<Transaction> createTransaction() OVERRIDE { return PassRefPtr<Transaction>(); }
};
diff --git a/Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp b/Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
index 38b0c9885..0cf82494b 100644
--- a/Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
+++ b/Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
@@ -29,6 +29,7 @@
#include "Color.h"
#include "GraphicsContext.h"
#include "IntRect.h"
+#include "PlatformContextSkia.h"
#include "skia/ext/platform_canvas.h"
#include <public/WebFloatRect.h>
#include <public/WebRect.h>
@@ -100,6 +101,22 @@ struct PaintFillPartialOpaque : public PaintCallback {
IntRect m_opaqueRect;
};
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+struct HintingScaleCallback : public PaintCallback {
+ HintingScaleCallback()
+ : hintingScale(SK_Scalar1)
+ {
+ }
+
+ virtual void operator()(GraphicsContext& context, const IntRect& contentRect)
+ {
+ hintingScale = context.platformContext()->hintingScaleFactor();
+ }
+
+ SkScalar hintingScale;
+};
+#endif
+
#define EXPECT_EQ_RECT(a, b) \
EXPECT_EQ(a.x, b.x); \
EXPECT_EQ(a.width, b.width); \
@@ -194,4 +211,23 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testPartialOpaqueRectTranslat
EXPECT_EQ_RECT(WebFloatRect(partialRect.x(), partialRect.y(), partialRect.width(), partialRect.height()), opaqueRect);
}
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testHintingScaleFactorSet)
+{
+ HintingScaleCallback callback;
+ TestLayerPainterChromium painter(callback);
+ OpaqueRectTrackingContentLayerDelegate delegate(&painter);
+
+ SkScalar hintingScale = SkIntToScalar(2);
+ SkCanvas canvas;
+ canvas.scale(hintingScale, hintingScale);
+ EXPECT_EQ(callback.hintingScale, SK_Scalar1);
+
+ IntRect rectA;
+ WebFloatRect rectB;
+ delegate.paintContents(&canvas, rectA, rectB);
+ EXPECT_EQ(callback.hintingScale, hintingScale);
+}
+#endif
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp b/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp
index eb2c07512..c73b6149a 100644
--- a/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp
+++ b/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp
@@ -830,4 +830,21 @@ TEST(PlatformContextSkiaTest, PreserveOpaqueOnlyMattersForFirstLayer)
EXPECT_PIXELS_MATCH_EXACT(bitmap, platformContext.opaqueRegion().asRect());
}
+#if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
+TEST(PlatformContextSkiaTest, hintingScaleFactorAppliedOnPaint)
+{
+ SkBitmap bitmap;
+ SkCanvas canvas(bitmap);
+
+ SkScalar hintingScale = SkIntToScalar(2);
+ PlatformContextSkia platformContext(&canvas);
+ platformContext.setHintingScaleFactor(hintingScale);
+
+ SkPaint paint;
+ EXPECT_EQ(paint.getHintingScaleFactor(), SK_Scalar1);
+ platformContext.setupPaintCommon(&paint);
+ EXPECT_EQ(paint.getHintingScaleFactor(), hintingScale);
+}
+#endif
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
index c6efbb5bf..b85149bcd 100644
--- a/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
@@ -61,6 +61,8 @@ public:
virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE { return WebScrollbar::ScrollbarOverlayStyleDefault; }
virtual bool isCustomScrollbar() const OVERRIDE { return false; }
virtual Orientation orientation() const OVERRIDE { return WebScrollbar::Horizontal; }
+ virtual bool isAlphaLocked() const OVERRIDE { return false; }
+ virtual void setIsAlphaLocked(bool) OVERRIDE { }
};
TEST(ScrollbarLayerChromiumTest, resolveScrollLayerPointer)
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
index 4328a0e4a..a0049b67e 100644
--- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
@@ -1072,7 +1072,7 @@ TEST_F(WebFrameTest, SelectRange)
frame = webView->mainFrame();
EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
webView->selectionBounds(startWebRect, endWebRect);
- frame->selectRange(WebPoint(0, 0), bottomRightMinusOne(endWebRect));
+ frame->selectRange(bottomRightMinusOne(endWebRect), WebPoint(0, 0));
EXPECT_EQ("16-char header. This text is initially selected.", selectionAsString(frame));
webView->close();
@@ -1086,176 +1086,100 @@ TEST_F(WebFrameTest, SelectRange)
webView->close();
}
-TEST_F(WebFrameTest, MoveSelectionStart)
+TEST_F(WebFrameTest, SelectRangeCanMoveSelectionStart)
{
registerMockedHttpURLLoad("text_selection.html");
WebView* webView = createWebViewForTextSelection(m_baseURL + "text_selection.html");
WebFrame* frame = webView->mainFrame();
- // moveSelectionStart() always returns false if there's no selection.
- EXPECT_FALSE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_1")), false));
- EXPECT_FALSE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_1")), true));
-
- frame->executeScript(WebScriptSource("selectElement('header_1');"));
- EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "header_2")), false));
- EXPECT_EQ("Header 1. Header 2.", selectionAsString(frame));
-
// Select second span. We can move the start to include the first span.
frame->executeScript(WebScriptSource("selectElement('header_2');"));
EXPECT_EQ("Header 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_1")), false));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "header_2")), topLeft(elementBounds(frame, "header_1")));
EXPECT_EQ("Header 1. Header 2.", selectionAsString(frame));
- // If allowCollapsedSelection=false we can't move the selection start beyond the current end.
- // We end up with a single character selected.
+ // We can move the start and end together.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(bottomRightMinusOne(elementBounds(frame, "header_1")), false));
- EXPECT_EQ(".", selectionAsString(frame));
-
- // If allowCollapsedSelection=true we can move the start and end together.
- frame->executeScript(WebScriptSource("selectElement('header_1');"));
- EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(bottomRightMinusOne(elementBounds(frame, "header_1")), true));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "header_1")), bottomRightMinusOne(elementBounds(frame, "header_1")));
EXPECT_EQ("", selectionAsString(frame));
// Selection is a caret, not empty.
EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_1")), true));
- EXPECT_EQ("Header 1.", selectionAsString(frame));
- // If allowCollapsedSelection=true we can move the start across the end.
+ // We can move the start across the end.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(bottomRightMinusOne(elementBounds(frame, "header_2")), true));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "header_1")), bottomRightMinusOne(elementBounds(frame, "header_2")));
EXPECT_EQ(" Header 2.", selectionAsString(frame));
// Can't extend the selection part-way into an editable element.
frame->executeScript(WebScriptSource("selectElement('footer_2');"));
EXPECT_EQ("Footer 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "editable_2")), true));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "footer_2")), topLeft(elementBounds(frame, "editable_2")));
EXPECT_EQ(" [ Footer 1. Footer 2.", selectionAsString(frame));
// Can extend the selection completely across editable elements.
frame->executeScript(WebScriptSource("selectElement('footer_2');"));
EXPECT_EQ("Footer 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_2")), true));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "footer_2")), topLeft(elementBounds(frame, "header_2")));
EXPECT_EQ("Header 2. ] [ Editable 1. Editable 2. ] [ Footer 1. Footer 2.", selectionAsString(frame));
// If the selection is editable text, we can't extend it into non-editable text.
frame->executeScript(WebScriptSource("selectElement('editable_2');"));
EXPECT_EQ("Editable 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "header_2")), true));
+ frame->selectRange(bottomRightMinusOne(elementBounds(frame, "editable_2")), topLeft(elementBounds(frame, "header_2")));
EXPECT_EQ("[ Editable 1. Editable 2.", selectionAsString(frame));
webView->close();
}
-TEST_F(WebFrameTest, MoveSelectionEnd)
+TEST_F(WebFrameTest, SelectRangeCanMoveSelectionEnd)
{
registerMockedHttpURLLoad("text_selection.html");
WebView* webView = createWebViewForTextSelection(m_baseURL + "text_selection.html");
WebFrame* frame = webView->mainFrame();
- // moveSelectionEnd() always returns false if there's no selection.
- EXPECT_FALSE(frame->moveSelectionEnd(topLeft(elementBounds(frame, "header_1")), false));
- EXPECT_FALSE(frame->moveSelectionEnd(topLeft(elementBounds(frame, "header_1")), true));
-
// Select first span. We can move the end to include the second span.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "header_2")), false));
+ frame->selectRange(topLeft(elementBounds(frame, "header_1")), bottomRightMinusOne(elementBounds(frame, "header_2")));
EXPECT_EQ("Header 1. Header 2.", selectionAsString(frame));
- // If allowCollapsedSelection=false we can't move the selection end beyond the current start.
- // We end up with a single character selected.
+ // We can move the start and end together.
frame->executeScript(WebScriptSource("selectElement('header_2');"));
EXPECT_EQ("Header 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(topLeft(elementBounds(frame, "header_2")), false));
- EXPECT_EQ("H", selectionAsString(frame));
-
- // If allowCollapsedSelection=true we can move the start and end together.
- frame->executeScript(WebScriptSource("selectElement('header_2');"));
- EXPECT_EQ("Header 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(topLeft(elementBounds(frame, "header_2")), true));
+ frame->selectRange(topLeft(elementBounds(frame, "header_2")), topLeft(elementBounds(frame, "header_2")));
EXPECT_EQ("", selectionAsString(frame));
// Selection is a caret, not empty.
EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "header_2")), true));
- EXPECT_EQ("Header 2.", selectionAsString(frame));
- // If allowCollapsedSelection=true we can move the end across the start.
+ // We can move the end across the start.
frame->executeScript(WebScriptSource("selectElement('header_2');"));
EXPECT_EQ("Header 2.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(topLeft(elementBounds(frame, "header_1")), true));
+ frame->selectRange(topLeft(elementBounds(frame, "header_2")), topLeft(elementBounds(frame, "header_1")));
EXPECT_EQ("Header 1. ", selectionAsString(frame));
// Can't extend the selection part-way into an editable element.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "editable_1")), true));
+ frame->selectRange(topLeft(elementBounds(frame, "header_1")), bottomRightMinusOne(elementBounds(frame, "editable_1")));
EXPECT_EQ("Header 1. Header 2. ] ", selectionAsString(frame));
// Can extend the selection completely across editable elements.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "footer_1")), true));
+ frame->selectRange(topLeft(elementBounds(frame, "header_1")), bottomRightMinusOne(elementBounds(frame, "footer_1")));
EXPECT_EQ("Header 1. Header 2. ] [ Editable 1. Editable 2. ] [ Footer 1.", selectionAsString(frame));
// If the selection is editable text, we can't extend it into non-editable text.
frame->executeScript(WebScriptSource("selectElement('editable_1');"));
EXPECT_EQ("Editable 1.", selectionAsString(frame));
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "footer_1")), true));
+ frame->selectRange(topLeft(elementBounds(frame, "editable_1")), bottomRightMinusOne(elementBounds(frame, "footer_1")));
EXPECT_EQ("Editable 1. Editable 2. ]", selectionAsString(frame));
webView->close();
}
-TEST_F(WebFrameTest, MoveCaret)
-{
- registerMockedHttpURLLoad("text_selection.html");
- WebView* webView = createWebViewForTextSelection(m_baseURL + "text_selection.html");
- WebFrame* frame = webView->mainFrame();
-
- // moveCaret() returns false if there's no selection, or if it isn't editable.
- EXPECT_FALSE(frame->moveCaret(topLeft(elementBounds(frame, "editable"))));
- frame->executeScript(WebScriptSource("selectElement('header_1');"));
- EXPECT_EQ("Header 1.", selectionAsString(frame));
- EXPECT_FALSE(frame->moveCaret(topLeft(elementBounds(frame, "editable"))));
-
- // Select the editable text span. Now moveCaret() works.
- frame->executeScript(WebScriptSource("selectElement('editable_1');"));
- EXPECT_EQ("Editable 1.", selectionAsString(frame));
-
- EXPECT_TRUE(frame->moveCaret(topLeft(elementBounds(frame, "editable_1"))));
- EXPECT_EQ("", selectionAsString(frame));
- EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "editable_1")), false));
- EXPECT_EQ("Editable 1.", selectionAsString(frame));
-
- EXPECT_TRUE(frame->moveCaret(bottomRightMinusOne(elementBounds(frame, "editable_2"))));
- EXPECT_EQ("", selectionAsString(frame));
- EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "editable_2")), false));
- EXPECT_EQ("Editable 2.", selectionAsString(frame));
-
- // Caret is pinned at the start of the editable region.
- EXPECT_TRUE(frame->moveCaret(topLeft(elementBounds(frame, "header_1"))));
- EXPECT_EQ("", selectionAsString(frame));
- EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionEnd(bottomRightMinusOne(elementBounds(frame, "editable_1")), false));
- EXPECT_EQ("[ Editable 1.", selectionAsString(frame));
-
- // Caret is pinned at the end of the editable region.
- EXPECT_TRUE(frame->moveCaret(bottomRightMinusOne(elementBounds(frame, "footer_2"))));
- EXPECT_EQ("", selectionAsString(frame));
- EXPECT_FALSE(frame->selectionRange().isNull());
- EXPECT_TRUE(frame->moveSelectionStart(topLeft(elementBounds(frame, "editable_2")), false));
- EXPECT_EQ("Editable 2. ]", selectionAsString(frame));
-
- webView->close();
-}
-
class DisambiguationPopupTestWebViewClient : public WebViewClient {
public:
virtual bool didTapMultipleTargets(const WebGestureEvent&, const WebVector<WebRect>& targetRects) OVERRIDE
diff --git a/Source/WebKit/chromium/tests/WebImageTest.cpp b/Source/WebKit/chromium/tests/WebImageTest.cpp
new file mode 100644
index 000000000..f968176cf
--- /dev/null
+++ b/Source/WebKit/chromium/tests/WebImageTest.cpp
@@ -0,0 +1,102 @@
+/*
+ * 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 are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <public/WebImage.h>
+
+#include "FileSystem.h"
+#include "SharedBuffer.h"
+#include <gtest/gtest.h>
+#include <public/WebData.h>
+#include <public/WebSize.h>
+#include <webkit/support/webkit_support.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+namespace {
+
+static PassRefPtr<SharedBuffer> readFile(const char* fileName)
+{
+ String filePath = webkit_support::GetWebKitRootDir();
+ filePath.append("/Source/WebKit/chromium/tests/data/");
+ filePath.append(fileName);
+
+ long long fileSize;
+ if (!getFileSize(filePath, fileSize))
+ return 0;
+
+ PlatformFileHandle handle = openFile(filePath, OpenForRead);
+ int fileLength = static_cast<int>(fileSize);
+ Vector<char> buffer(fileLength);
+ readFromFile(handle, buffer.data(), fileLength);
+ closeFile(handle);
+ return SharedBuffer::adoptVector(buffer);
+}
+
+TEST(WebImageTest, PNGImage)
+{
+ RefPtr<SharedBuffer> data = readFile("white-1x1.png");
+ ASSERT_TRUE(data.get());
+
+ WebImage image = WebImage::fromData(WebData(data), WebSize());
+ EXPECT_TRUE(image.size() == WebSize(1, 1));
+ SkAutoLockPixels autoLock(image.getSkBitmap());
+ EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), image.getSkBitmap().getColor(0, 0));
+}
+
+TEST(WebImageTest, ICOImage)
+{
+ RefPtr<SharedBuffer> data = readFile("black-and-white.ico");
+ ASSERT_TRUE(data.get());
+
+ WebVector<WebImage> images = WebImage::framesFromData(WebData(data));
+ ASSERT_EQ(2u, images.size());
+ EXPECT_TRUE(images[0].size() == WebSize(2, 2));
+ EXPECT_TRUE(images[1].size() == WebSize(1, 1));
+ SkAutoLockPixels autoLock1(images[0].getSkBitmap());
+ EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), images[0].getSkBitmap().getColor(0, 0));
+ SkAutoLockPixels autoLock2(images[1].getSkBitmap());
+ EXPECT_EQ(SkColorSetARGB(255, 0, 0, 0), images[1].getSkBitmap().getColor(0, 0));
+}
+
+TEST(WebImageTest, BadImage)
+{
+ const char badImage[] = "hello world";
+ WebVector<WebImage> images = WebImage::framesFromData(WebData(badImage));
+ ASSERT_EQ(0u, images.size());
+
+ WebImage image = WebImage::fromData(WebData(badImage), WebSize());
+ EXPECT_TRUE(image.getSkBitmap().empty());
+ EXPECT_TRUE(image.getSkBitmap().isNull());
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp
index b7ab658de..d478aad92 100644
--- a/Source/WebKit/chromium/tests/WebViewTest.cpp
+++ b/Source/WebKit/chromium/tests/WebViewTest.cpp
@@ -120,6 +120,40 @@ private:
bool m_focused;
};
+class TapHandlingWebViewClient : public WebViewClient {
+public:
+ // WebViewClient methods
+ virtual void didHandleGestureEvent(const WebGestureEvent& event, bool handled)
+ {
+ if (event.type == WebInputEvent::GestureTap) {
+ m_tapX = event.x;
+ m_tapY = event.y;
+ } else if (event.type == WebInputEvent::GestureLongPress) {
+ m_longpressX = event.x;
+ m_longpressY = event.y;
+ }
+ }
+
+ // Local methods
+ void reset()
+ {
+ m_tapX = -1;
+ m_tapY = -1;
+ m_longpressX = -1;
+ m_longpressY = -1;
+ }
+ int tapX() { return m_tapX; }
+ int tapY() { return m_tapY; }
+ int longpressX() { return m_longpressX; }
+ int longpressY() { return m_longpressY; }
+
+private:
+ int m_tapX;
+ int m_tapY;
+ int m_longpressX;
+ int m_longpressY;
+};
+
class WebViewTest : public testing::Test {
public:
WebViewTest()
@@ -589,4 +623,28 @@ TEST_F(WebViewTest, DetectContentAroundPosition)
webView->close();
}
+TEST_F(WebViewTest, ClientTapHandling)
+{
+ TapHandlingWebViewClient client;
+ client.reset();
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad("about:blank", true, 0, &client);
+ WebGestureEvent event;
+ event.type = WebInputEvent::GestureTap;
+ event.x = 3;
+ event.y = 8;
+ webView->handleInputEvent(event);
+ webkit_support::RunAllPendingMessages();
+ EXPECT_EQ(3, client.tapX());
+ EXPECT_EQ(8, client.tapY());
+ client.reset();
+ event.type = WebInputEvent::GestureLongPress;
+ event.x = 25;
+ event.y = 7;
+ webView->handleInputEvent(event);
+ webkit_support::RunAllPendingMessages();
+ EXPECT_EQ(25, client.longpressX());
+ EXPECT_EQ(7, client.longpressY());
+ webView->close();
+}
+
}
diff --git a/Source/WebKit/chromium/tests/data/black-and-white.ico b/Source/WebKit/chromium/tests/data/black-and-white.ico
new file mode 100644
index 000000000..6bdf9ca4f
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/black-and-white.ico
Binary files differ
diff --git a/Source/WebKit/chromium/tests/data/white-1x1.png b/Source/WebKit/chromium/tests/data/white-1x1.png
new file mode 100644
index 000000000..ccf7a6ca0
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/white-1x1.png
Binary files differ
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index 5dee3176c..463ef9884 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,246 @@
+2012-09-20 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ [EFL] Change the log macro names to be more consistent with EINA LOG
+ https://bugs.webkit.org/show_bug.cgi?id=97158
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Some log macro names in WebKit1 are inconsistent with EINA LOG names
+ such as WRN/INF not WARN/INFO.
+
+ #define WRN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
+ #define INF(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
+
+ This patch changes the such names to be consistent with EINA LOG's names.
+
+ * ewk/ewk_frame.cpp:
+ (_ewk_frame_smart_resize):
+ (ewk_frame_source_get):
+ (ewk_frame_uri_changed):
+ * ewk/ewk_main.cpp:
+ (_ewk_init_body):
+ * ewk/ewk_private.h:
+ * ewk/ewk_tiled_backing_store.cpp:
+ (_ewk_tiled_backing_store_render):
+ (_ewk_tiled_backing_store_recalc_renderers):
+ (_ewk_tiled_backing_store_smart_calculate_offset_force):
+ (_ewk_tiled_backing_store_smart_calculate_offset):
+ (ewk_tiled_backing_store_pre_render_relative_radius):
+ * ewk/ewk_tiled_matrix.cpp:
+ (ewk_tile_matrix_free):
+ (ewk_tile_matrix_tile_exact_get):
+ (_ewk_tile_matrix_slicer_setup):
+ * ewk/ewk_view.cpp:
+ (_ewk_view_smart_add_console_message):
+ (_ewk_view_smart_run_javascript_alert):
+ (_ewk_view_smart_run_javascript_confirm):
+ (_ewk_view_smart_should_interrupt_javascript):
+ (_ewk_view_smart_run_javascript_prompt):
+ (_ewk_view_smart_pre_render_region):
+ (_ewk_view_smart_pre_render_relative_radius):
+ (_ewk_view_smart_pre_render_start):
+ (_ewk_view_smart_pre_render_cancel):
+ (_ewk_view_smart_disable_render):
+ (_ewk_view_smart_enable_render):
+ (ewk_view_bg_color_set):
+ (ewk_view_zoom_set):
+ (ewk_view_zoom_weak_set):
+ (ewk_view_zoom_animated_set):
+ (ewk_view_statusbar_text_set):
+ (ewk_view_exceeded_application_cache_quota):
+ (ewk_view_exceeded_database_quota):
+ (ewk_view_scroll):
+ (ewk_view_popup_new):
+ (ewk_view_popup_destroy):
+ (ewk_view_popup_selected_set):
+ (ewk_view_color_chooser_new):
+ (ewk_view_color_chooser_destroy):
+ (ewk_view_color_chooser_color_set):
+ (ewk_view_color_chooser_changed):
+ (ewk_view_zoom_range_set):
+ * ewk/ewk_view_private.h:
+
+2012-09-19 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ Fix unused parameter compile warnings in WebKit/WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=96742
+
+ Reviewed by Gyuyoung Kim.
+
+ Fix unused parameter compile warning messages(-Wunused-parameter) in WebKit during EFL build.
+ WebCore's warning messages were fixed in r128570.
+
+ * WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::createWindow):
+ (WebCore::ChromeClientEfl::mouseDidMoveOverElement):
+ (WebCore::ChromeClientEfl::print):
+ (WebCore::ChromeClientEfl::reachedMaxAppCacheSize):
+ (WebCore::ChromeClientEfl::invalidateContents):
+ (WebCore::ChromeClientEfl::invalidateRootView):
+ (WebCore::ChromeClientEfl::invalidateContentsAndRootView):
+ * WebCoreSupport/EditorClientEfl.cpp:
+ (WebCore::EditorClientEfl::handleInputMethodKeydown):
+ (WebCore::EditorClientEfl::getGuessesForWord):
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveAuthenticationChallenge):
+ (WebCore::FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge):
+ (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientEfl::createFrame):
+ (WebCore::FrameLoaderClientEfl::createJavaAppletWidget):
+ (WebCore::FrameLoaderClientEfl::shouldStopLoadingForHistoryItem):
+ (WebCore::FrameLoaderClientEfl::canShowMIMETypeAsHTML):
+ (WebCore::FrameLoaderClientEfl::setTitle):
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientEfl::setMainDocumentError):
+ * WebCoreSupport/FullscreenVideoControllerEfl.cpp:
+ (FullscreenVideoController::showHud):
+ (FullscreenVideoController::setVolume):
+ (FullscreenVideoController::setCurrentTime):
+ * WebCoreSupport/InspectorClientEfl.cpp:
+ (WebCore::notifyWebInspectorDestroy):
+ (WebCore::InspectorFrontendSettingsEfl::getProperty):
+ (WebCore::InspectorFrontendSettingsEfl::setProperty):
+ * WebCoreSupport/PlatformStrategiesEfl.cpp:
+ (PlatformStrategiesEfl::getPluginInfo):
+ * ewk/ewk_auth_soup.cpp:
+ (ewk_auth_soup_dialog_class_init):
+ (ewk_auth_soup_dialog_init):
+ (ewk_auth_soup_dialog_session_feature_init):
+ (session_authenticate):
+ * ewk/ewk_file_chooser.cpp:
+ (ewk_file_chooser_allows_directory_upload_get):
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_feed_focus_out):
+ (ewk_frame_view_state_save):
+ (ewk_frame_plugin_create):
+ * ewk/ewk_js.cpp:
+ (ewk_js_object_new):
+ (ewk_js_object_free):
+ (ewk_js_object_view_get):
+ (ewk_js_object_properties_get):
+ (ewk_js_object_name_get):
+ (ewk_js_object_invoke):
+ (ewk_js_object_type_get):
+ (ewk_js_object_type_set):
+ (ewk_js_variant_free):
+ (ewk_js_variant_array_free):
+ * ewk/ewk_tiled_model.cpp:
+ (tile_account):
+ (_ewk_tile_account_allocated):
+ (_ewk_tile_account_freed):
+ * ewk/ewk_view.cpp:
+ (_ewk_view_smart_add_console_message):
+ (_ewk_view_smart_run_javascript_alert):
+ (_ewk_view_smart_run_javascript_confirm):
+ (_ewk_view_smart_should_interrupt_javascript):
+ (_ewk_view_smart_run_javascript_prompt):
+ (_ewk_view_smart_move):
+ (_ewk_view_smart_contents_resize):
+ (_ewk_view_editor_command_string_get):
+ (ewk_view_popup_new):
+ (ewk_view_js_object_add):
+ (ewk_view_accelerated_compositing_object_create):
+ (ewk_view_accelerated_compositing_context_get):
+ (ewk_view_setting_web_audio_get):
+ (ewk_view_setting_web_audio_set):
+ * ewk/ewk_view_single.cpp:
+ (_ewk_view_single_smart_bg_color_set):
+ * ewk/ewk_view_tiled.cpp:
+ (_ewk_view_tiled_updates_process_pre):
+ (_ewk_view_tiled_contents_size_changed_cb):
+ (_ewk_view_tiled_smart_bg_color_set):
+
+2012-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r128995.
+ http://trac.webkit.org/changeset/128995
+ https://bugs.webkit.org/show_bug.cgi?id=97114
+
+ Causes the api tests to segfault. (Requested by rakuco on
+ #webkit).
+
+ * tests/UnitTestUtils/EWKTestBase.cpp:
+ (EWKUnitTests::EWKTestBase::init):
+ (EWKUnitTests::EWKTestBase::shutdownAll):
+ (EWKUnitTests::EWKTestBase::startTest):
+ (EWKUnitTests::EWKTestBase::endTest):
+ (EWKUnitTests::EWKTestBase::createTest):
+ (EWKUnitTests):
+ (EWKUnitTests::EWKTestBase::runTest):
+ * tests/UnitTestUtils/EWKTestBase.h:
+ (EWKUnitTests):
+ (EWKTestBase):
+ * tests/UnitTestUtils/EWKTestView.cpp:
+ (EWKUnitTests::EWKTestEcoreEvas::EWKTestEcoreEvas):
+ (EWKUnitTests::EWKTestEcoreEvas::evas):
+ (EWKUnitTests):
+ (EWKUnitTests::EWKTestEcoreEvas::show):
+ (EWKUnitTests::EWKTestView::EWKTestView):
+ (EWKUnitTests::EWKTestView::init):
+ (EWKUnitTests::EWKTestView::show):
+ (EWKUnitTests::EWKTestView::mainFrame):
+ (EWKUnitTests::EWKTestView::evas):
+ (EWKUnitTests::EWKTestView::bindEvents):
+ * tests/UnitTestUtils/EWKTestView.h:
+ (EWKTestEcoreEvas):
+ (EWKUnitTests):
+ (EWKTestView):
+ * tests/test_ewk_view.cpp:
+ (ewkViewEditableGetCb):
+ (TEST):
+ (ewkViewUriGetCb):
+ * tests/test_runner.cpp:
+ (main):
+
+2012-09-19 Krzysztof Czech <k.czech@samsung.com>
+
+ [EFL][UT] Refactoring an implementation of testing framework for wk1.
+ https://bugs.webkit.org/show_bug.cgi?id=94925
+
+ Reviewed by Gyuyoung Kim.
+
+ The reason of changing, was to adjust current implementation to use gtest features
+ related to cleaning (SetUp, TearDown), cleaning code in terms of useless methods
+ and lastly to make framework easier to use.
+
+ * tests/UnitTestUtils/EWKTestBase.cpp:
+ (EWKUnitTests::EWKTestBase::EWKTestBase): Added to initialize test view.
+ (EWKUnitTests::EWKTestBase::webView): Returns current webview.
+ (EWKUnitTests::EWKTestBase::SetUp):
+ Before test is started, SetUp is called.
+ Used this to initialize efl and test view.
+ (EWKUnitTests::EWKTestBase::TearDown):
+ TearDown is called as soon as test is completed.
+ Used this to properly shutdown efl and clean test view.
+ (EWKUnitTests::EWKTestBase::onLoadFinished):
+ (EWKUnitTests::EWKTestBase::waitUntilLoadFinished): It waits till test page will be properly loaded.
+ (EWKUnitTests::EWKTestBase::loadUrl): Starts loading test page.
+ * tests/UnitTestUtils/EWKTestBase.h:
+ * tests/UnitTestUtils/EWKTestView.cpp:
+ (EWKUnitTests::EWKTestView::EWKTestView):
+ (EWKUnitTests::EWKTestView::init): Initialize test view.
+ * tests/UnitTestUtils/EWKTestView.h:
+ (EWKTestView):
+ * tests/test_ewk_view.cpp:
+ (TEST_F):
+ * tests/test_runner.cpp:
+ (main):
+
+2012-09-19 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] EFL's DRT does not support overriding 'WebKitCSSRegionsEnabled' preference
+ https://bugs.webkit.org/show_bug.cgi?id=97100
+
+ Reviewed by Gyuyoung Kim.
+
+ Add DumpRenderTree support method to set the
+ 'WebKitCSSRegionsEnabled' preference.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::setCSSRegionsEnabled):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
2012-09-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
Evas_Object* is a ref'ed structure, so tread it as such
diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index 9d5cde5a3..f491d6855 100644
--- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -154,7 +154,7 @@ void ChromeClientEfl::unfocus()
evas_object_focus_set(m_view, EINA_FALSE);
}
-Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
+Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&)
{
Evas_Object* newView = ewk_view_window_create(m_view, EINA_TRUE, &features);
if (!newView)
@@ -361,7 +361,7 @@ void ChromeClientEfl::scrollbarsModeDidChange() const
{
}
-void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
+void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned /*modifierFlags*/)
{
// FIXME, compare with old link, look at Qt impl.
bool isLink = hit.isLiveLink();
@@ -388,12 +388,12 @@ void ChromeClientEfl::setToolTip(const String& toolTip, TextDirection)
ewk_view_tooltip_text_set(m_view, toolTip.utf8().data());
}
-void ChromeClientEfl::print(Frame* frame)
+void ChromeClientEfl::print(Frame*)
{
notImplemented();
}
-void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded)
+void ChromeClientEfl::reachedMaxAppCacheSize(int64_t /*spaceNeeded*/)
{
// FIXME: Free some space.
notImplemented();
@@ -514,17 +514,17 @@ void ChromeClientEfl::cancelGeolocationPermissionForFrame(Frame*, Geolocation*)
notImplemented();
}
-void ChromeClientEfl::invalidateContents(const IntRect& updateRect, bool immediate)
+void ChromeClientEfl::invalidateContents(const IntRect& /*updateRect*/, bool /*immediate*/)
{
notImplemented();
}
-void ChromeClientEfl::invalidateRootView(const IntRect& updateRect, bool immediate)
+void ChromeClientEfl::invalidateRootView(const IntRect& /*updateRect*/, bool /*immediate*/)
{
notImplemented();
}
-void ChromeClientEfl::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
+void ChromeClientEfl::invalidateContentsAndRootView(const IntRect& updateRect, bool /*immediate*/)
{
if (updateRect.isEmpty())
return;
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
index 33bb088c6..305943c90 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
@@ -342,6 +342,13 @@ void DumpRenderTreeSupportEfl::setCSSGridLayoutEnabled(const Evas_Object* ewkVie
page->settings()->setCSSGridLayoutEnabled(enabled);
}
+void DumpRenderTreeSupportEfl::setCSSRegionsEnabled(const Evas_Object* ewkView, bool enabled)
+{
+ DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
+
+ page->settings()->setCSSRegionsEnabled(enabled);
+}
+
bool DumpRenderTreeSupportEfl::isCommandEnabled(const Evas_Object* ewkView, const char* name)
{
DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
index e3f208409..c8273b416 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
@@ -79,6 +79,7 @@ public:
static bool findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions);
static bool isCommandEnabled(const Evas_Object* ewkView, const char* name);
static void setCSSGridLayoutEnabled(const Evas_Object* ewkView, bool enabled);
+ static void setCSSRegionsEnabled(const Evas_Object* ewkView, bool enabled);
static void setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled);
static void setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled);
diff --git a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
index 1846cc50c..d8a2113c0 100644
--- a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -367,7 +367,7 @@ void EditorClientEfl::handleKeyboardEvent(KeyboardEvent* event)
event->setDefaultHandled();
}
-void EditorClientEfl::handleInputMethodKeydown(KeyboardEvent* event)
+void EditorClientEfl::handleInputMethodKeydown(KeyboardEvent*)
{
}
@@ -466,7 +466,7 @@ bool EditorClientEfl::spellingUIIsShowing()
return false;
}
-void EditorClientEfl::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
+void EditorClientEfl::getGuessesForWord(const String& /*word*/, const String& /*context*/, Vector<String>& /*guesses*/)
{
notImplemented();
}
diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 168171201..4ffe5ace1 100644
--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -163,12 +163,12 @@ void FrameLoaderClientEfl::dispatchDidPopStateWithinPage()
notImplemented();
}
-void FrameLoaderClientEfl::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
+void FrameLoaderClientEfl::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long /*identifier*/, const AuthenticationChallenge&)
{
notImplemented();
}
-void FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
+void FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long /*identifier*/, const AuthenticationChallenge&)
{
notImplemented();
}
@@ -310,7 +310,7 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForResponse(FramePolicyFunction f
callPolicyFunction(function, PolicyDownload);
}
-void FrameLoaderClientEfl::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>, const String&)
+void FrameLoaderClientEfl::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest& resourceRequest, PassRefPtr<FormState>, const String&)
{
ASSERT(function);
ASSERT(m_frame);
@@ -368,7 +368,7 @@ PassRefPtr<Widget> FrameLoaderClientEfl::createPlugin(const IntSize& pluginSize,
mimeType, loadManually);
}
-PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool /*allowsScrolling*/, int /*marginWidth*/, int /*marginHeight*/)
{
ASSERT(m_frame);
ASSERT(m_view);
@@ -383,8 +383,8 @@ void FrameLoaderClientEfl::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-PassRefPtr<Widget> FrameLoaderClientEfl::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
- const Vector<String>& paramNames, const Vector<String>& paramValues)
+PassRefPtr<Widget> FrameLoaderClientEfl::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&,
+ const Vector<String>& /*paramNames*/, const Vector<String>& /*paramValues*/)
{
notImplemented();
return 0;
@@ -544,7 +544,7 @@ bool FrameLoaderClientEfl::shouldGoToHistoryItem(HistoryItem* item) const
return item;
}
-bool FrameLoaderClientEfl::shouldStopLoadingForHistoryItem(HistoryItem* item) const
+bool FrameLoaderClientEfl::shouldStopLoadingForHistoryItem(HistoryItem*) const
{
return true;
}
@@ -714,7 +714,7 @@ bool FrameLoaderClientEfl::canHandleRequest(const ResourceRequest&) const
return true;
}
-bool FrameLoaderClientEfl::canShowMIMETypeAsHTML(const String& MIMEType) const
+bool FrameLoaderClientEfl::canShowMIMETypeAsHTML(const String& /*MIMEType*/) const
{
notImplemented();
return false;
@@ -771,12 +771,12 @@ void FrameLoaderClientEfl::prepareForDataSourceReplacement()
notImplemented();
}
-void FrameLoaderClientEfl::setTitle(const StringWithDirection& title, const KURL& url)
+void FrameLoaderClientEfl::setTitle(const StringWithDirection&, const KURL&)
{
// no need for, dispatchDidReceiveTitle is the right callback
}
-void FrameLoaderClientEfl::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int dataLength)
+void FrameLoaderClientEfl::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long /*identifier*/, int /*dataLength*/)
{
notImplemented();
}
@@ -810,7 +810,7 @@ void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader*, unsigned long
evas_object_smart_callback_call(m_view, "load,resource,failed", &error);
}
-bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
+bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int /*length*/)
{
notImplemented();
return false;
@@ -941,7 +941,7 @@ void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&)
notImplemented();
}
-void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader* loader, const ResourceError& error)
+void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader*, const ResourceError& error)
{
if (!m_pluginView)
return;
diff --git a/Source/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp
index 70deaef87..27958f451 100644
--- a/Source/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/FullscreenVideoControllerEfl.cpp
@@ -58,7 +58,7 @@ void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement)
}
}
-void FullscreenVideoController::showHud(bool autoHide)
+void FullscreenVideoController::showHud(bool /*autoHide*/)
{
notImplemented();
}
@@ -126,7 +126,7 @@ bool FullscreenVideoController::muted() const
return false;
}
-void FullscreenVideoController::setVolume(float volume)
+void FullscreenVideoController::setVolume(float /*volume*/)
{
notImplemented();
}
@@ -147,7 +147,7 @@ float FullscreenVideoController::currentTime() const
return 0;
}
-void FullscreenVideoController::setCurrentTime(float value)
+void FullscreenVideoController::setCurrentTime(float /*value*/)
{
notImplemented();
}
diff --git a/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
index 12afacb19..701f306a9 100644
--- a/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
@@ -30,7 +30,7 @@
namespace WebCore {
-static void notifyWebInspectorDestroy(void* userData, Evas_Object* webview, void* eventInfo)
+static void notifyWebInspectorDestroy(void* userData, Evas_Object* /*webview*/, void* /*eventInfo*/)
{
InspectorFrontendClientEfl* inspectorFrontendClient = static_cast<InspectorFrontendClientEfl*>(userData);
if (inspectorFrontendClient)
@@ -50,13 +50,13 @@ static void invalidateView(Evas_Object* webView)
class InspectorFrontendSettingsEfl : public InspectorFrontendClientLocal::Settings {
public:
- virtual String getProperty(const String& name)
+ virtual String getProperty(const String& /*name*/)
{
notImplemented();
return String();
}
- virtual void setProperty(const String& name, const String& value)
+ virtual void setProperty(const String& /*name*/, const String& /*value*/)
{
notImplemented();
}
diff --git a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp
index 5b40308a2..a76239ea1 100644
--- a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp
@@ -107,6 +107,9 @@ void PlatformStrategiesEfl::getPluginInfo(const Page* page, Vector<PluginInfo>&
outPlugins.append(pluginInfo);
}
+#else
+ UNUSED_PARAM(page);
+ UNUSED_PARAM(outPlugins);
#endif
}
diff --git a/Source/WebKit/efl/ewk/ewk_auth_soup.cpp b/Source/WebKit/efl/ewk/ewk_auth_soup.cpp
index f54fb0ed6..3d3e93f99 100644
--- a/Source/WebKit/efl/ewk/ewk_auth_soup.cpp
+++ b/Source/WebKit/efl/ewk/ewk_auth_soup.cpp
@@ -49,15 +49,15 @@ static void free_auth_data(Ewk_Auth_Data*);
G_DEFINE_TYPE_WITH_CODE(Ewk_Soup_Auth_Dialog, ewk_auth_soup_dialog, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE(SOUP_TYPE_SESSION_FEATURE, ewk_auth_soup_dialog_session_feature_init))
-static void ewk_auth_soup_dialog_class_init(Ewk_Soup_Auth_DialogClass* klass)
+static void ewk_auth_soup_dialog_class_init(Ewk_Soup_Auth_DialogClass*)
{
}
-static void ewk_auth_soup_dialog_init(Ewk_Soup_Auth_Dialog* instance)
+static void ewk_auth_soup_dialog_init(Ewk_Soup_Auth_Dialog*)
{
}
-static void ewk_auth_soup_dialog_session_feature_init(SoupSessionFeatureInterface* featureInterface, gpointer interfaceData)
+static void ewk_auth_soup_dialog_session_feature_init(SoupSessionFeatureInterface* featureInterface, gpointer /*interfaceData*/)
{
featureInterface->attach = attach;
featureInterface->detach = detach;
@@ -91,7 +91,7 @@ void ewk_auth_soup_credentials_set(const char* username, const char* password, v
free_auth_data(authenticationData);
}
-static void session_authenticate(SoupSession* session, SoupMessage* message, SoupAuth* auth, gboolean retrying, gpointer /* user_data */)
+static void session_authenticate(SoupSession* session, SoupMessage* message, SoupAuth* auth, gboolean /*retrying*/, gpointer /*user_data*/)
{
SoupURI* uri;
Ewk_Auth_Data* authenticationData;
diff --git a/Source/WebKit/efl/ewk/ewk_file_chooser.cpp b/Source/WebKit/efl/ewk/ewk_file_chooser.cpp
index 686bdc542..d152c79c8 100644
--- a/Source/WebKit/efl/ewk/ewk_file_chooser.cpp
+++ b/Source/WebKit/efl/ewk/ewk_file_chooser.cpp
@@ -40,6 +40,7 @@ Eina_Bool ewk_file_chooser_allows_directory_upload_get(const Ewk_File_Chooser* c
EINA_SAFETY_ON_NULL_RETURN_VAL(chooser, false);
return chooser->fileChooser->settings().allowsDirectoryUpload;
#else
+ UNUSED_PARAM(chooser);
return false;
#endif
}
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index 0af5d2433..73aa072b4 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -262,7 +262,7 @@ static void _ewk_frame_smart_resize(Evas_Object* ewkFrame, Evas_Coord width, Eva
evas_object_resize(smartData->region, width, height);
Evas_Coord x, y;
evas_object_geometry_get(smartData->region, &x, &y, &width, &height);
- INF("region=%p, visible=%d, geo=%d,%d + %dx%d",
+ INFO("region=%p, visible=%d, geo=%d,%d + %dx%d",
smartData->region, evas_object_visible_get(smartData->region), x, y, width, height);
_ewk_frame_debug(ewkFrame);
#endif
@@ -881,7 +881,7 @@ Eina_Bool ewk_frame_feed_focus_in(Evas_Object* ewkFrame)
return true;
}
-Eina_Bool ewk_frame_feed_focus_out(Evas_Object* ewkFrame)
+Eina_Bool ewk_frame_feed_focus_out(Evas_Object*)
{
// TODO: what to do on focus out?
ERR("what to do?");
@@ -1334,7 +1334,7 @@ void ewk_frame_did_perform_first_navigation(Evas_Object* ewkFrame)
*
* Emits signal: "state,save"
*/
-void ewk_frame_view_state_save(Evas_Object* ewkFrame, WebCore::HistoryItem* item)
+void ewk_frame_view_state_save(Evas_Object* ewkFrame, WebCore::HistoryItem*)
{
evas_object_smart_callback_call(ewkFrame, "state,save", 0);
}
@@ -1643,7 +1643,7 @@ ssize_t ewk_frame_source_get(const Evas_Object* ewkFrame, char** frameSource)
if (!smartData->frame->document()->isHTMLDocument()) {
// FIXME: Support others documents.
- WRN("Only HTML documents are supported");
+ WARN("Only HTML documents are supported");
return -1;
}
@@ -1794,7 +1794,7 @@ bool ewk_frame_uri_changed(Evas_Object* ewkFrame)
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
WTF::CString uri(smartData->frame->document()->url().string().utf8());
- INF("uri=%s", uri.data());
+ INFO("uri=%s", uri.data());
if (!uri.data()) {
ERR("no uri");
return false;
@@ -1844,6 +1844,15 @@ WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* ewkFrame,
if (pluginView->status() == WebCore::PluginStatusLoadedSuccessfully)
return pluginView.release();
+#else
+ UNUSED_PARAM(ewkFrame);
+ UNUSED_PARAM(pluginSize);
+ UNUSED_PARAM(element);
+ UNUSED_PARAM(url);
+ UNUSED_PARAM(paramNames);
+ UNUSED_PARAM(paramValues);
+ UNUSED_PARAM(mimeType);
+ UNUSED_PARAM(loadManually);
#endif // #if ENABLE(NETSCAPE_PLUGIN_API)
return 0;
}
diff --git a/Source/WebKit/efl/ewk/ewk_js.cpp b/Source/WebKit/efl/ewk/ewk_js.cpp
index bf4e4d787..aee8bba80 100644
--- a/Source/WebKit/efl/ewk/ewk_js.cpp
+++ b/Source/WebKit/efl/ewk/ewk_js.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "ewk_js.h"
+#include <wtf/UnusedParam.h>
+
#if ENABLE(NETSCAPE_PLUGIN_API)
#include "NP_jsobject.h"
@@ -590,6 +592,7 @@ error:
ewk_js_object_free(object);
return 0;
#else
+ UNUSED_PARAM(jsMetaClass);
return 0;
#endif
}
@@ -610,6 +613,8 @@ void ewk_js_object_free(Ewk_JS_Object* jsObject)
if (script_obj)
free(jsObject);
+#else
+ UNUSED_PARAM(jsObject);
#endif
}
@@ -620,6 +625,7 @@ Evas_Object* ewk_js_object_view_get(const Ewk_JS_Object* jsObject)
EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0);
return jsObject->view;
#else
+ UNUSED_PARAM(jsObject);
return 0;
#endif
}
@@ -631,6 +637,7 @@ Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* jsObject)
EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0);
return jsObject->properties;
#else
+ UNUSED_PARAM(jsObject);
return 0;
#endif
}
@@ -642,6 +649,7 @@ const char* ewk_js_object_name_get(const Ewk_JS_Object* jsObject)
EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0);
return jsObject->name;
#else
+ UNUSED_PARAM(jsObject);
return 0;
#endif
}
@@ -678,6 +686,10 @@ end:
free(np_args);
return fail;
#else
+ UNUSED_PARAM(jsObject);
+ UNUSED_PARAM(args);
+ UNUSED_PARAM(argCount);
+ UNUSED_PARAM(result);
return false;
#endif
}
@@ -690,6 +702,7 @@ Ewk_JS_Object_Type ewk_js_object_type_get(Ewk_JS_Object* jsObject)
return jsObject->type;
#else
+ UNUSED_PARAM(jsObject);
return EWK_JS_OBJECT_INVALID;
#endif
}
@@ -701,6 +714,9 @@ void ewk_js_object_type_set(Ewk_JS_Object* jsObject, Ewk_JS_Object_Type type)
EINA_MAGIC_CHECK_OR_RETURN(jsObject);
jsObject->type = type;
+#else
+ UNUSED_PARAM(jsObject);
+ UNUSED_PARAM(type);
#endif
}
@@ -713,6 +729,8 @@ void ewk_js_variant_free(Ewk_JS_Variant* jsVariant)
else if (jsVariant->type == EWK_JS_VARIANT_OBJECT)
ewk_js_object_free(jsVariant->value.o);
free(jsVariant);
+#else
+ UNUSED_PARAM(jsVariant);
#endif
}
@@ -727,5 +745,8 @@ void ewk_js_variant_array_free(Ewk_JS_Variant* jsVariant, int count)
ewk_js_object_free(jsVariant[i].value.o);
}
free(jsVariant);
+#else
+ UNUSED_PARAM(jsVariant);
+ UNUSED_PARAM(count);
#endif
}
diff --git a/Source/WebKit/efl/ewk/ewk_main.cpp b/Source/WebKit/efl/ewk/ewk_main.cpp
index 5850ee8de..efa3398e1 100644
--- a/Source/WebKit/efl/ewk/ewk_main.cpp
+++ b/Source/WebKit/efl/ewk/ewk_main.cpp
@@ -143,7 +143,7 @@ Eina_Bool _ewk_init_body(void)
g_type_init();
if (!ecore_main_loop_glib_integrate())
- WRN("Ecore was not compiled with GLib support, some plugins will not "
+ WARN("Ecore was not compiled with GLib support, some plugins will not "
"work (ie: Adobe Flash)");
WebCore::ScriptController::initializeThreading();
diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h
index e09483ad9..11ec1af03 100644
--- a/Source/WebKit/efl/ewk/ewk_private.h
+++ b/Source/WebKit/efl/ewk/ewk_private.h
@@ -46,8 +46,8 @@ extern int _ewk_log_dom;
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ewk_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_ewk_log_dom, __VA_ARGS__)
-#define WRN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
-#define INF(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
+#define WARN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
+#define INFO(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_ewk_log_dom, __VA_ARGS__)
#endif // ewk_private_h
diff --git a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
index 2f9d7fdc8..ddae17347 100644
--- a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
+++ b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
@@ -549,7 +549,7 @@ static void _ewk_tiled_backing_store_render(void* data, Ewk_Tile* tile, const Ei
{
Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data);
- INF("TODO %p (visible? %d) [%lu,%lu] %d,%d + %dx%d",
+ INFO("TODO %p (visible? %d) [%lu,%lu] %d,%d + %dx%d",
tile, tile->visible, tile->column, tile->row, area->x, area->y, area->w, area->h);
if (!tile->visible)
@@ -774,12 +774,12 @@ static void _ewk_tiled_backing_store_smart_hide(Evas_Object* ewkBackingStore)
static void _ewk_tiled_backing_store_recalc_renderers(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord width, Evas_Coord height, Evas_Coord tileWidth, Evas_Coord tileHeight)
{
- INF("ewkBackingStore=%p, new size: %dx%d", priv->self, width, height);
+ INFO("ewkBackingStore=%p, new size: %dx%d", priv->self, width, height);
unsigned long columns = 1 + static_cast<unsigned long>(ceil(width / static_cast<float>(tileWidth)));
unsigned long rows = 1 + static_cast<unsigned long>(ceil(height / static_cast<float>(tileHeight)));
- INF("ewkBackingStore=%p new grid size columns: %lu, rows: %lu, was %lu, %lu", priv->self, columns, rows, priv->view.columns, priv->view.rows);
+ INFO("ewkBackingStore=%p new grid size columns: %lu, rows: %lu, was %lu, %lu", priv->self, columns, rows, priv->view.columns, priv->view.rows);
if (priv->view.columns == columns && priv->view.rows == rows)
return;
@@ -1134,7 +1134,7 @@ static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Back
Evas_Coord deltaX = priv->view.offset.current.x - priv->view.offset.old.x;
Evas_Coord deltaY = priv->view.offset.current.y - priv->view.offset.old.y;
- INF("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)",
+ INFO("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)",
priv->self, deltaX, deltaY, priv->view.offset.current.x, priv->view.offset.current.y);
Evas_Coord tileWidth = priv->view.tile.width;
@@ -1160,7 +1160,7 @@ static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_St
Evas_Coord deltaX = priv->view.offset.current.x - priv->view.offset.old.x;
Evas_Coord deltaY = priv->view.offset.current.y - priv->view.offset.old.y;
- INF("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)", priv->self, deltaX, deltaY, priv->view.offset.current.x, priv->view.offset.current.y);
+ INFO("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)", priv->self, deltaX, deltaY, priv->view.offset.current.x, priv->view.offset.current.y);
if (!deltaX && !deltaY)
return;
@@ -1881,13 +1881,13 @@ bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* ewkBackingS
{
PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
- INF("priv->model.base.row =%ld, n=%u priv->view.rows=%lu", priv->model.base.row, n, priv->view.rows);
+ INFO("priv->model.base.row =%ld, n=%u priv->view.rows=%lu", priv->model.base.row, n, priv->view.rows);
unsigned long startRow = priv->model.base.row - n;
unsigned long startCol = priv->model.base.column - n;
unsigned long endRow = std::min(priv->model.current.rows - 1, priv->model.base.row + priv->view.rows + n - 1);
unsigned long endCol = std::min(priv->model.current.columns - 1, priv->model.base.column + priv->view.columns + n - 1);
- INF("startRow=%lu, endRow=%lu, startCol=%lu, endCol=%lu", startRow, endRow, startCol, endCol);
+ INFO("startRow=%lu, endRow=%lu, startCol=%lu, endCol=%lu", startRow, endRow, startCol, endCol);
zoom = ROUNDED_ZOOM(priv->view.tile.width, zoom);
diff --git a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp
index a1c029db3..0f2d0355c 100644
--- a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp
+++ b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp
@@ -321,14 +321,14 @@ void ewk_tile_matrix_free(Ewk_Tile_Matrix* tileMatrix)
tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed, tiles,
tileMatrix->stats.bytes.allocated, tileMatrix->stats.bytes.freed, bytes);
else if (tiles_leaked || bytes_leaked)
- WRN("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] "
+ WARN("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] "
"bytes[+%" PRIu64 ",-%" PRIu64 "], but some other leaked "
"%" PRIu64 " tiles (%" PRIu64 " bytes)",
tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed,
tileMatrix->stats.bytes.allocated, tileMatrix->stats.bytes.freed,
tiles_leaked, bytes_leaked);
else
- INF("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] "
+ INFO("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] "
"bytes[+%" PRIu64 ",-%" PRIu64 "]",
tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed,
tileMatrix->stats.bytes.allocated, tileMatrix->stats.bytes.freed);
@@ -399,7 +399,7 @@ Ewk_Tile* ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix* tileMatrix, unsigned l
#ifndef NDEBUG
if (!tile->visible) {
if (!ewk_tile_unused_cache_tile_get(tileMatrix->tileUnusedCache, tile))
- WRN("Ewk_Tile was unused but not in cache? bug!");
+ WARN("Ewk_Tile was unused but not in cache? bug!");
}
#endif
@@ -521,7 +521,7 @@ static bool _ewk_tile_matrix_slicer_setup(Ewk_Tile_Matrix* tileMatrix, const Ein
{
UNUSED_PARAM(zoom);
if (area->w <= 0 || area->h <= 0) {
- WRN("invalid area region: %d,%d+%dx%d.", area->x, area->y, area->w, area->h);
+ WARN("invalid area region: %d,%d+%dx%d.", area->x, area->y, area->w, area->h);
return false;
}
diff --git a/Source/WebKit/efl/ewk/ewk_tiled_model.cpp b/Source/WebKit/efl/ewk/ewk_tiled_model.cpp
index 25b2686ea..ed009d9d8 100644
--- a/Source/WebKit/efl/ewk/ewk_tiled_model.cpp
+++ b/Source/WebKit/efl/ewk/ewk_tiled_model.cpp
@@ -137,8 +137,8 @@ void ewk_tile_accounting_dbg()
}
#else
-static inline void _ewk_tile_account_allocated(const Ewk_Tile* tile) { }
-static inline void _ewk_tile_account_freed(const Ewk_Tile* tile) { }
+static inline void _ewk_tile_account_allocated(const Ewk_Tile*) { }
+static inline void _ewk_tile_account_freed(const Ewk_Tile*) { }
void ewk_tile_accounting_dbg()
{
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index 4949aac4e..f0b69673d 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -617,35 +617,35 @@ static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* smartData, const Ev
return ewk_frame_feed_key_up(frame, upEvent);
}
-static void _ewk_view_smart_add_console_message(Ewk_View_Smart_Data* smartData, const char* message, unsigned int lineNumber, const char* sourceID)
+static void _ewk_view_smart_add_console_message(Ewk_View_Smart_Data*, const char* message, unsigned int lineNumber, const char* sourceID)
{
- INF("console message: %s @%d: %s\n", sourceID, lineNumber, message);
+ INFO("console message: %s @%d: %s\n", sourceID, lineNumber, message);
}
-static void _ewk_view_smart_run_javascript_alert(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message)
+static void _ewk_view_smart_run_javascript_alert(Ewk_View_Smart_Data*, Evas_Object* /*frame*/, const char* message)
{
- INF("javascript alert: %s\n", message);
+ INFO("javascript alert: %s\n", message);
}
-static Eina_Bool _ewk_view_smart_run_javascript_confirm(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message)
+static Eina_Bool _ewk_view_smart_run_javascript_confirm(Ewk_View_Smart_Data*, Evas_Object* /*frame*/, const char* message)
{
- INF("javascript confirm: %s", message);
- INF("javascript confirm (HARD CODED)? YES");
+ INFO("javascript confirm: %s", message);
+ INFO("javascript confirm (HARD CODED)? YES");
return true;
}
-static Eina_Bool _ewk_view_smart_should_interrupt_javascript(Ewk_View_Smart_Data* smartData)
+static Eina_Bool _ewk_view_smart_should_interrupt_javascript(Ewk_View_Smart_Data*)
{
- INF("should interrupt javascript?\n"
+ INFO("should interrupt javascript?\n"
"\t(HARD CODED) NO");
return false;
}
-static Eina_Bool _ewk_view_smart_run_javascript_prompt(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message, const char* defaultValue, const char** value)
+static Eina_Bool _ewk_view_smart_run_javascript_prompt(Ewk_View_Smart_Data*, Evas_Object* /*frame*/, const char* message, const char* defaultValue, const char** value)
{
*value = eina_stringshare_add("test");
Eina_Bool result = true;
- INF("javascript prompt:\n"
+ INFO("javascript prompt:\n"
"\t message: %s\n"
"\tdefault value: %s\n"
"\tgiving answer: %s\n"
@@ -1037,7 +1037,7 @@ static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord w, Evas_Coor
_ewk_view_smart_changed(smartData);
}
-static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y)
+static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord /*x*/, Evas_Coord /*y*/)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
smartData->changed.position = true;
@@ -1126,7 +1126,7 @@ static void _ewk_view_smart_hide(Evas_Object* ewkView)
evas_object_hide(smartData->backing_store);
}
-static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data* smartData, int width, int height)
+static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data*, int /*width*/, int /*height*/)
{
return true;
}
@@ -1168,27 +1168,27 @@ static void _ewk_view_smart_flush(Ewk_View_Smart_Data* smartData)
static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* smartData, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
{
- WRN("not supported by engine. smartData=%p area=%d,%d+%dx%d, zoom=%f",
+ WARN("not supported by engine. smartData=%p area=%d,%d+%dx%d, zoom=%f",
smartData, x, y, width, height, zoom);
return false;
}
static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* smartData, unsigned int number, float zoom)
{
- WRN("not supported by engine. smartData=%p, n=%u zoom=%f",
+ WARN("not supported by engine. smartData=%p, n=%u zoom=%f",
smartData, number, zoom);
return false;
}
static Eina_Bool _ewk_view_smart_pre_render_start(Ewk_View_Smart_Data* smartData)
{
- WRN("not supported by engine. smartData=%p", smartData);
+ WARN("not supported by engine. smartData=%p", smartData);
return false;
}
static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* smartData)
{
- WRN("not supported by engine. smartData=%p", smartData);
+ WARN("not supported by engine. smartData=%p", smartData);
}
static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* smartData)
@@ -1278,17 +1278,17 @@ static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(const E
static Eina_Bool _ewk_view_smart_disable_render(Ewk_View_Smart_Data* smartData)
{
- WRN("not supported by engine. smartData=%p", smartData);
+ WARN("not supported by engine. smartData=%p", smartData);
return false;
}
static Eina_Bool _ewk_view_smart_enable_render(Ewk_View_Smart_Data* smartData)
{
- WRN("not supported by engine. smartData=%p", smartData);
+ WARN("not supported by engine. smartData=%p", smartData);
return false;
}
-static const char* _ewk_view_editor_command_string_get(Ewk_View_Private_Data* priv, Ewk_Editor_Command ewkCommand)
+static const char* _ewk_view_editor_command_string_get(Ewk_View_Private_Data*, Ewk_Editor_Command ewkCommand)
{
static OwnPtr<Eina_Hash> editorCommandHash;
@@ -1466,19 +1466,19 @@ void ewk_view_bg_color_set(Evas_Object* ewkView, int red, int green, int blue, i
EINA_SAFETY_ON_NULL_RETURN(smartData->api->bg_color_set);
if (alpha < 0) {
- WRN("Alpha less than zero (%d).", alpha);
+ WARN("Alpha less than zero (%d).", alpha);
alpha = 0;
} else if (alpha > 255) {
- WRN("Alpha is larger than 255 (%d).", alpha);
+ WARN("Alpha is larger than 255 (%d).", alpha);
alpha = 255;
}
#define CHECK_PREMUL_COLOR(color, alpha) \
if (color < 0) { \
- WRN("Color component " #color " is less than zero (%d).", color); \
+ WARN("Color component " #color " is less than zero (%d).", color); \
color = 0; \
} else if (color > alpha) { \
- WRN("Color component " #color " is greater than alpha (%d, alpha=%d).", \
+ WARN("Color component " #color " is greater than alpha (%d, alpha=%d).", \
color, alpha); \
color = alpha; \
}
@@ -1785,16 +1785,16 @@ Eina_Bool ewk_view_zoom_set(Evas_Object* ewkView, float zoom, Evas_Coord centerX
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->zoom_set, false);
if (!priv->settings.zoomRange.userScalable) {
- WRN("userScalable is false");
+ WARN("userScalable is false");
return false;
}
if (zoom < priv->settings.zoomRange.minScale) {
- WRN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
+ WARN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
return false;
}
if (zoom > priv->settings.zoomRange.maxScale) {
- WRN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
+ WARN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
return false;
}
@@ -1873,16 +1873,16 @@ Eina_Bool ewk_view_zoom_weak_set(Evas_Object* ewkView, float zoom, Evas_Coord ce
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->zoom_weak_set, false);
if (!priv->settings.zoomRange.userScalable) {
- WRN("userScalable is false");
+ WARN("userScalable is false");
return false;
}
if (zoom < priv->settings.zoomRange.minScale) {
- WRN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
+ WARN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
return false;
}
if (zoom > priv->settings.zoomRange.maxScale) {
- WRN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
+ WARN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
return false;
}
@@ -1929,16 +1929,16 @@ Eina_Bool ewk_view_zoom_animated_set(Evas_Object* ewkView, float zoom, float dur
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->zoom_weak_set, false);
if (!priv->settings.zoomRange.userScalable) {
- WRN("userScalable is false");
+ WARN("userScalable is false");
return false;
}
if (zoom < priv->settings.zoomRange.minScale) {
- WRN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
+ WARN("zoom level is < %f : %f", priv->settings.zoomRange.minScale, zoom);
return false;
}
if (zoom > priv->settings.zoomRange.maxScale) {
- WRN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
+ WARN("zoom level is > %f : %f", priv->settings.zoomRange.maxScale, zoom);
return false;
}
@@ -3390,7 +3390,7 @@ void ewk_view_statusbar_visible_get(Evas_Object* ewkView, bool* visible)
void ewk_view_statusbar_text_set(Evas_Object* ewkView, const char* text)
{
DBG("ewkView=%p (text=%s)", ewkView, text);
- INF("status bar text set: %s", text);
+ INFO("status bar text set: %s", text);
evas_object_smart_callback_call(ewkView, "statusbar,text,set", (void*)text);
}
@@ -3601,7 +3601,7 @@ int64_t ewk_view_exceeded_application_cache_quota(Evas_Object* ewkView, Ewk_Secu
if (!smartData->api->exceeded_application_cache_quota)
return 0;
- INF("defaultOriginQuota=%" PRIu64 " totalSpaceNeeded=%" PRIu64, defaultOriginQuota, totalSpaceNeeded);
+ INFO("defaultOriginQuota=%" PRIu64 " totalSpaceNeeded=%" PRIu64, defaultOriginQuota, totalSpaceNeeded);
return smartData->api->exceeded_application_cache_quota(smartData, origin, defaultOriginQuota, totalSpaceNeeded);
}
@@ -3627,7 +3627,7 @@ uint64_t ewk_view_exceeded_database_quota(Evas_Object* ewkView, Evas_Object* fra
if (!smartData->api->exceeded_database_quota)
return 0;
- INF("currentSize=%" PRIu64 " expectedSize=%" PRIu64, currentSize, expectedSize);
+ INFO("currentSize=%" PRIu64 " expectedSize=%" PRIu64, currentSize, expectedSize);
return smartData->api->exceeded_database_quota(smartData, frame, databaseName, currentSize, expectedSize);
}
@@ -3676,7 +3676,7 @@ void ewk_view_scroll(Evas_Object* ewkView, Evas_Coord deltaX, Evas_Coord deltaY,
ewkView, deltaX, deltaY, scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, centerWidth, centerHeight);
if ((scrollX != centerX) || (scrollY != centerY) || (scrollWidth != centerWidth) || (scrollHeight != centerHeight))
- WRN("scroll region and clip are different! %d,%d+%dx%d and %d,%d+%dx%d",
+ WARN("scroll region and clip are different! %d,%d+%dx%d and %d,%d+%dx%d",
scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, centerWidth, centerHeight);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
@@ -3750,9 +3750,9 @@ WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* ewkView, Ev
*
* Emits: "popup,create" with a list of Ewk_Menu containing each item's data
*/
-void ewk_view_popup_new(Evas_Object* ewkView, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect)
+void ewk_view_popup_new(Evas_Object* ewkView, WebCore::PopupMenuClient* client, int /*selected*/, const WebCore::IntRect& rect)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
@@ -3785,7 +3785,7 @@ void ewk_view_popup_new(Evas_Object* ewkView, WebCore::PopupMenuClient* client,
Eina_Bool ewk_view_popup_destroy(Evas_Object* ewkView)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
@@ -3808,7 +3808,7 @@ Eina_Bool ewk_view_popup_destroy(Evas_Object* ewkView)
void ewk_view_popup_selected_set(Evas_Object* ewkView, int index)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
EINA_SAFETY_ON_NULL_RETURN(priv->popup.menuClient);
@@ -3828,7 +3828,7 @@ void ewk_view_popup_selected_set(Evas_Object* ewkView, int index)
*/
void ewk_view_color_chooser_new(Evas_Object* ewkView, WebCore::ColorChooserClient* client, const WebCore::Color& initialColor)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
@@ -3848,7 +3848,7 @@ void ewk_view_color_chooser_new(Evas_Object* ewkView, WebCore::ColorChooserClien
Eina_Bool ewk_view_color_chooser_destroy(Evas_Object* ewkView)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
@@ -3865,7 +3865,7 @@ Eina_Bool ewk_view_color_chooser_destroy(Evas_Object* ewkView)
void ewk_view_color_chooser_color_set(Evas_Object *ewkView, int r, int g, int b)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
EINA_SAFETY_ON_NULL_RETURN(priv->colorChooserClient);
@@ -3886,7 +3886,7 @@ void ewk_view_color_chooser_color_set(Evas_Object *ewkView, int r, int g, int b)
*/
void ewk_view_color_chooser_changed(Evas_Object* ewkView, const WebCore::Color& newColor)
{
- INF("ewkView=%p", ewkView);
+ INFO("ewkView=%p", ewkView);
Ewk_Color color;
color.r = newColor.red();
@@ -3973,7 +3973,7 @@ Eina_Bool ewk_view_zoom_range_set(Evas_Object* ewkView, float minScale, float ma
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
if (maxScale < minScale) {
- WRN("minScale is larger than maxScale");
+ WARN("minScale is larger than maxScale");
return false;
}
@@ -4135,6 +4135,9 @@ Eina_Bool ewk_view_js_object_add(Evas_Object* ewkView, Ewk_JS_Object* object, co
window->methodTable()->put(window, executeState, id, runtimeObject, slot);
return true;
#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(object);
+ UNUSED_PARAM(objectName);
return false;
#endif // ENABLE(NETSCAPE_PLUGIN_API)
}
@@ -4475,13 +4478,13 @@ void ewk_view_web_inspector_view_set(Evas_Object* ewkView, Evas_Object* inspecto
}
#if USE(ACCELERATED_COMPOSITING)
-bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect)
+bool ewk_view_accelerated_compositing_object_create(Evas_Object*, Evas_Native_Surface*, const WebCore::IntRect& /*rect*/)
{
notImplemented();
return false;
}
-WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView)
+WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object*)
{
notImplemented();
return 0;
@@ -4495,6 +4498,7 @@ Eina_Bool ewk_view_setting_web_audio_get(const Evas_Object* ewkView)
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
return priv->settings.webAudio;
#else
+ UNUSED_PARAM(ewkView);
return false;
#endif
}
@@ -4510,6 +4514,8 @@ Eina_Bool ewk_view_setting_web_audio_set(Evas_Object* ewkView, Eina_Bool enable)
}
return true;
#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(enable);
return false;
#endif
}
diff --git a/Source/WebKit/efl/ewk/ewk_view_private.h b/Source/WebKit/efl/ewk/ewk_view_private.h
index daee67734..631fa2cd3 100644
--- a/Source/WebKit/efl/ewk/ewk_view_private.h
+++ b/Source/WebKit/efl/ewk/ewk_view_private.h
@@ -45,7 +45,7 @@ const char ewkViewSingleName[] = "Ewk_View_Single";
// Define to prevent an application using different view type from calling the function.
#define EWK_VIEW_TYPE_CHECK_OR_RETURN(ewkView, viewName, ...) \
if (!evas_object_smart_type_check(ewkView, viewName)) { \
- INF("ewkView isn't an instance of %s", viewName); \
+ INFO("ewkView isn't an instance of %s", viewName); \
return __VA_ARGS__; \
}
diff --git a/Source/WebKit/efl/ewk/ewk_view_single.cpp b/Source/WebKit/efl/ewk/ewk_view_single.cpp
index 419498b99..2d0597d87 100644
--- a/Source/WebKit/efl/ewk/ewk_view_single.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view_single.cpp
@@ -323,7 +323,7 @@ static void _ewk_view_single_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Dat
evas_object_image_smooth_scale_set(smartData->backing_store, smooth_scale);
}
-static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data* smartData, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
+static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data* smartData, unsigned char /*red*/, unsigned char /*green*/, unsigned char /*blue*/, unsigned char alpha)
{
evas_object_image_alpha_set(smartData->backing_store, alpha < 255);
}
diff --git a/Source/WebKit/efl/ewk/ewk_view_tiled.cpp b/Source/WebKit/efl/ewk/ewk_view_tiled.cpp
index f404b292c..f0a0e5245 100644
--- a/Source/WebKit/efl/ewk/ewk_view_tiled.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view_tiled.cpp
@@ -46,7 +46,7 @@ static bool _ewk_view_tiled_render_cb(void* data, Ewk_Tile* tile, const Eina_Rec
return result;
}
-static void* _ewk_view_tiled_updates_process_pre(void* data, Evas_Object* ewkView)
+static void* _ewk_view_tiled_updates_process_pre(void* data, Evas_Object*)
{
Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data);
ewk_view_layout_if_needed_recursive(priv);
@@ -63,7 +63,7 @@ static Evas_Object* _ewk_view_tiled_smart_backing_store_add(Ewk_View_Smart_Data*
}
static void
-_ewk_view_tiled_contents_size_changed_cb(void* data, Evas_Object* ewkView, void* eventInfo)
+_ewk_view_tiled_contents_size_changed_cb(void* data, Evas_Object*, void* eventInfo)
{
Evas_Coord* size = static_cast<Evas_Coord*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -163,7 +163,7 @@ static void _ewk_view_tiled_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data
ewk_tiled_backing_store_zoom_weak_smooth_scale_set(smartData->backing_store, smoothScale);
}
-static void _ewk_view_tiled_smart_bg_color_set(Ewk_View_Smart_Data* smartData, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
+static void _ewk_view_tiled_smart_bg_color_set(Ewk_View_Smart_Data* smartData, unsigned char /*red*/, unsigned char /*green*/, unsigned char /*blue*/, unsigned char alpha)
{
ewk_tiled_backing_store_alpha_set(smartData->backing_store, alpha < 255);
}
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 57cb94abb..c1afa53ed 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,20 @@
+2012-09-19 Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
+
+ [gtk] add enable-media-stream to websettings
+ https://bugs.webkit.org/show_bug.cgi?id=94361
+
+ Reviewed by Martin Robinson.
+
+ Applications should be allowed to enable/disable MediaStream on webkitwebsettings.
+
+ * webkit/webkitwebsettings.cpp:
+ (webkit_web_settings_class_init):
+ (webkit_web_settings_set_property):
+ (webkit_web_settings_get_property):
+ * webkit/webkitwebsettingsprivate.h:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_update_settings):
+
2012-09-14 Zan Dobersek <zandobersek@gmail.com>
[GTK] Clear application cache between tests in DumpRenderTree
diff --git a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
index db74507f6..dd801756f 100644
--- a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -114,6 +114,7 @@ enum {
PROP_ENABLE_FULLSCREEN,
PROP_ENABLE_DNS_PREFETCHING,
PROP_ENABLE_WEBGL,
+ PROP_ENABLE_MEDIA_STREAM,
PROP_ENABLE_WEB_AUDIO,
PROP_ENABLE_ACCELERATED_COMPOSITING,
PROP_ENABLE_SMOOTH_SCROLLING,
@@ -889,6 +890,25 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
_("Whether WebKit prefetches domain names"),
TRUE,
flags));
+ /**
+ * WebKitWebSettings:enable-media-stream:
+ *
+ * Enable or disable support for Media Stream on pages. Media Stream is
+ * an experimental proposal for allowing web pages to access local video and
+ * audio input devices. The standard is currently a work-in-progress as part
+ * of the Web Applications 1.0 specification from WHATWG.
+ *
+ * See also http://www.w3.org/TR/mediacapture-streams/
+ *
+ * Since: 1.10.0
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_ENABLE_MEDIA_STREAM,
+ g_param_spec_boolean("enable-media-stream",
+ _("Enable Media Stream"),
+ _("Whether Media Stream should be enabled"),
+ FALSE,
+ flags));
/**
* WebKitWebSettings:enable-smooth-scrolling
@@ -1130,6 +1150,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_ENABLE_WEBGL:
priv->enableWebgl = g_value_get_boolean(value);
break;
+ case PROP_ENABLE_MEDIA_STREAM:
+ priv->enableMediaStream = g_value_get_boolean(value);
+ break;
case PROP_ENABLE_WEB_AUDIO:
priv->enableWebAudio = g_value_get_boolean(value);
break;
@@ -1307,6 +1330,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
case PROP_ENABLE_WEBGL:
g_value_set_boolean(value, priv->enableWebgl);
break;
+ case PROP_ENABLE_MEDIA_STREAM:
+ g_value_set_boolean(value, priv->enableMediaStream);
+ break;
case PROP_ENABLE_WEB_AUDIO:
g_value_set_boolean(value, priv->enableWebAudio);
break;
diff --git a/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h b/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
index d8df8ef0c..80c84af19 100644
--- a/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
+++ b/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
@@ -78,6 +78,7 @@ struct _WebKitWebSettingsPrivate {
gboolean enableFullscreen;
gboolean enableDNSPrefetching;
gboolean enableWebgl;
+ gboolean enableMediaStream;
gboolean enableWebAudio;
gboolean enableAcceleratedCompositing;
gboolean enableSmoothScrolling;
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index 0cc8d96b6..123075af3 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -80,6 +80,7 @@
#include "ProgressTracker.h"
#include "RenderView.h"
#include "ResourceHandle.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptValue.h"
#include "Settings.h"
#include "webkit/WebKitDOMDocumentPrivate.h"
@@ -3432,6 +3433,10 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
coreSettings->setWebGLEnabled(settingsPrivate->enableWebgl);
#endif
+#if ENABLE(MEDIA_STREAM)
+ WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled(settingsPrivate->enableMediaStream);
+#endif
+
#if USE(ACCELERATED_COMPOSITING)
coreSettings->setAcceleratedCompositingEnabled(settingsPrivate->enableAcceleratedCompositing);
#endif
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 8ad470cfc..fcec6c6cb 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,19 @@
+2012-09-19 Dan Bernstein <mitz@apple.com>
+
+ WebKit/mac part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebPreferenceKeysPrivate.h: Defined WebKitScreenFontSubstitutionEnabledKey.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Added a default value of YES for the new preference key.
+ (-[WebPreferences setScreenFontSubstitutionEnabled:]): Added this setter.
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]): Added a call to Settings::setScreenFontSubstitutionEnabled
+ to push the preference down to Settings.
+
2012-09-17 Dan Bernstein <mitz@apple.com>
<rdar://problem/12316935> [mac WebKit1]: -[WebView _setPaginationBehavesLikeColumns:] is a no-op
diff --git a/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index b1711bb8b..847956d51 100644
--- a/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -125,6 +125,7 @@
#define WebKitShouldRespectImageOrientationKey @"WebKitShouldRespectImageOrientation"
#define WebKitRequestAnimationFrameEnabledPreferenceKey @"WebKitRequestAnimationFrameEnabled"
#define WebKitDiagnosticLoggingEnabledKey @"WebKitDiagnosticLoggingEnabled"
+#define WebKitScreenFontSubstitutionEnabledKey @"WebKitScreenFontSubstitutionEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/Source/WebKit/mac/WebView/WebPreferences.mm b/Source/WebKit/mac/WebView/WebPreferences.mm
index 8e13f19b4..8c2ea6ac5 100644
--- a/Source/WebKit/mac/WebView/WebPreferences.mm
+++ b/Source/WebKit/mac/WebView/WebPreferences.mm
@@ -399,6 +399,7 @@ public:
[NSNumber numberWithBool:YES], WebKitRequestAnimationFrameEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWantsBalancedSetDefersLoadingBehaviorKey,
[NSNumber numberWithBool:NO], WebKitDiagnosticLoggingEnabledKey,
+ [NSNumber numberWithBool:YES], WebKitScreenFontSubstitutionEnabledKey,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1739,6 +1740,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitDiagnosticLoggingEnabledKey];
}
+- (BOOL)screenFontSubstitutionEnabled
+{
+ return [self _boolValueForKey:WebKitScreenFontSubstitutionEnabledKey];
+}
+
+- (void)setScreenFontSubstitutionEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitScreenFontSubstitutionEnabledKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
diff --git a/Source/WebKit/mac/WebView/WebPreferencesPrivate.h b/Source/WebKit/mac/WebView/WebPreferencesPrivate.h
index 513540d5d..1f362fef4 100644
--- a/Source/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/Source/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -305,4 +305,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
- (BOOL)diagnosticLoggingEnabled;
- (void)setDiagnosticLoggingEnabled:(BOOL)enabled;
+- (BOOL)screenFontSubstitutionEnabled;
+- (void)setScreenFontSubstitutionEnabled:(BOOL)enabled;
+
@end
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index e0ca33284..c1f0a2d89 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -1430,6 +1430,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
settings->setUsesEncodingDetector([preferences usesEncodingDetector]);
settings->setFantasyFontFamily([preferences fantasyFontFamily]);
settings->setFixedFontFamily([preferences fixedFontFamily]);
+ settings->setScreenFontSubstitutionEnabled([preferences screenFontSubstitutionEnabled]);
settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]);
settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]);
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 874c99dee..2721d582d 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,24 @@
+2012-09-17 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ [Qt] Use UndoStep::editingAction() to set the text of undo/redo actions
+ https://bugs.webkit.org/show_bug.cgi?id=96921
+
+ Reviewed by Ryosuke Niwa.
+
+ Set the text of QUndoCommands we create for undo/redo actions based on the
+ editing action from UndoStep.
+
+ This change is visible using QtTestBrowser, and looking at the Edit menu after
+ doing HTML editing changes. I've used http://simple-rte.rniwa.com for testing.
+
+ * WebCoreSupport/UndoStepQt.cpp:
+ (undoNameForEditAction): This function returns a localized name of the action.
+ (UndoStepQt::UndoStepQt): Set the text based on UndoStep::editingAction.
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage):
+ (tst_QWebPage::undoActionHaveCustomText): Create a new test to verify that the text
+ describing the undo action after inserting a text and indenting the text is different.
+
2012-09-17 Leo Franchi <lfranchi@kde.org>
[Qt] Inspector WebSocket backend protocol update
diff --git a/Source/WebKit/qt/WebCoreSupport/UndoStepQt.cpp b/Source/WebKit/qt/WebCoreSupport/UndoStepQt.cpp
index 4f478eb61..15df2ee50 100644
--- a/Source/WebKit/qt/WebCoreSupport/UndoStepQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/UndoStepQt.cpp
@@ -23,11 +23,95 @@
using namespace WebCore;
#ifndef QT_NO_UNDOCOMMAND
+static QString undoNameForEditAction(const EditAction editAction)
+{
+ switch (editAction) {
+ case EditActionUnspecified:
+ return QString();
+ case EditActionSetColor:
+ return QObject::tr("Set Color");
+ case EditActionSetBackgroundColor:
+ return QObject::tr("Set Background Color");
+ case EditActionTurnOffKerning:
+ return QObject::tr("Turn Off Kerning");
+ case EditActionTightenKerning:
+ return QObject::tr("Tighten Kerning");
+ case EditActionLoosenKerning:
+ return QObject::tr("Loosen Kerning");
+ case EditActionUseStandardKerning:
+ return QObject::tr("Use Standard Kerning");
+ case EditActionTurnOffLigatures:
+ return QObject::tr("Turn Off Ligatures");
+ case EditActionUseStandardLigatures:
+ return QObject::tr("Use Standard Ligatures");
+ case EditActionUseAllLigatures:
+ return QObject::tr("Use All Ligatures");
+ case EditActionRaiseBaseline:
+ return QObject::tr("Raise Baseline");
+ case EditActionLowerBaseline:
+ return QObject::tr("Lower Baseline");
+ case EditActionSetTraditionalCharacterShape:
+ return QObject::tr("Set Traditional Character Shape");
+ case EditActionSetFont:
+ return QObject::tr("Set Font");
+ case EditActionChangeAttributes:
+ return QObject::tr("Change Attributes");
+ case EditActionAlignLeft:
+ return QObject::tr("Align Left");
+ case EditActionAlignRight:
+ return QObject::tr("Align Right");
+ case EditActionCenter:
+ return QObject::tr("Center");
+ case EditActionJustify:
+ return QObject::tr("Justify");
+ case EditActionSetWritingDirection:
+ return QObject::tr("Set Writing Direction");
+ case EditActionSubscript:
+ return QObject::tr("Subscript");
+ case EditActionSuperscript:
+ return QObject::tr("Superscript");
+ case EditActionUnderline:
+ return QObject::tr("Underline");
+ case EditActionOutline:
+ return QObject::tr("Outline");
+ case EditActionUnscript:
+ return QObject::tr("Unscript");
+ case EditActionDrag:
+ return QObject::tr("Drag");
+ case EditActionCut:
+ return QObject::tr("Cut");
+ case EditActionPaste:
+ return QObject::tr("Paste");
+ case EditActionPasteFont:
+ return QObject::tr("Paste Font");
+ case EditActionPasteRuler:
+ return QObject::tr("Paste Ruler");
+ case EditActionTyping:
+ return QObject::tr("Typing");
+ case EditActionCreateLink:
+ return QObject::tr("Create Link");
+ case EditActionUnlink:
+ return QObject::tr("Unlink");
+ case EditActionInsertList:
+ return QObject::tr("Insert List");
+ case EditActionFormatBlock:
+ return QObject::tr("Formatting");
+ case EditActionIndent:
+ return QObject::tr("Indent");
+ case EditActionOutdent:
+ return QObject::tr("Outdent");
+ }
+
+ ASSERT_NOT_REACHED();
+ return QString();
+}
+
UndoStepQt::UndoStepQt(WTF::RefPtr<UndoStep> step, QUndoCommand *parent)
: QUndoCommand(parent)
, m_step(step)
, m_first(true)
{
+ setText(undoNameForEditAction(step->editingAction()));
}
#else
UndoStepQt::UndoStepQt(WTF::RefPtr<UndoStep> step)
diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0099d410a..0ede374e0 100644
--- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -139,6 +139,7 @@ private Q_SLOTS:
void errorPageExtensionLoadFinished();
void userAgentApplicationName();
void userAgentNewlineStripping();
+ void undoActionHaveCustomText();
void viewModes();
@@ -3260,5 +3261,19 @@ void tst_QWebPage::loadSignalsOrder()
QTRY_VERIFY(loadSpy.isFinished());
}
+void tst_QWebPage::undoActionHaveCustomText()
+{
+ m_page->mainFrame()->setHtml("<div id=test contenteditable></div>");
+ m_page->mainFrame()->evaluateJavaScript("document.getElementById('test').focus()");
+
+ m_page->mainFrame()->evaluateJavaScript("document.execCommand('insertText', true, 'Test');");
+ QString typingActionText = m_page->action(QWebPage::Undo)->text();
+
+ m_page->mainFrame()->evaluateJavaScript("document.execCommand('indent', true);");
+ QString alignActionText = m_page->action(QWebPage::Undo)->text();
+
+ QVERIFY(typingActionText != alignActionText);
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index 73b494a9f..5e7a2d4e2 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,73 @@
+2012-09-19 Patrick Gansterer <paroga@webkit.org>
+
+ [WIN] Use BString in favour of BSTR to improve memory management
+ https://bugs.webkit.org/show_bug.cgi?id=93128
+
+ Reviewed by Anders Carlsson.
+
+ BString automatically calls SysFreeString() in its destructor which helps
+ avoiding memory leaks. So it should be used instead of BSTR directly.
+ Add operator& to BString to allow its usage for out parameters too (like COMPtr).
+ This fixes already a few memory leaks in the existing code.
+
+ * DefaultPolicyDelegate.cpp:
+ (DefaultPolicyDelegate::decidePolicyForNavigationAction):
+ (DefaultPolicyDelegate::decidePolicyForMIMEType):
+ (DefaultPolicyDelegate::unableToImplementPolicyWithError):
+ * MarshallingHelpers.cpp:
+ (MarshallingHelpers::KURLToBSTR):
+ (MarshallingHelpers::CFStringRefToBSTR):
+ (MarshallingHelpers::stringArrayToSafeArray):
+ (MarshallingHelpers::safeArrayToStringArray):
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::runJavaScriptPrompt):
+ * WebCoreSupport/WebEditorClient.cpp:
+ (WebEditorClient::checkGrammarOfString):
+ (WebEditorClient::getGuessesForWord):
+ * WebFrame.cpp:
+ (WebFrame::canProvideDocumentSource):
+ * WebHistory.cpp:
+ (WebHistory::removeItem):
+ (WebHistory::addItem):
+ * WebIconDatabase.cpp:
+ (WebIconDatabase::startUpIconDatabase):
+ * WebNotificationCenter.cpp:
+ (WebNotificationCenter::postNotification):
+ * WebPreferences.cpp:
+ (WebPreferences::setStringValue):
+ * WebView.cpp:
+ (toAtomicString):
+ (toString):
+ (toKURL):
+ (PreferencesChangedOrRemovedObserver::onNotify):
+ (WebView::close):
+ (WebView::canShowMIMEType):
+ (WebView::initWithFrame):
+ (WebView::setApplicationNameForUserAgent):
+ (WebView::setCustomUserAgent):
+ (WebView::userAgentForURL):
+ (WebView::setCustomTextEncodingName):
+ (WebView::customTextEncodingName):
+ (WebView::setPreferences):
+ (WebView::searchFor):
+ (WebView::executeCoreCommandByName):
+ (WebView::markAllMatchesForText):
+ (WebView::setGroupName):
+ (WebView::registerURLSchemeAsLocal):
+ (WebView::replaceSelectionWithText):
+ (WebView::onNotify):
+ (WebView::notifyPreferencesChanged):
+ (WebView::MIMETypeForExtension):
+ (WebView::standardUserAgentWithApplicationName):
+ (WebView::addAdditionalPluginDirectory):
+ (WebView::registerEmbeddedViewMIMEType):
+ (WebView::addOriginAccessWhitelistEntry):
+ (WebView::removeOriginAccessWhitelistEntry):
+ (WebView::geolocationDidFailWithError):
+ (WebView::setDomainRelaxationForbiddenForURLScheme):
+ (WebView::setCompositionForTesting):
+ (WebView::confirmCompositionForTesting):
+
2012-09-17 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r128809.
diff --git a/Source/WebKit/win/DefaultPolicyDelegate.cpp b/Source/WebKit/win/DefaultPolicyDelegate.cpp
index e83a8e977..f37969794 100644
--- a/Source/WebKit/win/DefaultPolicyDelegate.cpp
+++ b/Source/WebKit/win/DefaultPolicyDelegate.cpp
@@ -27,9 +27,12 @@
#include "WebKitDLL.h"
#include "DefaultPolicyDelegate.h"
+#include <WebCore/BString.h>
#include <WebCore/COMPtr.h>
#include <wtf/text/WTFString.h>
+using namespace WebCore;
+
// FIXME: move this enum to a separate header file when other code begins to use it.
typedef enum WebExtraNavigationType {
WebNavigationTypePlugInRequest = WebNavigationTypeOther + 1
@@ -116,7 +119,7 @@ HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForNavigationAction
else if (navType == WebNavigationTypePlugInRequest)
listener->use();
else {
- BSTR url;
+ BString url;
// A file URL shouldn't fall through to here, but if it did,
// it would be a security risk to open it.
if (SUCCEEDED(request->URL(&url)) && !String(url, SysStringLen(url)).startsWith("file:")) {
@@ -124,7 +127,6 @@ HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForNavigationAction
;
}
listener->ignore();
- SysFreeString(url);
}
}
return S_OK;
@@ -152,7 +154,7 @@ HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForMIMEType(
if (FAILED(webView->canShowMIMEType(type, &canShowMIMEType)))
canShowMIMEType = FALSE;
- BSTR url;
+ BString url;
request->URL(&url);
if (String(url, SysStringLen(url)).startsWith("file:")) {
@@ -171,7 +173,6 @@ HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForMIMEType(
listener->use();
else
listener->ignore();
- SysFreeString(url);
return S_OK;
}
@@ -180,15 +181,13 @@ HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::unableToImplementPolicyWithErro
/*[in]*/ IWebError* error,
/*[in]*/ IWebFrame* frame)
{
- BSTR errorStr;
+ BString errorStr;
error->localizedDescription(&errorStr);
- BSTR frameName;
+ BString frameName;
frame->name(&frameName);
LOG_ERROR("called unableToImplementPolicyWithError:%S inFrame:%S", errorStr ? errorStr : TEXT(""), frameName ? frameName : TEXT(""));
- SysFreeString(errorStr);
- SysFreeString(frameName);
return S_OK;
}
diff --git a/Source/WebKit/win/MarshallingHelpers.cpp b/Source/WebKit/win/MarshallingHelpers.cpp
index 138e4b425..6a037061f 100644
--- a/Source/WebKit/win/MarshallingHelpers.cpp
+++ b/Source/WebKit/win/MarshallingHelpers.cpp
@@ -27,6 +27,7 @@
#include "WebKitDLL.h"
#include "MarshallingHelpers.h"
+#include <WebCore/BString.h>
#include <WebCore/IntRect.h>
#include <WebCore/KURL.h>
#include <wtf/MathExtras.h>
@@ -46,7 +47,7 @@ KURL MarshallingHelpers::BSTRToKURL(BSTR urlStr)
BSTR MarshallingHelpers::KURLToBSTR(const KURL& url)
{
- return SysAllocStringLen(url.string().characters(), url.string().length());
+ return BString(url.string()).release();
}
CFURLRef MarshallingHelpers::PathStringToFileCFURLRef(const String& string)
@@ -89,20 +90,7 @@ CFStringRef MarshallingHelpers::LPCOLESTRToCFStringRef(LPCOLESTR str)
BSTR MarshallingHelpers::CFStringRefToBSTR(CFStringRef str)
{
- if (!str)
- return 0;
-
- const UniChar* uniChars = CFStringGetCharactersPtr(str);
- if (uniChars)
- return SysAllocStringLen((LPCTSTR)uniChars, CFStringGetLength(str));
-
- CFIndex length = CFStringGetLength(str);
- BSTR bstr = SysAllocStringLen(0, length);
- if (bstr) {
- CFStringGetCharacters(str, CFRangeMake(0, length), (UniChar*)bstr);
- bstr[length] = 0;
- }
- return bstr;
+ return BString(str).release();
}
int MarshallingHelpers::CFNumberRefToInt(CFNumberRef num)
@@ -159,9 +147,8 @@ SAFEARRAY* MarshallingHelpers::stringArrayToSafeArray(CFArrayRef inArray)
long count = 0;
for (CFIndex i=0; i<size; i++) {
CFStringRef item = (CFStringRef) CFArrayGetValueAtIndex(inArray, i);
- BSTR bstr = CFStringRefToBSTR(item);
- ::SafeArrayPutElement(sa, &count, bstr);
- SysFreeString(bstr); // SafeArrayPutElement() should make a copy of the string
+ BString bstr(item);
+ ::SafeArrayPutElement(sa, &count, bstr); // SafeArrayPutElement() copies the string correctly.
count++;
}
return sa;
@@ -232,10 +219,9 @@ CFArrayRef MarshallingHelpers::safeArrayToStringArray(SAFEARRAY* inArray)
if (len > 0) {
items = new CFStringRef[len];
for (; lBound <= uBound; lBound++) {
- BSTR str;
+ BString str;
hr = ::SafeArrayGetElement(inArray, &lBound, &str);
items[lBound] = BSTRToCFStringRef(str);
- SysFreeString(str);
}
}
CFArrayRef result = CFArrayCreate(0, (const void**)items, len, &kCFTypeArrayCallBacks);
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 3f7a418e6..c75bbe5df 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -410,17 +410,15 @@ bool WebChromeClient::runJavaScriptPrompt(Frame*, const String& message, const S
TimerBase::fireTimersInNestedEventLoop();
- BSTR resultBSTR = 0;
+ BString resultBSTR;
if (FAILED(ui->runJavaScriptTextInputPanelWithPrompt(m_webView, BString(message), BString(defaultValue), &resultBSTR)))
return false;
- if (resultBSTR) {
- result = String(resultBSTR, SysStringLen(resultBSTR));
- SysFreeString(resultBSTR);
- return true;
- }
+ if (!resultBSTR)
+ return false;
- return false;
+ result = String(resultBSTR, SysStringLen(resultBSTR));
+ return true;
}
void WebChromeClient::setStatusbarText(const String& statusText)
diff --git a/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
index 7767fff12..a189f70f1 100644
--- a/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
@@ -695,21 +695,19 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
continue;
if (FAILED(detailObj->location(&detail.location)))
continue;
- BSTR userDesc;
+ BString userDesc;
if (FAILED(detailObj->userDescription(&userDesc)))
continue;
detail.userDescription = String(userDesc, SysStringLen(userDesc));
- SysFreeString(userDesc);
COMPtr<IEnumSpellingGuesses> enumGuessesObj;
if (FAILED(detailObj->guesses(&enumGuessesObj)))
continue;
while (true) {
- BSTR guess;
+ BString guess;
if (enumGuessesObj->Next(1, &guess, &fetched) != S_OK)
break;
detail.guesses.append(String(guess, SysStringLen(guess)));
- SysFreeString(guess);
}
details.append(detail);
@@ -778,11 +776,10 @@ void WebEditorClient::getGuessesForWord(const String& word, const String& contex
while (true) {
ULONG fetched;
- BSTR guess;
+ BString guess;
if (enumGuessesObj->Next(1, &guess, &fetched) != S_OK)
break;
guesses.append(String(guess, SysStringLen(guess)));
- SysFreeString(guess);
}
}
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index 8a0a82cc5..ee9cdd8c4 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -1442,11 +1442,10 @@ HRESULT WebFrame::canProvideDocumentSource(bool* result)
COMPtr<IWebURLResponse> urlResponse;
hr = dataSource->response(&urlResponse);
if (SUCCEEDED(hr) && urlResponse) {
- BSTR mimeTypeBStr;
+ BString mimeTypeBStr;
if (SUCCEEDED(urlResponse->MIMEType(&mimeTypeBStr))) {
String mimeType(mimeTypeBStr, SysStringLen(mimeTypeBStr));
*result = mimeType == "text/html" || WebCore::DOMImplementation::isXMLMIMEType(mimeType);
- SysFreeString(mimeTypeBStr);
}
}
return hr;
diff --git a/Source/WebKit/win/WebHistory.cpp b/Source/WebKit/win/WebHistory.cpp
index e842c1407..91f882fb8 100644
--- a/Source/WebKit/win/WebHistory.cpp
+++ b/Source/WebKit/win/WebHistory.cpp
@@ -36,6 +36,7 @@
#include "WebNotificationCenter.h"
#include "WebPreferences.h"
#include <CoreFoundation/CoreFoundation.h>
+#include <WebCore/BString.h>
#include <WebCore/HistoryItem.h>
#include <WebCore/HistoryPropertyList.h>
#include <WebCore/KURL.h>
@@ -612,14 +613,13 @@ HRESULT STDMETHODCALLTYPE WebHistory::historyAgeInDaysLimit(
HRESULT WebHistory::removeItem(IWebHistoryItem* entry)
{
HRESULT hr = S_OK;
- BSTR urlBStr = 0;
+ BString urlBStr;
hr = entry->URLString(&urlBStr);
if (FAILED(hr))
return hr;
RetainPtr<CFStringRef> urlString(AdoptCF, MarshallingHelpers::BSTRToCFStringRef(urlBStr));
- SysFreeString(urlBStr);
// If this exact object isn't stored, then make no change.
// FIXME: Is this the right behavior if this entry isn't present, but another entry for the same URL is?
@@ -646,13 +646,12 @@ HRESULT WebHistory::addItem(IWebHistoryItem* entry, bool discardDuplicate, bool*
if (!entry)
return E_FAIL;
- BSTR urlBStr = 0;
+ BString urlBStr;
hr = entry->URLString(&urlBStr);
if (FAILED(hr))
return hr;
RetainPtr<CFStringRef> urlString(AdoptCF, MarshallingHelpers::BSTRToCFStringRef(urlBStr));
- SysFreeString(urlBStr);
COMPtr<IWebHistoryItem> oldEntry((IWebHistoryItem*) CFDictionaryGetValue(
m_entriesByURL.get(), urlString.get()));
diff --git a/Source/WebKit/win/WebIconDatabase.cpp b/Source/WebKit/win/WebIconDatabase.cpp
index 329817aa2..cddc40d81 100644
--- a/Source/WebKit/win/WebIconDatabase.cpp
+++ b/Source/WebKit/win/WebIconDatabase.cpp
@@ -84,12 +84,11 @@ void WebIconDatabase::startUpIconDatabase()
iconDatabase().setClient(this);
- BSTR prefDatabasePath = 0;
+ BString prefDatabasePath;
if (FAILED(standardPrefs->iconDatabaseLocation(&prefDatabasePath)))
LOG_ERROR("Unable to get icon database location preference");
String databasePath(prefDatabasePath, SysStringLen(prefDatabasePath));
- SysFreeString(prefDatabasePath);
if (databasePath.isEmpty()) {
databasePath = localUserSpecificStorageDirectory();
diff --git a/Source/WebKit/win/WebNotificationCenter.cpp b/Source/WebKit/win/WebNotificationCenter.cpp
index 23de1c1c9..e02abd593 100644
--- a/Source/WebKit/win/WebNotificationCenter.cpp
+++ b/Source/WebKit/win/WebNotificationCenter.cpp
@@ -28,6 +28,7 @@
#include "WebNotificationCenter.h"
#include "WebNotification.h"
+#include <WebCore/BString.h>
#include <WebCore/COMPtr.h>
#include <utility>
#include <wchar.h>
@@ -38,6 +39,8 @@
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
+using namespace WebCore;
+
typedef std::pair<COMPtr<IUnknown>, COMPtr<IWebNotificationObserver> > ObjectObserverPair;
typedef Vector<ObjectObserverPair> ObjectObserverList;
typedef ObjectObserverList::iterator ObserverListIterator;
@@ -160,7 +163,7 @@ HRESULT STDMETHODCALLTYPE WebNotificationCenter::addObserver(
HRESULT STDMETHODCALLTYPE WebNotificationCenter::postNotification(
/* [in] */ IWebNotification* notification)
{
- BSTR name;
+ BString name;
HRESULT hr = notification->name(&name);
if (FAILED(hr))
return hr;
@@ -171,7 +174,6 @@ HRESULT STDMETHODCALLTYPE WebNotificationCenter::postNotification(
return hr;
postNotificationInternal(notification, name, obj.get());
- SysFreeString(name);
return hr;
}
diff --git a/Source/WebKit/win/WebPreferences.cpp b/Source/WebKit/win/WebPreferences.cpp
index e1784a761..5634a15b3 100644
--- a/Source/WebKit/win/WebPreferences.cpp
+++ b/Source/WebKit/win/WebPreferences.cpp
@@ -349,10 +349,10 @@ LONGLONG WebPreferences::longlongValueForKey(CFStringRef key)
void WebPreferences::setStringValue(CFStringRef key, LPCTSTR value)
{
- BSTR val = stringValueForKey(key);
+ BString val;
+ val.adoptBSTR(stringValueForKey(key));
if (val && !wcscmp(val, value))
return;
- SysFreeString(val);
RetainPtr<CFStringRef> valueRef(AdoptCF,
CFStringCreateWithCharactersNoCopy(0, (UniChar*)_wcsdup(value), (CFIndex)wcslen(value), kCFAllocatorMalloc));
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index 3f38060cc..6f1069302 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -199,6 +199,21 @@ WebView* kit(Page* page)
return page ? static_cast<WebView*>(static_cast<WebChromeClient*>(page->chrome()->client())->webView()) : 0;
}
+static inline AtomicString toAtomicString(BSTR bstr)
+{
+ return AtomicString(bstr, SysStringLen(bstr));
+}
+
+static inline String toString(BSTR bstr)
+{
+ return String(bstr, SysStringLen(bstr));
+}
+
+static inline KURL toKURL(BSTR bstr)
+{
+ return KURL(KURL(), toString(bstr));
+}
+
class PreferencesChangedOrRemovedObserver : public IWebNotificationObserver {
public:
static PreferencesChangedOrRemovedObserver* sharedInstance();
@@ -245,12 +260,10 @@ HRESULT PreferencesChangedOrRemovedObserver::onNotify(IWebNotification* notifica
if (FAILED(hr))
return hr;
- BSTR nameBSTR;
- hr = notification->name(&nameBSTR);
+ BString name;
+ hr = notification->name(&name);
if (FAILED(hr))
return hr;
- BString name;
- name.adoptBSTR(nameBSTR);
if (wcscmp(name, WebPreferences::webPreferencesChangedNotification()) == 0)
return notifyPreferencesChanged(cacheModel);
@@ -726,17 +739,15 @@ HRESULT STDMETHODCALLTYPE WebView::close()
notifyCenter->removeObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get()));
if (COMPtr<WebPreferences> preferences = m_preferences) {
- BSTR identifier = 0;
+ BString identifier;
preferences->identifier(&identifier);
m_preferences = 0;
preferences->didRemoveFromWebView();
// Make sure we release the reference, since WebPreferences::removeReferenceForIdentifier will check for last reference to WebPreferences
preferences = 0;
- if (identifier) {
+ if (identifier)
WebPreferences::removeReferenceForIdentifier(identifier);
- SysFreeString(identifier);
- }
}
deleteBackingStore();
@@ -2513,7 +2524,7 @@ HRESULT STDMETHODCALLTYPE WebView::canShowMIMEType(
/* [in] */ BSTR mimeType,
/* [retval][out] */ BOOL* canShow)
{
- String mimeTypeStr(mimeType, SysStringLen(mimeType));
+ String mimeTypeStr = toString(mimeType);
if (!canShow)
return E_POINTER;
@@ -2680,18 +2691,14 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
m_page = new Page(pageClients);
provideGeolocationTo(m_page, new WebGeolocationClient(this));
- BSTR localStoragePath;
- if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
- m_page->settings()->setLocalStorageDatabasePath(String(localStoragePath, SysStringLen(localStoragePath)));
- SysFreeString(localStoragePath);
- }
+ BString localStoragePath;
+ if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath)))
+ m_page->settings()->setLocalStorageDatabasePath(toString(localStoragePath));
if (m_uiDelegate) {
- BSTR path;
- if (SUCCEEDED(m_uiDelegate->ftpDirectoryTemplatePath(this, &path))) {
- m_page->settings()->setFTPDirectoryTemplatePath(String(path, SysStringLen(path)));
- SysFreeString(path);
- }
+ BString path;
+ if (SUCCEEDED(m_uiDelegate->ftpDirectoryTemplatePath(this, &path)))
+ m_page->settings()->setFTPDirectoryTemplatePath(toString(path));
}
WebFrame* webFrame = WebFrame::createInstance();
@@ -2699,7 +2706,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
m_mainFrame = webFrame;
webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it.
- coreFrame->tree()->setName(String(frameName, SysStringLen(frameName)));
+ coreFrame->tree()->setName(toString(frameName));
coreFrame->init();
setGroupName(groupName);
@@ -3057,7 +3064,7 @@ float WebView::zoomMultiplier(bool isTextOnly)
HRESULT STDMETHODCALLTYPE WebView::setApplicationNameForUserAgent(
/* [in] */ BSTR applicationName)
{
- m_applicationName = String(applicationName, SysStringLen(applicationName));
+ m_applicationName = toString(applicationName);
m_userAgentStandard = String();
return S_OK;
}
@@ -3075,7 +3082,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCustomUserAgent(
/* [in] */ BSTR userAgentString)
{
m_userAgentOverridden = userAgentString;
- m_userAgentCustom = String(userAgentString, SysStringLen(userAgentString));
+ m_userAgentCustom = toString(userAgentString);
return S_OK;
}
@@ -3096,7 +3103,7 @@ HRESULT STDMETHODCALLTYPE WebView::userAgentForURL(
/* [retval][out] */ BSTR* userAgent)
{
String userAgentString = userAgentForKURL(MarshallingHelpers::BSTRToKURL(url));
- *userAgent = SysAllocStringLen(userAgentString.characters(), userAgentString.length());
+ *userAgent = BString(userAgentString).release();
if (!*userAgent && userAgentString.length())
return E_OUTOFMEMORY;
return S_OK;
@@ -3116,14 +3123,14 @@ HRESULT STDMETHODCALLTYPE WebView::setCustomTextEncodingName(
return E_FAIL;
HRESULT hr;
- BSTR oldEncoding;
+ BString oldEncoding;
hr = customTextEncodingName(&oldEncoding);
if (FAILED(hr))
return hr;
if (oldEncoding != encodingName && (!oldEncoding || !encodingName || wcscmp(oldEncoding, encodingName))) {
if (Frame* coreFrame = core(m_mainFrame))
- coreFrame->loader()->reloadWithOverrideEncoding(String(encodingName, SysStringLen(encodingName)));
+ coreFrame->loader()->reloadWithOverrideEncoding(toString(encodingName));
}
return S_OK;
@@ -3155,7 +3162,7 @@ HRESULT STDMETHODCALLTYPE WebView::customTextEncodingName(
return hr;
if (!*encodingName)
- *encodingName = SysAllocStringLen(m_overrideEncoding.characters(), m_overrideEncoding.length());
+ *encodingName = BString(m_overrideEncoding).release();
if (!*encodingName && m_overrideEncoding.length())
return E_OUTOFMEMORY;
@@ -3230,17 +3237,15 @@ HRESULT STDMETHODCALLTYPE WebView::setPreferences(
IWebNotificationCenter* nc = WebNotificationCenter::defaultCenterInternal();
nc->removeObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get()));
- BSTR identifier = 0;
+ BString identifier;
oldPrefs->identifier(&identifier);
oldPrefs->didRemoveFromWebView();
oldPrefs = 0; // Make sure we release the reference, since WebPreferences::removeReferenceForIdentifier will check for last reference to WebPreferences
m_preferences = webPrefs;
- if (identifier) {
+ if (identifier)
WebPreferences::removeReferenceForIdentifier(identifier);
- SysFreeString(identifier);
- }
nc->addObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get()));
@@ -3388,7 +3393,7 @@ HRESULT STDMETHODCALLTYPE WebView::searchFor(
if (!str || !SysStringLen(str))
return E_INVALIDARG;
- *found = m_page->findString(String(str, SysStringLen(str)), caseFlag ? TextCaseSensitive : TextCaseInsensitive, forward ? FindDirectionForward : FindDirectionBackward, wrapFlag);
+ *found = m_page->findString(toString(str), caseFlag ? TextCaseSensitive : TextCaseInsensitive, forward ? FindDirectionForward : FindDirectionBackward, wrapFlag);
return S_OK;
}
@@ -3418,12 +3423,9 @@ HRESULT STDMETHODCALLTYPE WebView::updateFocusedAndActiveState()
return S_OK;
}
-HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR bName, BSTR bValue)
+HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR value)
{
- String name(bName, SysStringLen(bName));
- String value(bValue, SysStringLen(bValue));
-
- m_page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
+ m_page->focusController()->focusedOrMainFrame()->editor()->command(toString(name)).execute(toString(value));
return S_OK;
}
@@ -3447,7 +3449,7 @@ HRESULT STDMETHODCALLTYPE WebView::markAllMatchesForText(
if (!str || !SysStringLen(str))
return E_INVALIDARG;
- *matches = m_page->markAllMatchesForText(String(str, SysStringLen(str)), caseSensitive ? TextCaseSensitive : TextCaseInsensitive, highlight, limit);
+ *matches = m_page->markAllMatchesForText(toString(str), caseSensitive ? TextCaseSensitive : TextCaseInsensitive, highlight, limit);
return S_OK;
}
@@ -3530,7 +3532,7 @@ HRESULT STDMETHODCALLTYPE WebView::setGroupName(
{
if (!m_page)
return S_OK;
- m_page->setGroupName(String(groupName, SysStringLen(groupName)));
+ m_page->setGroupName(toString(groupName));
return S_OK;
}
@@ -3764,7 +3766,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerURLSchemeAsLocal(
if (!scheme)
return E_POINTER;
- SchemeRegistry::registerURLSchemeAsLocal(String(scheme, ::SysStringLen(scheme)));
+ SchemeRegistry::registerURLSchemeAsLocal(toString(scheme));
return S_OK;
}
@@ -4315,9 +4317,8 @@ HRESULT STDMETHODCALLTYPE WebView::replaceSelectionWithNode(
HRESULT STDMETHODCALLTYPE WebView::replaceSelectionWithText(
/* [in] */ BSTR text)
{
- String textString(text, ::SysStringLen(text));
Position start = m_page->mainFrame()->selection()->selection().start();
- m_page->focusController()->focusedOrMainFrame()->editor()->insertText(textString, 0);
+ m_page->focusController()->focusedOrMainFrame()->editor()->insertText(toString(text), 0);
m_page->mainFrame()->selection()->setBase(start);
return S_OK;
}
@@ -4536,14 +4537,11 @@ HRESULT STDMETHODCALLTYPE WebView::stopSpeaking(
HRESULT STDMETHODCALLTYPE WebView::onNotify(
/* [in] */ IWebNotification* notification)
{
- BSTR nameBSTR;
- HRESULT hr = notification->name(&nameBSTR);
+ BString name;
+ HRESULT hr = notification->name(&name);
if (FAILED(hr))
return hr;
- BString name;
- name.adoptBSTR(nameBSTR);
-
if (!wcscmp(name, WebIconDatabase::iconDatabaseDidAddIconNotification()))
return notifyDidAddIcon(notification);
@@ -4568,7 +4566,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
ASSERT(preferences == m_preferences);
- BSTR str;
+ BString str;
int size;
BOOL enabled;
@@ -4577,8 +4575,8 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = preferences->cursiveFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setCursiveFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setCursiveFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->defaultFixedFontSize(&size);
if (FAILED(hr))
@@ -4589,24 +4587,24 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
if (FAILED(hr))
return hr;
settings->setDefaultFontSize(size);
-
+
hr = preferences->defaultTextEncodingName(&str);
if (FAILED(hr))
return hr;
- settings->setDefaultTextEncodingName(String(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setDefaultTextEncodingName(toString(str));
+ str.clear();
hr = preferences->fantasyFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setFantasyFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setFantasyFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->fixedFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setFixedFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setFixedFontFamily(toAtomicString(str));
+ str.clear();
#if ENABLE(VIDEO_TRACK)
hr = preferences->shouldDisplaySubtitles(&enabled);
@@ -4630,15 +4628,15 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = prefsPrivate->localStorageDatabasePath(&str);
if (FAILED(hr))
return hr;
- settings->setLocalStorageDatabasePath(String(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setLocalStorageDatabasePath(toString(str));
+ str.clear();
}
hr = preferences->pictographFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setPictographFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setPictographFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->isJavaEnabled(&enabled);
if (FAILED(hr))
@@ -4683,20 +4681,20 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = preferences->sansSerifFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setSansSerifFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setSansSerifFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->serifFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setSerifFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setSerifFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->standardFontFamily(&str);
if (FAILED(hr))
return hr;
- settings->setStandardFontFamily(AtomicString(str, SysStringLen(str)));
- SysFreeString(str);
+ settings->setStandardFontFamily(toAtomicString(str));
+ str.clear();
hr = preferences->loadsImagesAutomatically(&enabled);
if (FAILED(hr))
@@ -4711,7 +4709,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
if (FAILED(hr))
return hr;
- RetainPtr<CFStringRef> urlString(AdoptCF, String(str, SysStringLen(str)).createCFString());
+ RetainPtr<CFStringRef> urlString(AdoptCF, toString(str).createCFString());
RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateWithString(kCFAllocatorDefault, urlString.get(), 0));
// Check if the passed in string is a path and convert it to a URL.
@@ -4729,10 +4727,9 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
}
settings->setUserStyleSheetLocation(url.get());
- SysFreeString(str);
- } else {
+ str.clear();
+ } else
settings->setUserStyleSheetLocation(KURL());
- }
hr = preferences->shouldPrintBackgrounds(&enabled);
if (FAILED(hr))
@@ -4978,9 +4975,7 @@ HRESULT STDMETHODCALLTYPE WebView::MIMETypeForExtension(
if (!mimeType)
return E_POINTER;
- String extensionStr(extension, SysStringLen(extension));
-
- *mimeType = BString(MIMETypeRegistry::getMIMETypeForExtension(extensionStr)).release();
+ *mimeType = BString(MIMETypeRegistry::getMIMETypeForExtension(toString(extension))).release();
return S_OK;
}
@@ -5228,8 +5223,7 @@ HRESULT STDMETHODCALLTYPE WebView::standardUserAgentWithApplicationName(
return E_POINTER;
}
- BString applicationNameBString(applicationName);
- *groupName = BString(standardUserAgentWithApplicationName(String(applicationNameBString, SysStringLen(applicationNameBString)))).release();
+ *groupName = BString(standardUserAgentWithApplicationName(toString(applicationName))).release();
return S_OK;
}
@@ -5284,7 +5278,7 @@ HRESULT STDMETHODCALLTYPE WebView::setAllowSiteSpecificHacks(
HRESULT STDMETHODCALLTYPE WebView::addAdditionalPluginDirectory(
/* [in] */ BSTR directory)
{
- PluginDatabase::installedPlugins()->addExtraPluginDirectory(String(directory, SysStringLen(directory)));
+ PluginDatabase::installedPlugins()->addExtraPluginDirectory(toString(directory));
return S_OK;
}
@@ -6118,7 +6112,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerEmbeddedViewMIMEType(BSTR mimeType)
if (!m_embeddedViewMIMETypes)
m_embeddedViewMIMETypes = adoptPtr(new HashSet<String>);
- m_embeddedViewMIMETypes->add(String(mimeType, ::SysStringLen(mimeType)));
+ m_embeddedViewMIMETypes->add(toString(mimeType));
return S_OK;
}
@@ -6190,16 +6184,6 @@ HRESULT WebView::setCanStartPlugins(BOOL canStartPlugins)
return S_OK;
}
-static String toString(BSTR bstr)
-{
- return String(bstr, SysStringLen(bstr));
-}
-
-static KURL toKURL(BSTR bstr)
-{
- return KURL(KURL(), toString(bstr));
-}
-
void WebView::enterFullscreenForNode(Node* node)
{
if (!node->hasTagName(HTMLNames::videoTag) || !node->isElementNode())
@@ -6415,13 +6399,13 @@ HRESULT WebView::invalidateBackingStore(const RECT* rect)
HRESULT WebView::addOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
{
- SecurityPolicy::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
+ SecurityPolicy::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(toString(sourceOrigin)), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
return S_OK;
}
HRESULT WebView::removeOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
{
- SecurityPolicy::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
+ SecurityPolicy::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(toString(sourceOrigin)), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
return S_OK;
}
@@ -6598,20 +6582,18 @@ HRESULT WebView::geolocationDidFailWithError(IWebError* error)
if (!error)
return E_POINTER;
- BSTR descriptionBSTR;
- if (FAILED(error->localizedDescription(&descriptionBSTR)))
+ BString description;
+ if (FAILED(error->localizedDescription(&description)))
return E_FAIL;
- String descriptionString(descriptionBSTR, SysStringLen(descriptionBSTR));
- SysFreeString(descriptionBSTR);
- RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, descriptionString);
+ RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, toString(description));
GeolocationController::from(m_page)->errorOccurred(geolocationError.get());
return S_OK;
}
HRESULT WebView::setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, BSTR scheme)
{
- SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, String(scheme, SysStringLen(scheme)));
+ SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, toString(scheme));
return S_OK;
}
@@ -6906,7 +6888,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCompositionForTesting(
if (!frame || !frame->editor()->canEdit())
return E_FAIL;
- String compositionStr(composition, SysStringLen(composition));
+ String compositionStr = toString(composition);
Vector<CompositionUnderline> underlines;
underlines.append(CompositionUnderline(0, compositionStr.length(), Color(Color::black), false));
@@ -6938,7 +6920,7 @@ HRESULT STDMETHODCALLTYPE WebView::confirmCompositionForTesting(/* [in] */ BSTR
if (!frame || !frame->editor()->canEdit())
return E_FAIL;
- String compositionStr(composition, SysStringLen(composition));
+ String compositionStr = toString(composition);
if (compositionStr.isNull())
frame->editor()->confirmComposition();
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 1a701316d..cbb88ad72 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,684 @@
+2012-09-20 Balazs Kelemen <kbalazs@webkit.org>
+
+ [CoordinatedGraphics] Don't reset m_shouldSyncFrame in flushPendingLayerChanges
+ https://bugs.webkit.org/show_bug.cgi?id=97108
+
+ Reviewed by Noam Rosenthal.
+
+ Stop ignoring if m_shouldSyncFrame has been set between the two
+ layer flush. It can be set during layout in several situations,
+ for example when a layer is deleted or changed state. We want to
+ send the DidRenderFrame message at the next flush in those situations
+ so the UI process will apply the changes as soon as possible.
+
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+ (WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
+
+2012-09-20 Byungwoo Lee <bw80.lee@samsung.com>
+
+ [EFL][WK2] Check timeout on waitUntilLoadFinished() and waitUntilTitleChangedTo().
+ https://bugs.webkit.org/show_bug.cgi?id=97081
+
+ Reviewed by Gyuyoung Kim.
+
+ Add assertion to check timeout on waitUntilLoadFinished() and
+ waitUntilTitleChangedTo().
+ Set the default timeout for the functions as 10 seconds.
+
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
+ (EWK2UnitTestBase):
+ * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp:
+ (TEST_F):
+ * UIProcess/API/efl/tests/test_ewk2_context.cpp:
+ (TEST_F):
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ (TEST_F):
+
+2012-09-20 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ [EFL] Change the log macro names to be more consistent with EINA LOG
+ https://bugs.webkit.org/show_bug.cgi?id=97158
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Some log macro names in WebKit2 are inconsistent with EINA LOG names
+ such as WRN/INF not WARN/INFO.
+
+ #define WRN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
+ #define INF(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
+
+ This patch changes the such names to be consistent with EINA LOG's names.
+
+ * UIProcess/API/efl/ewk_main.cpp:
+ (ewk_init):
+ * UIProcess/API/efl/ewk_private.h:
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_webprocess_crashed):
+
+2012-09-20 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Same page navigation does not update view URI
+ https://bugs.webkit.org/show_bug.cgi?id=97094
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Handle didSameDocumentNavigationForFrame callback in
+ WKPageLoaderClient in order to update the view URI.
+ This fixes issues with the view URI not being updated
+ in case of a same page navigation.
+
+ * UIProcess/API/efl/ewk_view_loader_client.cpp:
+ (didSameDocumentNavigationForFrame):
+ (ewk_view_loader_client_attach):
+ * UIProcess/API/efl/ewk_view_private.h:
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
+ (CallbackDataTimer):
+ (EWK2UnitTest::CallbackDataTimer::CallbackDataTimer):
+ (EWK2UnitTest::CallbackDataTimer::~CallbackDataTimer):
+ (EWK2UnitTest::CallbackDataTimer::isDone):
+ (EWK2UnitTest::CallbackDataTimer::setDone):
+ (EWK2UnitTest::CallbackDataTimer::didTimeOut):
+ (EWK2UnitTest::CallbackDataTimer::setTimedOut):
+ (EWK2UnitTest):
+ (CallbackDataExpectedValue):
+ (EWK2UnitTest::CallbackDataExpectedValue::CallbackDataExpectedValue):
+ (EWK2UnitTest::CallbackDataExpectedValue::expectedValue):
+ (EWK2UnitTest::onLoadFinished):
+ (EWK2UnitTest::timeOutWhileWaitingUntilLoadFinished):
+ (EWK2UnitTest::EWK2UnitTestBase::waitUntilLoadFinished):
+ (EWK2UnitTest::onTitleChanged):
+ (EWK2UnitTest::timeOutWhileWaitingUntilTitleChangedTo):
+ (EWK2UnitTest::EWK2UnitTestBase::waitUntilTitleChangedTo):
+ (EWK2UnitTest::onURIChanged):
+ (EWK2UnitTest::timeOutWhileWaitingUntilURIChangedTo):
+ (EWK2UnitTest::EWK2UnitTestBase::waitUntilURIChangedTo): Add convenience function to test
+ framework in order to wait until the view URI changes to a given value.
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
+ (EWK2UnitTestBase):
+ * UIProcess/API/efl/tests/resources/same_page_navigation.html: Added.
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ (TEST_F): Add corresponding unit test to verify fix and prevent regressions
+ in the future.
+
+2012-09-19 Dan Bernstein <mitz@apple.com>
+
+ WebKit2 part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit): Defined ScreenFontSubstitutionEnabled key with a default value of true.
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetScreenFontSubstitutionEnabled): Added this setter.
+ (WKPreferencesGetScreenFontSubstitutionEnabled): Added this getter.
+ * UIProcess/API/C/WKPreferencesPrivate.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences): Added a call to Settings::setScreenFontSubstitutionEnabled
+ to push the preference into Settings.
+
+2012-09-19 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ Fix unused parameter compile warnings in WebKit/WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=96742
+
+ Reviewed by Gyuyoung Kim.
+
+ Fix unused parameter compile warning messages(-Wunused-parameter) in WebKit2 during EFL build.
+ WebCore's warning messages were fixed in r128570.
+
+ * Shared/FontInfo.cpp:
+ (WebKit::FontInfo::encode):
+ (WebKit::FontInfo::decode):
+ * Shared/PlatformPopupMenuData.cpp:
+ (WebKit::PlatformPopupMenuData::encode):
+ (WebKit::PlatformPopupMenuData::decode):
+ * Shared/SandboxExtension.h:
+ (WebKit::SandboxExtension::createHandleForTemporaryFile):
+ * Shared/ShareableSurface.cpp:
+ (WebKit::ShareableSurface::create):
+ * Shared/WebMemorySampler.cpp:
+ (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile):
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageGetContentsAsMHTMLData):
+ * UIProcess/API/C/WKPluginSiteDataManager.cpp:
+ (WKPluginSiteDataManagerClearSiteData):
+ (WKPluginSiteDataManagerClearAllSiteData):
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetHixie76WebSocketProtocolEnabled):
+ (WKPreferencesGetHixie76WebSocketProtocolEnabled):
+ * UIProcess/API/efl/BatteryProvider.cpp:
+ (startUpdatingCallback):
+ (stopUpdatingCallback):
+ * UIProcess/API/efl/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::doneWithTouchEvent):
+ * UIProcess/API/efl/VibrationProvider.cpp:
+ (vibrateCallback):
+ (cancelVibrationCallback):
+ * UIProcess/API/efl/ewk_context_download_client.cpp:
+ (decideDestinationWithSuggestedFilename):
+ (didCreateDestination):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (_ewk_view_on_focus_in):
+ (_ewk_view_on_focus_out):
+ (_ewk_view_on_mouse_wheel):
+ (_ewk_view_on_mouse_down):
+ (_ewk_view_on_mouse_up):
+ (_ewk_view_on_mouse_move):
+ (_ewk_view_on_key_down):
+ (_ewk_view_on_key_up):
+ (_ewk_view_smart_move):
+ (ewk_view_contents_size_changed):
+ * UIProcess/API/efl/ewk_view_find_client.cpp:
+ (didFindString):
+ * UIProcess/API/efl/ewk_view_form_client.cpp:
+ (willSubmitForm):
+ * UIProcess/API/efl/ewk_view_loader_client.cpp:
+ (didReceiveIntentForFrame):
+ (registerIntentServiceForFrame):
+ (didFinishLoadForFrame):
+ (didFailLoadWithErrorForFrame):
+ (didStartProvisionalLoadForFrame):
+ (didReceiveServerRedirectForProvisionalLoadForFrame):
+ (didFailProvisionalLoadWithErrorForFrame):
+ (didChangeBackForwardList):
+ * UIProcess/API/efl/ewk_view_policy_client.cpp:
+ (decidePolicyForNavigationAction):
+ (decidePolicyForNewWindowAction):
+ (decidePolicyForResponseCallback):
+ * UIProcess/DrawingAreaProxy.h:
+ (WebKit::DrawingAreaProxy::update):
+ (WebKit::DrawingAreaProxy::didUpdateBackingStoreState):
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
+ (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
+ (WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
+ * UIProcess/FindIndicator.cpp:
+ (WebKit::FindIndicator::draw):
+ * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
+ (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
+ * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
+ (WebKit::PluginInfoStore::shouldUsePlugin):
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::setHTTPPipeliningEnabled):
+ * UIProcess/WebFullScreenManagerProxy.cpp:
+ (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::sessionStateData):
+ (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
+ (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::createWebPage):
+ * UIProcess/efl/TextCheckerEfl.cpp:
+ (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
+ (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
+ * UIProcess/efl/WebFullScreenManagerProxyEfl.cpp:
+ (WebKit::WebFullScreenManagerProxy::beganEnterFullScreen):
+ (WebKit::WebFullScreenManagerProxy::beganExitFullScreen):
+ * UIProcess/efl/WebPageProxyEfl.cpp:
+ (WebKit::WebPageProxy::standardUserAgent):
+ (WebKit::WebPageProxy::getEditorCommandsForKeyEvent):
+ * WebProcess/Downloads/soup/DownloadSoup.cpp:
+ (WebKit::Download::start):
+ (WebKit::Download::startWithHandle):
+ (WebKit::Download::didDecideDestination):
+ (WebKit::Download::receivedCredential):
+ (WebKit::Download::receivedRequestToContinueWithoutCredential):
+ (WebKit::Download::receivedCancellation):
+ * WebProcess/Geolocation/WebGeolocationManager.cpp:
+ (WebKit::WebGeolocationManager::didChangePosition):
+ * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
+ (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
+ (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL):
+ (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL):
+ (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL):
+ (WebKit::WebIconDatabaseProxy::iconDataForIconURL):
+ * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+ (WKBundleFrameCopyWebArchiveFilteringSubframes):
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKAccessibilityRootObject):
+ (WKAccessibilityFocusedObject):
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::setGeoLocationPermission):
+ (WebKit::InjectedBundle::didReceiveMessage):
+ (WebKit::InjectedBundle::webNotificationID):
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::initialize):
+ (WebKit::WebNotificationManager::didUpdateNotificationDecision):
+ (WebKit::WebNotificationManager::didRemoveNotificationDecisions):
+ (WebKit::WebNotificationManager::policyForOrigin):
+ (WebKit::WebNotificationManager::notificationIDForTesting):
+ (WebKit::WebNotificationManager::show):
+ (WebKit::WebNotificationManager::cancel):
+ (WebKit::WebNotificationManager::clearNotifications):
+ (WebKit::WebNotificationManager::didDestroyNotification):
+ (WebKit::WebNotificationManager::didShowNotification):
+ (WebKit::WebNotificationManager::didClickNotification):
+ (WebKit::WebNotificationManager::didCloseNotifications):
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::paint):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::addMessageToConsole):
+ (WebKit::WebChromeClient::contentsSizeChanged):
+ (WebKit::WebChromeClient::customHighlightRect):
+ (WebKit::WebChromeClient::paintCustomHighlight):
+ (WebKit::WebChromeClient::supportsFullScreenForElement):
+ * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
+ (WebKit::WebContextMenuClient::downloadURL):
+ * WebProcess/WebCoreSupport/WebDragClient.cpp:
+ (WebKit::WebDragClient::dragSourceActionMaskForPoint):
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
+ (WebKit::WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
+ (WebKit::WebFrameLoaderClient::shouldStopLoadingForHistoryItem):
+ (WebKit::WebFrameLoaderClient::canShowMIMEType):
+ (WebKit::WebFrameLoaderClient::canShowMIMETypeAsHTML):
+ (WebKit::WebFrameLoaderClient::representationExistsForURLScheme):
+ (WebKit::WebFrameLoaderClient::generatedMIMETypeForURLScheme):
+ (WebKit::WebFrameLoaderClient::createFrame):
+ (WebKit::WebFrameLoaderClient::createJavaAppletWidget):
+ (WebKit::WebFrameLoaderClient::registerForIconNotification):
+ * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+ (WebKit::WebInspectorClient::drawRect):
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::forceRepaintAsync):
+ (WebKit::DrawingArea::updateBackingStoreState):
+ * WebProcess/WebPage/FindController.cpp:
+ (WebKit::FindController::mouseEvent):
+ * WebProcess/WebPage/LayerTreeHost.cpp:
+ (WebKit::LayerTreeHost::create):
+ * WebProcess/WebPage/LayerTreeHost.h:
+ (WebKit::LayerTreeHost::forceRepaintAsync):
+ * WebProcess/WebPage/TapHighlightController.cpp:
+ (WebKit::TapHighlightController::drawRect):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::getWebArchiveOfFrame):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::getSitesWithPluginData):
+ (WebKit::WebProcess::clearPluginSiteData):
+ * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
+ (webkitSoupRequestGenericSendFinish):
+ * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
+ (webkitSoupRequestInputStreamReadAsync):
+ (webkitSoupRequestInputStreamReadFinish):
+
+2012-09-19 Pratik Solanki <psolanki@apple.com>
+
+ Warning in SandboxExtension.h if WEB_PROCESS_SANDBOX is not enabled
+ https://bugs.webkit.org/show_bug.cgi?id=97137
+
+ Reviewed by Benjamin Poulain.
+
+ m_size is only used when WEB_PROCESS_SANDBOX is enabled, so move its declaration inside
+ #if ENABLE(WEB_PROCESS_SANDBOX).
+
+ * Shared/SandboxExtension.h:
+ (HandleArray):
+
+2012-09-19 Sudarsana Nagineni <sudarsana.nagineni@intel.com>
+
+ [WTR] Memory leaks in TestRunner::deliverWebIntent()
+ https://bugs.webkit.org/show_bug.cgi?id=97111
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix memory leaks in WKBundleIntentCreate() by adopting strings
+ created with WKStringCreateWithUTF8CString().
+
+ * WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp:
+ (WKBundleIntentCreate):
+
+2012-09-19 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] fast/forms/select-writing-direction-natural.html is failing
+ https://bugs.webkit.org/show_bug.cgi?id=97082
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ WebChromeClient::selectItemWritingDirectionIsNatural() now returns
+ true for EFL-WK2, consistently with EFL-WK1, so that the style
+ is properly adjusted in RenderMenuList::adjustInnerStyle().
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
+
+2012-09-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add API to get/set the security policy of a given URI scheme to WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=96497
+
+ Reviewed by Martin Robinson.
+
+ Add WebKitSecurityManager object associated to a WebKitWebContext
+ to get/set the security policy of a URI scheme.
+
+ * GNUmakefile.list.am: Add new files to compilation.
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode): Encode the list of
+ schemes to be reigstered as Local, NoAccess, DisplayIsolated and
+ CORSEnabled.
+ (WebKit::WebProcessCreationParameters::decode): Decode the list of
+ schemes to be reigstered as Local, NoAccess, DisplayIsolated and
+ CORSEnabled.
+ * Shared/WebProcessCreationParameters.h:
+ (WebProcessCreationParameters): Add new parameters to be able to
+ register schemes as Local, NoAccess, DisplayIsolated and
+ CORSEnabled.
+ * UIProcess/API/gtk/WebKitSecurityManager.cpp: Added.
+ (webkit_security_manager_init):
+ (webkitSecurityManagerFinalize):
+ (webkit_security_manager_class_init):
+ (webkitSecurityManagerCreate): Private function to create the
+ WebKitSecurityManager object associated to the given
+ WebKitWebContext.
+ (registerSecurityPolicyForURIScheme):
+ (checkSecurityPolicyForURIScheme):
+ (webkit_security_manager_register_uri_scheme_as_local):
+ (webkit_security_manager_uri_scheme_is_local):
+ (webkit_security_manager_register_uri_scheme_as_no_access):
+ (webkit_security_manager_uri_scheme_is_no_access):
+ (webkit_security_manager_register_uri_scheme_as_display_isolated):
+ (webkit_security_manager_uri_scheme_is_display_isolated):
+ (webkit_security_manager_register_uri_scheme_as_secure):
+ (webkit_security_manager_uri_scheme_is_secure):
+ (webkit_security_manager_register_uri_scheme_as_cors_enabled):
+ (webkit_security_manager_uri_scheme_is_cors_enabled):
+ (webkit_security_manager_register_uri_scheme_as_empty_document):
+ (webkit_security_manager_uri_scheme_is_empty_document):
+ * UIProcess/API/gtk/WebKitSecurityManager.h: Added.
+ * UIProcess/API/gtk/WebKitSecurityManagerPrivate.h: Added.
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkit_web_context_get_security_manager): Return the
+ WebKitSecurityManager object, creating it before if it doesn't exist.
+ * UIProcess/API/gtk/WebKitWebContext.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for
+ WebKitSecurityManager.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
+ * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
+ (testWebContextSecurityPolicy):
+ (beforeAll):
+ * UIProcess/API/gtk/webkit2.h: Add WebKitSecurityManager.h.
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::createNewWebProcess): Copy new vector
+ schemes.
+ (WebKit::WebContext::registerURLSchemeAsLocal): Send a message to
+ WebProcess to register the given URL scheme as Local.
+ (WebKit::WebContext::registerURLSchemeAsNoAccess): Send a message
+ to WebProcess to register the given URL scheme as NoAccess.
+ (WebKit::WebContext::registerURLSchemeAsDisplayIsolated): Send a
+ message to WebProcess to register the given URL scheme as
+ DisplayIsolated.
+ (WebKit::WebContext::registerURLSchemeAsCORSEnabled): Send a
+ message to WebProcess to register the given URL scheme as
+ CORSEnabled.
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::registerURLSchemeAsLocal): Register the
+ given URL scheme as Local in the SchemeRegistry.
+ (WebKit::WebProcess::registerURLSchemeAsNoAccess): Register the
+ given URL scheme as NoAccess in the SchemeRegistry.
+ (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated): Register
+ the given URL scheme as DisplayIsolated in the SchemeRegistry.
+ (WebKit::WebProcess::registerURLSchemeAsCORSEnabled): Register the
+ given URL scheme as CORSEnabled in the SchemeRegistry.
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in: Add new messages.
+
+2012-09-19 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Texmap] Potential crash in TextureMapperLayer because of referencing deleted mask/replica layer
+ https://bugs.webkit.org/show_bug.cgi?id=96919
+
+ Reviewed by Noam Rosenthal.
+
+ Delay syncing deleted layers until flushPendingLayerChanges so the UI side state
+ will contain all changes related to the deletion of a layer. This saves us from
+ referencing a deleted layer.
+
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+ (WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
+ (WebKit::LayerTreeCoordinator::detachLayer):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
+ (LayerTreeCoordinator):
+
+2012-09-19 Byungwoo Lee <bw80.lee@samsung.com>
+
+ [EFL][WK2] waitUntilTitleChangedTo() and waitUntilLoadFinished() needs timeout.
+ https://bugs.webkit.org/show_bug.cgi?id=96910
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Currently, the waitUntilTitleChangedTo() and waitUntilLoadFinished()
+ functions doesn't handle timeout by itself.
+ And if there are some failed cases that loading is not finished or
+ title is not changed to the expected string, test case just stopped
+ with timeout and there is no more information about this such as line
+ number.
+
+ To handle timeout status more properly, timeout parameter is added to
+ these functions.
+
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
+ (EWK2UnitTest::LoadFinishedData::LoadFinishedData):
+ (LoadFinishedData):
+ (EWK2UnitTest::LoadFinishedData::~LoadFinishedData):
+ (EWK2UnitTest):
+ (EWK2UnitTest::onLoadFinished):
+ (EWK2UnitTest::timeOutWhileWaitingUntilLoadFinished):
+ (EWK2UnitTest::EWK2UnitTestBase::waitUntilLoadFinished):
+ (EWK2UnitTest::TitleChangedData::TitleChangedData):
+ (TitleChangedData):
+ (EWK2UnitTest::TitleChangedData::~TitleChangedData):
+ (EWK2UnitTest::onTitleChanged):
+ (EWK2UnitTest::timeOutWhileWaitingUntilTitleChangedTo):
+ (EWK2UnitTest::EWK2UnitTestBase::waitUntilTitleChangedTo):
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
+ (EWK2UnitTestBase):
+
+2012-09-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ [EFL][WK2] Add javascript popup API.
+ https://bugs.webkit.org/show_bug.cgi?id=95672
+
+ Reviewed by Gyuyoung Kim.
+
+ Add smart class member function for javascript alert(), confirm() and prompt().
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_run_javascript_alert):
+ (ewk_view_run_javascript_confirm):
+ (ewk_view_run_javascript_prompt):
+ * UIProcess/API/efl/ewk_view.h:
+ * UIProcess/API/efl/ewk_view_private.h:
+ * UIProcess/API/efl/ewk_view_ui_client.cpp:
+ (runJavaScriptAlert):
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (ewk_view_ui_client_attach):
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ Added unit test for javascript popup smart class member function.
+ (checkAlert):
+ (TEST_F):
+ (checkConfirm):
+ (checkPrompt):
+
+2012-09-18 Sailesh Agrawal <sail@chromium.org>
+
+ Chromium: Scrollbar with tickmarks doesn't respond to clicks
+ https://bugs.webkit.org/show_bug.cgi?id=96049
+
+ Reviewed by Beth Dakin.
+
+ Update exported symbols.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-09-18 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ [EFL][WK2] Add log macros for EINA_LOG_DOM_XXX series
+ https://bugs.webkit.org/show_bug.cgi?id=97061
+
+ Reviewed by Gyuyoung Kim.
+
+ EFL Webkit2 is using the EINA_LOG_DOM_XXX series in several places to log a message on the specified domain and format.
+ This patch adds log macros to simplify these logging codes.
+
+ * UIProcess/API/efl/ewk_main.cpp:
+ (ewk_init):
+ * UIProcess/API/efl/ewk_private.h:
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_webprocess_crashed):
+
+2012-09-17 Martin Robinson <mrobinson@igalia.com>
+
+ [WebKit2] [GTK] Add API for controlling the user agent
+ https://bugs.webkit.org/show_bug.cgi?id=95697
+
+ Reviewed by Carlos Garcia Campos.
+
+ Add API for changing the user agent in WebKit2. This adds two styles of
+ setting the user agent: complete override and a method that just inserts
+ the application name and version, but preserves the carefully crafted user agent
+ in the library.
+
+ * UIProcess/API/gtk/WebKitSettings.cpp:
+ (_WebKitSettingsPrivate): Added a new field to store the user agent.
+ This is stored in the private data structure, because we can only
+ set the user agent when attaching the settings to the page.
+ (webKitSettingsSetProperty): Add hooks for the new user agent property.
+ (webKitSettingsGetProperty): Ditto.
+ (webkit_settings_class_init): Ditto.
+ (webkitSettingsAttachSettingsToPage): Ditto.
+ (webkit_settings_get_user_agent): Added.
+ (webkit_settings_set_user_agent): Added.
+ (webkit_settings_set_user_agent_with_application_name): Added.
+ * UIProcess/API/gtk/WebKitSettings.h: Added new methods.
+ * UIProcess/API/gtk/WebKitWebView.cpp: Update the glue for the settings
+ when attaching and detaching from WebViews.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added new methods to
+ the documentation.
+ * UIProcess/API/gtk/tests/TestWebKitSettings.cpp: Test the new user agent
+ property.
+ (testWebKitSettingsUserAgent): Ditto.
+ (beforeAll): Ditto.
+ * UIProcess/gtk/WebPageProxyGtk.cpp:
+ (WebKit::WebPageProxy::standardUserAgent): Now use the shared WebCore
+ code when setting the user agent.
+
+2012-09-18 Ryuan Choi <ryuan.choi@samsung.com>
+
+ [EFL][WK2] Implement PageClientImpl::isViewFocused.
+ https://bugs.webkit.org/show_bug.cgi?id=97015
+
+ Reviewed by Gyuyoung Kim.
+
+ WebKit2/Efl always returns true for PageClientImpl::isViewFocused.
+ So window.onblur events will not be generated when webview lost focus.
+
+ This patch implements isViewFocused to return the current focus of webview.
+
+ * UIProcess/API/efl/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::isViewFocused):
+
+2012-09-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Title string should be changed when document.title is set to ''.
+ https://bugs.webkit.org/show_bug.cgi?id=96793
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added unit test for setting document.title and checking the title
+ string with title,changed signal and ewk_view_title_get() function.
+
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ (TEST_F):
+
+2012-09-18 Anders Carlsson <andersca@apple.com>
+
+ Division by zero crash in BackingStore::scroll
+ https://bugs.webkit.org/show_bug.cgi?id=97046
+ <rdar://problem/11722564>
+
+ Reviewed by Dan Bernstein.
+
+ It appears that DrawingAreaImpl::scroll can be called with an empty scroll rect. Do nothing
+ if that's the case. Also, assert that the scrolling rect in BackingStoreMac is never empty.
+
+ * UIProcess/mac/BackingStoreMac.mm:
+ (WebKit::BackingStore::scroll):
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::scroll):
+
+2012-09-18 Bo Liu <boliu@chromium.org>
+
+ Revert 128780, 128676, 128645
+ https://bugs.webkit.org/show_bug.cgi?id=97022
+
+ Reviewed by Adam Barth.
+
+ I made these revisions to add in-place reload behavior to ImagesEnabled setting.
+ Reverting this for now due to them causing performance regression in
+ chromium, possibly caused by increased calls to
+ PermissionClient::imageAllowed.
+
+ * win/WebKit2.def:
+
+2012-09-18 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] [WebKit2] Use XComposite window for accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=94417
+
+ Reviewed by Carlos Garcia Campos.
+
+ Instead of rendering directly to the widget's native window, render to an
+ offscreen window redirected to a Pixmap with XComposite.
+
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (_WebKitWebViewBasePrivate): Added a few members necessary to track the
+ offscreen window.
+ (webkit_web_view_base_init):
+ (renderAcceleratedCompositingResults): Added this helper functions which renders
+ the results of the accelerated compositing operations during the GTK+ draw loop.
+ (webkitWebViewBaseDraw): Call renderAcceleratedCompositingResults when appropriate.
+ (resizeWebKitWebViewBaseFromAllocation): Resize the offscreen window when appropriate.
+ (webkitWebViewBaseSizeAllocate): Do not call resizeWebKitWebViewBaseFromAllocation when
+ the actual size of the widget does not change. This prevents destroying and recreating
+ the offscreen window pixmap when it isn't necessary.
+ (webkitWebViewBaseMap): We no longer send the window id during map, instead it's sent
+ as soon as there is WebPageProxy.
+ (webkitWebViewBaseCreateWebPage): Send the window id of the redirected window to
+ the WebProcess.
+ (queueAnotherDrawOfAcceleratedCompositingResults): Added this helper which works
+ around the issue of slow updates of the pixmap backing the redirected XComposite window.
+ (webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults): Added this method which
+ is what the WebProcess uses to force a redraw on the UIProcess side.
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Added new method to the list of private methods.
+ * UIProcess/DrawingAreaProxyImpl.h:
+ (DrawingAreaProxyImpl):
+ (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): Exposed this method publically
+ so that it can be used from WebKitWebViewBase.
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy): Renamed widgetMapped to setAcceleratedCompositingWindowId.
+ * UIProcess/WebPageProxy.messages.in: Ditto.
+ * UIProcess/gtk/WebPageProxyGtk.cpp: Ditto.
+ (WebKit::WebPageProxy::setAcceleratedCompositingWindowId):
+ * WebProcess/WebPage/WebPage.h:
+ (WebPage): Ditto.
+ * WebProcess/WebPage/WebPage.messages.in: Ditto.
+ * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
+ (WebKit::LayerTreeHostGtk::sizeDidChange): Force a composite to the resized window right
+ away so that the new window pixmap is updated before the first draw.
+ (WebKit::LayerTreeHostGtk::compositeLayersToContext): If the composition is for a resize,
+ first clear the entire GL context so that we don't see black artifacts during resize.
+ * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
+ (LayerTreeHostGtk): Update the signature of compositeLayersToContext.
+ * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+ (WebKit::WebPage::setAcceleratedCompositingWindowId): Added.
+
2012-09-18 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r128849.
diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am
index f10249d35..41d311d12 100644
--- a/Source/WebKit2/GNUmakefile.list.am
+++ b/Source/WebKit2/GNUmakefile.list.am
@@ -118,6 +118,7 @@ webkit2gtk_h_api += \
$(WebKit2)/UIProcess/API/gtk/WebKitPrintOperation.h \
$(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
$(WebKit2)/UIProcess/API/gtk/WebKitScriptDialog.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitSecurityManager.h \
$(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
$(WebKit2)/UIProcess/API/gtk/WebKitURIRequest.h \
$(WebKit2)/UIProcess/API/gtk/WebKitURIResponse.h \
@@ -697,6 +698,9 @@ webkit2_sources += \
Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.h \
Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h \
Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h \
Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h \
diff --git a/Source/WebKit2/Shared/FontInfo.cpp b/Source/WebKit2/Shared/FontInfo.cpp
index 12cfd5980..cd0263045 100644
--- a/Source/WebKit2/Shared/FontInfo.cpp
+++ b/Source/WebKit2/Shared/FontInfo.cpp
@@ -40,6 +40,8 @@ void FontInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
encoder->encode(static_cast<bool>(fontAttributeDictionary));
if (fontAttributeDictionary)
CoreIPC::encode(encoder, fontAttributeDictionary.get());
+#else
+ UNUSED_PARAM(encoder);
#endif
}
@@ -55,6 +57,9 @@ bool FontInfo::decode(CoreIPC::ArgumentDecoder* decoder, FontInfo& fontInfo)
if (!CoreIPC::decode(decoder, fontInfo.fontAttributeDictionary))
return false;
+#else
+ UNUSED_PARAM(decoder);
+ UNUSED_PARAM(fontInfo);
#endif
return true;
diff --git a/Source/WebKit2/Shared/PlatformPopupMenuData.cpp b/Source/WebKit2/Shared/PlatformPopupMenuData.cpp
index b627afe24..1decaacc5 100644
--- a/Source/WebKit2/Shared/PlatformPopupMenuData.cpp
+++ b/Source/WebKit2/Shared/PlatformPopupMenuData.cpp
@@ -66,6 +66,8 @@ void PlatformPopupMenuData::encode(CoreIPC::ArgumentEncoder* encoder) const
encoder->encode(shouldPopOver);
#elif PLATFORM(QT)
encoder->encode(multipleSelections);
+#else
+ UNUSED_PARAM(encoder);
#endif
}
@@ -102,6 +104,9 @@ bool PlatformPopupMenuData::decode(CoreIPC::ArgumentDecoder* decoder, PlatformPo
#elif PLATFORM(QT)
if (!decoder->decode(data.multipleSelections))
return false;
+#else
+ UNUSED_PARAM(decoder);
+ UNUSED_PARAM(data);
#endif
return true;
diff --git a/Source/WebKit2/Shared/SandboxExtension.h b/Source/WebKit2/Shared/SandboxExtension.h
index e076bc111..4fdb1ed63 100644
--- a/Source/WebKit2/Shared/SandboxExtension.h
+++ b/Source/WebKit2/Shared/SandboxExtension.h
@@ -84,10 +84,10 @@ public:
private:
#if ENABLE(WEB_PROCESS_SANDBOX)
Handle* m_data;
+ size_t m_size;
#else
Handle m_emptyHandle;
#endif
- size_t m_size;
};
static PassRefPtr<SandboxExtension> create(const Handle&);
@@ -127,7 +127,7 @@ inline bool SandboxExtension::HandleArray::decode(CoreIPC::ArgumentDecoder*, Han
inline PassRefPtr<SandboxExtension> SandboxExtension::create(const Handle&) { return 0; }
inline void SandboxExtension::createHandle(const String&, Type, Handle&) { }
inline void SandboxExtension::createHandleForReadWriteDirectory(const String&, Handle&) { }
-inline String SandboxExtension::createHandleForTemporaryFile(const String& prefix, Type type, Handle&) {return String();}
+inline String SandboxExtension::createHandleForTemporaryFile(const String& /*prefix*/, Type, Handle&) {return String();}
inline SandboxExtension::~SandboxExtension() { }
inline bool SandboxExtension::invalidate() { return true; }
inline bool SandboxExtension::consume() { return true; }
diff --git a/Source/WebKit2/Shared/ShareableSurface.cpp b/Source/WebKit2/Shared/ShareableSurface.cpp
index 228c0e5dc..43bd525b4 100644
--- a/Source/WebKit2/Shared/ShareableSurface.cpp
+++ b/Source/WebKit2/Shared/ShareableSurface.cpp
@@ -77,6 +77,7 @@ PassRefPtr<ShareableSurface> ShareableSurface::create(const IntSize& size, Share
return surface.release();
}
#endif
+ UNUSED_PARAM(hints);
return create(size, flags, ShareableBitmap::createShareable(size, flags));
}
diff --git a/Source/WebKit2/Shared/WebMemorySampler.cpp b/Source/WebKit2/Shared/WebMemorySampler.cpp
index 868e84823..344f7f573 100644
--- a/Source/WebKit2/Shared/WebMemorySampler.cpp
+++ b/Source/WebKit2/Shared/WebMemorySampler.cpp
@@ -167,7 +167,7 @@ void WebMemorySampler::stopTimerFired(Timer<WebMemorySampler>*)
stop();
}
-void WebMemorySampler::appendCurrentMemoryUsageToFile(PlatformFileHandle& file)
+void WebMemorySampler::appendCurrentMemoryUsageToFile(PlatformFileHandle&)
{
// Collect statistics from allocators and get RSIZE metric
StringBuilder statString;
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h
index fc1f6c00a..b70767c75 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.h
+++ b/Source/WebKit2/Shared/WebPreferencesStore.h
@@ -128,6 +128,7 @@ namespace WebKit {
macro(ScrollingPerformanceLoggingEnabled, scrollingPerformanceLoggingEnabled, Bool, bool, false) \
macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, 0) \
macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
+ macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, true) \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
index 4339d59e2..31f11a7e8 100644
--- a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
+++ b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
@@ -60,6 +60,10 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
encoder->encode(urlSchemesRegistererdAsEmptyDocument);
encoder->encode(urlSchemesRegisteredAsSecure);
encoder->encode(urlSchemesForWhichDomainRelaxationIsForbidden);
+ encoder->encode(urlSchemesRegisteredAsLocal);
+ encoder->encode(urlSchemesRegisteredAsNoAccess);
+ encoder->encode(urlSchemesRegisteredAsDisplayIsolated);
+ encoder->encode(urlSchemesRegisteredAsCORSEnabled);
encoder->encode(mimeTypesWithCustomRepresentation);
encoder->encodeEnum(cacheModel);
encoder->encode(shouldTrackVisitedLinks);
@@ -134,6 +138,14 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
return false;
if (!decoder->decode(parameters.urlSchemesForWhichDomainRelaxationIsForbidden))
return false;
+ if (!decoder->decode(parameters.urlSchemesRegisteredAsLocal))
+ return false;
+ if (!decoder->decode(parameters.urlSchemesRegisteredAsNoAccess))
+ return false;
+ if (!decoder->decode(parameters.urlSchemesRegisteredAsDisplayIsolated))
+ return false;
+ if (!decoder->decode(parameters.urlSchemesRegisteredAsCORSEnabled))
+ return false;
if (!decoder->decode(parameters.mimeTypesWithCustomRepresentation))
return false;
if (!decoder->decodeEnum(parameters.cacheModel))
diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.h b/Source/WebKit2/Shared/WebProcessCreationParameters.h
index 9fae17f54..892ab8bcb 100644
--- a/Source/WebKit2/Shared/WebProcessCreationParameters.h
+++ b/Source/WebKit2/Shared/WebProcessCreationParameters.h
@@ -64,6 +64,10 @@ struct WebProcessCreationParameters {
Vector<String> urlSchemesRegistererdAsEmptyDocument;
Vector<String> urlSchemesRegisteredAsSecure;
Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
+ Vector<String> urlSchemesRegisteredAsLocal;
+ Vector<String> urlSchemesRegisteredAsNoAccess;
+ Vector<String> urlSchemesRegisteredAsDisplayIsolated;
+ Vector<String> urlSchemesRegisteredAsCORSEnabled;
// MIME types for which the UI process will handle showing the data.
Vector<String> mimeTypesWithCustomRepresentation;
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
index e24c2d6ef..b2ce4fcc2 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -596,6 +596,11 @@ void WKPageGetContentsAsMHTMLData(WKPageRef pageRef, bool useBinaryEncoding, voi
{
#if ENABLE(MHTML)
toImpl(pageRef)->getContentsAsMHTMLData(DataCallback::create(context, callback), useBinaryEncoding);
+#else
+ UNUSED_PARAM(pageRef);
+ UNUSED_PARAM(useBinaryEncoding);
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(callback);
#endif
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
index e3024e762..179610b0c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
@@ -63,6 +63,13 @@ void WKPluginSiteDataManagerClearSiteData(WKPluginSiteDataManagerRef managerRef,
{
#if ENABLE(NETSCAPE_PLUGIN_API)
toImpl(managerRef)->clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, VoidCallback::create(context, function));
+#else
+ UNUSED_PARAM(managerRef);
+ UNUSED_PARAM(sitesRef);
+ UNUSED_PARAM(flags);
+ UNUSED_PARAM(maxAgeInSeconds);
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(function);
#endif
}
@@ -70,5 +77,9 @@ void WKPluginSiteDataManagerClearAllSiteData(WKPluginSiteDataManagerRef managerR
{
#if ENABLE(NETSCAPE_PLUGIN_API)
toImpl(managerRef)->clearSiteData(0, NP_CLEAR_ALL, numeric_limits<uint64_t>::max(), VoidCallback::create(context, function));
+#else
+ UNUSED_PARAM(managerRef);
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(function);
#endif
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
index 862e2d1b0..657b1b730 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -288,6 +288,16 @@ uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->minimumFontSize();
}
+void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setScreenFontSubstitutionEnabled(enabled);
+}
+
+bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->screenFontSubstitutionEnabled();
+}
+
void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
{
toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));
@@ -648,11 +658,11 @@ bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesR
return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
}
-void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef, bool /*enabled*/)
{
}
-bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef)
{
return false;
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
index 31899d47e..11311704d 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
@@ -215,6 +215,10 @@ WK_EXPORT bool WKPreferencesGetInteractiveFormValidationEnabled(WKPreferencesRef
WK_EXPORT void WKPreferencesSetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef);
+// Defaults to true
+WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
+
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
#ifdef __cplusplus
diff --git a/Source/WebKit2/UIProcess/API/efl/BatteryProvider.cpp b/Source/WebKit2/UIProcess/API/efl/BatteryProvider.cpp
index 18c9e1443..83cc37119 100644
--- a/Source/WebKit2/UIProcess/API/efl/BatteryProvider.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/BatteryProvider.cpp
@@ -40,12 +40,12 @@ static inline BatteryProvider* toBatteryProvider(const void* clientInfo)
return static_cast<BatteryProvider*>(const_cast<void*>(clientInfo));
}
-static void startUpdatingCallback(WKBatteryManagerRef batteryManager, const void* clientInfo)
+static void startUpdatingCallback(WKBatteryManagerRef, const void* clientInfo)
{
toBatteryProvider(clientInfo)->startUpdating();
}
-static void stopUpdatingCallback(WKBatteryManagerRef batteryManager, const void* clientInfo)
+static void stopUpdatingCallback(WKBatteryManagerRef, const void* clientInfo)
{
toBatteryProvider(clientInfo)->stopUpdating();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
index f8519ce6b..100633962 100644
--- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
@@ -89,8 +89,7 @@ bool PageClientImpl::isViewWindowActive()
bool PageClientImpl::isViewFocused()
{
- notImplemented();
- return true;
+ return evas_object_focus_get(m_viewWidget);
}
bool PageClientImpl::isViewVisible()
@@ -195,7 +194,7 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool)
}
#if ENABLE(TOUCH_EVENTS)
-void PageClientImpl::doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled)
+void PageClientImpl::doneWithTouchEvent(const NativeWebTouchEvent&, bool /*wasEventHandled*/)
{
notImplemented();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp
index a96910638..29fb6a4fc 100644
--- a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp
@@ -55,12 +55,12 @@ static inline VibrationProvider* toVibrationProvider(const void* clientInfo)
return static_cast<VibrationProvider*>(const_cast<void*>(clientInfo));
}
-static void vibrateCallback(WKVibrationRef vibrationRef, uint64_t vibrationTime, const void* clientInfo)
+static void vibrateCallback(WKVibrationRef, uint64_t vibrationTime, const void* clientInfo)
{
toVibrationProvider(clientInfo)->vibrate(vibrationTime);
}
-static void cancelVibrationCallback(WKVibrationRef vibrationRef, const void* clientInfo)
+static void cancelVibrationCallback(WKVibrationRef, const void* clientInfo)
{
toVibrationProvider(clientInfo)->cancelVibration();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
index 1cb7e17f2..9d924bff2 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
@@ -48,7 +48,7 @@ static inline Ewk_Context* toEwkContext(const void* clientInfo)
return static_cast<Ewk_Context*>(const_cast<void*>(clientInfo));
}
-static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef wkDownload, WKStringRef filename, bool* allowOverwrite, const void* clientInfo)
+static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef wkDownload, WKStringRef filename, bool* /*allowOverwrite*/, const void* clientInfo)
{
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
@@ -74,7 +74,7 @@ static void didReceiveResponse(WKContextRef, WKDownloadRef wkDownload, WKURLResp
ewk_url_response_unref(response);
}
-static void didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStringRef path, const void* clientInfo)
+static void didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStringRef /*path*/, const void* clientInfo)
{
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp
index 0d01924bc..fcc9faf1a 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "ewk_main.h"
+#include "ewk_private.h"
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Edje.h>
@@ -53,24 +54,24 @@ int ewk_init(void)
}
if (!evas_init()) {
- EINA_LOG_DOM_CRIT(_ewk_log_dom, "could not init evas.");
+ CRITICAL("could not init evas.");
goto error_evas;
}
if (!ecore_init()) {
- EINA_LOG_DOM_CRIT(_ewk_log_dom, "could not init ecore.");
+ CRITICAL("could not init ecore.");
goto error_ecore;
}
if (!ecore_evas_init()) {
- EINA_LOG_DOM_CRIT(_ewk_log_dom, "could not init ecore_evas.");
+ CRITICAL("could not init ecore_evas.");
goto error_ecore_evas;
}
g_type_init();
if (!ecore_main_loop_glib_integrate()) {
- EINA_LOG_DOM_WARN(_ewk_log_dom, "Ecore was not compiled with GLib support, some plugins will not "
+ WARN("Ecore was not compiled with GLib support, some plugins will not "
"work (ie: Adobe Flash)");
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_private.h
index 96611e20d..4bdb25b68 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_private.h
@@ -33,4 +33,10 @@
extern int _ewk_log_dom;
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ewk_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_ewk_log_dom, __VA_ARGS__)
+#define WARN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
+#define INFO(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_ewk_log_dom, __VA_ARGS__)
+
#endif // ewk_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index 148a5b64c..98c9c66be 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -281,7 +281,7 @@ static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* smartData, const Ev
}
// Event Handling.
-static void _ewk_view_on_focus_in(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_focus_in(void* data, Evas*, Evas_Object*, void* /*eventInfo*/)
{
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
EINA_SAFETY_ON_NULL_RETURN(smartData->api);
@@ -289,7 +289,7 @@ static void _ewk_view_on_focus_in(void* data, Evas* canvas, Evas_Object* ewkView
smartData->api->focus_in(smartData);
}
-static void _ewk_view_on_focus_out(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_focus_out(void* data, Evas*, Evas_Object*, void* /*eventInfo*/)
{
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
EINA_SAFETY_ON_NULL_RETURN(smartData->api);
@@ -297,7 +297,7 @@ static void _ewk_view_on_focus_out(void* data, Evas* canvas, Evas_Object* ewkVie
smartData->api->focus_out(smartData);
}
-static void _ewk_view_on_mouse_wheel(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_mouse_wheel(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Mouse_Wheel* wheelEvent = static_cast<Evas_Event_Mouse_Wheel*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -306,7 +306,7 @@ static void _ewk_view_on_mouse_wheel(void* data, Evas* canvas, Evas_Object* ewkV
smartData->api->mouse_wheel(smartData, wheelEvent);
}
-static void _ewk_view_on_mouse_down(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_mouse_down(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Mouse_Down* downEvent = static_cast<Evas_Event_Mouse_Down*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -315,7 +315,7 @@ static void _ewk_view_on_mouse_down(void* data, Evas* canvas, Evas_Object* ewkVi
smartData->api->mouse_down(smartData, downEvent);
}
-static void _ewk_view_on_mouse_up(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_mouse_up(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Mouse_Up* upEvent = static_cast<Evas_Event_Mouse_Up*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -324,7 +324,7 @@ static void _ewk_view_on_mouse_up(void* data, Evas* canvas, Evas_Object* ewkView
smartData->api->mouse_up(smartData, upEvent);
}
-static void _ewk_view_on_mouse_move(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_mouse_move(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Mouse_Move* moveEvent = static_cast<Evas_Event_Mouse_Move*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -333,7 +333,7 @@ static void _ewk_view_on_mouse_move(void* data, Evas* canvas, Evas_Object* ewkVi
smartData->api->mouse_move(smartData, moveEvent);
}
-static void _ewk_view_on_key_down(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_key_down(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Key_Down* downEvent = static_cast<Evas_Event_Key_Down*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -342,7 +342,7 @@ static void _ewk_view_on_key_down(void* data, Evas* canvas, Evas_Object* ewkView
smartData->api->key_down(smartData, downEvent);
}
-static void _ewk_view_on_key_up(void* data, Evas* canvas, Evas_Object* ewkView, void* eventInfo)
+static void _ewk_view_on_key_up(void* data, Evas*, Evas_Object*, void* eventInfo)
{
Evas_Event_Key_Up* upEvent = static_cast<Evas_Event_Key_Up*>(eventInfo);
Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
@@ -452,7 +452,7 @@ static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord width, Evas_
_ewk_view_smart_changed(smartData);
}
-static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y)
+static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord /*x*/, Evas_Coord /*y*/)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
@@ -1531,6 +1531,9 @@ void ewk_view_contents_size_changed(const Evas_Object* ewkView, const IntSize& s
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
priv->viewportHandler->didChangeContentsSize(size);
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(size);
#endif
}
@@ -1643,9 +1646,54 @@ void ewk_view_webprocess_crashed(Evas_Object* ewkView)
if (!handled) {
CString url = priv->pageProxy->urlAtProcessExit().utf8();
- EINA_LOG_DOM_WARN(_ewk_log_dom, "WARNING: The web process experienced a crash on '%s'.\n", url.data());
+ WARN("WARNING: The web process experienced a crash on '%s'.\n", url.data());
// Display an error page
ewk_view_html_string_load(ewkView, "The web process has crashed.", 0, url.data());
}
}
+
+/**
+ * @internal
+ * Calls a smart member function for javascript alert().
+ */
+void ewk_view_run_javascript_alert(Evas_Object* ewkView, const WKEinaSharedString& message)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EINA_SAFETY_ON_NULL_RETURN(smartData->api);
+
+ if (!smartData->api->run_javascript_alert)
+ return;
+
+ smartData->api->run_javascript_alert(smartData, message);
+}
+
+/**
+ * @internal
+ * Calls a smart member function for javascript confirm() and returns a value from the function. Returns false by default.
+ */
+bool ewk_view_run_javascript_confirm(Evas_Object* ewkView, const WKEinaSharedString& message)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api, false);
+
+ if (!smartData->api->run_javascript_confirm)
+ return false;
+
+ return smartData->api->run_javascript_confirm(smartData, message);
+}
+
+/**
+ * @internal
+ * Calls a smart member function for javascript prompt() and returns a value from the function. Returns null string by default.
+ */
+WKEinaSharedString ewk_view_run_javascript_prompt(Evas_Object* ewkView, const WKEinaSharedString& message, const WKEinaSharedString& defaultValue)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, WKEinaSharedString());
+ EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api, WKEinaSharedString());
+
+ if (!smartData->api->run_javascript_prompt)
+ return WKEinaSharedString();
+
+ return WKEinaSharedString::adopt(smartData->api->run_javascript_prompt(smartData, message, defaultValue));
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
index 996a2bbf5..c449514aa 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
@@ -115,13 +115,19 @@ struct _Ewk_View_Smart_Class {
Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
+
+ // javascript popup:
+ // - All strings should be guaranteed to be stringshared.
+ void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, const char *message);
+ Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, const char *message);
+ const char *(*run_javascript_prompt)(Ewk_View_Smart_Data *sd, const char *message, const char *default_value); /**< return string should be stringshared. */
};
/**
* The version you have to put into the version field
* in the @a Ewk_View_Smart_Class structure.
*/
-#define EWK_VIEW_SMART_CLASS_VERSION 3UL
+#define EWK_VIEW_SMART_CLASS_VERSION 4UL
/**
* Initializer for whole Ewk_View_Smart_Class structure.
@@ -133,7 +139,7 @@ struct _Ewk_View_Smart_Class {
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
-#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializer to zero a whole Ewk_View_Smart_Class structure.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp
index 2a0dacaa3..637e7aec2 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp
@@ -34,7 +34,7 @@ static inline Evas_Object* toEwkView(const void* clientInfo)
return static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
}
-static void didFindString(WKPageRef page, WKStringRef string, unsigned matchCount, const void* clientInfo)
+static void didFindString(WKPageRef, WKStringRef /*string*/, unsigned matchCount, const void* clientInfo)
{
ewk_view_text_found(toEwkView(clientInfo), static_cast<unsigned int>(matchCount));
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp
index 264ac5e47..37cc9bf8f 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp
@@ -31,7 +31,7 @@
#include "ewk_view_form_client_private.h"
#include "ewk_view_private.h"
-static void willSubmitForm(WKPageRef page, WKFrameRef frame, WKFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef userData, WKFormSubmissionListenerRef listener, const void* clientInfo)
+static void willSubmitForm(WKPageRef, WKFrameRef /*frame*/, WKFrameRef /*sourceFrame*/, WKDictionaryRef values, WKTypeRef /*userData*/, WKFormSubmissionListenerRef listener, const void* clientInfo)
{
Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
index 2deb38e19..ab88624a4 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
@@ -50,7 +50,7 @@ static void didReceiveTitleForFrame(WKPageRef, WKStringRef title, WKFrameRef fra
}
#if ENABLE(WEB_INTENTS)
-static void didReceiveIntentForFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent, WKTypeRef, const void* clientInfo)
+static void didReceiveIntentForFrame(WKPageRef, WKFrameRef, WKIntentDataRef intent, WKTypeRef, const void* clientInfo)
{
Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
Ewk_Intent* ewkIntent = ewk_intent_new(intent);
@@ -60,7 +60,7 @@ static void didReceiveIntentForFrame(WKPageRef page, WKFrameRef frame, WKIntentD
#endif
#if ENABLE(WEB_INTENTS_TAG)
-static void registerIntentServiceForFrame(WKPageRef page, WKFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef, const void *clientInfo)
+static void registerIntentServiceForFrame(WKPageRef, WKFrameRef, WKIntentServiceInfoRef serviceInfo, WKTypeRef, const void *clientInfo)
{
Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
Ewk_Intent_Service* ewkIntentService = ewk_intent_service_new(serviceInfo);
@@ -75,7 +75,7 @@ static void didChangeProgress(WKPageRef page, const void* clientInfo)
ewk_view_load_progress_changed(ewkView, WKPageGetEstimatedProgress(page));
}
-static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+static void didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void *clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
@@ -84,7 +84,7 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
ewk_view_load_finished(ewkView);
}
-static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void *clientInfo)
+static void didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void *clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
@@ -96,7 +96,7 @@ static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErr
ewk_web_error_free(ewkError);
}
-static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
@@ -105,7 +105,7 @@ static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WK
ewk_view_load_provisional_started(ewkView);
}
-static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
@@ -114,7 +114,7 @@ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, W
ewk_view_load_provisional_redirect(ewkView);
}
-static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
@@ -125,7 +125,7 @@ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef f
ewk_web_error_free(ewkError);
}
-static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
+static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
{
Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
ASSERT(ewkView);
@@ -133,6 +133,15 @@ static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef ad
ewk_back_forward_list_changed(ewk_view_back_forward_list_get(ewkView), addedItem, removedItems);
}
+static void didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo)
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ ewk_view_uri_update(ewkView);
+}
+
void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
{
WKPageLoaderClient loadClient;
@@ -155,5 +164,6 @@ void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
loadClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
loadClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
loadClient.didChangeBackForwardList = didChangeBackForwardList;
+ loadClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
WKPageSetPageLoaderClient(pageRef, &loadClient);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp
index cf3b85e09..cf2f10eb4 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp
@@ -42,21 +42,21 @@ static inline Evas_Object* toEwkView(const void* clientInfo)
return static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
}
-static void decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* clientInfo)
{
Ewk_Navigation_Policy_Decision* decision = ewk_navigation_policy_decision_new(navigationType, mouseButton, modifiers, request, 0, listener);
ewk_view_navigation_policy_decision(toEwkView(clientInfo), decision);
ewk_navigation_policy_decision_unref(decision);
}
-static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForNewWindowAction(WKPageRef, WKFrameRef, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* clientInfo)
{
Ewk_Navigation_Policy_Decision* decision = ewk_navigation_policy_decision_new(navigationType, mouseButton, modifiers, request, toImpl(frameName)->string().utf8().data(), listener);
ewk_view_new_window_policy_decision(toEwkView(clientInfo), decision);
ewk_navigation_policy_decision_unref(decision);
}
-static void decidePolicyForResponseCallback(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForResponseCallback(WKPageRef, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* /*clientInfo*/)
{
const ResourceResponse resourceResponse = toImpl(response)->resourceResponse();
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
index 88f9aab07..5d6881dcc 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
@@ -23,6 +23,7 @@
#include "WebPageProxy.h"
#include <Evas.h>
+#include <WKEinaSharedString.h>
#include <WebCore/TextDirection.h>
#include <WebKit2/WKBase.h>
#include <wtf/Vector.h>
@@ -81,6 +82,7 @@ void ewk_view_resource_load_initiated(Evas_Object* ewkView, uint64_t resourceIde
void ewk_view_resource_load_response(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Response* response);
void ewk_view_resource_request_sent(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse);
void ewk_view_text_found(Evas_Object* ewkView, unsigned int matchCount);
+void ewk_view_uri_update(Evas_Object* ewkView);
void ewk_view_contents_size_changed(const Evas_Object* ewkView, const WebCore::IntSize&);
Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef, WKPageGroupRef);
@@ -103,4 +105,8 @@ bool ewk_view_accelerated_compositing_mode_exit(const Evas_Object* ewkView);
void ewk_view_popup_menu_request(Evas_Object* ewkView, WebKit::WebPopupMenuProxyEfl* popupMenu, const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebKit::WebPopupItem>& items, int32_t selectedIndex);
void ewk_view_webprocess_crashed(Evas_Object* ewkView);
+void ewk_view_run_javascript_alert(Evas_Object* ewkView, const WKEinaSharedString& message);
+bool ewk_view_run_javascript_confirm(Evas_Object* ewkView, const WKEinaSharedString& message);
+WKEinaSharedString ewk_view_run_javascript_prompt(Evas_Object* ewkView, const WKEinaSharedString& message, const WKEinaSharedString& defaultValue);
+
#endif // ewk_view_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp
index 18ede08a1..8ede50dd9 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp
@@ -25,6 +25,7 @@
#include "config.h"
+#include "WKString.h"
#include "ewk_view_private.h"
#include "ewk_view_ui_client_private.h"
@@ -43,6 +44,22 @@ static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEv
return ewk_view_page_create(toEwkView(clientInfo));
}
+static void runJavaScriptAlert(WKPageRef, WKStringRef alertText, WKFrameRef, const void* clientInfo)
+{
+ ewk_view_run_javascript_alert(toEwkView(clientInfo), WKEinaSharedString(alertText));
+}
+
+static bool runJavaScriptConfirm(WKPageRef, WKStringRef message, WKFrameRef, const void* clientInfo)
+{
+ return ewk_view_run_javascript_confirm(toEwkView(clientInfo), WKEinaSharedString(message));
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef, WKStringRef message, WKStringRef defaultValue, WKFrameRef, const void* clientInfo)
+{
+ WKEinaSharedString value = ewk_view_run_javascript_prompt(toEwkView(clientInfo), WKEinaSharedString(message), WKEinaSharedString(defaultValue));
+ return value ? WKStringCreateWithUTF8CString(value) : 0;
+}
+
void ewk_view_ui_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
{
WKPageUIClient uiClient;
@@ -51,5 +68,8 @@ void ewk_view_ui_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
uiClient.clientInfo = ewkView;
uiClient.close = closePage;
uiClient.createNewPage = createNewPage;
+ uiClient.runJavaScriptAlert = runJavaScriptAlert;
+ uiClient.runJavaScriptConfirm = runJavaScriptConfirm;
+ uiClient.runJavaScriptPrompt = runJavaScriptPrompt;
WKPageSetPageUIClient(pageRef, &uiClient);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
index 54523f046..1691f0d7c 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
@@ -29,15 +29,6 @@ extern EWK2UnitTest::EWK2UnitTestEnvironment* environment;
namespace EWK2UnitTest {
-static void onLoadFinished(void* userData, Evas_Object* webView, void* eventInfo)
-{
- UNUSED_PARAM(webView);
- UNUSED_PARAM(eventInfo);
-
- bool* loadFinished = static_cast<bool*>(userData);
- *loadFinished = true;
-}
-
static Ewk_View_Smart_Class ewk2UnitTestBrowserViewSmartClass()
{
static Ewk_View_Smart_Class ewkViewClass = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("Browser_View");
@@ -89,40 +80,155 @@ void EWK2UnitTestBase::loadUrlSync(const char* url)
waitUntilLoadFinished();
}
-void EWK2UnitTestBase::waitUntilLoadFinished()
+class CallbackDataTimer {
+public:
+ CallbackDataTimer(double timeoutSeconds, Ecore_Task_Cb callback)
+ : m_done(false)
+ , m_timer(timeoutSeconds >= 0 ? ecore_timer_add(timeoutSeconds, callback, this) : 0)
+ , m_didTimeOut(false)
+ {
+ }
+
+ virtual ~CallbackDataTimer()
+ {
+ if (m_timer)
+ ecore_timer_del(m_timer);
+ }
+
+ bool isDone() const { return m_done; }
+
+ bool setDone()
+ {
+ if (m_timer) {
+ ecore_timer_del(m_timer);
+ m_timer = 0;
+ }
+ m_done = true;
+ }
+
+ bool didTimeOut() const { return m_didTimeOut; }
+
+ void setTimedOut()
+ {
+ m_done = true;
+ m_timer = 0;
+ m_didTimeOut = true;
+ }
+
+protected:
+ bool m_done;
+ Ecore_Timer* m_timer;
+ bool m_didTimeOut;
+};
+
+template <class T>
+class CallbackDataExpectedValue : public CallbackDataTimer {
+public:
+ CallbackDataExpectedValue(const T& expectedValue, double timeoutSeconds, Ecore_Task_Cb callback)
+ : CallbackDataTimer(timeoutSeconds, callback)
+ , m_expectedValue(expectedValue)
+ {
+ }
+
+ const T& expectedValue() const { return m_expectedValue; }
+
+private:
+ T m_expectedValue;
+};
+
+static void onLoadFinished(void* userData, Evas_Object* webView, void* eventInfo)
+{
+ UNUSED_PARAM(webView);
+ UNUSED_PARAM(eventInfo);
+
+ CallbackDataTimer* data = static_cast<CallbackDataTimer*>(userData);
+ data->setDone();
+}
+
+static bool timeOutWhileWaitingUntilLoadFinished(void* userData)
+{
+ CallbackDataTimer* data = static_cast<CallbackDataTimer*>(userData);
+ data->setTimedOut();
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+bool EWK2UnitTestBase::waitUntilLoadFinished(double timeoutSeconds)
{
- bool loadFinished = false;
+ CallbackDataTimer data(timeoutSeconds, reinterpret_cast<Ecore_Task_Cb>(timeOutWhileWaitingUntilLoadFinished));
- evas_object_smart_callback_add(m_webView, "load,finished", onLoadFinished, &loadFinished);
+ evas_object_smart_callback_add(m_webView, "load,finished", onLoadFinished, &data);
- while (!loadFinished)
+ while (!data.isDone())
ecore_main_loop_iterate();
evas_object_smart_callback_del(m_webView, "load,finished", onLoadFinished);
+
+ return !data.didTimeOut();
}
-struct TitleChangedData {
- CString expectedTitle;
- bool done;
-};
+static void onTitleChanged(void* userData, Evas_Object* webView, void*)
+{
+ CallbackDataExpectedValue<CString>* data = static_cast<CallbackDataExpectedValue<CString>*>(userData);
+
+ if (strcmp(ewk_view_title_get(webView), data->expectedValue().data()))
+ return;
-static void onTitleChanged(void* userData, Evas_Object* webView, void* eventInfo)
+ data->setDone();
+}
+
+static bool timeOutWhileWaitingUntilTitleChangedTo(void* userData)
{
- TitleChangedData* data = static_cast<TitleChangedData*>(userData);
+ CallbackDataExpectedValue<CString>* data = static_cast<CallbackDataExpectedValue<CString>*>(userData);
+ data->setTimedOut();
- if (!strcmp(ewk_view_title_get(webView), data->expectedTitle.data()))
- data->done = true;
+ return ECORE_CALLBACK_CANCEL;
}
-void EWK2UnitTestBase::waitUntilTitleChangedTo(const char* expectedTitle)
+bool EWK2UnitTestBase::waitUntilTitleChangedTo(const char* expectedTitle, double timeoutSeconds)
{
- TitleChangedData data = { expectedTitle, false };
+ CallbackDataExpectedValue<CString> data(expectedTitle, timeoutSeconds, reinterpret_cast<Ecore_Task_Cb>(timeOutWhileWaitingUntilTitleChangedTo));
+
evas_object_smart_callback_add(m_webView, "title,changed", onTitleChanged, &data);
- while (!data.done)
+ while (!data.isDone())
ecore_main_loop_iterate();
evas_object_smart_callback_del(m_webView, "title,changed", onTitleChanged);
+
+ return !data.didTimeOut();
+}
+
+static void onURIChanged(void* userData, Evas_Object* webView, void*)
+{
+ CallbackDataExpectedValue<CString>* data = static_cast<CallbackDataExpectedValue<CString>*>(userData);
+
+ if (strcmp(ewk_view_uri_get(webView), data->expectedValue().data()))
+ return;
+
+ data->setDone();
+}
+
+static bool timeOutWhileWaitingUntilURIChangedTo(void* userData)
+{
+ CallbackDataExpectedValue<CString>* data = static_cast<CallbackDataExpectedValue<CString>*>(userData);
+ data->setTimedOut();
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+bool EWK2UnitTestBase::waitUntilURIChangedTo(const char* expectedURI, double timeoutSeconds)
+{
+ CallbackDataExpectedValue<CString> data(expectedURI, timeoutSeconds, reinterpret_cast<Ecore_Task_Cb>(timeOutWhileWaitingUntilURIChangedTo));
+
+ evas_object_smart_callback_add(m_webView, "uri,changed", onURIChanged, &data);
+
+ while (!data.isDone())
+ ecore_main_loop_iterate();
+
+ evas_object_smart_callback_del(m_webView, "uri,changed", onURIChanged);
+
+ return !data.didTimeOut();
}
void EWK2UnitTestBase::mouseClick(int x, int y)
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
index 717607897..e1146b198 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h
@@ -41,8 +41,12 @@ protected:
virtual void TearDown();
void loadUrlSync(const char* url);
- void waitUntilLoadFinished();
- void waitUntilTitleChangedTo(const char* expectedTitle);
+
+ static const double defaultTimeoutSeconds = 10.0;
+ bool waitUntilLoadFinished(double timeoutSeconds = defaultTimeoutSeconds);
+ bool waitUntilTitleChangedTo(const char* expectedTitle, double timeoutSeconds = defaultTimeoutSeconds);
+ bool waitUntilURIChangedTo(const char* expectedURI, double timeoutSeconds = defaultTimeoutSeconds);
+
void mouseClick(int x, int y);
private:
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/same_page_navigation.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/same_page_navigation.html
new file mode 100644
index 000000000..7b64b214b
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/resources/same_page_navigation.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+<a id="myLink" href="#"><div style="position: absolute; top: 0; left: 0; width: 100px; height: 100px;"></div></a>
+</body>
+</html>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp
index 68c15dbb8..9542b76f0 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp
@@ -136,7 +136,7 @@ TEST_F(EWK2UnitTestBase, ewk_back_forward_list_next_item_get)
// Go back to Page1.
ewk_view_back(webView());
- waitUntilTitleChangedTo(title1);
+ ASSERT_TRUE(waitUntilTitleChangedTo(title1));
Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
ASSERT_TRUE(backForwardList);
@@ -245,9 +245,9 @@ TEST_F(EWK2UnitTestBase, ewk_back_forward_list_n_forward_items_copy)
// Go back to Page1.
ewk_view_back(webView());
- waitUntilTitleChangedTo(title2);
+ ASSERT_TRUE(waitUntilTitleChangedTo(title2));
ewk_view_back(webView());
- waitUntilTitleChangedTo(title1);
+ ASSERT_TRUE(waitUntilTitleChangedTo(title1));
Ewk_Back_Forward_List* backForwardList = ewk_view_back_forward_list_get(webView());
ASSERT_TRUE(backForwardList);
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
index a5e8157da..b5ce2ee57 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
@@ -138,13 +138,13 @@ TEST_F(EWK2UnitTestBase, ewk_context_vibration_client_callbacks_set)
// Make sure we don't receive vibration event.
loadVibrationHTMLString(webView(), "[5000]", false, &data);
- waitUntilTitleChangedTo("Loaded");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Loaded"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Loaded");
ASSERT_FALSE(data.didReceiveVibrateCallback);
// Make sure we don't receive cancel vibration event.
loadVibrationHTMLString(webView(), "0", false, &data);
- waitUntilTitleChangedTo("Loaded");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Loaded"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Loaded");
ASSERT_FALSE(data.didReceiveCancelVibrationCallback);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
index 6e928edd9..b608c7cb7 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
@@ -30,6 +30,7 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
using namespace EWK2UnitTest;
@@ -73,10 +74,10 @@ TEST_F(EWK2UnitTestBase, ewk_view_device_pixel_ratio)
TEST_F(EWK2UnitTestBase, ewk_view_html_string_load)
{
ewk_view_html_string_load(webView(), "<html><head><title>Foo</title></head><body>Bar</body></html>", 0, 0);
- waitUntilTitleChangedTo("Foo");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Foo"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Foo");
ewk_view_html_string_load(webView(), "<html><head><title>Bar</title></head><body>Foo</body></html>", 0, 0);
- waitUntilTitleChangedTo("Bar");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Bar"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Bar");
}
@@ -117,14 +118,14 @@ TEST_F(EWK2UnitTestBase, ewk_view_navigation)
// Go back to Page1
ewk_view_back(webView());
- waitUntilTitleChangedTo("Page1");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Page1"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Page1");
ASSERT_FALSE(ewk_view_back_possible(webView()));
ASSERT_TRUE(ewk_view_forward_possible(webView()));
// Go forward to Page2
ewk_view_forward(webView());
- waitUntilTitleChangedTo("Page2");
+ ASSERT_TRUE(waitUntilTitleChangedTo("Page2"));
ASSERT_STREQ(ewk_view_title_get(webView()), "Page2");
ASSERT_TRUE(ewk_view_back_possible(webView()));
ASSERT_FALSE(ewk_view_forward_possible(webView()));
@@ -253,9 +254,9 @@ TEST_F(EWK2UnitTestBase, ewk_view_popup_menu_select)
ewkViewClass()->popup_menu_show = showPopupMenu;
ewk_view_html_string_load(webView(), selectHTML, "file:///", 0);
- waitUntilLoadFinished();
+ ASSERT_TRUE(waitUntilLoadFinished());
mouseClick(30, 20);
- waitUntilTitleChangedTo("first");
+ ASSERT_TRUE(waitUntilTitleChangedTo("first"));
EXPECT_TRUE(ewk_view_popup_menu_close(webView()));
EXPECT_FALSE(ewk_view_popup_menu_select(webView(), 0));
@@ -275,19 +276,19 @@ TEST_F(EWK2UnitTestBase, ewk_view_theme_set)
"</body></html>";
ewk_view_html_string_load(webView(), buttonHTML, "file:///", 0);
- waitUntilTitleChangedTo("30"); // button of default theme has 30px as padding (15 to -16)
+ EXPECT_TRUE(waitUntilTitleChangedTo("30")); // button of default theme has 30px as padding (15 to -16)
ewk_view_theme_set(webView(), environment->pathForResource("it_does_not_exist.edj").data());
ewk_view_html_string_load(webView(), buttonHTML, "file:///", 0);
- waitUntilTitleChangedTo("30"); // the result should be same as default theme
+ EXPECT_TRUE(waitUntilTitleChangedTo("30")); // the result should be same as default theme
ewk_view_theme_set(webView(), environment->pathForResource("empty_theme.edj").data());
ewk_view_html_string_load(webView(), buttonHTML, "file:///", 0);
- waitUntilTitleChangedTo("30"); // the result should be same as default theme
+ EXPECT_TRUE(waitUntilTitleChangedTo("30")); // the result should be same as default theme
ewk_view_theme_set(webView(), environment->pathForResource("big_button_theme.edj").data());
ewk_view_html_string_load(webView(), buttonHTML, "file:///", 0);
- waitUntilTitleChangedTo("299"); // button of big button theme has 299px as padding (150 to -150)
+ EXPECT_TRUE(waitUntilTitleChangedTo("299")); // button of big button theme has 299px as padding (150 to -150)
}
TEST_F(EWK2UnitTestBase, ewk_view_mouse_events_enabled)
@@ -333,9 +334,9 @@ TEST_F(EWK2UnitTestBase, ewk_view_full_screen_enter)
ewkViewClass()->fullscreen_enter = fullScreenCallback;
ewk_view_html_string_load(webView(), fullscreenHTML, "file:///", 0);
- waitUntilLoadFinished();
+ ASSERT_TRUE(waitUntilLoadFinished());
mouseClick(50, 50);
- waitUntilTitleChangedTo("fullscreen entered");
+ ASSERT_TRUE(waitUntilTitleChangedTo("fullscreen entered"));
ASSERT_TRUE(fullScreenCallbackCalled);
checkFullScreenProperty(webView(), true);
}
@@ -354,9 +355,272 @@ TEST_F(EWK2UnitTestBase, ewk_view_full_screen_exit)
ewkViewClass()->fullscreen_exit = fullScreenCallback;
ewk_view_html_string_load(webView(), fullscreenHTML, "file:///", 0);
- waitUntilLoadFinished();
+ ASSERT_TRUE(waitUntilLoadFinished());
mouseClick(50, 50);
- waitUntilTitleChangedTo("fullscreen exited");
+ ASSERT_TRUE(waitUntilTitleChangedTo("fullscreen exited"));
ASSERT_TRUE(fullScreenCallbackCalled);
checkFullScreenProperty(webView(), false);
}
+
+TEST_F(EWK2UnitTestBase, ewk_view_same_page_navigation)
+{
+ // Tests that same page navigation updates the page URI.
+ String testUrl = environment->urlForResource("same_page_navigation.html").data();
+ loadUrlSync(testUrl.utf8().data());
+ ASSERT_STREQ(testUrl.utf8().data(), ewk_view_uri_get(webView()));
+ mouseClick(50, 50);
+ testUrl = testUrl + '#';
+ ASSERT_TRUE(waitUntilURIChangedTo(testUrl.utf8().data()));
+}
+
+TEST_F(EWK2UnitTestBase, ewk_view_title_changed)
+{
+ const char* titleChangedHTML =
+ "<!doctype html><head><title>Title before changed</title></head>"
+ "<body onload=\"document.title='Title after changed';\"></body>";
+ ewk_view_html_string_load(webView(), titleChangedHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("Title after changed"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "Title after changed");
+
+ titleChangedHTML =
+ "<!doctype html><head><title>Title before changed</title></head>"
+ "<body onload=\"document.title='';\"></body>";
+ ewk_view_html_string_load(webView(), titleChangedHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(""));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "");
+
+ titleChangedHTML =
+ "<!doctype html><head><title>Title before changed</title></head>"
+ "<body onload=\"document.title=null;\"></body>";
+ ewk_view_html_string_load(webView(), titleChangedHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(""));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "");
+}
+
+static struct {
+ const char* expectedMessage;
+ bool called;
+} alertCallbackData;
+
+static struct {
+ const char* expectedMessage;
+ bool result;
+ bool called;
+} confirmCallbackData;
+
+static struct {
+ const char* expectedMessage;
+ const char* expectedDefaultValue;
+ const char* result;
+ bool called;
+} promptCallbackData;
+
+static void checkAlert(Ewk_View_Smart_Data*, const char* message)
+{
+ alertCallbackData.called = true;
+ EXPECT_STREQ(message, alertCallbackData.expectedMessage);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_view_run_javascript_alert)
+{
+ ewkViewClass()->run_javascript_alert = checkAlert;
+
+ const char* alertHTML = "<!doctype html><body onload=\"alert('Alert message');\"></body>";
+ alertCallbackData.expectedMessage = "Alert message";
+ alertCallbackData.called = false;
+ ewk_view_html_string_load(webView(), alertHTML, 0, 0);
+ EXPECT_TRUE(waitUntilLoadFinished());
+ EXPECT_EQ(alertCallbackData.called, true);
+
+ alertHTML = "<!doctype html><body onload=\"alert('');\"></body>";
+ alertCallbackData.expectedMessage = "";
+ alertCallbackData.called = false;
+ ewk_view_html_string_load(webView(), alertHTML, 0, 0);
+ EXPECT_TRUE(waitUntilLoadFinished());
+ EXPECT_EQ(alertCallbackData.called, true);
+
+ alertHTML = "<!doctype html><body onload=\"alert(null);\"></body>";
+ alertCallbackData.expectedMessage = "null";
+ alertCallbackData.called = false;
+ ewk_view_html_string_load(webView(), alertHTML, 0, 0);
+ EXPECT_TRUE(waitUntilLoadFinished());
+ EXPECT_EQ(alertCallbackData.called, true);
+
+ alertHTML = "<!doctype html><body onload=\"alert();\"></body>";
+ alertCallbackData.expectedMessage = "undefined";
+ alertCallbackData.called = false;
+ ewk_view_html_string_load(webView(), alertHTML, 0, 0);
+ EXPECT_TRUE(waitUntilLoadFinished());
+ EXPECT_EQ(alertCallbackData.called, true);
+
+ ewkViewClass()->run_javascript_alert = 0;
+
+ alertCallbackData.called = false;
+ ewk_view_html_string_load(webView(), alertHTML, 0, 0);
+ EXPECT_TRUE(waitUntilLoadFinished());
+ EXPECT_EQ(alertCallbackData.called, false);
+}
+
+static Eina_Bool checkConfirm(Ewk_View_Smart_Data*, const char* message)
+{
+ confirmCallbackData.called = true;
+ EXPECT_STREQ(message, confirmCallbackData.expectedMessage);
+ return confirmCallbackData.result;
+}
+
+TEST_F(EWK2UnitTestBase, ewk_view_run_javascript_confirm)
+{
+ ewkViewClass()->run_javascript_confirm = checkConfirm;
+
+ const char* confirmHTML = "<!doctype html><body onload=\"document.title = confirm('Confirm message');\"></body>";
+ confirmCallbackData.expectedMessage = "Confirm message";
+ confirmCallbackData.result = true;
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("true"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "true");
+ EXPECT_EQ(confirmCallbackData.called, true);
+
+ confirmCallbackData.expectedMessage = "Confirm message";
+ confirmCallbackData.result = false;
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("false"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "false");
+ EXPECT_EQ(confirmCallbackData.called, true);
+
+ confirmHTML = "<!doctype html><body onload=\"document.title = confirm('');\"></body>";
+ confirmCallbackData.expectedMessage = "";
+ confirmCallbackData.result = true;
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("true"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "true");
+ EXPECT_EQ(confirmCallbackData.called, true);
+
+ confirmHTML = "<!doctype html><body onload=\"document.title = confirm(null);\"></body>";
+ confirmCallbackData.expectedMessage = "null";
+ confirmCallbackData.result = true;
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("true"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "true");
+ EXPECT_EQ(confirmCallbackData.called, true);
+
+ confirmHTML = "<!doctype html><body onload=\"document.title = confirm();\"></body>";
+ confirmCallbackData.expectedMessage = "undefined";
+ confirmCallbackData.result = true;
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("true"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "true");
+ EXPECT_EQ(confirmCallbackData.called, true);
+
+ ewkViewClass()->run_javascript_confirm = 0;
+
+ confirmCallbackData.called = false;
+ ewk_view_html_string_load(webView(), confirmHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("false"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "false");
+ EXPECT_EQ(confirmCallbackData.called, false);
+}
+
+static const char* checkPrompt(Ewk_View_Smart_Data*, const char* message, const char* defaultValue)
+{
+ promptCallbackData.called = true;
+ EXPECT_STREQ(message, promptCallbackData.expectedMessage);
+ EXPECT_STREQ(defaultValue, promptCallbackData.expectedDefaultValue);
+
+ if (!promptCallbackData.result)
+ return 0;
+
+ return eina_stringshare_add(promptCallbackData.result);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_view_run_javascript_prompt)
+{
+ static const char promptMessage[] = "Prompt message";
+ static const char promptResult[] = "Prompt result";
+
+ ewkViewClass()->run_javascript_prompt = checkPrompt;
+
+ const char* promptHTML = "<!doctype html><body onload=\"document.title = prompt('Prompt message', 'Prompt default value');\"></body>";
+ promptCallbackData.expectedMessage = promptMessage;
+ promptCallbackData.expectedDefaultValue = "Prompt default value";
+ promptCallbackData.result = promptResult;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(promptResult));
+ EXPECT_STREQ(ewk_view_title_get(webView()), promptResult);
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptHTML = "<!doctype html><body onload=\"document.title = prompt('Prompt message', '');\"></body>";
+ promptCallbackData.expectedMessage = promptMessage;
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = promptResult;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(promptResult));
+ EXPECT_STREQ(ewk_view_title_get(webView()), promptResult);
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptHTML = "<!doctype html><body onload=\"document.title = prompt('Prompt message');\"></body>";
+ promptCallbackData.expectedMessage = promptMessage;
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = promptResult;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(promptResult));
+ EXPECT_STREQ(ewk_view_title_get(webView()), promptResult);
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptHTML = "<!doctype html><body onload=\"document.title = prompt('');\"></body>";
+ promptCallbackData.expectedMessage = "";
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = promptResult;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(promptResult));
+ EXPECT_STREQ(ewk_view_title_get(webView()), promptResult);
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptHTML = "<!doctype html><body onload=\"document.title = prompt();\"></body>";
+ promptCallbackData.expectedMessage = "undefined";
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = promptResult;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(promptResult));
+ EXPECT_STREQ(ewk_view_title_get(webView()), promptResult);
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptHTML = "<html><head><title>Default title</title></head>"
+ "<body onload=\"var promptResult = prompt('Prompt message');"
+ "if (promptResult == null) document.title='null';"
+ "else document.title = promptResult;\"></body></html>";
+ promptCallbackData.expectedMessage = promptMessage;
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = "";
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo(""));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "");
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ promptCallbackData.expectedMessage = promptMessage;
+ promptCallbackData.expectedDefaultValue = "";
+ promptCallbackData.result = 0;
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("null"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "null");
+ EXPECT_EQ(promptCallbackData.called, true);
+
+ ewkViewClass()->run_javascript_prompt = 0;
+
+ promptCallbackData.called = false;
+ ewk_view_html_string_load(webView(), promptHTML, 0, 0);
+ EXPECT_TRUE(waitUntilTitleChangedTo("null"));
+ EXPECT_STREQ(ewk_view_title_get(webView()), "null");
+ EXPECT_EQ(promptCallbackData.called, false);
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp
new file mode 100644
index 000000000..53b46f875
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp
@@ -0,0 +1,336 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitSecurityManager.h"
+
+#include "WebContext.h"
+#include "WebKitSecurityManagerPrivate.h"
+#include "WebKitWebContextPrivate.h"
+#include <WebCore/SchemeRegistry.h>
+
+using namespace WebKit;
+
+typedef enum {
+ SecurityPolicyLocal,
+ SecurityPolicyNoAccess,
+ SecurityPolicyDisplayIsolated,
+ SecurityPolicySecure,
+ SecurityPolicyCORSEnabled,
+ SecurityPolicyEmptyDocument
+} SecurityPolicy;
+
+struct _WebKitSecurityManagerPrivate {
+ WebKitWebContext* webContext;
+};
+
+G_DEFINE_TYPE(WebKitSecurityManager, webkit_security_manager, G_TYPE_OBJECT)
+
+static void webkit_security_manager_init(WebKitSecurityManager* manager)
+{
+ WebKitSecurityManagerPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(manager, WEBKIT_TYPE_SECURITY_MANAGER, WebKitSecurityManagerPrivate);
+ manager->priv = priv;
+ new (priv) WebKitSecurityManagerPrivate();
+}
+
+static void webkitSecurityManagerFinalize(GObject* object)
+{
+ WebKitSecurityManagerPrivate* priv = WEBKIT_SECURITY_MANAGER(object)->priv;
+ priv->~WebKitSecurityManagerPrivate();
+ G_OBJECT_CLASS(webkit_security_manager_parent_class)->finalize(object);
+}
+
+static void webkit_security_manager_class_init(WebKitSecurityManagerClass* klass)
+{
+ GObjectClass* gObjectClass = G_OBJECT_CLASS(klass);
+ gObjectClass->finalize = webkitSecurityManagerFinalize;
+
+ g_type_class_add_private(klass, sizeof(WebKitSecurityManagerPrivate));
+}
+
+WebKitSecurityManager* webkitSecurityManagerCreate(WebKitWebContext* webContext)
+{
+ WebKitSecurityManager* manager = WEBKIT_SECURITY_MANAGER(g_object_new(WEBKIT_TYPE_SECURITY_MANAGER, NULL));
+ manager->priv->webContext = webContext;
+ return manager;
+}
+
+static void registerSecurityPolicyForURIScheme(WebKitSecurityManager* manager, const char* scheme, SecurityPolicy policy)
+{
+ String urlScheme = String::fromUTF8(scheme);
+ WebContext* webContext = toImpl(webkitWebContextGetWKContext(manager->priv->webContext));
+
+ // We keep the WebCore::SchemeRegistry of the UI process in sync with the
+ // web process one, so that we can return the SecurityPolicy for
+ // a given URI scheme synchronously without blocking.
+ switch (policy) {
+ case SecurityPolicyLocal:
+ WebCore::SchemeRegistry::registerURLSchemeAsLocal(urlScheme);
+ webContext->registerURLSchemeAsLocal(urlScheme);
+ break;
+ case SecurityPolicyNoAccess:
+ WebCore::SchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
+ webContext->registerURLSchemeAsNoAccess(urlScheme);
+ break;
+ case SecurityPolicyDisplayIsolated:
+ WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
+ webContext->registerURLSchemeAsDisplayIsolated(urlScheme);
+ break;
+ case SecurityPolicySecure:
+ WebCore::SchemeRegistry::registerURLSchemeAsSecure(urlScheme);
+ webContext->registerURLSchemeAsSecure(urlScheme);
+ break;
+ case SecurityPolicyCORSEnabled:
+ WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
+ webContext->registerURLSchemeAsCORSEnabled(urlScheme);
+ break;
+ case SecurityPolicyEmptyDocument:
+ WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
+ webContext->registerURLSchemeAsEmptyDocument(urlScheme);
+ break;
+ }
+}
+
+static bool checkSecurityPolicyForURIScheme(const char* scheme, SecurityPolicy policy)
+{
+ String urlScheme = String::fromUTF8(scheme);
+
+ switch (policy) {
+ case SecurityPolicyLocal:
+ return WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(urlScheme);
+ case SecurityPolicyNoAccess:
+ return WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess(urlScheme);
+ case SecurityPolicyDisplayIsolated:
+ return WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(urlScheme);
+ case SecurityPolicySecure:
+ return WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure(urlScheme);
+ case SecurityPolicyCORSEnabled:
+ return WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(urlScheme);
+ case SecurityPolicyEmptyDocument:
+ return WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(urlScheme);
+ }
+
+ return false;
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_local:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as a local scheme. This means that other non-local pages
+ * cannot link to or access URIs of this scheme.
+ */
+void webkit_security_manager_register_uri_scheme_as_local(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicyLocal);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_local:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as a local scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_local().
+ *
+ * Returns: %TRUE if @scheme is a local scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_local(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicyLocal);
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_no_access:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as a no-access scheme. This means that pages loaded
+ * with this URI scheme cannot access pages loaded with any other URI scheme.
+ */
+void webkit_security_manager_register_uri_scheme_as_no_access(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicyNoAccess);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_no_access:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as a no-access scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_no_access().
+ *
+ * Returns: %TRUE if @scheme is a no-access scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_no_access(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicyNoAccess);
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_display_isolated:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as a display isolated scheme. This means that pages cannot
+ * display these URIs unless they are from the same scheme.
+ */
+void webkit_security_manager_register_uri_scheme_as_display_isolated(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicyDisplayIsolated);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_display_isolated:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as a display isolated scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_display_isolated().
+ *
+ * Returns: %TRUE if @scheme is a display isolated scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_display_isolated(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicyDisplayIsolated);
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_secure:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as a secure scheme. This means that mixed
+ * content warnings won't be generated for this scheme when
+ * included by an HTTPS page.
+ */
+void webkit_security_manager_register_uri_scheme_as_secure(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicySecure);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_secure:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as a secure scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_secure().
+ *
+ * Returns: %TRUE if @scheme is a secure scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_secure(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicySecure);
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_cors_enabled:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as a CORS (Cross-origin resource sharing) enabled scheme.
+ * This means that CORS requests are allowed. See W3C CORS specification
+ * http://www.w3.org/TR/cors/.
+ */
+void webkit_security_manager_register_uri_scheme_as_cors_enabled(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicyCORSEnabled);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_cors_enabled:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as a CORS enabled scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_cors_enabled().
+ *
+ * Returns: %TRUE if @scheme is a CORS enabled scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_cors_enabled(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicyCORSEnabled);
+}
+
+/**
+ * webkit_security_manager_register_uri_scheme_as_empty_document:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Register @scheme as an empty document scheme. This means that
+ * they are allowd to commit synchronously.
+ */
+void webkit_security_manager_register_uri_scheme_as_empty_document(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager));
+ g_return_if_fail(scheme);
+
+ registerSecurityPolicyForURIScheme(manager, scheme, SecurityPolicyEmptyDocument);
+}
+
+/**
+ * webkit_security_manager_uri_scheme_is_empty_document:
+ * @security_manager: a #WebKitSecurityManager
+ * @scheme: a URI scheme
+ *
+ * Whether @scheme is considered as an empty document scheme.
+ * See also webkit_security_manager_register_uri_scheme_as_empty_document().
+ *
+ * Returns: %TRUE if @scheme is a an empty document scheme or %FALSE otherwise.
+ */
+gboolean webkit_security_manager_uri_scheme_is_empty_document(WebKitSecurityManager* manager, const char* scheme)
+{
+ g_return_val_if_fail(WEBKIT_IS_SECURITY_MANAGER(manager), FALSE);
+ g_return_val_if_fail(scheme, FALSE);
+
+ return checkSecurityPolicyForURIScheme(scheme, SecurityPolicyEmptyDocument);
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h
new file mode 100644
index 000000000..fb8c36eda
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitSecurityManager_h
+#define WebKitSecurityManager_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_SECURITY_MANAGER (webkit_security_manager_get_type())
+#define WEBKIT_SECURITY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_SECURITY_MANAGER, WebKitSecurityManager))
+#define WEBKIT_IS_SECURITY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_SECURITY_MANAGER))
+#define WEBKIT_SECURITY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_SECURITY_MANAGER, WebKitSecurityManagerClass))
+#define WEBKIT_IS_SECURITY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_SECURITY_MANAGER))
+#define WEBKIT_SECURITY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_SECURITY_MANAGER, WebKitSecurityManagerClass))
+
+typedef struct _WebKitSecurityManager WebKitSecurityManager;
+typedef struct _WebKitSecurityManagerClass WebKitSecurityManagerClass;
+typedef struct _WebKitSecurityManagerPrivate WebKitSecurityManagerPrivate;
+
+struct _WebKitSecurityManager {
+ GObject parent;
+
+ WebKitSecurityManagerPrivate *priv;
+};
+
+struct _WebKitSecurityManagerClass {
+ GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_security_manager_get_type (void);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_local (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_local (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_no_access (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_no_access (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_display_isolated (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_display_isolated (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_secure (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_secure (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_cors_enabled (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_cors_enabled (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API void
+webkit_security_manager_register_uri_scheme_as_empty_document (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+WEBKIT_API gboolean
+webkit_security_manager_uri_scheme_is_empty_document (WebKitSecurityManager *security_manager,
+ const gchar *scheme);
+
+G_END_DECLS
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h
new file mode 100644
index 000000000..feabdced6
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitSecurityManagerPrivate_h
+#define WebKitSecurityManagerPrivate_h
+
+#include "WebKitSecurityManager.h"
+#include "WebKitWebContext.h"
+
+WebKitSecurityManager* webkitSecurityManagerCreate(WebKitWebContext*);
+
+#endif // WebKitSecurityManagerPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 5e0be7d32..c0a64162a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -34,6 +34,7 @@
#include "WebKitPrivate.h"
#include "WebKitSettingsPrivate.h"
#include "WebPageProxy.h"
+#include <WebCore/UserAgentGtk.h>
#include <glib/gi18n-lib.h>
#include <wtf/text/CString.h>
@@ -47,6 +48,7 @@ struct _WebKitSettingsPrivate {
CString fantasyFontFamily;
CString pictographFontFamily;
CString defaultCharset;
+ CString userAgent;
bool allowModalDialogs;
bool zoomTextOnly;
};
@@ -114,7 +116,8 @@ enum {
PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
PROP_DRAW_COMPOSITING_INDICATORS,
PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
- PROP_ENABLE_PAGE_CACHE
+ PROP_ENABLE_PAGE_CACHE,
+ PROP_USER_AGENT
};
static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
@@ -245,6 +248,9 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu
case PROP_ENABLE_PAGE_CACHE:
webkit_settings_set_enable_page_cache(settings, g_value_get_boolean(value));
break;
+ case PROP_USER_AGENT:
+ webkit_settings_set_user_agent(settings, g_value_get_string(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -379,6 +385,9 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val
case PROP_ENABLE_PAGE_CACHE:
g_value_set_boolean(value, webkit_settings_get_enable_page_cache(settings));
break;
+ case PROP_USER_AGENT:
+ g_value_set_string(value, webkit_settings_get_user_agent(settings));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -1010,6 +1019,26 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
TRUE,
readWriteConstructParamFlags));
+ /**
+ * WebKitSettings:user-agent:
+ *
+ * The user-agent string used by WebKit. Unusual user-agent strings may cause web
+ * content to render incorrectly or fail to run, as many web pages are written to
+ * parse the user-agent strings of only the most popular browsers. Therefore, it's
+ * typically better to not completely override the standard user-agent, but to use
+ * webkit_settings_set_user_agent_with_application_details() instead.
+ *
+ * If this property is set to the empty string or %NULL, it will revert to the standard
+ * user-agent.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_USER_AGENT,
+ g_param_spec_string("user-agent",
+ _("User agent string"),
+ _("The user agent string"),
+ 0, // A null string forces the standard user agent.
+ readWriteConstructParamFlags));
+
g_type_class_add_private(klass, sizeof(WebKitSettingsPrivate));
}
@@ -1048,8 +1077,13 @@ static void webkit_settings_init(WebKitSettings* settings)
void webkitSettingsAttachSettingsToPage(WebKitSettings* settings, WKPageRef wkPage)
{
- WKPageGroupSetPreferences(WKPageGetPageGroup(wkPage), settings->priv->preferences.get());
- WebKit::toImpl(wkPage)->setCanRunModal(settings->priv->allowModalDialogs);
+ WebKitSettingsPrivate* priv = settings->priv;
+ WKPageGroupSetPreferences(WKPageGetPageGroup(wkPage), priv->preferences.get());
+ WebKit::toImpl(wkPage)->setCanRunModal(priv->allowModalDialogs);
+
+ ASSERT(!priv->userAgent.isNull());
+ WKRetainPtr<WKStringRef> userAgent = adoptWK(WKStringCreateWithUTF8CString(priv->userAgent.data()));
+ WKPageSetCustomUserAgent(wkPage, userAgent.get());
}
/**
@@ -2555,3 +2589,58 @@ void webkit_settings_set_enable_page_cache(WebKitSettings* settings, gboolean en
WKPreferencesSetPageCacheEnabled(priv->preferences.get(), enabled);
g_object_notify(G_OBJECT(settings), "enable-page-cache");
}
+
+/**
+ * webkit_settings_get_user_agent:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:user-agent property.
+ *
+ * Returns: The current value of the user-agent property.
+ */
+const char* webkit_settings_get_user_agent(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ ASSERT(!priv->userAgent.isNull());
+ return priv->userAgent.data();
+}
+
+/**
+ * webkit_settings_set_user_agent:
+ * @settings: a #WebKitSettings
+ * @user_agent: (allow-none): The new custom user agent string or %NULL to use the default user agent
+ *
+ * Set the #WebKitSettings:user-agent property.
+ */
+void webkit_settings_set_user_agent(WebKitSettings* settings, const char* userAgent)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ CString newUserAgent = (!userAgent || !strlen(userAgent)) ? WebCore::standardUserAgent("").utf8() : userAgent;
+ if (newUserAgent == priv->userAgent)
+ return;
+
+ priv->userAgent = newUserAgent;
+ g_object_notify(G_OBJECT(settings), "user-agent");
+}
+
+/**
+ * webkit_settings_set_user_agent_with_application_details:
+ * @settings: a #WebKitSettings
+ * @application_name: (allow-none): The application name used for the user agent or %NULL to use the default user agent.
+ * @application_version: (allow-none): The application version for the user agent or %NULL to user the default version.
+ *
+ * Set the #WebKitSettings:user-agent property by appending the application details to the default user
+ * agent. If no application name or version is given, the default user agent used will be used. If only
+ * the version is given, the default engine version is used with the given application name.
+ */
+void webkit_settings_set_user_agent_with_application_details(WebKitSettings* settings, const char* applicationName, const char* applicationVersion)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ CString newUserAgent = WebCore::standardUserAgent(String::fromUTF8(applicationName), String::fromUTF8(applicationVersion)).utf8();
+ webkit_settings_set_user_agent(settings, newUserAgent.data());
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
index 0c719cd47..b35a23f06 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
@@ -362,6 +362,17 @@ WEBKIT_API void
webkit_settings_set_enable_page_cache (WebKitSettings *settings,
gboolean enabled);
+WEBKIT_API const gchar *
+webkit_settings_get_user_agent (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_user_agent (WebKitSettings *settings,
+ const gchar *user_agent);
+WEBKIT_API void
+webkit_settings_set_user_agent_with_application_details (WebKitSettings *settings,
+ const gchar *application_name,
+ const gchar *application_version);
+
G_END_DECLS
#endif /* WebKitSettings_h */
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
index e9231e47b..5b2c26697 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
@@ -28,6 +28,7 @@
#include "WebKitPluginPrivate.h"
#include "WebKitPrivate.h"
#include "WebKitRequestManagerClient.h"
+#include "WebKitSecurityManagerPrivate.h"
#include "WebKitTextChecker.h"
#include "WebKitURISchemeRequestPrivate.h"
#include "WebKitWebContextPrivate.h"
@@ -95,6 +96,7 @@ struct _WebKitWebContextPrivate {
WKRetainPtr<WKContextRef> context;
GRefPtr<WebKitCookieManager> cookieManager;
+ GRefPtr<WebKitSecurityManager> securityManager;
WKRetainPtr<WKSoupRequestManagerRef> requestManager;
URISchemeHandlerMap uriSchemeHandlers;
URISchemeRequestMap uriSchemeRequests;
@@ -322,6 +324,25 @@ WebKitCookieManager* webkit_web_context_get_cookie_manager(WebKitWebContext* con
}
/**
+ * webkit_web_context_get_security_manager:
+ * @context: a #WebKitWebContext
+ *
+ * Get the #WebKitSecurityManager of @context.
+ *
+ * Returns: (transfer none): the #WebKitSecurityManager of @context.
+ */
+WebKitSecurityManager* webkit_web_context_get_security_manager(WebKitWebContext* context)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0);
+
+ WebKitWebContextPrivate* priv = context->priv;
+ if (!priv->securityManager)
+ priv->securityManager = adoptGRef(webkitSecurityManagerCreate(context));
+
+ return priv->securityManager.get();
+}
+
+/**
* webkit_web_context_set_additional_plugins_directory:
* @context: a #WebKitWebContext
* @directory: the directory to add
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
index a2bf573f5..f77086f4d 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
@@ -28,6 +28,7 @@
#include <webkit2/WebKitCookieManager.h>
#include <webkit2/WebKitDefines.h>
#include <webkit2/WebKitDownload.h>
+#include <webkit2/WebKitSecurityManager.h>
#include <webkit2/WebKitURISchemeRequest.h>
G_BEGIN_DECLS
@@ -113,6 +114,9 @@ webkit_web_context_download_uri (WebKitWebContext
WEBKIT_API WebKitCookieManager *
webkit_web_context_get_cookie_manager (WebKitWebContext *context);
+WEBKIT_API WebKitSecurityManager *
+webkit_web_context_get_security_manager (WebKitWebContext *context);
+
WEBKIT_API void
webkit_web_context_set_additional_plugins_directory (WebKitWebContext *context,
const gchar *directory);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index e35f603ff..1e6aa7fac 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -248,12 +248,19 @@ static void zoomTextOnlyChanged(WebKitSettings* settings, GParamSpec*, WebKitWeb
WKPageSetPageAndTextZoomFactors(wkPage, pageZoomLevel, textZoomLevel);
}
+static void userAgentChanged(WebKitSettings* settings, GParamSpec*, WebKitWebView* webView)
+{
+ WKRetainPtr<WKStringRef> userAgent = adoptWK(WKStringCreateWithUTF8CString(webkit_settings_get_user_agent(settings)));
+ WKPageSetCustomUserAgent(toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView))), userAgent.get());
+}
+
static void webkitWebViewSetSettings(WebKitWebView* webView, WebKitSettings* settings, WKPageRef wkPage)
{
webView->priv->settings = settings;
webkitSettingsAttachSettingsToPage(webView->priv->settings.get(), wkPage);
g_signal_connect(settings, "notify::allow-modal-dialogs", G_CALLBACK(allowModalDialogsChanged), webView);
g_signal_connect(settings, "notify::zoom-text-only", G_CALLBACK(zoomTextOnlyChanged), webView);
+ g_signal_connect(settings, "notify::user-agent", G_CALLBACK(userAgentChanged), webView);
}
static void webkitWebViewDisconnectSettingsSignalHandlers(WebKitWebView* webView)
@@ -261,7 +268,7 @@ static void webkitWebViewDisconnectSettingsSignalHandlers(WebKitWebView* webView
WebKitSettings* settings = webView->priv->settings.get();
g_signal_handlers_disconnect_by_func(settings, reinterpret_cast<gpointer>(allowModalDialogsChanged), webView);
g_signal_handlers_disconnect_by_func(settings, reinterpret_cast<gpointer>(zoomTextOnlyChanged), webView);
-
+ g_signal_handlers_disconnect_by_func(settings, reinterpret_cast<gpointer>(userAgentChanged), webView);
}
static void webkitWebViewDisconnectMainResourceResponseChangedSignalHandler(WebKitWebView* webView)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
index 0482b347e..23b02f649 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
@@ -67,7 +67,7 @@
#endif
#if USE(TEXTURE_MAPPER_GL) && defined(GDK_WINDOWING_X11)
-#include <gdk/gdkx.h>
+#include <WebCore/RedirectedXCompositeWindow.h>
#endif
using namespace WebKit;
@@ -90,14 +90,20 @@ struct _WebKitWebViewBasePrivate {
IntSize resizerSize;
GRefPtr<AtkObject> accessible;
bool needsResizeOnMap;
-#if ENABLE(FULLSCREEN_API)
- bool fullScreenModeActive;
- WebFullScreenClientGtk fullScreenClient;
-#endif
GtkWidget* inspectorView;
unsigned inspectorViewHeight;
GOwnPtr<GdkEvent> contextMenuEvent;
WebContextMenuProxyGtk* activeContextMenuProxy;
+
+#if ENABLE(FULLSCREEN_API)
+ bool fullScreenModeActive;
+ WebFullScreenClientGtk fullScreenClient;
+#endif
+
+#if USE(TEXTURE_MAPPER_GL)
+ OwnPtr<RedirectedXCompositeWindow> redirectedWindow;
+ bool readyToRenderAcceleratedCompositingResults;
+#endif
};
G_DEFINE_TYPE(WebKitWebViewBase, webkit_web_view_base, GTK_TYPE_CONTAINER)
@@ -162,9 +168,6 @@ static void webkitWebViewBaseRealize(GtkWidget* widget)
gint attributesMask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributesMask);
-#if USE(TEXTURE_MAPPER_GL)
- gdk_window_ensure_native(window);
-#endif
gtk_widget_set_window(widget, window);
gdk_window_set_user_data(window, widget);
@@ -264,7 +267,6 @@ static void webkit_web_view_base_init(WebKitWebViewBase* webkitWebViewBase)
priv->shouldForwardNextKeyEvent = FALSE;
GtkWidget* viewWidget = GTK_WIDGET(webkitWebViewBase);
- gtk_widget_set_double_buffered(viewWidget, FALSE);
gtk_widget_set_can_focus(viewWidget, TRUE);
priv->imContext = adoptGRef(gtk_im_multicontext_new());
@@ -275,11 +277,38 @@ static void webkit_web_view_base_init(WebKitWebViewBase* webkitWebViewBase)
gtk_drag_dest_set(viewWidget, static_cast<GtkDestDefaults>(0), 0, 0,
static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE));
gtk_drag_dest_set_target_list(viewWidget, PasteboardHelper::defaultPasteboardHelper()->targetList());
+
+#if USE(TEXTURE_MAPPER_GL)
+ priv->redirectedWindow = RedirectedXCompositeWindow::create(IntSize(1, 1));
+ priv->readyToRenderAcceleratedCompositingResults = false;
+#endif
+}
+
+#if USE(TEXTURE_MAPPER_GL)
+static bool webkitWebViewRenderAcceleratedCompositingResults(WebKitWebViewBase* webViewBase, DrawingAreaProxyImpl* drawingArea, cairo_t* cr, GdkRectangle* clipRect)
+{
+ if (!drawingArea->isInAcceleratedCompositingMode())
+ return false;
+
+ // To avoid flashes when initializing accelerated compositing for the first
+ // time, we wait until we know there's a frame ready before rendering.
+ WebKitWebViewBasePrivate* priv = webViewBase->priv;
+ if (!priv->readyToRenderAcceleratedCompositingResults)
+ return false;
+
+ ASSERT(priv->redirectedWindow);
+ cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height);
+ cairo_surface_t* surface = priv->redirectedWindow->cairoSurfaceForWidget(GTK_WIDGET(webViewBase));
+ cairo_set_source_surface(cr, surface, 0, 0);
+ cairo_fill(cr);
+ return true;
}
+#endif
static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
{
- DrawingAreaProxy* drawingArea = WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea();
+ WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
+ DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(webViewBase->priv->pageProxy->drawingArea());
if (!drawingArea)
return FALSE;
@@ -287,8 +316,13 @@ static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
if (!gdk_cairo_get_clip_rectangle(cr, &clipRect))
return FALSE;
+#if USE(TEXTURE_MAPPER_GL)
+ if (webkitWebViewRenderAcceleratedCompositingResults(webViewBase, drawingArea, cr, &clipRect))
+ return FALSE;
+#endif
+
WebCore::Region unpaintedRegion; // This is simply unused.
- static_cast<DrawingAreaProxyImpl*>(drawingArea)->paint(cr, clipRect, unpaintedRegion);
+ drawingArea->paint(cr, clipRect, unpaintedRegion);
return FALSE;
}
@@ -309,7 +343,7 @@ static void webkitWebViewBaseChildAllocate(GtkWidget* child, gpointer userData)
priv->children.set(child, IntRect());
}
-static void resizeWebKitWebViewBaseFromAllocation(WebKitWebViewBase* webViewBase, GtkAllocation* allocation)
+static void resizeWebKitWebViewBaseFromAllocation(WebKitWebViewBase* webViewBase, GtkAllocation* allocation, bool sizeChanged)
{
gtk_container_foreach(GTK_CONTAINER(webViewBase), webkitWebViewBaseChildAllocate, webViewBase);
@@ -324,6 +358,11 @@ static void resizeWebKitWebViewBaseFromAllocation(WebKitWebViewBase* webViewBase
viewRect.setHeight(allocation->height - priv->inspectorViewHeight);
}
+#if USE(TEXTURE_MAPPER_GL)
+ if (sizeChanged)
+ webViewBase->priv->redirectedWindow->resize(viewRect.size());
+#endif
+
if (priv->pageProxy->drawingArea())
priv->pageProxy->drawingArea()->setSize(viewRect.size(), IntSize());
@@ -334,14 +373,18 @@ static void resizeWebKitWebViewBaseFromAllocation(WebKitWebViewBase* webViewBase
static void webkitWebViewBaseSizeAllocate(GtkWidget* widget, GtkAllocation* allocation)
{
+ bool sizeChanged = gtk_widget_get_allocated_width(widget) != allocation->width
+ || gtk_widget_get_allocated_height(widget) != allocation->height;
+
GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->size_allocate(widget, allocation);
WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
- if (!gtk_widget_get_mapped(GTK_WIDGET(webViewBase)) && !webViewBase->priv->pageProxy->drawingArea()->size().isEmpty()) {
+ if (sizeChanged && !gtk_widget_get_mapped(widget) && !webViewBase->priv->pageProxy->drawingArea()->size().isEmpty()) {
webViewBase->priv->needsResizeOnMap = true;
return;
}
- resizeWebKitWebViewBaseFromAllocation(webViewBase, allocation);
+
+ resizeWebKitWebViewBaseFromAllocation(webViewBase, allocation, sizeChanged);
}
static void webkitWebViewBaseMap(GtkWidget* widget)
@@ -349,19 +392,12 @@ static void webkitWebViewBaseMap(GtkWidget* widget)
GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->map(widget);
WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
-#if USE(TEXTURE_MAPPER_GL) && defined(GDK_WINDOWING_X11)
- GdkWindow* gdkWindow = gtk_widget_get_window(widget);
- ASSERT(gdkWindow);
- if (gdk_window_has_native(gdkWindow))
- webViewBase->priv->pageProxy->widgetMapped(GDK_WINDOW_XID(gdkWindow));
-#endif
-
if (!webViewBase->priv->needsResizeOnMap)
return;
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
- resizeWebKitWebViewBaseFromAllocation(webViewBase, &allocation);
+ resizeWebKitWebViewBaseFromAllocation(webViewBase, &allocation, true /* sizeChanged */);
webViewBase->priv->needsResizeOnMap = false;
}
@@ -680,6 +716,10 @@ void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WKCont
#if ENABLE(FULLSCREEN_API)
priv->pageProxy->fullScreenManager()->setWebView(webkitWebViewBase);
#endif
+
+#if USE(TEXTURE_MAPPER_GL)
+ priv->pageProxy->setAcceleratedCompositingWindowId(priv->redirectedWindow->windowId());
+#endif
}
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char* tooltip)
@@ -803,3 +843,38 @@ GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase* webkitWebView
{
return webkitWebViewBase->priv->contextMenuEvent.release();
}
+
+#if USE(TEXTURE_MAPPER_GL)
+static gboolean queueAnotherDrawOfAcceleratedCompositingResults(gpointer* webViewBasePointer)
+{
+ // The WebViewBase may have been destroyed in the time since we queued this
+ // draw and the time we are actually executing.
+ if (!*webViewBasePointer) {
+ fastFree(webViewBasePointer);
+ return FALSE;
+ }
+
+ WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(*webViewBasePointer);
+ gtk_widget_queue_draw(GTK_WIDGET(webViewBase));
+ webViewBase->priv->readyToRenderAcceleratedCompositingResults = true;
+
+ g_object_remove_weak_pointer(G_OBJECT(webViewBase), webViewBasePointer);
+ fastFree(webViewBasePointer);
+
+ return FALSE;
+}
+
+void webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults(WebKitWebViewBase* webViewBase)
+{
+ gtk_widget_queue_draw(GTK_WIDGET(webViewBase));
+
+ // Redraw again, one frame later, as it might take some time for the new GL frame to be available.
+ // This prevents the display from always being one frame behind in the case GL hasn't yet finished
+ // rendering to the window.
+ // TODO: Add XDamage support to RedirectedXCompositeWindow to accomplish this.
+ gpointer* webViewBasePointer = static_cast<gpointer*>(fastMalloc(sizeof(gpointer)));
+ g_object_add_weak_pointer(G_OBJECT(webViewBase), webViewBasePointer);
+ *webViewBasePointer = webViewBase;
+ g_timeout_add(1000 / 60, reinterpret_cast<GSourceFunc>(queueAnotherDrawOfAcceleratedCompositingResults), webViewBasePointer);
+}
+#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
index 1295f3d53..031e5d59b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
@@ -52,4 +52,8 @@ void webkitWebViewBaseSetActiveContextMenuProxy(WebKitWebViewBase*, WebContextMe
WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKitWebViewBase*);
GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase*);
+#if USE(TEXTURE_MAPPER_GL)
+void webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults(WebKitWebViewBase*);
+#endif
+
#endif // WebKitWebViewBasePrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
index 6aac7c843..a7f34e6d1 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
@@ -40,6 +40,7 @@
<xi:include href="xml/WebKitContextMenu.xml"/>
<xi:include href="xml/WebKitContextMenuItem.xml"/>
<xi:include href="xml/WebKitFormSubmissionRequest.xml"/>
+ <xi:include href="xml/WebKitSecurityManager.xml"/>
</chapter>
<index id="index-all">
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
index 596498c83..73defe419 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
@@ -30,6 +30,7 @@ webkit_web_context_set_cache_model
webkit_web_context_clear_cache
webkit_web_context_download_uri
webkit_web_context_get_cookie_manager
+webkit_web_context_get_security_manager
webkit_web_context_set_additional_plugins_directory
webkit_web_context_get_plugins
webkit_web_context_get_plugins_finish
@@ -283,6 +284,9 @@ webkit_settings_get_enable_site_specific_quirks
webkit_settings_set_enable_site_specific_quirks
webkit_settings_get_enable_page_cache
webkit_settings_set_enable_page_cache
+webkit_settings_get_user_agent
+webkit_settings_set_user_agent
+webkit_settings_set_user_agent_with_application_details
<SUBSECTION Standard>
WebKitSettingsClass
@@ -845,3 +849,33 @@ WEBKIT_FORM_SUBMISSION_REQUEST_GET_CLASS
WebKitFormSubmissionRequestPrivate
webkit_form_submission_request_get_type
</SECTION>
+
+<SECTION>
+<FILE>WebKitSecurityManager</FILE>
+WebKitSecurityManager
+webkit_security_manager_register_uri_scheme_as_local
+webkit_security_manager_uri_scheme_is_local
+webkit_security_manager_register_uri_scheme_as_no_access
+webkit_security_manager_uri_scheme_is_no_access
+webkit_security_manager_register_uri_scheme_as_display_isolated
+webkit_security_manager_uri_scheme_is_display_isolated
+webkit_security_manager_register_uri_scheme_as_secure
+webkit_security_manager_uri_scheme_is_secure
+webkit_security_manager_register_uri_scheme_as_cors_enabled
+webkit_security_manager_uri_scheme_is_cors_enabled
+webkit_security_manager_register_uri_scheme_as_empty_document
+webkit_security_manager_uri_scheme_is_empty_document
+
+<SUBSECTION Standard>
+WebKitSecurityManagerClass
+WEBKIT_TYPE_SECURITY_MANAGER
+WEBKIT_SECURITY_MANAGER
+WEBKIT_IS_SECURITY_MANAGER
+WEBKIT_SECURITY_MANAGER_CLASS
+WEBKIT_IS_SECURITY_MANAGER_CLASS
+WEBKIT_SECURITY_MANAGER_GET_CLASS
+
+<SUBSECTION Private>
+WebKitSecurityManagerPrivate
+webkit_security_manager_get_type
+</SECTION>
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
index 5e6e91b09..d8e355472 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
@@ -31,10 +31,14 @@
#include "config.h"
#include "TestMain.h"
+#include "WebViewTest.h"
+#include "WebKitTestServer.h"
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
#include <wtf/gobject/GRefPtr.h>
+static WebKitTestServer* gServer;
+
static void testWebKitSettings(Test*, gconstpointer)
{
WebKitSettings* settings = webkit_settings_new();
@@ -254,13 +258,81 @@ void testWebKitSettingsNewWithSettings(Test* test, gconstpointer)
g_assert(webkit_settings_get_load_icons_ignoring_image_load_setting(settings.get()));
}
+static CString convertWebViewMainResourceDataToCString(WebViewTest* test)
+{
+ size_t mainResourceDataSize = 0;
+ const char* mainResourceData = test->mainResourceData(mainResourceDataSize);
+ return CString(mainResourceData, mainResourceDataSize);
+}
+
+static void assertThatUserAgentIsSentInHeaders(WebViewTest* test, const CString& userAgent)
+{
+ test->loadURI(gServer->getURIForPath("/").data());
+ test->waitUntilLoadFinished();
+ g_assert_cmpstr(convertWebViewMainResourceDataToCString(test).data(), ==, userAgent.data());
+}
+
+static void testWebKitSettingsUserAgent(WebViewTest* test, gconstpointer)
+{
+ GRefPtr<WebKitSettings> settings = adoptGRef(webkit_settings_new());
+ CString defaultUserAgent = webkit_settings_get_user_agent(settings.get());
+ webkit_web_view_set_settings(test->m_webView, settings.get());
+
+ g_assert(g_strstr_len(defaultUserAgent.data(), -1, "Safari"));
+ g_assert(g_strstr_len(defaultUserAgent.data(), -1, "Chromium"));
+ g_assert(g_strstr_len(defaultUserAgent.data(), -1, "Chrome"));
+
+ webkit_settings_set_user_agent(settings.get(), 0);
+ g_assert_cmpstr(defaultUserAgent.data(), ==, webkit_settings_get_user_agent(settings.get()));
+ assertThatUserAgentIsSentInHeaders(test, defaultUserAgent.data());
+
+ webkit_settings_set_user_agent(settings.get(), "");
+ g_assert_cmpstr(defaultUserAgent.data(), ==, webkit_settings_get_user_agent(settings.get()));
+
+ const char* funkyUserAgent = "Funky!";
+ webkit_settings_set_user_agent(settings.get(), funkyUserAgent);
+ g_assert_cmpstr(funkyUserAgent, ==, webkit_settings_get_user_agent(settings.get()));
+ assertThatUserAgentIsSentInHeaders(test, funkyUserAgent);
+
+ webkit_settings_set_user_agent_with_application_details(settings.get(), "WebKitGTK+", 0);
+ CString userAgentWithNullVersion = webkit_settings_get_user_agent(settings.get());
+ g_assert_cmpstr(g_strstr_len(userAgentWithNullVersion.data(), -1, defaultUserAgent.data()), ==, userAgentWithNullVersion.data());
+ g_assert(g_strstr_len(userAgentWithNullVersion.data(), -1, "WebKitGTK+"));
+
+ webkit_settings_set_user_agent_with_application_details(settings.get(), "WebKitGTK+", "");
+ g_assert_cmpstr(webkit_settings_get_user_agent(settings.get()), ==, userAgentWithNullVersion.data());
+
+ webkit_settings_set_user_agent_with_application_details(settings.get(), "WebCatGTK+", "3.4.5");
+ const char* newUserAgent = webkit_settings_get_user_agent(settings.get());
+ g_assert(g_strstr_len(newUserAgent, -1, "3.4.5"));
+ g_assert(g_strstr_len(newUserAgent, -1, "WebCatGTK+"));
+}
+
+static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
+{
+ if (message->method != SOUP_METHOD_GET) {
+ soup_message_set_status(message, SOUP_STATUS_NOT_IMPLEMENTED);
+ return;
+ }
+
+ soup_message_set_status(message, SOUP_STATUS_OK);
+ const char* userAgent = soup_message_headers_get_one(message->request_headers, "User-Agent");
+ soup_message_body_append(message->response_body, SOUP_MEMORY_COPY, userAgent, strlen(userAgent));
+ soup_message_body_complete(message->response_body);
+}
+
void beforeAll()
{
+ gServer = new WebKitTestServer();
+ gServer->run(serverCallback);
+
Test::add("WebKitSettings", "webkit-settings", testWebKitSettings);
Test::add("WebKitSettings", "new-with-settings", testWebKitSettingsNewWithSettings);
+ WebViewTest::add("WebKitSettings", "user-agent", testWebKitSettingsUserAgent);
}
void afterAll()
{
+ delete gServer;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
index 7c712244e..7a13d285d 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
@@ -297,6 +297,83 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char*
soup_message_body_complete(message->response_body);
}
+class SecurityPolicyTest: public Test {
+public:
+ MAKE_GLIB_TEST_FIXTURE(SecurityPolicyTest);
+
+ enum SecurityPolicy {
+ Local = 1 << 1,
+ NoAccess = 1 << 2,
+ DisplayIsolated = 1 << 3,
+ Secure = 1 << 4,
+ CORSEnabled = 1 << 5,
+ EmptyDocument = 1 << 6
+ };
+
+ SecurityPolicyTest()
+ : m_manager(webkit_web_context_get_security_manager(webkit_web_context_get_default()))
+ {
+ }
+
+ void verifyThatSchemeMatchesPolicy(const char* scheme, unsigned policy)
+ {
+ if (policy & Local)
+ g_assert(webkit_security_manager_uri_scheme_is_local(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_local(m_manager, scheme));
+ if (policy & NoAccess)
+ g_assert(webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme));
+ if (policy & DisplayIsolated)
+ g_assert(webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme));
+ if (policy & Secure)
+ g_assert(webkit_security_manager_uri_scheme_is_secure(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_secure(m_manager, scheme));
+ if (policy & CORSEnabled)
+ g_assert(webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme));
+ if (policy & EmptyDocument)
+ g_assert(webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme));
+ else
+ g_assert(!webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme));
+ }
+
+ WebKitSecurityManager* m_manager;
+};
+
+static void testWebContextSecurityPolicy(SecurityPolicyTest* test, gconstpointer)
+{
+ // VerifyThatSchemeMatchesPolicy default policy for well known schemes.
+ test->verifyThatSchemeMatchesPolicy("http", SecurityPolicyTest::CORSEnabled);
+ test->verifyThatSchemeMatchesPolicy("https", SecurityPolicyTest::CORSEnabled | SecurityPolicyTest::Secure);
+ test->verifyThatSchemeMatchesPolicy("file", SecurityPolicyTest::Local);
+ test->verifyThatSchemeMatchesPolicy("data", SecurityPolicyTest::NoAccess | SecurityPolicyTest::Secure);
+ test->verifyThatSchemeMatchesPolicy("about", SecurityPolicyTest::NoAccess | SecurityPolicyTest::Secure | SecurityPolicyTest::EmptyDocument);
+
+ // Custom scheme.
+ test->verifyThatSchemeMatchesPolicy("foo", 0);
+
+ webkit_security_manager_register_uri_scheme_as_local(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local);
+ webkit_security_manager_register_uri_scheme_as_no_access(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess);
+ webkit_security_manager_register_uri_scheme_as_display_isolated(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated);
+ webkit_security_manager_register_uri_scheme_as_secure(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure);
+ webkit_security_manager_register_uri_scheme_as_cors_enabled(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure
+ | SecurityPolicyTest::CORSEnabled);
+ webkit_security_manager_register_uri_scheme_as_empty_document(test->m_manager, "foo");
+ test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure
+ | SecurityPolicyTest::CORSEnabled | SecurityPolicyTest::EmptyDocument);
+}
+
void beforeAll()
{
kServer = new WebKitTestServer();
@@ -307,6 +384,7 @@ void beforeAll()
URISchemeTest::add("WebKitWebContext", "uri-scheme", testWebContextURIScheme);
Test::add("WebKitWebContext", "spell-checker", testWebContextSpellChecker);
WebViewTest::add("WebKitWebContext", "languages", testWebContextLanguages);
+ SecurityPolicyTest::add("WebKitSecurityManager", "security-policy", testWebContextSecurityPolicy);
}
void afterAll()
diff --git a/Source/WebKit2/UIProcess/API/gtk/webkit2.h b/Source/WebKit2/UIProcess/API/gtk/webkit2.h
index 116dafc2d..e1f3ba04a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/webkit2.h
+++ b/Source/WebKit2/UIProcess/API/gtk/webkit2.h
@@ -47,6 +47,7 @@
#include <webkit2/WebKitPrintOperation.h>
#include <webkit2/WebKitResponsePolicyDecision.h>
#include <webkit2/WebKitScriptDialog.h>
+#include <webkit2/WebKitSecurityManager.h>
#include <webkit2/WebKitSettings.h>
#include <webkit2/WebKitURIRequest.h>
#include <webkit2/WebKitURIResponse.h>
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index 5c2d508c4..437a2cfb7 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -122,8 +122,8 @@ private:
// CoreIPC message handlers.
// FIXME: These should be pure virtual.
- virtual void update(uint64_t backingStoreStateID, const UpdateInfo&) { }
- virtual void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) { }
+ virtual void update(uint64_t /*backingStoreStateID*/, const UpdateInfo&) { }
+ virtual void didUpdateBackingStoreState(uint64_t /*backingStoreStateID*/, const UpdateInfo&, const LayerTreeContext&) { }
#if USE(ACCELERATED_COMPOSITING)
virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) { }
virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) { }
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index cd9cafc17..baf6470ec 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -215,6 +215,8 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState
ASSERT(!m_backingStore);
return;
}
+#else
+ UNUSED_PARAM(layerTreeContext);
#endif
// If we have a backing store the right size, reuse it.
@@ -231,6 +233,8 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(uint64_t backingStore
#if USE(ACCELERATED_COMPOSITING)
enterAcceleratedCompositingMode(layerTreeContext);
+#else
+ UNUSED_PARAM(layerTreeContext);
#endif
}
@@ -255,6 +259,8 @@ void DrawingAreaProxyImpl::updateAcceleratedCompositingMode(uint64_t backingStor
#if USE(ACCELERATED_COMPOSITING)
updateAcceleratedCompositingMode(layerTreeContext);
+#else
+ UNUSED_PARAM(layerTreeContext);
#endif
}
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index 0c9f04f8e..762e35c69 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -48,6 +48,10 @@ public:
void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&, WebCore::Region& unpaintedRegion);
+#if USE(ACCELERATED_COMPOSITING)
+ bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
+#endif
+
private:
explicit DrawingAreaProxyImpl(WebPageProxy*);
@@ -78,9 +82,6 @@ private:
void enterAcceleratedCompositingMode(const LayerTreeContext&);
void exitAcceleratedCompositingMode();
void updateAcceleratedCompositingMode(const LayerTreeContext&);
-
- bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
-
#if USE(COORDINATED_GRAPHICS)
virtual void setVisibleContentsRect(const WebCore::FloatRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectory);
void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/UIProcess/FindIndicator.cpp b/Source/WebKit2/UIProcess/FindIndicator.cpp
index e3dfe6f4d..2ad193f1b 100644
--- a/Source/WebKit2/UIProcess/FindIndicator.cpp
+++ b/Source/WebKit2/UIProcess/FindIndicator.cpp
@@ -173,7 +173,7 @@ static Path pathWithRoundedRect(const FloatRect& pathRect, float radius)
return path;
}
-void FindIndicator::draw(GraphicsContext& graphicsContext, const IntRect& dirtyRect)
+void FindIndicator::draw(GraphicsContext& graphicsContext, const IntRect& /*dirtyRect*/)
{
for (size_t i = 0; i < m_textRectsInSelectionRectCoordinates.size(); ++i) {
FloatRect textRect = m_textRectsInSelectionRectCoordinates[i];
diff --git a/Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
index 71beaf5a5..eb06c29d8 100644
--- a/Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
@@ -65,6 +65,8 @@ void GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDe
#if ENABLE(GEOLOCATION)
m_page->process()->send(Messages::WebPage::DidReceiveGeolocationPermissionDecision(geolocationID, allowed), m_page->pageID());
+#else
+ UNUSED_PARAM(allowed);
#endif
m_pendingRequests.remove(it);
diff --git a/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
index aa44998d1..afaed6d21 100644
--- a/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
@@ -104,7 +104,7 @@ bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo&
#endif
}
-bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo& plugin)
+bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& /*alreadyLoadedPlugins*/, const PluginModuleInfo& /*plugin*/)
{
// We do not do any black-listing presently.
return true;
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index 0dc530647..fbdc6b3fa 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -336,6 +336,10 @@ PassRefPtr<WebProcessProxy> WebContext::createNewWebProcess()
copyToVector(m_schemesToRegisterAsEmptyDocument, parameters.urlSchemesRegistererdAsEmptyDocument);
copyToVector(m_schemesToRegisterAsSecure, parameters.urlSchemesRegisteredAsSecure);
copyToVector(m_schemesToSetDomainRelaxationForbiddenFor, parameters.urlSchemesForWhichDomainRelaxationIsForbidden);
+ copyToVector(m_schemesToRegisterAsLocal, parameters.urlSchemesRegisteredAsLocal);
+ copyToVector(m_schemesToRegisterAsNoAccess, parameters.urlSchemesRegisteredAsNoAccess);
+ copyToVector(m_schemesToRegisterAsDisplayIsolated, parameters.urlSchemesRegisteredAsDisplayIsolated);
+ copyToVector(m_schemesToRegisterAsCORSEnabled, parameters.urlSchemesRegisteredAsCORSEnabled);
parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
parameters.shouldUseFontSmoothing = m_shouldUseFontSmoothing;
@@ -640,6 +644,30 @@ void WebContext::setDomainRelaxationForbiddenForURLScheme(const String& urlSchem
sendToAllProcesses(Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme(urlScheme));
}
+void WebContext::registerURLSchemeAsLocal(const String& urlScheme)
+{
+ m_schemesToRegisterAsLocal.add(urlScheme);
+ sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsLocal(urlScheme));
+}
+
+void WebContext::registerURLSchemeAsNoAccess(const String& urlScheme)
+{
+ m_schemesToRegisterAsNoAccess.add(urlScheme);
+ sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsNoAccess(urlScheme));
+}
+
+void WebContext::registerURLSchemeAsDisplayIsolated(const String& urlScheme)
+{
+ m_schemesToRegisterAsDisplayIsolated.add(urlScheme);
+ sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated(urlScheme));
+}
+
+void WebContext::registerURLSchemeAsCORSEnabled(const String& urlScheme)
+{
+ m_schemesToRegisterAsCORSEnabled.add(urlScheme);
+ sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCORSEnabled(urlScheme));
+}
+
void WebContext::setCacheModel(CacheModel cacheModel)
{
m_cacheModel = cacheModel;
@@ -916,6 +944,8 @@ void WebContext::setHTTPPipeliningEnabled(bool enabled)
{
#if PLATFORM(MAC)
ResourceRequest::setHTTPPipeliningEnabled(enabled);
+#else
+ UNUSED_PARAM(enabled);
#endif
}
diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h
index dfeff1fa6..1d051c817 100644
--- a/Source/WebKit2/UIProcess/WebContext.h
+++ b/Source/WebKit2/UIProcess/WebContext.h
@@ -132,6 +132,10 @@ public:
void registerURLSchemeAsEmptyDocument(const String&);
void registerURLSchemeAsSecure(const String&);
void setDomainRelaxationForbiddenForURLScheme(const String&);
+ void registerURLSchemeAsLocal(const String&);
+ void registerURLSchemeAsNoAccess(const String&);
+ void registerURLSchemeAsDisplayIsolated(const String&);
+ void registerURLSchemeAsCORSEnabled(const String&);
void addVisitedLink(const String&);
void addVisitedLinkHash(WebCore::LinkHash);
@@ -295,6 +299,10 @@ private:
HashSet<String> m_schemesToRegisterAsEmptyDocument;
HashSet<String> m_schemesToRegisterAsSecure;
HashSet<String> m_schemesToSetDomainRelaxationForbiddenFor;
+ HashSet<String> m_schemesToRegisterAsLocal;
+ HashSet<String> m_schemesToRegisterAsNoAccess;
+ HashSet<String> m_schemesToRegisterAsDisplayIsolated;
+ HashSet<String> m_schemesToRegisterAsCORSEnabled;
bool m_alwaysUsesComplexTextCodePath;
bool m_shouldUseFontSmoothing;
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
index bb1bd6011..9dc13bcc9 100644
--- a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
@@ -94,7 +94,7 @@ void WebFullScreenManagerProxy::requestExitFullScreen()
m_page->process()->send(Messages::WebFullScreenManager::RequestExitFullScreen(), m_page->pageID());
}
-void WebFullScreenManagerProxy::supportsFullScreen(bool withKeyboard, bool& supports)
+void WebFullScreenManagerProxy::supportsFullScreen(bool /*withKeyboard*/, bool& supports)
{
supports = true;
}
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 8fd72a0c6..9bbabe12b 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1352,7 +1352,7 @@ void WebPageProxy::terminateProcess()
}
#if !USE(CF) || defined(BUILDING_QT__)
-PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
+PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* /*context*/) const
{
// FIXME: Return session state data for saving Page state.
return 0;
@@ -3815,6 +3815,8 @@ void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
{
#if PLATFORM(MAC)
m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
+#else
+ UNUSED_PARAM(newStyle);
#endif
}
@@ -3853,6 +3855,8 @@ void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const S
pluginIdentifier = plugin.bundleIdentifier;
pluginVersion = plugin.versionString;
+#else
+ UNUSED_PARAM(urlString);
#endif
m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index c4d274308..28c5da90a 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -714,7 +714,8 @@ public:
virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent();
#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
- void widgetMapped(uint64_t nativeWindowId);
+ void setAcceleratedCompositingWindowId(uint64_t nativeWindowId);
+ void invalidateWidget();
#endif
void setSuppressVisibilityUpdates(bool flag) { m_suppressVisibilityUpdates = flag; }
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index c541d2c14..a4a3c57bf 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -177,6 +177,10 @@ messages -> WebPageProxy {
BindAccessibilityTree(WTF::String plugID)
#endif
+#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
+ InvalidateWidget()
+#endif
+
# BackForward messages
BackForwardAddItem(uint64_t itemID)
BackForwardGoToItem(uint64_t itemID) -> (WebKit::SandboxExtension::Handle sandboxExtensionHandle)
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
index 22a2b7f2c..13ca474f3 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -181,7 +181,7 @@ WebPageProxy* WebProcessProxy::webPage(uint64_t pageID) const
return m_pageMap.get(pageID);
}
-PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient* pageClient, WebContext* context, WebPageGroup* pageGroup)
+PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient* pageClient, WebContext*, WebPageGroup* pageGroup)
{
uint64_t pageID = generatePageID();
RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, this, pageGroup, pageID);
diff --git a/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp b/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp
index aa33f2f4c..75a8a99a5 100644
--- a/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp
@@ -57,12 +57,12 @@ void TextChecker::setGrammarCheckingEnabled(bool)
notImplemented();
}
-void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
+void TextChecker::continuousSpellCheckingEnabledStateChanged(bool /*enabled*/)
{
notImplemented();
}
-void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
+void TextChecker::grammarCheckingEnabledStateChanged(bool /*enabled*/)
{
notImplemented();
}
diff --git a/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
index f000c152a..254340de5 100644
--- a/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
@@ -71,12 +71,12 @@ void WebFullScreenManagerProxy::exitFullScreen()
didExitFullScreen();
}
-void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& /*initialFrame*/, const IntRect& /*finalFrame*/)
{
notImplemented();
}
-void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
+void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& /*initialFrame*/, const IntRect& /*finalFrame*/)
{
notImplemented();
}
diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
index 94dc44b31..2a3b3078d 100644
--- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
@@ -41,7 +41,7 @@ Evas_Object* WebPageProxy::viewWidget()
return static_cast<PageClientImpl*>(m_pageClient)->viewWidget();
}
-String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
+String WebPageProxy::standardUserAgent(const String& /*applicationNameForUserAgent*/)
{
WTF::String platform;
WTF::String version;
@@ -63,7 +63,7 @@ String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent
+ " (KHTML, like Gecko) Version/5.0 Safari/" + version;
}
-void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& commandsList)
+void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& /*commandsList*/)
{
notImplemented();
}
diff --git a/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
index ac26c0cb8..80881bfe7 100644
--- a/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
@@ -33,6 +33,7 @@
#include "WebKitWebViewBasePrivate.h"
#include "WebPageMessages.h"
#include "WebProcessProxy.h"
+#include <WebCore/UserAgentGtk.h>
#include <gtk/gtkx.h>
namespace WebKit {
@@ -44,8 +45,7 @@ GtkWidget* WebPageProxy::viewWidget()
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
{
- // FIXME: This should not be hard coded.
- return "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.7 (KHTML, like Gecko) Version/5.0 Safari/534.7";
+ return WebCore::standardUserAgent(applicationNameForUserAgent);
}
void WebPageProxy::getEditorCommandsForKeyEvent(const AtomicString& eventType, Vector<WTF::String>& commandsList)
@@ -110,9 +110,14 @@ void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect& frame
}
#if USE(TEXTURE_MAPPER_GL)
-void WebPageProxy::widgetMapped(uint64_t nativeWindowId)
+void WebPageProxy::setAcceleratedCompositingWindowId(uint64_t nativeWindowId)
{
- process()->send(Messages::WebPage::WidgetMapped(nativeWindowId), m_pageID);
+ process()->send(Messages::WebPage::SetAcceleratedCompositingWindowId(nativeWindowId), m_pageID);
+}
+
+void WebPageProxy::invalidateWidget()
+{
+ webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults(WEBKIT_WEB_VIEW_BASE(static_cast<PageClientImpl*>(m_pageClient)->viewWidget()));
}
#endif
diff --git a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
index 3afd2ab47..ac59e6fbb 100644
--- a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
+++ b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
@@ -214,6 +214,8 @@ void BackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset
if (scrollOffset.isZero())
return;
+ ASSERT(!scrollRect.isEmpty());
+
if (!m_scrolledRect.isEmpty() && m_scrolledRect != scrollRect)
resetScrolledRect();
diff --git a/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
index 81500b5c4..38117ebb3 100644
--- a/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
+++ b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
@@ -137,7 +137,7 @@ public:
GRefPtr<SoupMessage> m_response;
};
-void Download::start(WebPage* initiatingWebPage)
+void Download::start(WebPage*)
{
ASSERT(!m_downloadClient);
ASSERT(!m_resourceHandle);
@@ -146,7 +146,7 @@ void Download::start(WebPage* initiatingWebPage)
didStart();
}
-void Download::startWithHandle(WebPage* initiatingPage, ResourceHandle* resourceHandle, const ResourceResponse&)
+void Download::startWithHandle(WebPage*, ResourceHandle* resourceHandle, const ResourceResponse&)
{
ASSERT(!m_downloadClient);
ASSERT(!m_resourceHandle);
@@ -179,7 +179,7 @@ void Download::platformInvalidate()
m_downloadClient.release();
}
-void Download::didDecideDestination(const String& destination, bool allowOverwrite)
+void Download::didDecideDestination(const String& /*destination*/, bool /*allowOverwrite*/)
{
notImplemented();
}
@@ -189,17 +189,17 @@ void Download::platformDidFinish()
m_resourceHandle = 0;
}
-void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential)
+void Download::receivedCredential(const AuthenticationChallenge&, const Credential&)
{
notImplemented();
}
-void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge)
+void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
{
notImplemented();
}
-void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge)
+void Download::receivedCancellation(const AuthenticationChallenge&)
{
notImplemented();
}
diff --git a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
index 1bdf11d65..691844aaa 100644
--- a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
+++ b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
@@ -83,6 +83,8 @@ void WebGeolocationManager::didChangePosition(const WebGeolocationPosition::Data
if (page->corePage())
GeolocationController::from(page->corePage())->positionChanged(position.get());
}
+#else
+ UNUSED_PARAM(data);
#endif // ENABLE(GEOLOCATION)
}
diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
index 02077912b..217f1e80a 100644
--- a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
+++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
@@ -72,7 +72,7 @@ void WebIconDatabaseProxy::releaseIconForPageURL(const String& pageURL)
m_process->connection()->send(Messages::WebIconDatabase::ReleaseIconForPageURL(pageURL), 0);
}
-Image* WebIconDatabaseProxy::synchronousIconForPageURL(const String& pageURL, const IntSize& size)
+Image* WebIconDatabaseProxy::synchronousIconForPageURL(const String& pageURL, const IntSize& /*size*/)
{
CoreIPC::DataReference result;
if (!m_process->connection()->sendSync(Messages::WebIconDatabase::SynchronousIconDataForPageURL(pageURL), Messages::WebIconDatabase::SynchronousIconDataForPageURL::Reply(result), 0))
@@ -83,21 +83,21 @@ Image* WebIconDatabaseProxy::synchronousIconForPageURL(const String& pageURL, co
}
-String WebIconDatabaseProxy::synchronousIconURLForPageURL(const String& pageURL)
+String WebIconDatabaseProxy::synchronousIconURLForPageURL(const String& /*pageURL*/)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
return String();
}
-bool WebIconDatabaseProxy::synchronousIconDataKnownForIconURL(const String& iconURL)
+bool WebIconDatabaseProxy::synchronousIconDataKnownForIconURL(const String& /*iconURL*/)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
return false;
}
-IconLoadDecision WebIconDatabaseProxy::synchronousLoadDecisionForIconURL(const String& iconURL, DocumentLoader* documentLoader)
+IconLoadDecision WebIconDatabaseProxy::synchronousLoadDecisionForIconURL(const String& /*iconURL*/, DocumentLoader*)
{
// FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading.
// The parts in WebCore that need this data will have to be changed to work asycnchronously.
@@ -124,7 +124,7 @@ void WebIconDatabaseProxy::receivedIconLoadDecision(int decision, uint64_t callb
callback->performCallback(static_cast<WebCore::IconLoadDecision>(decision));
}
-void WebIconDatabaseProxy::iconDataForIconURL(const String& iconURL, PassRefPtr<WebCore::IconDataCallback> callback)
+void WebIconDatabaseProxy::iconDataForIconURL(const String& /*iconURL*/, PassRefPtr<WebCore::IconDataCallback>)
{
}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index 895be2323..9a2b9fc00 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -263,6 +263,10 @@ WKDataRef WKBundleFrameCopyWebArchiveFilteringSubframes(WKBundleFrameRef frameRe
RetainPtr<CFDataRef> data = toImpl(frameRef)->webArchiveData(frameFilterCallback, context);
if (data)
return WKDataCreate(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
+#else
+ UNUSED_PARAM(frameRef);
+ UNUSED_PARAM(frameFilterCallback);
+ UNUSED_PARAM(context);
#endif
return 0;
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
index 561a514eb..dc13c57fc 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp
@@ -33,6 +33,7 @@
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
#include "WKDictionary.h"
+#include "WKRetainPtr.h"
#include "WKString.h"
#include "WebSerializedScriptValue.h"
@@ -52,11 +53,14 @@ WKTypeID WKBundleIntentGetTypeID()
WKBundleIntentRef WKBundleIntentCreate(WKDictionaryRef dictionaryRef)
{
#if ENABLE(WEB_INTENTS)
- WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("action")));
+ WKRetainPtr<WKStringRef> actionKey(AdoptWK, WKStringCreateWithUTF8CString("action"));
+ WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, actionKey.get()));
ASSERT(action);
- WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("type")));
+ WKRetainPtr<WKStringRef> typeKey(AdoptWK, WKStringCreateWithUTF8CString("type"));
+ WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, typeKey.get()));
ASSERT(type);
- WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(dictionaryRef, WKStringCreateWithUTF8CString("data")));
+ WKRetainPtr<WKStringRef> dataKey(AdoptWK, WKStringCreateWithUTF8CString("data"));
+ WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(dictionaryRef, dataKey.get()));
MessagePortArray dummyPorts;
ExceptionCode ec;
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index 91d0ad865..18247b664 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -166,6 +166,7 @@ void* WKAccessibilityRootObject(WKBundlePageRef pageRef)
return root->wrapper();
#else
+ UNUSED_PARAM(pageRef);
return 0;
#endif
}
@@ -188,6 +189,7 @@ void* WKAccessibilityFocusedObject(WKBundlePageRef pageRef)
return focusedObject->wrapper();
#else
+ UNUSED_PARAM(pageRef);
return 0;
#endif
}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index a1ba347f5..206f47ee6 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -254,6 +254,9 @@ void InjectedBundle::setGeoLocationPermission(WebPageGroupProxy* pageGroup, bool
const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
static_cast<GeolocationClientMock*>(GeolocationController::from(*iter)->client())->setPermission(enabled);
+#else
+ UNUSED_PARAM(pageGroup);
+ UNUSED_PARAM(enabled);
#endif // ENABLE(GEOLOCATION)
}
@@ -549,7 +552,7 @@ void InjectedBundle::didReceiveMessageToPage(WebPage* page, const String& messag
m_client.didReceiveMessageToPage(this, page, messageName, messageBody);
}
-void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void InjectedBundle::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
switch (messageID.get<InjectedBundleMessage::Kind>()) {
case InjectedBundleMessage::PostMessage: {
@@ -644,6 +647,8 @@ uint64_t InjectedBundle::webNotificationID(JSContextRef jsContext, JSValueRef js
return 0;
return WebProcess::shared().notificationManager().notificationIDForTesting(notification);
#else
+ UNUSED_PARAM(jsContext);
+ UNUSED_PARAM(jsNotification);
return 0;
#endif
}
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
index e6e2cd4e3..ea3973699 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
@@ -71,6 +71,8 @@ void WebNotificationManager::initialize(const HashMap<String, bool>& permissions
{
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
m_permissionsMap = permissions;
+#else
+ UNUSED_PARAM(permissions);
#endif
}
@@ -78,6 +80,9 @@ void WebNotificationManager::didUpdateNotificationDecision(const String& originS
{
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
m_permissionsMap.set(originString, allowed);
+#else
+ UNUSED_PARAM(originString);
+ UNUSED_PARAM(allowed);
#endif
}
@@ -87,6 +92,8 @@ void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>
size_t count = originStrings.size();
for (size_t i = 0; i < count; ++i)
m_permissionsMap.remove(originStrings[i]);
+#else
+ UNUSED_PARAM(originStrings);
#endif
}
@@ -100,6 +107,8 @@ NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::
HashMap<String, bool>::const_iterator it = m_permissionsMap.find(origin->toRawString());
if (it != m_permissionsMap.end())
return it->second ? NotificationClient::PermissionAllowed : NotificationClient::PermissionDenied;
+#else
+ UNUSED_PARAM(origin);
#endif
return NotificationClient::PermissionNotAllowed;
@@ -119,6 +128,7 @@ uint64_t WebNotificationManager::notificationIDForTesting(Notification* notifica
return 0;
return m_notificationMap.get(notification);
#else
+ UNUSED_PARAM(notification);
return 0;
#endif
}
@@ -143,6 +153,8 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
#endif
return true;
#else
+ UNUSED_PARAM(notification);
+ UNUSED_PARAM(page);
return false;
#endif
}
@@ -158,6 +170,9 @@ void WebNotificationManager::cancel(Notification* notification, WebPage* page)
return;
m_process->connection()->send(Messages::WebNotificationManagerProxy::Cancel(notificationID), page->pageID());
+#else
+ UNUSED_PARAM(notification);
+ UNUSED_PARAM(page);
#endif
}
@@ -180,6 +195,9 @@ void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext*
}
m_notificationContextMap.remove(it);
+#else
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(page);
#endif
}
@@ -193,6 +211,9 @@ void WebNotificationManager::didDestroyNotification(Notification* notification,
m_notificationIDMap.remove(notificationID);
removeNotificationFromContextMap(notificationID, notification);
m_process->connection()->send(Messages::WebNotificationManagerProxy::DidDestroyNotification(notificationID), page->pageID());
+#else
+ UNUSED_PARAM(notification);
+ UNUSED_PARAM(page);
#endif
}
@@ -207,6 +228,8 @@ void WebNotificationManager::didShowNotification(uint64_t notificationID)
return;
notification->dispatchShowEvent();
+#else
+ UNUSED_PARAM(notificationID);
#endif
}
@@ -221,6 +244,8 @@ void WebNotificationManager::didClickNotification(uint64_t notificationID)
return;
notification->dispatchClickEvent();
+#else
+ UNUSED_PARAM(notificationID);
#endif
}
@@ -242,6 +267,8 @@ void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notif
notification->dispatchCloseEvent();
}
+#else
+ UNUSED_PARAM(notificationIDs);
#endif
}
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
index fc06486fd..40a0d7a21 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -641,7 +641,7 @@ void PluginView::setFrameRect(const WebCore::IntRect& rect)
viewGeometryDidChange();
}
-void PluginView::paint(GraphicsContext* context, const IntRect& dirtyRect)
+void PluginView::paint(GraphicsContext* context, const IntRect& /*dirtyRect*/)
{
if (!m_plugin || !m_isInitialized)
return;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 87b54f5bd..dbcab8dbf 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -263,7 +263,7 @@ void WebChromeClient::setResizable(bool resizable)
m_page->send(Messages::WebPageProxy::SetIsResizable(resizable));
}
-void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID)
+void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& /*sourceID*/)
{
// Notify the bundle client.
m_page->injectedBundleUIClient().willAddMessageToConsole(m_page, message, lineNumber);
@@ -428,7 +428,7 @@ PlatformPageClient WebChromeClient::platformPageClient() const
return 0;
}
-void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
+void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& /*size*/) const
{
if (!m_page->corePage()->settings()->frameFlatteningEnabled()) {
WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
@@ -572,14 +572,14 @@ void WebChromeClient::populateVisitedLinks()
{
}
-FloatRect WebChromeClient::customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect)
+FloatRect WebChromeClient::customHighlightRect(Node*, const AtomicString& /*type*/, const FloatRect& /*lineRect*/)
{
notImplemented();
return FloatRect();
}
-void WebChromeClient::paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
- bool behindText, bool entireLine)
+void WebChromeClient::paintCustomHighlight(Node*, const AtomicString& /*type*/, const FloatRect& /*boxRect*/, const FloatRect& /*lineRect*/,
+ bool /*behindText*/, bool /*entireLine*/)
{
notImplemented();
}
@@ -658,7 +658,7 @@ void WebChromeClient::formStateDidChange(const Node*)
bool WebChromeClient::selectItemWritingDirectionIsNatural()
{
-#if PLATFORM(WIN)
+#if PLATFORM(WIN) || PLATFORM(EFL)
return true;
#else
return false;
@@ -735,7 +735,7 @@ void WebChromeClient::setLastSetCursorToCurrentCursor()
#endif
#if ENABLE(FULLSCREEN_API)
-bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard)
+bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard)
{
return m_page->fullScreenManager()->supportsFullScreen(withKeyboard);
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
index 3624ca9cc..29c7e2e9d 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
@@ -66,7 +66,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem*, const Conte
notImplemented();
}
-void WebContextMenuClient::downloadURL(const KURL& url)
+void WebContextMenuClient::downloadURL(const KURL&)
{
// This is handled in the UI process.
ASSERT_NOT_REACHED();
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
index 184e680a3..d56a03004 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
@@ -51,7 +51,7 @@ DragDestinationAction WebDragClient::actionMaskForDrag(DragData*)
return DragDestinationActionAny;
}
-DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& windowPoint)
+DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& /*windowPoint*/)
{
return DragSourceActionAny;
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index baf68f033..fe4e9d32a 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -397,6 +397,7 @@ bool WebEditorClient::shouldEraseMarkersAfterChangeSelection(WebCore::TextChecki
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
return type != TextCheckingTypeSpelling;
#else
+ UNUSED_PARAM(type);
return true;
#endif
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 6a8019306..9640edaa7 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -210,7 +210,7 @@ void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoa
AuthenticationManager::shared().didReceiveAuthenticationChallenge(m_frame, challenge);
}
-void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
+void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long /*identifier*/, const AuthenticationChallenge&)
{
notImplemented();
}
@@ -273,7 +273,7 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long
webPage->send(Messages::WebPageProxy::DidFailLoadForResource(m_frame->frameID(), identifier, error));
}
-bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
+bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int /*length*/)
{
notImplemented();
return false;
@@ -1000,7 +1000,7 @@ bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
return shouldGoToBackForwardListItem;
}
-bool WebFrameLoaderClient::shouldStopLoadingForHistoryItem(HistoryItem* item) const
+bool WebFrameLoaderClient::shouldStopLoadingForHistoryItem(HistoryItem*) const
{
return true;
}
@@ -1106,24 +1106,24 @@ bool WebFrameLoaderClient::canHandleRequest(const ResourceRequest&) const
return true;
}
-bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const
+bool WebFrameLoaderClient::canShowMIMEType(const String& /*MIMEType*/) const
{
notImplemented();
return true;
}
-bool WebFrameLoaderClient::canShowMIMETypeAsHTML(const String& MIMEType) const
+bool WebFrameLoaderClient::canShowMIMETypeAsHTML(const String& /*MIMEType*/) const
{
return true;
}
-bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const
+bool WebFrameLoaderClient::representationExistsForURLScheme(const String& /*URLScheme*/) const
{
notImplemented();
return false;
}
-String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLScheme) const
+String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& /*URLScheme*/) const
{
notImplemented();
return String();
@@ -1287,7 +1287,7 @@ void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceReques
}
PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
- const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+ const String& referrer, bool /*allowsScrolling*/, int /*marginWidth*/, int /*marginHeight*/)
{
WebPage* webPage = m_frame->page();
@@ -1360,7 +1360,7 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
m_pluginView = static_cast<PluginView*>(pluginWidget);
}
-PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* appletElement, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues)
+PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* appletElement, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
RefPtr<Widget> plugin = createPlugin(pluginSize, appletElement, KURL(), paramNames, paramValues, appletElement->serviceType(), false);
if (!plugin) {
@@ -1514,7 +1514,7 @@ void WebFrameLoaderClient::didPerformFirstNavigation() const
notImplemented();
}
-void WebFrameLoaderClient::registerForIconNotification(bool listen)
+void WebFrameLoaderClient::registerForIconNotification(bool /*listen*/)
{
notImplemented();
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
index 2c30b72bd..048c25718 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
@@ -122,7 +122,7 @@ void WebInspectorClient::didMoveToWebPage(PageOverlay*, WebPage*)
{
}
-void WebInspectorClient::drawRect(PageOverlay* overlay, WebCore::GraphicsContext& context, const WebCore::IntRect& dirtyRect)
+void WebInspectorClient::drawRect(PageOverlay*, WebCore::GraphicsContext& context, const WebCore::IntRect& /*dirtyRect*/)
{
m_page->corePage()->inspectorController()->drawHighlight(context);
}
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
index 0d2bd4d3f..d979ad71c 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
@@ -254,7 +254,10 @@ bool LayerTreeCoordinator::flushPendingLayerChanges()
if (m_waitingForUIProcess)
return false;
- m_shouldSyncFrame = false;
+ for (size_t i = 0; i < m_detachedLayers.size(); ++i)
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(m_detachedLayers[i]));
+ m_detachedLayers.clear();
+
bool didSync = m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
m_nonCompositedContentLayer->syncCompositingStateForThisLayerOnly();
if (m_pageOverlayLayer)
@@ -326,7 +329,8 @@ void LayerTreeCoordinator::detachLayer(CoordinatedGraphicsLayer* layer)
{
m_registeredLayers.remove(layer);
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(layer->id()));
+ m_detachedLayers.append(layer->id());
+ scheduleLayerFlush();
}
static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
index 73b84e524..6c61bb6b6 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
@@ -127,6 +127,7 @@ private:
OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
HashSet<WebCore::CoordinatedGraphicsLayer*> m_registeredLayers;
+ Vector<WebLayerID> m_detachedLayers;
HashMap<int64_t, int> m_directlyCompositedImageRefCounts;
Vector<OwnPtr<UpdateAtlas> > m_updateAtlases;
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
index 9c7212a9b..6178e85bb 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -70,7 +70,7 @@ public:
// FIXME: These should be pure virtual.
virtual void pageBackgroundTransparencyChanged() { }
virtual void forceRepaint() { }
- virtual bool forceRepaintAsync(uint64_t callbackID) { return false; }
+ virtual bool forceRepaintAsync(uint64_t /*callbackID*/) { return false; }
virtual void setLayerTreeStateIsFrozen(bool) { }
virtual bool layerTreeStateIsFrozen() const { return false; }
virtual LayerTreeHost* layerTreeHost() const { return 0; }
@@ -110,7 +110,8 @@ protected:
private:
// CoreIPC message handlers.
// FIXME: These should be pure virtual.
- virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset) { }
+ virtual void updateBackingStoreState(uint64_t /*backingStoreStateID*/, bool /*respondImmediately*/, float /*deviceScaleFactor*/, const WebCore::IntSize& /*size*/,
+ const WebCore::IntSize& /*scrollOffset*/) { }
virtual void didUpdate() { }
virtual void suspendPainting() { }
virtual void resumePainting() { }
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index b3c732819..2299bc3ea 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -117,6 +117,9 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOff
if (m_webPage->mainFrameHasCustomRepresentation())
return;
+ if (scrollRect.isEmpty())
+ return;
+
if (!m_scrollRect.isEmpty() && scrollRect != m_scrollRect) {
unsigned scrollArea = scrollRect.width() * scrollRect.height();
unsigned currentScrollArea = m_scrollRect.width() * m_scrollRect.height();
diff --git a/Source/WebKit2/WebProcess/WebPage/FindController.cpp b/Source/WebKit2/WebProcess/WebPage/FindController.cpp
index a3d1d8feb..533ac2b24 100644
--- a/Source/WebKit2/WebProcess/WebPage/FindController.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/FindController.cpp
@@ -367,7 +367,7 @@ void FindController::drawRect(PageOverlay* pageOverlay, GraphicsContext& graphic
}
}
-bool FindController::mouseEvent(PageOverlay* pageOverlay, const WebMouseEvent& mouseEvent)
+bool FindController::mouseEvent(PageOverlay*, const WebMouseEvent& mouseEvent)
{
// If we get a mouse down event inside the page overlay we should hide the find UI.
if (mouseEvent.type() == WebEvent::MouseDown) {
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
index 87b46b372..7d590a1a7 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
@@ -57,6 +57,7 @@ PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage)
#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
return LayerTreeHostGtk::create(webPage);
#else
+ UNUSED_PARAM(webPage);
return 0;
#endif
}
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
index 9beeb3d0c..8d3bb94ac 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
@@ -73,7 +73,7 @@ public:
virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&) = 0;
virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0;
virtual void forceRepaint() = 0;
- virtual bool forceRepaintAsync(uint64_t callbackID) { return false; }
+ virtual bool forceRepaintAsync(uint64_t /*callbackID*/) { return false; }
virtual void sizeDidChange(const WebCore::IntSize& newSize) = 0;
virtual void deviceScaleFactorDidChange() = 0;
diff --git a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
index 60b9c9744..039f31048 100644
--- a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
@@ -97,7 +97,7 @@ static Color highlightColor(Color baseColor, float fractionFadedIn)
return Color(baseColor.red(), baseColor.green(), baseColor.blue(), int(baseColor.alpha() * fractionFadedIn));
}
-void TapHighlightController::drawRect(PageOverlay* pageOverlay, GraphicsContext& context, const IntRect& dirtyRect)
+void TapHighlightController::drawRect(PageOverlay* pageOverlay, GraphicsContext& context, const IntRect& /*dirtyRect*/)
{
if (m_path.isEmpty())
return;
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 915140f8d..750983169 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -1954,6 +1954,8 @@ void WebPage::getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
if ((data = frame->webArchiveData(0, 0)))
dataReference = CoreIPC::DataReference(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
}
+#else
+ UNUSED_PARAM(frameID);
#endif
send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
@@ -2054,6 +2056,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey()));
settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
+ settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()));
settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 96cb6e1a1..775b8270a 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -458,7 +458,8 @@ public:
void updateAccessibilityTree();
bool handleMousePressedEvent(const WebCore::PlatformMouseEvent&);
#if USE(TEXTURE_MAPPER_GL)
- void widgetMapped(int64_t nativeWindowHandle);
+ void setAcceleratedCompositingWindowId(int64_t nativeWindowHandle);
+ void invalidateWidget();
#endif
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
index b6bcace51..59362bcf5 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -299,6 +299,6 @@ messages -> WebPage {
#endif
#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
- WidgetMapped(int64_t id)
+ SetAcceleratedCompositingWindowId(int64_t id)
#endif
}
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
index ee483aed3..098a4c716 100644
--- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
@@ -203,6 +203,8 @@ void LayerTreeHostGtk::sizeDidChange(const IntSize& newSize)
if (m_pageOverlayLayer)
m_pageOverlayLayer->setSize(newSize);
+
+ compositeLayersToContext(ForResize);
}
void LayerTreeHostGtk::deviceScaleFactorDidChange()
@@ -293,7 +295,7 @@ bool LayerTreeHostGtk::flushPendingLayerChanges()
return m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
}
-void LayerTreeHostGtk::compositeLayersToContext()
+void LayerTreeHostGtk::compositeLayersToContext(CompositePurpose purpose)
{
GLContext* context = glContext();
if (!context || !context->makeContextCurrent())
@@ -305,11 +307,17 @@ void LayerTreeHostGtk::compositeLayersToContext()
IntSize contextSize = m_context->defaultFrameBufferSize();
glViewport(0, 0, contextSize.width(), contextSize.height());
+ if (purpose == ForResize) {
+ glClearColor(1, 1, 1, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+
m_textureMapper->beginPainting();
toTextureMapperLayer(m_rootLayer.get())->paint();
m_textureMapper->endPainting();
context->swapBuffers();
+ m_webPage->invalidateWidget();
}
void LayerTreeHostGtk::flushAndRenderLayers()
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
index 060570b64..d9a816c2e 100644
--- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
+++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
@@ -83,7 +83,10 @@ private:
void createPageOverlayLayer();
void destroyPageOverlayLayer();
- void compositeLayersToContext();
+
+ enum CompositePurpose { ForResize, NotForResize };
+ void compositeLayersToContext(CompositePurpose = NotForResize);
+
void flushAndRenderLayers();
void cancelPendingLayerFlush();
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
index 30aaa4037..d9dde81a2 100644
--- a/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
@@ -156,10 +156,15 @@ PassRefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const KURL&)
}
#if USE(TEXTURE_MAPPER_GL)
-void WebPage::widgetMapped(int64_t nativeWindowHandle)
+void WebPage::setAcceleratedCompositingWindowId(int64_t nativeWindowHandle)
{
m_nativeWindowHandle = nativeWindowHandle;
}
+
+void WebPage::invalidateWidget()
+{
+ send(Messages::WebPageProxy::InvalidateWidget());
+}
#endif
bool WebPage::handleMousePressedEvent(const PlatformMouseEvent& platformMouseEvent)
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index ef86bf3d4..de1832459 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -292,6 +292,26 @@ void WebProcess::setDomainRelaxationForbiddenForURLScheme(const String& urlSchem
SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(true, urlScheme);
}
+void WebProcess::registerURLSchemeAsLocal(const String& urlScheme) const
+{
+ SchemeRegistry::registerURLSchemeAsLocal(urlScheme);
+}
+
+void WebProcess::registerURLSchemeAsNoAccess(const String& urlScheme) const
+{
+ SchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
+}
+
+void WebProcess::registerURLSchemeAsDisplayIsolated(const String& urlScheme) const
+{
+ SchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
+}
+
+void WebProcess::registerURLSchemeAsCORSEnabled(const String& urlScheme) const
+{
+ SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
+}
+
void WebProcess::setDefaultRequestTimeoutInterval(double timeoutInterval)
{
ResourceRequest::setDefaultTimeoutInterval(timeoutInterval);
@@ -870,6 +890,8 @@ void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint6
for (size_t i = 0; i < sites.size(); ++i)
sitesSet.add(sites[i]);
}
+#else
+ UNUSED_PARAM(pluginPaths);
#endif
Vector<String> sites;
@@ -897,6 +919,11 @@ void WebProcess::clearPluginSiteData(const Vector<String>& pluginPaths, const Ve
for (size_t i = 0; i < sites.size(); ++i)
netscapePluginModule->clearSiteData(sites[i], flags, maxAgeInSeconds);
}
+#else
+ UNUSED_PARAM(pluginPaths);
+ UNUSED_PARAM(sites);
+ UNUSED_PARAM(flags);
+ UNUSED_PARAM(maxAgeInSeconds);
#endif
connection()->send(Messages::WebProcessProxy::DidClearPluginSiteData(callbackID), 0);
diff --git a/Source/WebKit2/WebProcess/WebProcess.h b/Source/WebKit2/WebProcess/WebProcess.h
index 953af29c0..0f542bedb 100644
--- a/Source/WebKit2/WebProcess/WebProcess.h
+++ b/Source/WebKit2/WebProcess/WebProcess.h
@@ -199,6 +199,10 @@ private:
void registerURLSchemeAsEmptyDocument(const String&);
void registerURLSchemeAsSecure(const String&) const;
void setDomainRelaxationForbiddenForURLScheme(const String&) const;
+ void registerURLSchemeAsLocal(const String&) const;
+ void registerURLSchemeAsNoAccess(const String&) const;
+ void registerURLSchemeAsDisplayIsolated(const String&) const;
+ void registerURLSchemeAsCORSEnabled(const String&) const;
void setDefaultRequestTimeoutInterval(double);
void setAlwaysUsesComplexTextCodePath(bool);
void setShouldUseFontSmoothing(bool);
diff --git a/Source/WebKit2/WebProcess/WebProcess.messages.in b/Source/WebKit2/WebProcess/WebProcess.messages.in
index 22716cea5..336ff8bfa 100644
--- a/Source/WebKit2/WebProcess/WebProcess.messages.in
+++ b/Source/WebKit2/WebProcess/WebProcess.messages.in
@@ -42,6 +42,10 @@ messages -> WebProcess {
RegisterURLSchemeAsEmptyDocument(WTF::String scheme)
RegisterURLSchemeAsSecure(WTF::String scheme)
SetDomainRelaxationForbiddenForURLScheme(WTF::String scheme)
+ RegisterURLSchemeAsLocal(WTF::String scheme)
+ RegisterURLSchemeAsNoAccess(WTF::String scheme)
+ RegisterURLSchemeAsDisplayIsolated(WTF::String scheme)
+ RegisterURLSchemeAsCORSEnabled(WTF::String scheme)
SetDefaultRequestTimeoutInterval(double timeoutInterval)
SetAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
SetShouldUseFontSmoothing(bool useFontSmoothing)
diff --git a/Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp b/Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp
index a85109863..8b251b831 100644
--- a/Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp
+++ b/Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp
@@ -51,7 +51,7 @@ static void webkitSoupRequestGenericSendAsync(SoupRequest* request, GCancellable
WebProcess::shared().soupRequestManager().send(result, cancellable);
}
-static GInputStream* webkitSoupRequestGenericSendFinish(SoupRequest* request, GAsyncResult* result, GError** error)
+static GInputStream* webkitSoupRequestGenericSendFinish(SoupRequest*, GAsyncResult* result, GError** error)
{
GSimpleAsyncResult* simpleResult = G_SIMPLE_ASYNC_RESULT(result);
g_warn_if_fail(g_simple_async_result_get_source_tag(simpleResult) == webkitSoupRequestGenericSendAsync);
diff --git a/Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp b/Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp
index 126bc6db3..852a585d6 100644
--- a/Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp
+++ b/Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp
@@ -83,7 +83,7 @@ static bool webkitSoupRequestInputStreamIsWaitingForData(WebKitSoupRequestInputS
return !stream->priv->contentLength || stream->priv->bytesReceived < stream->priv->contentLength;
}
-static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, void* buffer, gsize count, int priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData)
+static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, void* buffer, gsize count, int /*priority*/, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData)
{
WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(inputStream);
GRefPtr<GSimpleAsyncResult> result = adoptGRef(g_simple_async_result_new(G_OBJECT(stream), callback, userData, reinterpret_cast<void*>(webkitSoupRequestInputStreamReadAsync)));
@@ -104,7 +104,7 @@ static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, voi
stream->priv->pendingAsyncRead = adoptPtr(new AsyncReadData(result.get(), buffer, count, cancellable));
}
-static gssize webkitSoupRequestInputStreamReadFinish(GInputStream* inputStream, GAsyncResult* result, GError** error)
+static gssize webkitSoupRequestInputStreamReadFinish(GInputStream*, GAsyncResult* result, GError**)
{
GSimpleAsyncResult* simpleResult = G_SIMPLE_ASYNC_RESULT(result);
g_warn_if_fail(g_simple_async_result_get_source_tag(simpleResult) == webkitSoupRequestInputStreamReadAsync);
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 8aa40371f..a9b00db39 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -222,9 +222,9 @@ EXPORTS
?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
?setFantasyFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
?setFixedFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
- ?setImagesEnabled@Settings@WebCore@@QAEX_N@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?mockScrollbarsEnabled@Settings@WebCore@@SA_NXZ
+ ?setUsesOverlayScrollbars@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index 100843781..51f5538dc 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -218,6 +218,7 @@ EXPORTS
?setImagesEnabled@Settings@WebCore@@QAEX_N@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?mockScrollbarsEnabled@Settings@WebCore@@SA_NXZ
+ ?setUsesOverlayScrollbars@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
diff --git a/Source/api.pri b/Source/api.pri
index 0053268b7..453c0ecd1 100644
--- a/Source/api.pri
+++ b/Source/api.pri
@@ -24,10 +24,6 @@ build?(webkit2): QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
use?(3D_GRAPHICS): WEBKIT += angle
-# We load the relevant modules here, so that the effects of each module
-# on the QT variable can be picked up when we later load(qt_module).
-load(webkit_modules)
-
MODULE = webkit
# This is the canonical list of dependencies for the public API of
@@ -35,6 +31,10 @@ MODULE = webkit
QT_API_DEPENDS = core gui network
build?(webkit1): QT_API_DEPENDS += widgets
+# We load the relevant modules here, so that the effects of each module
+# on the QT variable can be picked up when we later load(qt_module).
+load(webkit_modules)
+
# ---------------- Custom developer-build handling -------------------
#
# The assumption for Qt developer builds is that the module file
diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter
index 2af7e7607..d5d54106a 100644
--- a/Source/autotools/symbols.filter
+++ b/Source/autotools/symbols.filter
@@ -145,7 +145,6 @@ _ZN7WebCore14ScrollableArea28setScrollOffsetFromInternalsERKNS_8IntPointE;
_ZN7WebCore10ScrollView23setScrollbarsSuppressedEbb;
_ZN7WebCore10ScrollView21setDelegatesScrollingEb;
_ZN7WebCore4Node14removedLastRefEv;
-_ZN7WebCore8Settings16setImagesEnabledEb;
_ZN7WebCore8Settings18setFixedFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
_ZN7WebCore8Settings18setSerifFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
_ZN7WebCore8Settings20setCursiveFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
@@ -155,6 +154,7 @@ _ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
_ZN7WebCore8Settings22setSansSerifFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
_ZN7WebCore8Settings23setPictographFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
_ZN7WebCore8Settings24setMockScrollbarsEnabledEb;
+_ZN7WebCore8Settings24setUsesOverlayScrollbarsEb;
_ZN7WebCore8Settings24setStorageBlockingPolicyENS_14SecurityOrigin21StorageBlockingPolicyE;
_ZN7WebCore8Settings37setFixedElementsLayoutRelativeToFrameEb;
_ZN7WebCore9FrameView17paintControlTintsEv;
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 1e5b3a11d..9a3edbaf0 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,582 @@
+2012-09-20 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] QtWebKit module header includes private dependencies
+
+ Reviewed by Tor Arne Vestbø.
+
+ * qmake/mkspecs/features/default_post.prf: Don't try to sanitize LIBS, because we can make sure
+ that LIBS_PRIVATE is set from the beginning. Moved the creating_module and PKGCONFIG/QT(_PRIVATE)
+ sanitization into webkit_modules.prf. creating_module determination requires TARGET to be set, so
+ we can't do it in default_pre.
+ * qmake/mkspecs/features/webkit_modules.prf:
+
+2012-09-20 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Fix build with MingW
+
+ Reviewed by Tor Arne Vestbø.
+
+ Don't try to compile WebCore, etc. with debug symbols for production
+ builds, it's just too big.
+
+ * qmake/mkspecs/features/production_build.prf:
+
+2012-09-20 Michał Pakuła vel Rutka <m.pakula@samsung.com>
+
+ [EFL][DRT]DumpRenderTree needs to reset focus state when test starts.
+ https://bugs.webkit.org/show_bug.cgi?id=97087
+
+ Reviewed by Gyuyoung Kim.
+
+ Add focusing a main frame on settings reset.
+ After editing/undo/undo-iframe-location-change was executed a frame
+ was left in unfocused state. This caused flakiness in two tests results.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+
+2012-09-20 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Add eventSender.gestureTap
+ https://bugs.webkit.org/show_bug.cgi?id=66173
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Implement support for sending raw QGesture events.
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::EventSender):
+ (EventSender::gestureTap):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ (EventSender):
+
+2012-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r129007.
+ http://trac.webkit.org/changeset/129007
+ https://bugs.webkit.org/show_bug.cgi?id=97172
+
+ It broke the build on the Qt bots (Requested by Ossy on
+ #webkit).
+
+ * qmake/config.tests/gccdepends/empty.cpp:
+ * qmake/config.tests/gccdepends/gccdepends.pro:
+ * qmake/mkspecs/features/default_pre.prf:
+
+2012-09-19 Ryosuke Niwa <rniwa@webkit.org>
+
+ run-perf-tests should record indivisual value instead of statistics
+ https://bugs.webkit.org/show_bug.cgi?id=97155
+
+ Reviewed by Hajime Morita.
+
+ Parse the list of indivisual value reported by tests and include them as "values".
+ We strip "values" from the output JSON when uploading it to the perf-o-matic
+ since it doesn't know how to parse "values" or ignore it.
+
+ * Scripts/webkitpy/performance_tests/perftest.py:
+ (PerfTest):
+ (PerfTest.parse_output): Parse and report "values".
+ (PageLoadingPerfTest.run): Report indivisual page loading time in "values".
+ * Scripts/webkitpy/performance_tests/perftest_unittest.py:
+ (MainTest.test_parse_output):
+ (MainTest.test_parse_output_with_failing_line):
+ (TestPageLoadingPerfTest.test_run):
+ * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+ (PerfTestsRunner._generate_and_show_results): Strip "values" from each result
+ until we update perf-o-matic.
+ * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+ (test_run_memory_test):
+ (test_run_with_json_output):
+ (test_run_with_description):
+ (test_run_with_slave_config_json):
+ (test_run_with_multiple_repositories):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ Fix regex groups for bug matching in flakiness dashboard.
+ https://bugs.webkit.org/show_bug.cgi?id=97152
+
+ Unreviewed, build fix.
+
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (htmlForBugs):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: print unexpected results using new TestExpectations syntax
+ https://bugs.webkit.org/show_bug.cgi?id=97159
+
+ Unreviewed, build fix.
+
+ Change new-run-webkit-tests to print out failures using the new
+ syntax when there are unexpected results, e.g.:
+
+ 52 tests ran as expected, 19 didn't:
+
+
+ Regressions: Unexpected failures : (2)
+ failures/flaky/text.html [ Failure ]
+ failures/unexpected/text-image-checksum.html [ Failure ]
+
+ and so forth
+
+ * Scripts/webkitpy/layout_tests/views/printing.py:
+ (Printer._print_unexpected_results):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ update flakiness dashboard after cutover to new test expectations syntax
+ https://bugs.webkit.org/show_bug.cgi?id=97152
+
+ Unreviewed, build fix.
+
+ Handle (??) the new Bug notations as well. Hopefully we don't
+ still need the old ones.
+
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (filterBugs):
+ (htmlForBugs):
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ update flakiness dashboard after cutover to new test expectations syntax
+ https://bugs.webkit.org/show_bug.cgi?id=97152
+
+ Reviewed by Ryosuke Niwa.
+
+ This change clones the TestExpectation parsing state machine
+ from python into javascript.
+
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (parsedExpectations.lines.forEach):
+ (parsedExpectations):
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+
+2012-09-19 Dana Jansens <danakj@chromium.org>
+
+ Add backer@chromium.org as contributor
+ https://bugs.webkit.org/show_bug.cgi?id=97150
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ fix MISSING after TestExpectations conversion
+ https://bugs.webkit.org/show_bug.cgi?id=97148
+
+ Unreviewed, expectations change / build fix.
+
+ * Scripts/convert-test-expectations:
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectationParser):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: convert chromium TestExpectations to the new syntax
+ https://bugs.webkit.org/show_bug.cgi?id=97139
+
+ Reviewed by Ryosuke Niwa.
+
+ Add in a file temporarily that does the conversion of
+ test expectations formats
+
+ * Tools/Scripts/convert-test-expectations: Added.
+
+2012-09-19 Ryosuke Niwa <rniwa@webkit.org>
+
+ REGRESSION: run-perf-tests no longer reports the total test time
+ https://bugs.webkit.org/show_bug.cgi?id=97138
+
+ Reviewed by Tony Chang.
+
+ Report the finished time as a info-level log as opposed to a debug level log.
+
+ * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+ (PerfTestsRunner._run_single_test):
+ * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+ (MainTest.normalizeFinishedTime): Added. It replaces all finished times by 0.1 seconds.
+ (test_run_test_pause_before_testing):
+ (test_run_test_set_for_parser_tests):
+ (test_run_memory_test):
+ (_test_run_with_json_output):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ Support new TestExpectations format alongside old one
+ https://bugs.webkit.org/show_bug.cgi?id=96588
+
+ Reviewed by Ojan Vafai.
+
+ This patch adds support for actually reading in lines formatted
+ in the new style, and when we re-serialize/write out the file,
+ all lines will be written in the new style. Note that reading in
+ the old style is still supported, and no updates are being made
+ to the actual TestExpectations files as part of this change.
+
+ This change updates most but not all of the unit tests to use
+ the new syntax. I will update the rest when (or before where
+ possible) I drop support for the old format.
+
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectationParser):
+ (TestExpectationParser._tokenize_line):
+ (TestExpectationParser._tokenize_line_using_new_format):
+ (TestExpectationLine.to_string):
+ (TestExpectationLine._format_line):
+ (TestExpectations):
+ * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+ (test_parse_warning):
+ (SkippedTests.test_skipped_entry_dont_exist):
+ (NewExpectationSyntaxTests.test_warnings):
+ (RemoveConfigurationsTest.test_remove):
+ (test_remove_line):
+ (RebaseliningTest.test_remove):
+ (RebaseliningTest.test_no_get_rebaselining_failures):
+ (TestExpectationParserTests.test_tokenize_blank):
+ (TestExpectationParserTests.test_tokenize_extra_colon):
+ (TestExpectationParserTests.test_tokenize_missing_equal):
+ (TestExpectationParserTests.test_tokenize_extra_equal):
+ (TestExpectationSerializationTests.test_unparsed_to_string):
+ (TestExpectationSerializationTests.test_unparsed_list_to_string):
+ (TestExpectationSerializationTests.test_parsed_to_string):
+ (TestExpectationSerializationTests.test_format_line):
+ (TestExpectationSerializationTests.test_string_roundtrip):
+ (TestExpectationSerializationTests.test_list_roundtrip):
+ (TestExpectationSerializationTests.test_reconstitute_only_these):
+ (TestExpectationSerializationTests.test_string_whitespace_stripping):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (LintTest.test_lint_test_files__errors):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (PrintExpectationsTest.test_basic):
+ (PrintExpectationsTest.test_multiple):
+ (PrintExpectationsTest.test_full):
+ (PrintExpectationsTest.test_exclude):
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+ (RebaselineExpectations.execute):
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+ (TestRebaseline.test_rebaseline_updates_expectations_file_noop):
+ (test_rebaseline_updates_expectations_file):
+ (test_rebaseline_does_not_include_overrides):
+ (test_rebaseline_expectations_noop):
+ (test_overrides_are_included_correctly):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ implement first part of support for the new TestExpectations syntax
+ https://bugs.webkit.org/show_bug.cgi?id=96569
+
+ Reviewed by Ryosuke Niwa.
+
+ This patch implements support for parsing a line of the new
+ format for the TestExpectations file and converting it back into
+ the old format for compatibility. This routine is not yet used
+ by anything.
+
+ The new format is documented at:
+ http://trac.webkit.org/wiki/TestExpectations
+
+ but, in short:
+
+ [bugs] [ "[" modifiers "]" ] test_name [ "[" expectations "]" ]
+
+ - Comments are indicated with "#" instead of "//"
+ - If no expectations are specified we default to Skip for
+ compatibility with the Skipped files (these two changes make
+ Skipped files a subset of TestExpectations files)
+
+ - All of the tokens are now CamelCase instead of ALLCAPS.
+ - FAIL -> Failure
+ - IMAGE -> ImageOnlyFailure
+ - WONTFIX -> WontFix
+ - modifiers refer to just the platforms and configurations
+ (release/debug) that the line applies to.
+ - WontFix, Rebaseline, Slow, and Skip move to the right-hand side as
+ expectations
+ - expectations will typically be written out in lexicographic order
+ - We use webkit.org/b/12345, crbug.com/12345, and Bug(dpranke)
+ instead of BUGWK12345, BUGCR12345, and BUGDPRANKE.
+
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectationParser):
+ (TestExpectationParser._tokenize_line_using_new_format):
+ * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+ (NewExpectationSyntaxTests):
+ (NewExpectationSyntaxTests.assert_exp):
+ (NewExpectationSyntaxTests.test_bare_name):
+ (NewExpectationSyntaxTests.test_bare_name_and_bugs):
+ (NewExpectationSyntaxTests.test_comments):
+ (NewExpectationSyntaxTests.test_config_modifiers):
+ (NewExpectationSyntaxTests.test_unknown_config):
+ (NewExpectationSyntaxTests.test_unknown_expectation):
+ (NewExpectationSyntaxTests.test_skip):
+ (NewExpectationSyntaxTests.test_slow):
+ (NewExpectationSyntaxTests.test_wontfix):
+ (NewExpectationSyntaxTests.test_blank_line):
+ (NewExpectationSyntaxTests.test_warnings):
+
+2012-09-19 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: replace TEXT, AUDIO, and IMAGE+TEXT with FAIL
+ https://bugs.webkit.org/show_bug.cgi?id=96845
+
+ Reviewed by Ojan Vafai.
+
+ In preparation for the new TestExpectations syntax, we replace
+ all TEXT, IMAGE+TEXT, and AUDIO failures with FAIL. This will
+ make switching to the new syntax lossless (i.e., we lose
+ information now, not then).
+
+ Note that we can still parse in results.json files that have the
+ old data for backwards compatibility.
+
+
+ * Scripts/webkitpy/common/net/resultsjsonparser.py:
+ (JSONTestResult._failure_types_from_actual_result):
+ * Scripts/webkitpy/common/net/resultsjsonparser_unittest.py:
+ (ResultsJSONParserTest):
+ (test_basic):
+ * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
+ (ResultSummaryTest.test_summarized_results_wontfix):
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ (JSONLayoutResultsGenerator):
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectations):
+ (TestExpectations.remove_pixel_failures):
+ (TestExpectations.has_pixel_failures):
+ (TestExpectations.suffixes_for_expectations):
+ (TestExpectations.get_rebaselining_failures):
+ (TestExpectations.remove_configuration_from_test):
+ * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+ (assert_bad_expectations):
+ (BasicTests):
+ (BasicTests.test_basic):
+ (MiscTests):
+ (MiscTests.test_multiple_results):
+ (MiscTests.test_result_was_expected):
+ (MiscTests.test_remove_pixel_failures):
+ (MiscTests.test_suffixes_for_expectations):
+ (test_get_expectations_string):
+ (test_parse_warning):
+ (test_error_on_different_platform):
+ (test_error_on_different_build_type):
+ (test_overrides):
+ (test_overrides__directory):
+ (test_overrides__duplicate):
+ (test_pixel_tests_flag):
+ (test_more_specific_override_resets_skip):
+ (SkippedTests.test_skipped_file_overrides_expectations):
+ (SkippedTests.test_skipped_dir_overrides_expectations):
+ (SkippedTests.test_skipped_file_overrides_overrides):
+ (SkippedTests.test_skipped_dir_overrides_overrides):
+ (ExpectationSyntaxTests.test_missing_colon):
+ (ExpectationSyntaxTests.test_too_many_equals_signs):
+ (SemanticTests.test_bug_format):
+ (SemanticTests.test_bad_bugid):
+ (SemanticTests.test_missing_bugid):
+ (SemanticTests.test_rebaseline):
+ (test_missing_file):
+ (test_more_modifiers):
+ (test_order_in_file):
+ (test_macro_overrides):
+ (RemoveConfigurationsTest.test_remove):
+ (test_remove_line):
+ (RebaseliningTest.test_remove):
+ (TestExpectationSerializationTests.test_serialize_parsed_expectations):
+ * Scripts/webkitpy/layout_tests/models/test_failures.py:
+ (determine_result_type):
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ (test_test_expectations):
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (MainTest.test_missing_and_unexpected_results):
+ (MainTest.test_retrying_and_flaky_tests):
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+ (TestExpectationsTestCase.test_valid_expectations):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (PrintExpectationsTest.test_basic):
+ (PrintExpectationsTest.test_multiple):
+ (PrintExpectationsTest.test_full):
+ (PrintExpectationsTest.test_exclude):
+ (PrintExpectationsTest.test_csv):
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+ (test_rebaseline_does_not_include_overrides):
+ (test_overrides_are_included_correctly):
+
+2012-09-19 Dominic Mazzoni <dmazzoni@google.com>
+
+ AX: A few control types are returning the wrong answer for isReadOnly
+ https://bugs.webkit.org/show_bug.cgi?id=96735
+
+ Reviewed by Chris Fleizach.
+
+ Exposing isReadOnly in an AccessibilityObject to DumpRenderTree.
+
+ * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
+ (AccessibilityUIElement::AccessibilityUIElement):
+ (AccessibilityUIElement::isReadOnlyGetterCallback):
+ * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h:
+ (AccessibilityUIElement):
+
+2012-09-19 Sudarsana Nagineni <sudarsana.nagineni@intel.com>
+
+ [WTR] Memory leaks in TestRunner::deliverWebIntent()
+ https://bugs.webkit.org/show_bug.cgi?id=97111
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix memory leaks in deliverWebIntent() by adopting strings
+ created with WKStringCreateWithUTF8CString().
+
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::deliverWebIntent):
+
+2012-09-19 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Fix incremental builds with all-in-one-files and gccdepends
+
+ Reviewed by Tor Arne Vestbø.
+
+ Pass -MP to gcc when we use the gcc depends feature, to ensure that implicit rules
+ are not only created for header files but also for .cpp files. AllInOne.cpp files
+ include other .cpp files, and when those are removed we need those dummy rules to
+ avoid a "No rule to make Foo.cpp required by AllInOne.o" error.
+
+ * qmake/config.tests/gccdepends/empty.cpp:
+ (main):
+ * qmake/config.tests/gccdepends/gccdepends.pro:
+ * qmake/mkspecs/features/default_pre.prf:
+
+2012-09-19 Rick Byers <rbyers@chromium.org>
+
+ Do touch adjustment on GestureTapDown
+ https://bugs.webkit.org/show_bug.cgi?id=96677
+
+ Reviewed by Antonio Gomes.
+
+ Allow radius to be set for GestureTapDown events.
+ * DumpRenderTree/chromium/TestRunner/EventSender.cpp:
+ (EventSender::gestureEvent):
+
+2012-09-19 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] EFL's DRT does not support overriding 'WebKitCSSRegionsEnabled' preference
+ https://bugs.webkit.org/show_bug.cgi?id=97100
+
+ Reviewed by Gyuyoung Kim.
+
+ EFL's DRT now supports overriding the 'WebKitCSSRegionsEnabled'
+ preference, in order to match WebKitTestRunner functionality.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+ * DumpRenderTree/efl/TestRunnerEfl.cpp:
+ (TestRunner::overridePreference):
+
+2012-09-18 Kangil Han <kangil.han@samsung.com>
+
+ [WK2][WTR] CodeGeneratorTestRunner could keep original copyright.
+ https://bugs.webkit.org/show_bug.cgi?id=96181
+
+ Reviewed by Daniel Bates.
+
+ This patch enabled derived files, in DerivedSources/InjectedBundle, to keep original copyright.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ (new):
+ (_parseLicenseBlock):
+ (_parseLicenseBlockFromFile):
+ (_defaultLicenseBlock):
+ (_licenseBlock):
+ (_generateHeaderFile):
+ (_generateImplementationFile):
+
+2012-09-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Title string should be changed when document.title is set to ''.
+ https://bugs.webkit.org/show_bug.cgi?id=96793
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change dump format of dumpTitleChanges more understandable.
+ Uses single quotation marks for the title string.
+
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ (BlackBerry::WebKit::DumpRenderTree::didReceiveTitleForFrame):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didReceiveTitle):
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::onFrameTitleChanged):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewTitleChanged):
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::titleChanged):
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didReceiveTitle):
+ * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
+ (LayoutWebViewEventHandler::OnReceivedTitleEvent):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+
+2012-09-18 Szilard Ledan <szledan@inf.u-szeged.hu>
+
+ EWS shouldn't sleep if there are new patches in its queue
+ https://bugs.webkit.org/show_bug.cgi?id=83038
+
+ Reviewed by Eric Seidel.
+
+ EWS tries to process a security patch. Of course it can't, because the EWS isn't
+ the member of the security group. But the problem is that after it can't process
+ the attachment, it says that queue is empty (but it isn't!) and it sleeps 2 minutes
+ and push the security patch to the end of the queue.
+ Now it stays in the loop until it finds a patch or the queue gets empty.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ (AbstractPatchQueue._next_patch):
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ (AbstractPatchQueueTest.test_next_patch):
+
+2012-09-18 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [WK2][WTR] InjectedBundle::booleanForKey() should handle literals effectively
+ https://bugs.webkit.org/show_bug.cgi?id=97014
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ According to http://trac.webkit.org/wiki/EfficientStrings WTF::StringBuilder::appendLiteral() shall
+ be used for literals rather than WTF::StringBuilder::append().
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::booleanForKey):
+
+2012-09-18 Simon Hausmann <simon.hausmann@digia.com>
+
+ Update my e-mail address.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-09-18 Andras Becsi <andras.becsi@digia.com>
+
+ Update my e-mail address.
+
+ Unreviewed.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-09-18 Andras Becsi <andras.becsi@digia.com>
+
+ [Qt] qt_webkit.pri should not be listed in Tools.pro
+
+ Reviewed and rubber-stamped by Simon Hausmann and Tor Arne Vestbø.
+
+ Since r128751 the module pri file is auto-generated
+ but it was still listed in OTHER_FILES.
+
+ * Tools.pro: Remove unneeded line.
+
2012-09-18 Simon Hausmann <simon.hausmann@digia.com>
[Qt] Fix build with some versions of the gold linker
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
index 78414a25a..cc930e166 100644
--- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
@@ -637,7 +637,7 @@ void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame
printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data());
if (gTestRunner->dumpTitleChanges())
- printf("TITLE CHANGED: %s\n", title.utf8().data());
+ printf("TITLE CHANGED: '%s'\n", title.utf8().data());
}
// ChromeClient delegates.
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
index 08002094c..c0278cd57 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
@@ -348,6 +348,7 @@ AccessibilityUIElement::AccessibilityUIElement(const WebAccessibilityObject& obj
bindProperty("isCollapsed", &AccessibilityUIElement::isCollapsedGetterCallback);
bindProperty("hasPopup", &AccessibilityUIElement::hasPopupGetterCallback);
bindProperty("isValid", &AccessibilityUIElement::isValidGetterCallback);
+ bindProperty("isReadOnly", &AccessibilityUIElement::isReadOnlyGetterCallback);
bindProperty("orientation", &AccessibilityUIElement::orientationGetterCallback);
//
@@ -584,6 +585,11 @@ void AccessibilityUIElement::isValidGetterCallback(CppVariant* result)
result->set(!accessibilityObject().isDetached());
}
+void AccessibilityUIElement::isReadOnlyGetterCallback(CppVariant* result)
+{
+ result->set(accessibilityObject().isReadOnly());
+}
+
void AccessibilityUIElement::orientationGetterCallback(CppVariant* result)
{
result->set(getOrientation(accessibilityObject()));
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h
index 0710b4d80..d9e73e57e 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h
@@ -90,6 +90,7 @@ private:
void isCollapsedGetterCallback(CppVariant*);
void hasPopupGetterCallback(CppVariant*);
void isValidGetterCallback(CppVariant*);
+ void isReadOnlyGetterCallback(CppVariant*);
void orientationGetterCallback(CppVariant*);
// Bound methods.
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
index 236012865..23b65d071 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
@@ -1188,6 +1188,10 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList&
case WebInputEvent::GestureTapDown:
event.x = point.x;
event.y = point.y;
+ if (arguments.size() >= 4) {
+ event.data.tapDown.width = static_cast<float>(arguments[2].toDouble());
+ event.data.tapDown.height = static_cast<float>(arguments[3].toDouble());
+ }
break;
case WebInputEvent::GestureTapCancel:
event.x = point.x;
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index 87a913fc6..87faaf248 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -1192,7 +1192,7 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe
}
if (testRunner()->shouldDumpTitleChanges())
- printf("TITLE CHANGED: %s\n", title8.data());
+ printf("TITLE CHANGED: '%s'\n", title8.data());
setPageTitle(title);
testRunner()->setTitleTextDirection(direction);
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
index 6e23dd301..09d7d4033 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -292,6 +292,8 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
ewk_history_clear(ewk_view_history_get(mainView()));
+ ewk_frame_feed_focus_in(mainFrame());
+
ewk_cookies_clear();
ewk_cookies_policy_set(EWK_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY);
@@ -311,6 +313,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
DumpRenderTreeSupportEfl::setLoadsSiteIconsIgnoringImageLoadingSetting(mainView(), false);
DumpRenderTreeSupportEfl::setSerializeHTTPLoads(false);
DumpRenderTreeSupportEfl::setMinimumLogicalFontSize(mainView(), 9);
+ DumpRenderTreeSupportEfl::setCSSRegionsEnabled(mainView(), true);
// Reset capacities for the memory cache for dead objects.
static const unsigned cacheTotalCapacity = 8192 * 1024;
@@ -513,7 +516,7 @@ void DumpRenderTreeChrome::onFrameTitleChanged(void*, Evas_Object* frame, void*
}
if (!done && gTestRunner->dumpTitleChanges())
- printf("TITLE CHANGED: %s\n", (titleText && titleText->string) ? titleText->string : "");
+ printf("TITLE CHANGED: '%s'\n", (titleText && titleText->string) ? titleText->string : "");
if (!done && gTestRunner->dumpHistoryDelegateCallbacks())
printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", ewk_frame_uri_get(frame)
diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
index e43e7e075..2e380c569 100644
--- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
+++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
@@ -707,6 +707,8 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
DumpRenderTreeSupportEfl::setLoadsSiteIconsIgnoringImageLoadingSetting(browser->mainView(), toBool(value));
else if (equals(key, "WebKitCSSGridLayoutEnabled"))
DumpRenderTreeSupportEfl::setCSSGridLayoutEnabled(browser->mainView(), toBool(value));
+ else if (equals(key, "WebKitCSSRegionsEnabled"))
+ DumpRenderTreeSupportEfl::setCSSRegionsEnabled(browser->mainView(), toBool(value));
else if (equals(key, "WebKitWebAudioEnabled"))
ewk_view_setting_web_audio_set(browser->mainView(), toBool(value));
else
diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
index eecade97c..ad27436c2 100644
--- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -944,7 +944,7 @@ static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame,
static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data)
{
if (gTestRunner->dumpTitleChanges() && !done)
- printf("TITLE CHANGED: %s\n", title ? title : "");
+ printf("TITLE CHANGED: '%s'\n", title ? title : "");
}
static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKitWebFrame* frame,
diff --git a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
index 88cc7c920..274ea96b5 100644
--- a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
+++ b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
@@ -344,7 +344,7 @@
}
if (gTestRunner->dumpTitleChanges())
- printf("TITLE CHANGED: %s\n", [title UTF8String]);
+ printf("TITLE CHANGED: '%s'\n", [title UTF8String]);
}
- (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index be984e3eb..abe08aa26 100755
--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -1002,7 +1002,7 @@ void DumpRenderTree::dump()
void DumpRenderTree::titleChanged(const QString &s)
{
if (m_controller->shouldDumpTitleChanges())
- printf("TITLE CHANGED: %s\n", s.toUtf8().data());
+ printf("TITLE CHANGED: '%s'\n", s.toUtf8().data());
}
void DumpRenderTree::connectFrame(QWebFrame *frame)
diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.cpp b/Tools/DumpRenderTree/qt/EventSenderQt.cpp
index 58a75a728..f0c64c369 100644
--- a/Tools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/Tools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "EventSenderQt.h"
+#include <QGestureEvent>
#include <QGraphicsSceneMouseEvent>
#include <QtTest/QtTest>
#include <qpa/qwindowsysteminterface.h>
@@ -59,6 +60,9 @@ static unsigned startOfQueue;
EventSender::EventSender(QWebPage* parent)
: QObject(parent)
+#ifndef QT_NO_GESTURES
+ , m_tapGesture(parent)
+#endif
{
m_page = parent;
m_mouseButtonPressed = false;
@@ -531,6 +535,17 @@ void EventSender::sendTouchEvent(QEvent::Type type)
}
}
+#ifndef QT_NO_GESTURES
+void EventSender::gestureTap(int x, int y)
+{
+ m_tapGesture.setPosition(QPointF(x, y));
+ m_gestures.clear();
+ m_gestures.append(&m_tapGesture);
+ QGestureEvent event(m_gestures);
+ sendEvent(m_page, &event);
+}
+#endif
+
void EventSender::zoomPageIn()
{
if (QWebFrame* frame = m_page->mainFrame())
diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h
index 1c4db0208..8a4d9362a 100644
--- a/Tools/DumpRenderTree/qt/EventSenderQt.h
+++ b/Tools/DumpRenderTree/qt/EventSenderQt.h
@@ -36,6 +36,7 @@
#include <QBasicTimer>
#include <QEvent>
#include <QEventLoop>
+#include <QGesture>
#include <QMouseEvent>
#include <QObject>
#include <QPoint>
@@ -83,6 +84,9 @@ public Q_SLOTS:
void clearTouchPoints();
void releaseTouchPoint(int index);
void cancelTouchPoint(int index);
+#ifndef QT_NO_GESTURES
+ void gestureTap(int x, int y);
+#endif
protected:
void timerEvent(QTimerEvent*);
@@ -112,6 +116,10 @@ private:
QBasicTimer m_clickTimer;
QList<QTouchEvent::TouchPoint> m_touchPoints;
Qt::KeyboardModifiers m_touchModifiers;
+#ifndef QT_NO_GESTURES
+ QTapGesture m_tapGesture;
+ QList<QGesture*> m_gestures;
+#endif
bool m_touchActive;
};
#endif // EventSenderQt_h
diff --git a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
index 28d1317a6..0ea40fa17 100644
--- a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
+++ b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
@@ -180,7 +180,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle(
printf("%s - didReceiveTitle: %S\n", descriptionSuitableForTestResult(frame).c_str(), title);
if (::gTestRunner->dumpTitleChanges() && !done)
- printf("TITLE CHANGED: %S\n", title ? title : L"");
+ printf("TITLE CHANGED: '%S'\n", title ? title : L"");
return S_OK;
}
diff --git a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
index 0f8788504..538ff249d 100644
--- a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
+++ b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
@@ -129,7 +129,7 @@ public:
void OnReceivedTitleEvent(WebViewReceivedTitleEvent& event)
{
if (gTestRunner->dumpTitleChanges() && !done)
- wxFprintf(stdout, "TITLE CHANGED: %S\n", event.GetTitle());
+ wxFprintf(stdout, "TITLE CHANGED: '%S'\n", event.GetTitle());
}
void OnWindowObjectClearedEvent(WebViewWindowObjectClearedEvent& event)
diff --git a/Tools/Scripts/convert-test-expectations b/Tools/Scripts/convert-test-expectations
new file mode 100755
index 000000000..7ee5aa173
--- /dev/null
+++ b/Tools/Scripts/convert-test-expectations
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+
+# FIXME: Delete this file after all of the TestExpectations are converted.
+
+import sys
+
+from webkitpy.common.host import Host
+from webkitpy.layout_tests.models.test_expectations import TestExpectationParser
+
+host = Host()
+port = host.port_factory.get(sys.argv[1])
+filename = sys.argv[2]
+contents = host.filesystem.read_text_file(filename)
+
+parser = TestExpectationParser(port, [], False)
+expectation_lines = parser.parse(filename, contents)
+for line in expectation_lines:
+ new_line = line.to_string(parser._test_configuration_converter)
+ print new_line
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index 1030de694..fcfbf32ca 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -137,6 +137,7 @@ contributors_who_are_not_committers = [
Contributor("Hao Zheng", "zhenghao@chromium.org"),
Contributor("Ian Hickson", "ian@hixie.ch", "hixie"),
Contributor("Janos Badics", "jbadics@inf.u-szeged.hu", 'dicska'),
+ Contributor("Jonathan Backer", "backer@chromium.org", 'backer'),
Contributor("Jeff Timanus", ["twiz@chromium.org", "twiz@google.com"], "twiz"),
Contributor("Jing Zhao", "jingzhao@chromium.org"),
Contributor("John Bates", ["jbates@google.com", "jbates@chromium.org"], "jbates"),
@@ -198,7 +199,7 @@ committers_unable_to_review = [
Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"], "proton"),
Committer("Andrew Scherkus", "scherkus@chromium.org", "scherkus"),
Committer("Andrey Kosyakov", "caseq@chromium.org", "caseq"),
- Committer("Andras Becsi", ["abecsi@webkit.org", "andras.becsi@nokia.com"], "bbandix"),
+ Committer("Andras Becsi", ["abecsi@webkit.org", "andras.becsi@digia.com"], "bbandix"),
Committer("Andy Wingo", "wingo@igalia.com", "wingo"),
Committer("Anna Cavender", "annacc@chromium.org", "annacc"),
Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
@@ -517,7 +518,7 @@ reviewers_list = [
Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"], "weinig"),
Reviewer("Shinichiro Hamaji", "hamaji@chromium.org", "hamaji"),
Reviewer("Simon Fraser", "simon.fraser@apple.com", "smfr"),
- Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"], "tronical"),
+ Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@digia.com"], "tronical"),
Reviewer("Stephanie Lewis", "slewis@apple.com", "sundiamonde"),
Reviewer("Stephen White", "senorblanco@chromium.org", "senorblanco"),
Reviewer("Steve Block", "steveblock@google.com", "steveblock"),
diff --git a/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py b/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py
index d30ad55aa..42ce56a17 100644
--- a/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py
+++ b/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py
@@ -100,8 +100,13 @@ class JSONTestResult(object):
# FIXME: There doesn't seem to be a full list of all possible values of
# 'actual' anywhere. However JSONLayoutResultsGenerator.FAILURE_TO_CHAR
# is a useful reference as that's for "old" style results.json files
+ #
+ # FIXME: TEXT, IMAGE_PLUS_TEXT, and AUDIO are obsolete but we keep them for
+ # now so that we can parse old results.json files.
if actual == test_expectations.PASS:
return []
+ elif actual == test_expectations.FAIL:
+ return [test_failures.FailureTextMismatch(), test_failures.FailureImageHashMismatch(), test_failures.FailureAudioMismatch()]
elif actual == test_expectations.TEXT:
return [test_failures.FailureTextMismatch()]
elif actual == test_expectations.IMAGE:
diff --git a/Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py b/Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py
index 1a2cba511..867379f92 100644
--- a/Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py
+++ b/Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py
@@ -35,33 +35,30 @@ from webkitpy.layout_tests.models import test_failures
class ResultsJSONParserTest(unittest.TestCase):
# The real files have no whitespace, but newlines make this much more readable.
+
_example_full_results_json = """ADD_RESULTS({
"tests": {
"fast": {
"dom": {
"prototype-inheritance.html": {
"expected": "PASS",
- "actual": "TEXT"
+ "actual": "FAIL"
},
"prototype-banana.html": {
- "expected": "TEXT",
+ "expected": "FAIL",
"actual": "PASS"
},
"prototype-taco.html": {
"expected": "PASS",
- "actual": "PASS TEXT"
+ "actual": "PASS FAIL"
},
"prototype-chocolate.html": {
- "expected": "TEXT",
- "actual": "TEXT"
+ "expected": "FAIL",
+ "actual": "FAIL"
},
"prototype-strawberry.html": {
"expected": "PASS",
- "actual": "TEXT PASS"
- },
- "prototype-peach.html": {
- "expected": "IMAGE+TEXT",
- "actual": "TEXT"
+ "actual": "FAIL PASS"
}
}
},
@@ -90,7 +87,7 @@ class ResultsJSONParserTest(unittest.TestCase):
def test_basic(self):
expected_results = [
test_results.TestResult("svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html", [test_failures.FailureImageHashMismatch()], 0),
- test_results.TestResult("fast/dom/prototype-inheritance.html", [test_failures.FailureTextMismatch()], 0),
+ test_results.TestResult("fast/dom/prototype-inheritance.html", [test_failures.FailureTextMismatch(), test_failures.FailureImageHashMismatch(), test_failures.FailureAudioMismatch()], 0),
]
results = ResultsJSONParser.parse_results_json(self._example_full_results_json)
self.assertEqual(expected_results, results)
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
index ce511813d..1b8613f76 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
@@ -192,5 +192,5 @@ class ResultSummaryTest(unittest.TestCase):
port = host.port_factory.get('test')
port._options.builder_name = 'dummy builder'
port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), "failures/expected/wontfix.html"), "Dummy test contents")
- expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False, extra_tests=['failures/expected/wontfix.html'], extra_expectations='BUGX WONTFIX : failures/expected/wontfix.html = TEXT\n')
+ expected_results, unexpected_results = self.summarized_results(port, expected=False, passing=False, flaky=False, extra_tests=['failures/expected/wontfix.html'], extra_expectations='BUGX WONTFIX : failures/expected/wontfix.html = FAIL\n')
self.assertTrue(expected_results['tests']['failures']['expected']['wontfix.html']['wontfix'])
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index af36b2733..aa5cdc60f 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -40,15 +40,15 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
# Additional JSON fields.
WONTFIX = "wontfixCounts"
+ # Note that there used to be an "A" for audio failures and a "Z" for IMAGE+TEXT failures.
+
FAILURE_TO_CHAR = {test_expectations.PASS: json_results_generator.JSONResultsGeneratorBase.PASS_RESULT,
test_expectations.SKIP: json_results_generator.JSONResultsGeneratorBase.SKIP_RESULT,
test_expectations.CRASH: "C",
test_expectations.TIMEOUT: "T",
+ test_expectations.FAIL: "F",
test_expectations.IMAGE: "I",
- test_expectations.TEXT: "F",
- test_expectations.MISSING: "O",
- test_expectations.AUDIO: "A",
- test_expectations.IMAGE_PLUS_TEXT: "Z"}
+ test_expectations.MISSING: "O"}
def __init__(self, port, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
index 156c68d94..d4b9f9694 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
@@ -40,6 +40,10 @@ _log = logging.getLogger(__name__)
# Test expectation and modifier constants.
+# TEXT, IMAGE_PLUS_TEXT, and AUDIO are no longer used in new test runs but
+# we keep them around for now so we can parse old results.json entries and to
+# avoid changing the numbering for the constants.
+#
# FIXME: range() starts with 0 which makes if expectation checks harder
# as PASS is 0.
(PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, AUDIO, TIMEOUT, CRASH, SKIP, WONTFIX,
@@ -205,10 +209,15 @@ class TestExpectationParser(object):
if expectation_line.path in self._full_test_list:
expectation_line.matching_tests.append(expectation_line.path)
+ # FIXME: Seems like these should be classmethods on TestExpectationLine instead of TestExpectationParser.
@classmethod
def _tokenize_line(cls, filename, expectation_string, line_number):
- # FIXME: Add in support for the new format as well.
- return cls._tokenize_line_using_old_format(filename, expectation_string, line_number)
+ expectation_line = cls._tokenize_line_using_new_format(filename, expectation_string, line_number)
+ if expectation_line.is_invalid():
+ old_expectation_line = cls._tokenize_line_using_old_format(filename, expectation_string, line_number)
+ if not old_expectation_line.is_invalid():
+ return old_expectation_line
+ return expectation_line
@classmethod
def _tokenize_line_using_old_format(cls, filename, expectation_string, line_number):
@@ -250,10 +259,152 @@ class TestExpectationParser(object):
return expectation_line
+ # FIXME: Update the original modifiers and remove this once the old syntax is gone.
+ _configuration_tokens_list = [
+ 'Mac', 'SnowLeopard', 'Lion', 'MountainLion',
+ 'Win', 'XP', 'Vista', 'Win7',
+ 'Linux',
+ 'Android',
+ 'Release',
+ 'Debug',
+ ]
+
+ _configuration_tokens = dict((token, token.upper()) for token in _configuration_tokens_list)
+ _inverted_configuration_tokens = dict((value, name) for name, value in _configuration_tokens.iteritems())
+
+ # FIXME: Update the original modifiers list and remove this once the old syntax is gone.
+ _expectation_tokens = {
+ 'Crash': 'CRASH',
+ 'Failure': 'FAIL',
+ 'ImageOnlyFailure': 'IMAGE',
+ 'Missing': 'MISSING',
+ 'Pass': 'PASS',
+ 'Rebaseline': 'REBASELINE',
+ 'Skip': 'SKIP',
+ 'Slow': 'SLOW',
+ 'Timeout': 'TIMEOUT',
+ 'WontFix': 'WONTFIX',
+ }
+
+ _inverted_expectation_tokens = dict((value, name) for name, value in _expectation_tokens.iteritems())
+
@classmethod
def _tokenize_line_using_new_format(cls, filename, expectation_string, line_number):
- # FIXME: implement :).
- raise NotImplementedError
+ """Tokenizes a line from TestExpectations and returns an unparsed TestExpectationLine instance using the old format.
+
+ The new format for a test expectation line is:
+
+ [[bugs] [ "[" <configuration modifiers> "]" <name> [ "[" <expectations> "]" ["#" <comment>]
+
+ Any errant whitespace is not preserved.
+
+ """
+ expectation_line = TestExpectationLine()
+ expectation_line.original_string = expectation_string
+ expectation_line.filename = filename
+ expectation_line.line_number = line_number
+
+ comment_index = expectation_string.find("#")
+ if comment_index == -1:
+ comment_index = len(expectation_string)
+ else:
+ expectation_line.comment = expectation_string[comment_index + 1:]
+
+ remaining_string = re.sub(r"\s+", " ", expectation_string[:comment_index].strip())
+ if len(remaining_string) == 0:
+ return expectation_line
+
+ # special-case parsing this so that we fail immediately instead of treating this as a test name
+ if remaining_string.startswith('//'):
+ expectation_line.warnings = ['use "#" instead of "//" for comments']
+ return expectation_line
+
+ bugs = []
+ modifiers = []
+ name = None
+ expectations = []
+ warnings = []
+
+ WEBKIT_BUG_PREFIX = 'webkit.org/b/'
+ CHROMIUM_BUG_PREFIX = 'crbug.com/'
+ V8_BUG_PREFIX = 'code.google.com/p/v8/issues/detail?id='
+
+ tokens = remaining_string.split()
+ state = 'start'
+ for token in tokens:
+ if (token.startswith(WEBKIT_BUG_PREFIX) or
+ token.startswith(CHROMIUM_BUG_PREFIX) or
+ token.startswith(V8_BUG_PREFIX) or
+ token.startswith('Bug(')):
+ if state != 'start':
+ warnings.append('"%s" is not at the start of the line.' % token)
+ break
+ if token.startswith(WEBKIT_BUG_PREFIX):
+ bugs.append(token.replace(WEBKIT_BUG_PREFIX, 'BUGWK'))
+ elif token.startswith(CHROMIUM_BUG_PREFIX):
+ bugs.append(token.replace(CHROMIUM_BUG_PREFIX, 'BUGCR'))
+ elif token.startswith(V8_BUG_PREFIX):
+ bugs.append(token.replace(V8_BUG_PREFIX, 'BUGV8_'))
+ else:
+ match = re.match('Bug\((\w+)\)$', token)
+ if not match:
+ warnings.append('unrecognized bug identifier "%s"' % token)
+ break
+ else:
+ bugs.append('BUG' + match.group(1).upper())
+ elif token.startswith('BUG'):
+ warnings.append('unrecognized old-style bug identifier "%s"' % token)
+ break
+ elif token == '[':
+ if state == 'start':
+ state = 'configuration'
+ elif state == 'name_found':
+ state = 'expectations'
+ else:
+ warnings.append('unexpected "["')
+ break
+ elif token == ']':
+ if state == 'configuration':
+ state = 'name'
+ elif state == 'expectations':
+ state = 'done'
+ else:
+ warnings.append('unexpected "]"')
+ break
+ elif token in ('//', ':', '='):
+ warnings.append('"%s" is not legal in the new TestExpectations syntax.' % token)
+ break
+ elif state == 'configuration':
+ modifiers.append(cls._configuration_tokens.get(token, token))
+ elif state == 'expectations':
+ if token in ('Rebaseline', 'Skip', 'Slow', 'WontFix'):
+ modifiers.append(token.upper())
+ else:
+ expectations.append(cls._expectation_tokens.get(token, token))
+ elif state == 'name_found':
+ warnings.append('expecting "[", "#", or end of line instead of "%s"' % token)
+ break
+ else:
+ name = token
+ state = 'name_found'
+
+ if not warnings:
+ if not name:
+ warnings.append('Did not find a test name.')
+ elif state not in ('name_found', 'done'):
+ warnings.append('Missing a "]"')
+
+ if not expectations:
+ if 'SKIP' not in modifiers and 'REBASELINE' not in modifiers and 'SLOW' not in modifiers:
+ modifiers.append('SKIP')
+ expectations = ['PASS']
+
+ # FIXME: expectation line should just store bugs and modifiers separately.
+ expectation_line.modifiers = bugs + modifiers
+ expectation_line.expectations = expectations
+ expectation_line.name = name
+ expectation_line.warnings = warnings
+ return expectation_line
@classmethod
def _split_space_separated(cls, space_separated_string):
@@ -304,18 +455,19 @@ class TestExpectationLine(object):
return self.original_string or ''
if self.name is None:
- return '' if self.comment is None else "//%s" % self.comment
+ return '' if self.comment is None else "#%s" % self.comment
if test_configuration_converter and self.parsed_bug_modifiers:
specifiers_list = test_configuration_converter.to_specifiers_list(self.matching_configurations)
result = []
for specifiers in specifiers_list:
- modifiers = self._serialize_parsed_modifiers(test_configuration_converter, specifiers)
- expectations = self._serialize_parsed_expectations(parsed_expectation_to_string)
+ # FIXME: this is silly that we join the modifiers and then immediately split them.
+ modifiers = self._serialize_parsed_modifiers(test_configuration_converter, specifiers).split()
+ expectations = self._serialize_parsed_expectations(parsed_expectation_to_string).split()
result.append(self._format_line(modifiers, self.name, expectations, self.comment))
return "\n".join(result) if result else None
- return self._format_line(" ".join(self.modifiers), self.name, " ".join(self.expectations), self.comment,
+ return self._format_line(self.modifiers, self.name, self.expectations, self.comment,
include_modifiers, include_expectations, include_comment)
def to_csv(self):
@@ -339,14 +491,38 @@ class TestExpectationLine(object):
@staticmethod
def _format_line(modifiers, name, expectations, comment, include_modifiers=True, include_expectations=True, include_comment=True):
+ bugs = []
+ new_modifiers = []
+ new_expectations = []
+ for modifier in modifiers:
+ modifier = modifier.upper()
+ if modifier.startswith('BUGWK'):
+ bugs.append('webkit.org/b/' + modifier.replace('BUGWK', ''))
+ elif modifier.startswith('BUGCR'):
+ bugs.append('crbug.com/' + modifier.replace('BUGCR', ''))
+ elif modifier.startswith('BUG'):
+ # FIXME: we should preserve case once we can drop the old syntax.
+ bugs.append('Bug(' + modifier[3:].lower() + ')')
+ elif modifier in ('SLOW', 'SKIP', 'REBASELINE', 'WONTFIX'):
+ new_expectations.append(TestExpectationParser._inverted_expectation_tokens.get(modifier))
+ else:
+ new_modifiers.append(TestExpectationParser._inverted_configuration_tokens.get(modifier, modifier))
+
+ for expectation in expectations:
+ expectation = expectation.upper()
+ new_expectations.append(TestExpectationParser._inverted_expectation_tokens.get(expectation, expectation))
+
result = ''
- if include_modifiers:
- result += '%s : ' % modifiers.upper()
+ if include_modifiers and (bugs or new_modifiers):
+ if bugs:
+ result += ' '.join(bugs) + ' '
+ if new_modifiers:
+ result += '[ %s ] ' % ' '.join(new_modifiers)
result += name
- if include_expectations:
- result += ' = %s' % expectations.upper()
+ if include_expectations and new_expectations and set(new_expectations) != set(['Skip', 'Pass']):
+ result += ' [ %s ]' % ' '.join(sorted(set(new_expectations)))
if include_comment and comment is not None:
- result += " //%s" % comment
+ result += " #%s" % comment
return result
@@ -590,35 +766,33 @@ class TestExpectations(object):
in which case the expectations apply to all test cases in that
directory and any subdirectory. The format is along the lines of:
- LayoutTests/fast/js/fixme.js = TEXT
- LayoutTests/fast/js/flaky.js = TEXT PASS
- LayoutTests/fast/js/crash.js = CRASH TIMEOUT TEXT PASS
+ LayoutTests/fast/js/fixme.js [ Failure ]
+ LayoutTests/fast/js/flaky.js [ Failure Pass ]
+ LayoutTests/fast/js/crash.js [ Crash Failure Pass Timeout ]
...
To add modifiers:
- SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- DEBUG : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- LINUX DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
+ LayoutTests/fast/js/no-good.js
+ [ Debug ] LayoutTests/fast/js/no-good.js [ Pass Timeout ]
+ [ Debug ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ]
+ [ Linux Debug ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ]
+ [ Linux Win ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ]
- SKIP: Doesn't run the test.
- SLOW: The test takes a long time to run, but does not timeout indefinitely.
- WONTFIX: For tests that we never intend to pass on a given platform.
+ Skip: Doesn't run the test.
+ Slow: The test takes a long time to run, but does not timeout indefinitely.
+ WontFix: For tests that we never intend to pass on a given platform (treated like Skip).
Notes:
-A test cannot be both SLOW and TIMEOUT
- -A test should only be one of IMAGE, TEXT, IMAGE+TEXT, or AUDIO.
-A test can be included twice, but not via the same path.
-If a test is included twice, then the more precise path wins.
-CRASH tests cannot be WONTFIX
"""
+ # FIXME: Update to new syntax once the old format is no longer supported.
EXPECTATIONS = {'pass': PASS,
- 'text': TEXT,
+ 'fail': FAIL,
'image': IMAGE,
- 'image+text': IMAGE_PLUS_TEXT,
- 'audio': AUDIO,
'timeout': TIMEOUT,
'crash': CRASH,
'missing': MISSING}
@@ -626,15 +800,13 @@ class TestExpectations(object):
# (aggregated by category, pass/fail/skip, type)
EXPECTATION_DESCRIPTIONS = {SKIP: ('skipped', 'skipped', ''),
PASS: ('passes', 'passed', ''),
- TEXT: ('text failures', 'failed', ' (text diff)'),
+ FAIL: ('failures', 'failed', ''),
IMAGE: ('image-only failures', 'failed', ' (image diff)'),
- IMAGE_PLUS_TEXT: ('both image and text failures', 'failed', ' (both image and text diffs'),
- AUDIO: ('audio failures', 'failed', ' (audio diff)'),
CRASH: ('crashes', 'crashed', ''),
TIMEOUT: ('timeouts', 'timed out', ''),
MISSING: ('no expected results found', 'no expected result found', '')}
- EXPECTATION_ORDER = (PASS, CRASH, TIMEOUT, MISSING, IMAGE_PLUS_TEXT, TEXT, IMAGE, AUDIO, SKIP)
+ EXPECTATION_ORDER = (PASS, CRASH, TIMEOUT, MISSING, FAIL, IMAGE, SKIP)
BUILD_TYPES = ('debug', 'release')
@@ -683,23 +855,20 @@ class TestExpectations(object):
if IMAGE in expected_results:
expected_results.remove(IMAGE)
expected_results.add(PASS)
- if IMAGE_PLUS_TEXT in expected_results:
- expected_results.remove(IMAGE_PLUS_TEXT)
- expected_results.add(TEXT)
return expected_results
@staticmethod
def has_pixel_failures(actual_results):
- return IMAGE in actual_results or IMAGE_PLUS_TEXT in actual_results
+ return IMAGE in actual_results or FAIL in actual_results
@staticmethod
def suffixes_for_expectations(expectations):
suffixes = set()
- if expectations.intersection(set([TEXT, IMAGE_PLUS_TEXT])):
+ if IMAGE in expectations:
+ suffixes.add('png')
+ if FAIL in expectations:
suffixes.add('txt')
- if expectations.intersection(set([IMAGE, IMAGE_PLUS_TEXT])):
suffixes.add('png')
- if AUDIO in expectations:
suffixes.add('wav')
return set(suffixes)
@@ -735,10 +904,7 @@ class TestExpectations(object):
return self._model
def get_rebaselining_failures(self):
- return (self._model.get_test_set(REBASELINE, IMAGE) |
- self._model.get_test_set(REBASELINE, TEXT) |
- self._model.get_test_set(REBASELINE, IMAGE_PLUS_TEXT) |
- self._model.get_test_set(REBASELINE, AUDIO))
+ return self._model.get_test_set(REBASELINE, IMAGE) | self._model.get_test_set(REBASELINE, FAIL)
# FIXME: Change the callsites to use TestExpectationsModel and remove.
def get_expectations(self, test):
@@ -815,7 +981,7 @@ class TestExpectations(object):
for expectation in self._expectations:
if expectation.name != test or expectation.is_flaky() or not expectation.parsed_expectations:
continue
- if iter(expectation.parsed_expectations).next() not in (TEXT, IMAGE, IMAGE_PLUS_TEXT, AUDIO):
+ if iter(expectation.parsed_expectations).next() not in (FAIL, IMAGE):
continue
if test_configuration not in expectation.matching_configurations:
continue
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
index 210daff06..8827cd76d 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
@@ -43,14 +43,6 @@ except ImportError:
from webkitpy.thirdparty.ordered_dict import OrderedDict
-class MockBugManager(object):
- def close_bug(self, bug_id, reference_bug_id=None):
- pass
-
- def create_bug(self):
- return "BUG_NEWLY_CREATED"
-
-
class Base(unittest.TestCase):
# Note that all of these tests are written assuming the configuration
# being tested is Windows XP, Release build.
@@ -75,7 +67,7 @@ class Base(unittest.TestCase):
def get_basic_expectations(self):
return """
-BUG_TEST : failures/expected/text.html = TEXT
+BUG_TEST : failures/expected/text.html = FAIL
BUG_TEST WONTFIX SKIP : failures/expected/crash.html = CRASH
BUG_TEST REBASELINE : failures/expected/missing_image.html = MISSING
BUG_TEST WONTFIX : failures/expected/image_checksum.html = IMAGE
@@ -97,10 +89,27 @@ BUG_TEST WONTFIX MAC : failures/expected/image.html = IMAGE
def assert_bad_expectations(self, expectations, overrides=None):
self.assertRaises(ParseError, self.parse_exp, expectations, is_lint_mode=True, overrides=overrides)
+
+class BasicTests(Base):
+ def test_basic(self):
+ self.parse_exp(self.get_basic_expectations())
+ self.assert_exp('failures/expected/text.html', FAIL)
+ self.assert_exp('failures/expected/image_checksum.html', IMAGE)
+ self.assert_exp('passes/text.html', PASS)
+ self.assert_exp('failures/expected/image.html', PASS)
+
+
+class MiscTests(Base):
+ def test_multiple_results(self):
+ self.parse_exp('BUGX : failures/expected/text.html = FAIL CRASH')
+ self.assertEqual(self._exp.get_expectations(
+ self.get_test('failures/expected/text.html')),
+ set([FAIL, CRASH]))
+
def test_result_was_expected(self):
# test basics
self.assertEquals(TestExpectations.result_was_expected(PASS, set([PASS]), test_needs_rebaselining=False, test_is_skipped=False), True)
- self.assertEquals(TestExpectations.result_was_expected(TEXT, set([PASS]), test_needs_rebaselining=False, test_is_skipped=False), False)
+ self.assertEquals(TestExpectations.result_was_expected(FAIL, set([PASS]), test_needs_rebaselining=False, test_is_skipped=False), False)
# test handling of SKIPped tests and results
self.assertEquals(TestExpectations.result_was_expected(SKIP, set([CRASH]), test_needs_rebaselining=False, test_is_skipped=True), True)
@@ -111,37 +120,18 @@ BUG_TEST WONTFIX MAC : failures/expected/image.html = IMAGE
self.assertEquals(TestExpectations.result_was_expected(MISSING, set([PASS]), test_needs_rebaselining=False, test_is_skipped=False), False)
def test_remove_pixel_failures(self):
- self.assertEquals(TestExpectations.remove_pixel_failures(set([TEXT])), set([TEXT]))
+ self.assertEquals(TestExpectations.remove_pixel_failures(set([FAIL])), set([FAIL]))
self.assertEquals(TestExpectations.remove_pixel_failures(set([PASS])), set([PASS]))
self.assertEquals(TestExpectations.remove_pixel_failures(set([IMAGE])), set([PASS]))
- self.assertEquals(TestExpectations.remove_pixel_failures(set([IMAGE_PLUS_TEXT])), set([TEXT]))
+ self.assertEquals(TestExpectations.remove_pixel_failures(set([FAIL])), set([FAIL]))
self.assertEquals(TestExpectations.remove_pixel_failures(set([PASS, IMAGE, CRASH])), set([PASS, CRASH]))
def test_suffixes_for_expectations(self):
- self.assertEquals(TestExpectations.suffixes_for_expectations(set([TEXT])), set(['txt']))
- self.assertEquals(TestExpectations.suffixes_for_expectations(set([IMAGE_PLUS_TEXT])), set(['txt', 'png']))
+ self.assertEquals(TestExpectations.suffixes_for_expectations(set([FAIL])), set(['txt', 'png', 'wav']))
self.assertEquals(TestExpectations.suffixes_for_expectations(set([IMAGE])), set(['png']))
- self.assertEquals(TestExpectations.suffixes_for_expectations(set([AUDIO])), set(['wav']))
- self.assertEquals(TestExpectations.suffixes_for_expectations(set([TEXT, IMAGE, CRASH])), set(['txt', 'png']))
+ self.assertEquals(TestExpectations.suffixes_for_expectations(set([FAIL, IMAGE, CRASH])), set(['txt', 'png', 'wav']))
self.assertEquals(TestExpectations.suffixes_for_expectations(set()), set())
-
-class BasicTests(Base):
- def test_basic(self):
- self.parse_exp(self.get_basic_expectations())
- self.assert_exp('failures/expected/text.html', TEXT)
- self.assert_exp('failures/expected/image_checksum.html', IMAGE)
- self.assert_exp('passes/text.html', PASS)
- self.assert_exp('failures/expected/image.html', PASS)
-
-
-class MiscTests(Base):
- def test_multiple_results(self):
- self.parse_exp('BUGX : failures/expected/text.html = TEXT CRASH')
- self.assertEqual(self._exp.get_expectations(
- self.get_test('failures/expected/text.html')),
- set([TEXT, CRASH]))
-
def test_category_expectations(self):
# This test checks unknown tests are not present in the
# expectations and that known test part of a test category is
@@ -165,7 +155,7 @@ BUGX WONTFIX : failures/expected = IMAGE
self.parse_exp(self.get_basic_expectations())
self.assertEquals(self._exp.get_expectations_string(
self.get_test('failures/expected/text.html')),
- 'TEXT')
+ 'FAIL')
def test_expectation_to_string(self):
# Normal cases are handled by other tests.
@@ -191,20 +181,18 @@ BUGX WONTFIX : failures/expected = IMAGE
filesystem = self._port.host.filesystem
filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'disabled-test.html-disabled'), 'content')
self.get_test('disabled-test.html-disabled'),
- self.parse_exp("FOO : failures/expected/text.html = TEXT\n"
- "SKIP : failures/expected/image.html\n"
- "BUGRNIWA : non-existent-test.html = TEXT\n"
- "BUGRNIWA : disabled-test.html-disabled = IMAGE", is_lint_mode=True)
+ self.parse_exp("[ FOO ] failures/expected/text.html [ Failure ]\n"
+ "Bug(rniwa) non-existent-test.html [ Failure ]\n"
+ "Bug(rniwa) disabled-test.html-disabled [ ImageOnlyFailure ]", is_lint_mode=True)
self.assertFalse(True, "ParseError wasn't raised")
except ParseError, e:
warnings = ("expectations:1 Test lacks BUG modifier. failures/expected/text.html\n"
"expectations:1 Unrecognized modifier 'foo' failures/expected/text.html\n"
- "expectations:2 Missing expectations SKIP : failures/expected/image.html\n"
- "expectations:3 Path does not exist. non-existent-test.html")
+ "expectations:2 Path does not exist. non-existent-test.html")
self.assertEqual(str(e), warnings)
try:
- self.parse_exp('SKIP : failures/expected/text.html = TEXT', is_lint_mode=True)
+ self.parse_exp('SKIP : failures/expected/text.html = FAIL', is_lint_mode=True)
self.assertFalse(True, "ParseError wasn't raised")
except ParseError, e:
warnings = u'expectations:1 Test lacks BUG modifier. failures/expected/text.html'
@@ -213,28 +201,28 @@ BUGX WONTFIX : failures/expected = IMAGE
def test_error_on_different_platform(self):
# parse_exp uses a Windows port. Assert errors on Mac show up in lint mode.
self.assertRaises(ParseError, self.parse_exp,
- 'BUG_TEST MAC : failures/expected/text.html = TEXT\nBUG_TEST MAC : failures/expected/text.html = TEXT',
+ 'BUG_TEST MAC : failures/expected/text.html = FAIL\nBUG_TEST MAC : failures/expected/text.html = FAIL',
is_lint_mode=True)
def test_error_on_different_build_type(self):
# parse_exp uses a Release port. Assert errors on DEBUG show up in lint mode.
self.assertRaises(ParseError, self.parse_exp,
- 'BUG_TEST DEBUG : failures/expected/text.html = TEXT\nBUG_TEST DEBUG : failures/expected/text.html = TEXT',
+ 'BUG_TEST DEBUG : failures/expected/text.html = FAIL\nBUG_TEST DEBUG : failures/expected/text.html = FAIL',
is_lint_mode=True)
def test_overrides(self):
- self.parse_exp("BUG_EXP: failures/expected/text.html = TEXT",
+ self.parse_exp("BUG_EXP: failures/expected/text.html = FAIL",
"BUG_OVERRIDE : failures/expected/text.html = IMAGE")
self.assert_exp('failures/expected/text.html', IMAGE)
def test_overrides__directory(self):
- self.parse_exp("BUG_EXP: failures/expected/text.html = TEXT",
+ self.parse_exp("BUG_EXP: failures/expected/text.html = FAIL",
"BUG_OVERRIDE: failures/expected = CRASH")
self.assert_exp('failures/expected/text.html', CRASH)
self.assert_exp('failures/expected/image.html', CRASH)
def test_overrides__duplicate(self):
- self.assert_bad_expectations("BUG_EXP: failures/expected/text.html = TEXT",
+ self.assert_bad_expectations("BUG_EXP: failures/expected/text.html = FAIL",
"BUG_OVERRIDE : failures/expected/text.html = IMAGE\n"
"BUG_OVERRIDE : failures/expected/text.html = CRASH\n")
@@ -244,8 +232,8 @@ BUGX WONTFIX : failures/expected = IMAGE
self.get_test(test), result, pixel_tests_enabled)
self.parse_exp(self.get_basic_expectations())
- self.assertTrue(match('failures/expected/text.html', TEXT, True))
- self.assertTrue(match('failures/expected/text.html', TEXT, False))
+ self.assertTrue(match('failures/expected/text.html', FAIL, True))
+ self.assertTrue(match('failures/expected/text.html', FAIL, False))
self.assertFalse(match('failures/expected/text.html', CRASH, True))
self.assertFalse(match('failures/expected/text.html', CRASH, False))
self.assertTrue(match('failures/expected/image_checksum.html', IMAGE,
@@ -256,7 +244,7 @@ BUGX WONTFIX : failures/expected = IMAGE
self.assertTrue(match('passes/text.html', PASS, False))
def test_more_specific_override_resets_skip(self):
- self.parse_exp("BUGX SKIP : failures/expected = TEXT\n"
+ self.parse_exp("BUGX SKIP : failures/expected = FAIL\n"
"BUGX : failures/expected/text.html = IMAGE\n")
self.assert_exp('failures/expected/text.html', IMAGE)
self.assertFalse(self._port._filesystem.join(self._port.layout_tests_dir(),
@@ -288,19 +276,19 @@ class SkippedTests(Base):
self.assertRaises(ParseError, self.check, expectations='BUGX : failures/expected/text.html = text\n', overrides=None, skips=['failures/expected/text.html'], lint=True)
def test_skipped_file_overrides_expectations(self):
- self.check(expectations='BUGX : failures/expected/text.html = TEXT\n', overrides=None,
+ self.check(expectations='BUGX : failures/expected/text.html = FAIL\n', overrides=None,
skips=['failures/expected/text.html'])
def test_skipped_dir_overrides_expectations(self):
- self.check(expectations='BUGX : failures/expected/text.html = TEXT\n', overrides=None,
+ self.check(expectations='BUGX : failures/expected/text.html = FAIL\n', overrides=None,
skips=['failures/expected'])
def test_skipped_file_overrides_overrides(self):
- self.check(expectations='', overrides='BUGX : failures/expected/text.html = TEXT\n',
+ self.check(expectations='', overrides='BUGX : failures/expected/text.html = FAIL\n',
skips=['failures/expected/text.html'])
def test_skipped_dir_overrides_overrides(self):
- self.check(expectations='', overrides='BUGX : failures/expected/text.html = TEXT\n',
+ self.check(expectations='', overrides='BUGX : failures/expected/text.html = FAIL\n',
skips=['failures/expected'])
def test_skipped_entry_dont_exist(self):
@@ -316,6 +304,8 @@ class SkippedTests(Base):
self.assertEqual('The following test foo/bar/baz.html from the Skipped list doesn\'t exist\n', logs)
+# FIXME: remove these tests when we stop supporting the old syntax.
+
class ExpectationSyntaxTests(Base):
def test_missing_expectation(self):
# This is missing the expectation.
@@ -323,38 +313,161 @@ class ExpectationSyntaxTests(Base):
def test_missing_colon(self):
# This is missing the modifiers and the ':'
- self.assert_bad_expectations('failures/expected/text.html = TEXT')
+ self.assert_bad_expectations('failures/expected/text.html = FAIL')
def test_too_many_colons(self):
self.assert_bad_expectations('BUG_TEST: failures/expected/text.html = PASS :')
def test_too_many_equals_signs(self):
- self.assert_bad_expectations('BUG_TEST: failures/expected/text.html = TEXT = IMAGE')
+ self.assert_bad_expectations('BUG_TEST: failures/expected/text.html = FAIL = IMAGE')
def test_unrecognized_expectation(self):
self.assert_bad_expectations('BUG_TEST: failures/expected/text.html = UNKNOWN')
def test_macro(self):
exp_str = """
-BUG_TEST WIN : failures/expected/text.html = TEXT
+BUG_TEST WIN : failures/expected/text.html = FAIL
"""
self.parse_exp(exp_str)
- self.assert_exp('failures/expected/text.html', TEXT)
+ self.assert_exp('failures/expected/text.html', FAIL)
+
+
+class NewExpectationSyntaxTests(unittest.TestCase):
+ def assert_exp(self, line, bugs=None, modifiers=None, expectations=None, warnings=None, comment=None, name='foo.html'):
+ bugs = bugs or []
+ modifiers = modifiers or []
+ expectations = expectations or []
+ warnings = warnings or []
+ filename = 'TestExpectations'
+ line_number = 1
+ expectation_line = TestExpectationParser._tokenize_line_using_new_format(filename, line, line_number)
+ self.assertEquals(expectation_line.warnings, warnings)
+ self.assertEquals(expectation_line.name, name)
+ self.assertEquals(expectation_line.filename, filename)
+ self.assertEquals(expectation_line.line_number, line_number)
+ if not warnings:
+ self.assertEquals(expectation_line.modifiers, modifiers)
+ self.assertEquals(expectation_line.expectations, expectations)
+
+ def test_bare_name(self):
+ self.assert_exp('foo.html', modifiers=['SKIP'], expectations=['PASS'])
+
+ def test_bare_name_and_bugs(self):
+ self.assert_exp('webkit.org/b/12345 foo.html', modifiers=['BUGWK12345', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('crbug.com/12345 foo.html', modifiers=['BUGCR12345', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('Bug(dpranke) foo.html', modifiers=['BUGDPRANKE', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('crbug.com/12345 crbug.com/34567 foo.html', modifiers=['BUGCR12345', 'BUGCR34567', 'SKIP'], expectations=['PASS'])
+
+ def test_comments(self):
+ self.assert_exp("# comment", name=None, comment="# comment")
+ self.assert_exp("foo.html # comment", comment="# comment", expectations=['PASS'], modifiers=['SKIP'])
+
+ def test_config_modifiers(self):
+ self.assert_exp('[ Mac ] foo.html', modifiers=['MAC', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('[ Mac Vista ] foo.html', modifiers=['MAC', 'VISTA', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('[ Mac ] foo.html [ Failure ] ', modifiers=['MAC'], expectations=['FAIL'])
+
+ def test_unknown_config(self):
+ self.assert_exp('[ Foo ] foo.html ', modifiers=['Foo', 'SKIP'], expectations=['PASS'])
+
+ def test_unknown_expectation(self):
+ self.assert_exp('foo.html [ Audio ]', expectations=['Audio'])
+
+ def test_skip(self):
+ self.assert_exp('foo.html [ Skip ]', modifiers=['SKIP'], expectations=['PASS'])
+
+ def test_slow(self):
+ self.assert_exp('foo.html [ Slow ]', modifiers=['SLOW'], expectations=['PASS'])
+
+ def test_wontfix(self):
+ self.assert_exp('foo.html [ WontFix ]', modifiers=['WONTFIX', 'SKIP'], expectations=['PASS'])
+
+ def test_blank_line(self):
+ self.assert_exp('', name=None)
+
+ def test_warnings(self):
+ self.assert_exp('[ Mac ]', warnings=['Did not find a test name.'], name=None)
+
+ self.assert_exp('[ [', warnings=['unexpected "["'], name=None)
+ self.assert_exp('crbug.com/12345 ]', warnings=['unexpected "]"'], name=None)
+
+ self.assert_exp('foo.html crbug.com/12345 ]', warnings=['"crbug.com/12345" is not at the start of the line.'])
+
+
+class NewExpectationSyntaxTests(unittest.TestCase):
+ def assert_exp(self, line, bugs=None, modifiers=None, expectations=None, warnings=None, comment=None, name='foo.html'):
+ bugs = bugs or []
+ modifiers = modifiers or []
+ expectations = expectations or []
+ warnings = warnings or []
+ filename = 'TestExpectations'
+ line_number = 1
+ expectation_line = TestExpectationParser._tokenize_line_using_new_format(filename, line, line_number)
+ self.assertEquals(expectation_line.warnings, warnings)
+ self.assertEquals(expectation_line.name, name)
+ self.assertEquals(expectation_line.filename, filename)
+ self.assertEquals(expectation_line.line_number, line_number)
+ if not warnings:
+ self.assertEquals(expectation_line.modifiers, modifiers)
+ self.assertEquals(expectation_line.expectations, expectations)
+
+ def test_bare_name(self):
+ self.assert_exp('foo.html', modifiers=['SKIP'], expectations=['PASS'])
+
+ def test_bare_name_and_bugs(self):
+ self.assert_exp('webkit.org/b/12345 foo.html', modifiers=['BUGWK12345', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('crbug.com/12345 foo.html', modifiers=['BUGCR12345', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('Bug(dpranke) foo.html', modifiers=['BUGDPRANKE', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('crbug.com/12345 crbug.com/34567 foo.html', modifiers=['BUGCR12345', 'BUGCR34567', 'SKIP'], expectations=['PASS'])
+
+ def test_comments(self):
+ self.assert_exp("# comment", name=None, comment="# comment")
+ self.assert_exp("foo.html # comment", comment="# comment", expectations=['PASS'], modifiers=['SKIP'])
+
+ def test_config_modifiers(self):
+ self.assert_exp('[ Mac ] foo.html', modifiers=['MAC', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('[ Mac Vista ] foo.html', modifiers=['MAC', 'VISTA', 'SKIP'], expectations=['PASS'])
+ self.assert_exp('[ Mac ] foo.html [ Failure ] ', modifiers=['MAC'], expectations=['FAIL'])
+
+ def test_unknown_config(self):
+ self.assert_exp('[ Foo ] foo.html ', modifiers=['Foo', 'SKIP'], expectations=['PASS'])
+
+ def test_unknown_expectation(self):
+ self.assert_exp('foo.html [ Audio ]', expectations=['Audio'])
+
+ def test_skip(self):
+ self.assert_exp('foo.html [ Skip ]', modifiers=['SKIP'], expectations=['PASS'])
+
+ def test_slow(self):
+ self.assert_exp('foo.html [ Slow ]', modifiers=['SLOW'], expectations=['PASS'])
+
+ def test_wontfix(self):
+ self.assert_exp('foo.html [ WontFix ]', modifiers=['WONTFIX', 'SKIP'], expectations=['PASS'])
+
+ def test_blank_line(self):
+ self.assert_exp('', name=None)
+
+ def test_warnings(self):
+ self.assert_exp('[ Mac ]', warnings=['Did not find a test name.'], name=None)
+ self.assert_exp('[ [', warnings=['unexpected "["'], name=None)
+ self.assert_exp('crbug.com/12345 ]', warnings=['unexpected "]"'], name=None)
+
+ self.assert_exp('foo.html crbug.com/12345 ]', warnings=['"crbug.com/12345" is not at the start of the line.'])
class SemanticTests(Base):
def test_bug_format(self):
- self.assertRaises(ParseError, self.parse_exp, 'BUG1234 : failures/expected/text.html = TEXT', is_lint_mode=True)
+ self.assertRaises(ParseError, self.parse_exp, 'BUG1234 : failures/expected/text.html = FAIL', is_lint_mode=True)
def test_bad_bugid(self):
try:
- self.parse_exp('BUG1234 SLOW : failures/expected/text.html = TEXT', is_lint_mode=True)
+ self.parse_exp('BUG1234 SLOW : failures/expected/text.html = FAIL', is_lint_mode=True)
self.fail('should have raised an error about a bad bug identifier')
except ParseError, exp:
self.assertEquals(len(exp.warnings), 1)
def test_missing_bugid(self):
- self.parse_exp('SLOW : failures/expected/text.html = TEXT')
+ self.parse_exp('SLOW : failures/expected/text.html = FAIL')
self.assertTrue(self._exp.has_warnings())
def test_slow_and_timeout(self):
@@ -365,22 +478,22 @@ class SemanticTests(Base):
def test_rebaseline(self):
# Can't lint a file w/ 'REBASELINE' in it.
self.assertRaises(ParseError, self.parse_exp,
- 'BUG_TEST REBASELINE : failures/expected/text.html = TEXT',
+ 'BUG_TEST REBASELINE : failures/expected/text.html = FAIL',
is_lint_mode=True)
def test_duplicates(self):
self.assertRaises(ParseError, self.parse_exp, """
-BUG_EXP : failures/expected/text.html = TEXT
+BUG_EXP : failures/expected/text.html = FAIL
BUG_EXP : failures/expected/text.html = IMAGE""", is_lint_mode=True)
self.assertRaises(ParseError, self.parse_exp,
self.get_basic_expectations(), overrides="""
-BUG_OVERRIDE : failures/expected/text.html = TEXT
+BUG_OVERRIDE : failures/expected/text.html = FAIL
BUG_OVERRIDE : failures/expected/text.html = IMAGE""", is_lint_mode=True)
def test_missing_file(self):
# This should log a non-fatal error.
- self.parse_exp('BUG_TEST : missing_file.html = TEXT')
+ self.parse_exp('BUG_TEST : missing_file.html = FAIL')
self.assertTrue(self._exp.has_warnings(), 1)
@@ -389,19 +502,19 @@ class PrecedenceTests(Base):
# This tests handling precedence of specific lines over directories
# and tests expectations covering entire directories.
exp_str = """
-BUGX : failures/expected/text.html = TEXT
+BUGX : failures/expected/text.html = FAIL
BUGX WONTFIX : failures/expected = IMAGE
"""
self.parse_exp(exp_str)
- self.assert_exp('failures/expected/text.html', TEXT)
+ self.assert_exp('failures/expected/text.html', FAIL)
self.assert_exp('failures/expected/crash.html', IMAGE)
exp_str = """
BUGX WONTFIX : failures/expected = IMAGE
-BUGX : failures/expected/text.html = TEXT
+BUGX : failures/expected/text.html = FAIL
"""
self.parse_exp(exp_str)
- self.assert_exp('failures/expected/text.html', TEXT)
+ self.assert_exp('failures/expected/text.html', FAIL)
self.assert_exp('failures/expected/crash.html', IMAGE)
def test_ambiguous(self):
@@ -410,15 +523,15 @@ BUGX : failures/expected/text.html = TEXT
def test_more_modifiers(self):
self.assert_bad_expectations("BUG_TEST RELEASE : passes/text.html = PASS\n"
- "BUG_TEST WIN RELEASE : passes/text.html = TEXT\n")
+ "BUG_TEST WIN RELEASE : passes/text.html = FAIL\n")
def test_order_in_file(self):
- self.assert_bad_expectations("BUG_TEST WIN RELEASE : passes/text.html = TEXT\n"
+ self.assert_bad_expectations("BUG_TEST WIN RELEASE : passes/text.html = FAIL\n"
"BUG_TEST RELEASE : passes/text.html = PASS\n")
def test_macro_overrides(self):
self.assert_bad_expectations("BUG_TEST WIN : passes/text.html = PASS\n"
- "BUG_TEST XP : passes/text.html = TEXT\n")
+ "BUG_TEST XP : passes/text.html = FAIL\n")
class RemoveConfigurationsTest(Base):
@@ -429,15 +542,15 @@ class RemoveConfigurationsTest(Base):
test_port.test_isfile = lambda test: True
test_config = test_port.test_configuration()
- test_port.expectations_dict = lambda: {"expectations": """BUGX LINUX WIN RELEASE : failures/expected/foo.html = TEXT
-BUGY WIN MAC DEBUG : failures/expected/foo.html = CRASH
+ test_port.expectations_dict = lambda: {"expectations": """Bug(x) [ Linux Win Release ] failures/expected/foo.html [ Failure ]
+Bug(y) [ Win Mac Debug ] failures/expected/foo.html [ Crash ]
"""}
expectations = TestExpectations(test_port, self.get_basic_tests())
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', test_config)
- self.assertEqual("""BUGX LINUX VISTA WIN7 RELEASE : failures/expected/foo.html = TEXT
-BUGY WIN MAC DEBUG : failures/expected/foo.html = CRASH
+ self.assertEqual("""Bug(x) [ Linux Vista Win7 Release ] failures/expected/foo.html [ Failure ]
+Bug(y) [ Win Mac Debug ] failures/expected/foo.html [ Crash ]
""", actual_expectations)
def test_remove_line(self):
@@ -447,8 +560,8 @@ BUGY WIN MAC DEBUG : failures/expected/foo.html = CRASH
test_port.test_isfile = lambda test: True
test_config = test_port.test_configuration()
- test_port.expectations_dict = lambda: {'expectations': """BUGX WIN RELEASE : failures/expected/foo.html = TEXT
-BUGY WIN DEBUG : failures/expected/foo.html = CRASH
+ test_port.expectations_dict = lambda: {'expectations': """Bug(x) [ Win Release ] failures/expected/foo.html [ Failure ]
+Bug(y) [ Win Debug ] failures/expected/foo.html [ Crash ]
"""}
expectations = TestExpectations(test_port)
@@ -456,7 +569,7 @@ BUGY WIN DEBUG : failures/expected/foo.html = CRASH
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-vista', None).test_configuration())
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-win7', None).test_configuration())
- self.assertEqual("""BUGY WIN DEBUG : failures/expected/foo.html = CRASH
+ self.assertEqual("""Bug(y) [ Win Debug ] failures/expected/foo.html [ Crash ]
""", actual_expectations)
@@ -470,14 +583,14 @@ class RebaseliningTest(Base):
self.assertEqual(expected_overrides, actual_overrides)
def test_remove(self):
- self.assertRemove('BUGX REBASELINE : failures/expected/text.html = TEXT\n'
- 'BUGY : failures/expected/image.html = IMAGE\n'
- 'BUGZ REBASELINE : failures/expected/crash.html = CRASH\n',
- 'BUGXO : failures/expected/image.html = CRASH\n',
+ self.assertRemove('Bug(x) failures/expected/text.html [ Failure Rebaseline ]\n'
+ 'Bug(y) failures/expected/image.html [ ImageOnlyFailure Rebaseline ]\n'
+ 'Bug(z) failures/expected/crash.html [ Crash ]\n',
+ 'Bug(x0) failures/expected/image.html [ Crash ]\n',
['failures/expected/text.html'],
- 'BUGY : failures/expected/image.html = IMAGE\n'
- 'BUGZ REBASELINE : failures/expected/crash.html = CRASH\n',
- 'BUGXO : failures/expected/image.html = CRASH\n')
+ 'Bug(y) failures/expected/image.html [ ImageOnlyFailure Rebaseline ]\n'
+ 'Bug(z) failures/expected/crash.html [ Crash ]\n',
+ 'Bug(x0) failures/expected/image.html [ Crash ]\n')
def test_no_get_rebaselining_failures(self):
@@ -485,6 +598,8 @@ class RebaseliningTest(Base):
self.assertEqual(len(self._exp.get_rebaselining_failures()), 0)
+# FIXME: remove most of these tests when we no longer support the old syntax.
+
class TestExpectationParserTests(unittest.TestCase):
def _tokenize(self, line):
return TestExpectationParser._tokenize_line('path', line, 0)
@@ -494,13 +609,9 @@ class TestExpectationParserTests(unittest.TestCase):
self.assertEqual(expectation.comment, None)
self.assertEqual(len(expectation.warnings), 0)
- def test_tokenize_missing_colon(self):
- expectation = self._tokenize('Qux.')
- self.assertEqual(str(expectation.warnings), '["Missing a \':\'"]')
-
def test_tokenize_extra_colon(self):
expectation = self._tokenize('FOO : : bar')
- self.assertEqual(str(expectation.warnings), '["Extraneous \':\'"]')
+ self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.'])
def test_tokenize_empty_comment(self):
expectation = self._tokenize('//')
@@ -514,11 +625,11 @@ class TestExpectationParserTests(unittest.TestCase):
def test_tokenize_missing_equal(self):
expectation = self._tokenize('FOO : bar')
- self.assertEqual(str(expectation.warnings), "['Missing expectations\']")
+ self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.'])
def test_tokenize_extra_equal(self):
expectation = self._tokenize('FOO : bar = BAZ = Qux.')
- self.assertEqual(str(expectation.warnings), '["Extraneous \'=\'"]')
+ self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.'])
def test_tokenize_valid(self):
expectation = self._tokenize('FOO : bar = BAZ')
@@ -578,18 +689,19 @@ class TestExpectationSerializationTests(unittest.TestCase):
expectation = TestExpectationLine()
self.assertEqual(expectation.to_string(self._converter), '')
- expectation.comment = 'Qux.'
- self.assertEqual(expectation.to_string(self._converter), '//Qux.')
+ expectation.comment = ' Qux.'
+ self.assertEqual(expectation.to_string(self._converter), '# Qux.')
expectation.name = 'bar'
- self.assertEqual(expectation.to_string(self._converter), ' : bar = //Qux.')
+ self.assertEqual(expectation.to_string(self._converter), 'bar # Qux.')
expectation.modifiers = ['foo']
- self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = //Qux.')
+ # FIXME: case should be preserved here but we can't until we drop the old syntax.
+ self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar # Qux.')
expectation.expectations = ['bAz']
- self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = BAZ //Qux.')
+ self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar [ BAZ ] # Qux.')
expectation.expectations = ['bAz1', 'baZ2']
- self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = BAZ1 BAZ2 //Qux.')
+ self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar [ BAZ1 BAZ2 ] # Qux.')
expectation.modifiers = ['foo1', 'foO2']
- self.assertEqual(expectation.to_string(self._converter), 'FOO1 FOO2 : bar = BAZ1 BAZ2 //Qux.')
+ self.assertEqual(expectation.to_string(self._converter), '[ FOO1 FOO2 ] bar [ BAZ1 BAZ2 ] # Qux.')
expectation.warnings.append('Oh the horror.')
self.assertEqual(expectation.to_string(self._converter), '')
expectation.original_string = 'Yes it is!'
@@ -601,7 +713,8 @@ class TestExpectationSerializationTests(unittest.TestCase):
expectation.name = 'bar'
expectation.modifiers = ['foo']
expectation.expectations = ['bAz1', 'baZ2']
- self.assertEqual(TestExpectations.list_to_string([expectation]), 'FOO : bar = BAZ1 BAZ2 //Qux.')
+ # FIXME: case should be preserved here but we can't until we drop the old syntax.
+ self.assertEqual(TestExpectations.list_to_string([expectation]), '[ FOO ] bar [ BAZ1 BAZ2 ] #Qux.')
def test_parsed_to_string(self):
expectation_line = TestExpectationLine()
@@ -610,21 +723,21 @@ class TestExpectationSerializationTests(unittest.TestCase):
expectation_line.parsed_expectations = set([IMAGE])
self.assertEqual(expectation_line.to_string(self._converter), None)
expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release')])
- self.assertEqual(expectation_line.to_string(self._converter), 'BUGX XP RELEASE : test/name/for/realz.html = IMAGE')
+ self.assertEqual(expectation_line.to_string(self._converter), 'Bug(x) [ XP Release ] test/name/for/realz.html [ ImageOnlyFailure ]')
expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')])
- self.assertEqual(expectation_line.to_string(self._converter), 'BUGX XP : test/name/for/realz.html = IMAGE')
+ self.assertEqual(expectation_line.to_string(self._converter), 'Bug(x) [ XP ] test/name/for/realz.html [ ImageOnlyFailure ]')
def test_serialize_parsed_expectations(self):
expectation_line = TestExpectationLine()
expectation_line.parsed_expectations = set([])
parsed_expectation_to_string = dict([[parsed_expectation, expectation_string] for expectation_string, parsed_expectation in TestExpectations.EXPECTATIONS.items()])
self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), '')
- expectation_line.parsed_expectations = set([IMAGE_PLUS_TEXT])
- self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'image+text')
+ expectation_line.parsed_expectations = set([FAIL])
+ self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'fail')
expectation_line.parsed_expectations = set([PASS, IMAGE])
self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'pass image')
- expectation_line.parsed_expectations = set([TEXT, PASS])
- self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'pass text')
+ expectation_line.parsed_expectations = set([FAIL, PASS])
+ self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'pass fail')
def test_serialize_parsed_modifier_string(self):
expectation_line = TestExpectationLine()
@@ -643,40 +756,40 @@ class TestExpectationSerializationTests(unittest.TestCase):
self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, ['win']), 'garden-o-matic is total win')
def test_format_line(self):
- self.assertEqual(TestExpectationLine._format_line('modifiers', 'name', 'expectations', 'comment'), 'MODIFIERS : name = EXPECTATIONS //comment')
- self.assertEqual(TestExpectationLine._format_line('modifiers', 'name', 'expectations', None), 'MODIFIERS : name = EXPECTATIONS')
+ self.assertEqual(TestExpectationLine._format_line(['MODIFIERS'], 'name', ['EXPECTATIONS'], 'comment'), '[ MODIFIERS ] name [ EXPECTATIONS ] #comment')
+ self.assertEqual(TestExpectationLine._format_line(['MODIFIERS'], 'name', ['EXPECTATIONS'], None), '[ MODIFIERS ] name [ EXPECTATIONS ]')
def test_string_roundtrip(self):
self.assert_round_trip('')
self.assert_round_trip('FOO')
- self.assert_round_trip(':')
- self.assert_round_trip('FOO :')
- self.assert_round_trip('FOO : bar')
- self.assert_round_trip(' FOO :')
- self.assert_round_trip(' FOO : bar')
- self.assert_round_trip('FOO : bar = BAZ')
- self.assert_round_trip('FOO : bar = BAZ //Qux.')
- self.assert_round_trip('FOO : bar = BAZ // Qux.')
- self.assert_round_trip('FOO : bar = BAZ // Qux. ')
- self.assert_round_trip('FOO : bar = BAZ // Qux. ')
- self.assert_round_trip('FOO : : bar = BAZ')
- self.assert_round_trip('FOO : : bar = BAZ')
- self.assert_round_trip('FOO : : bar ==== BAZ')
+ self.assert_round_trip('[')
+ self.assert_round_trip('FOO [')
+ self.assert_round_trip('FOO ] bar')
+ self.assert_round_trip(' FOO [')
+ self.assert_round_trip(' [ FOO ] ')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ]')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux. ')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux. ')
+ self.assert_round_trip('[ FOO ] ] ] bar BAZ')
+ self.assert_round_trip('[ FOO ] ] ] bar [ BAZ ]')
+ self.assert_round_trip('FOO ] ] bar ==== BAZ')
self.assert_round_trip('=')
- self.assert_round_trip('//')
- self.assert_round_trip('// ')
- self.assert_round_trip('// Foo')
- self.assert_round_trip('// Foo')
- self.assert_round_trip('// Foo :')
- self.assert_round_trip('// Foo : =')
+ self.assert_round_trip('#')
+ self.assert_round_trip('# ')
+ self.assert_round_trip('# Foo')
+ self.assert_round_trip('# Foo')
+ self.assert_round_trip('# Foo :')
+ self.assert_round_trip('# Foo : =')
def test_list_roundtrip(self):
self.assert_list_round_trip('')
self.assert_list_round_trip('\n')
self.assert_list_round_trip('\n\n')
self.assert_list_round_trip('bar')
- self.assert_list_round_trip('bar\n//Qux.')
- self.assert_list_round_trip('bar\n//Qux.\n')
+ self.assert_list_round_trip('bar\n# Qux.')
+ self.assert_list_round_trip('bar\n# Qux.\n')
def test_reconstitute_only_these(self):
lines = []
@@ -696,18 +809,18 @@ class TestExpectationSerializationTests(unittest.TestCase):
add_line(set([TestConfiguration('xp', 'x86', 'release')]), True)
add_line(set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')]), False)
serialized = TestExpectations.list_to_string(lines, self._converter)
- self.assertEquals(serialized, "BUGX XP RELEASE : Yay = IMAGE\nBUGX XP : Yay = IMAGE")
+ self.assertEquals(serialized, "Bug(x) [ XP Release ] Yay [ ImageOnlyFailure ]\nBug(x) [ XP ] Yay [ ImageOnlyFailure ]")
serialized = TestExpectations.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these)
- self.assertEquals(serialized, "BUGX XP RELEASE : Yay = IMAGE\nNay")
+ self.assertEquals(serialized, "Bug(x) [ XP Release ] Yay [ ImageOnlyFailure ]\nNay")
def test_string_whitespace_stripping(self):
self.assert_round_trip('\n', '')
- self.assert_round_trip(' FOO : bar = BAZ', 'FOO : bar = BAZ')
- self.assert_round_trip('FOO : bar = BAZ', 'FOO : bar = BAZ')
- self.assert_round_trip('FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ // Qux.')
- self.assert_round_trip('FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ // Qux.')
- self.assert_round_trip('FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ // Qux.')
- self.assert_round_trip('FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ // Qux.')
+ self.assert_round_trip(' [ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.')
+ self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.')
if __name__ == '__main__':
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
index afea52e60..96628afc3 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
@@ -44,7 +44,7 @@ def determine_result_type(failure_list):
the list of failures. "Best fits" means we use the worst type of failure.
Returns:
- one of the test_expectations result types - PASS, TEXT, CRASH, etc."""
+ one of the test_expectations result types - PASS, FAIL, CRASH, etc."""
if not failure_list or len(failure_list) == 0:
return test_expectations.PASS
@@ -62,18 +62,10 @@ def determine_result_type(failure_list):
FailureMissingAudio in failure_types):
return test_expectations.MISSING
else:
- is_text_failure = FailureTextMismatch in failure_types
- is_image_failure = (FailureImageHashIncorrect in failure_types or
- FailureImageHashMismatch in failure_types)
- is_audio_failure = (FailureAudioMismatch in failure_types)
- if is_text_failure and is_image_failure:
- return test_expectations.IMAGE_PLUS_TEXT
- elif is_text_failure:
- return test_expectations.TEXT
- elif is_image_failure or is_reftest_failure(failure_list):
+ if FailureTextMismatch in failure_types or FailureAudioMismatch in failure_types:
+ return test_expectations.FAIL
+ elif FailureImageHashIncorrect in failure_types or FailureImageHashMismatch in failure_types or is_reftest_failure(failure_list):
return test_expectations.IMAGE
- elif is_audio_failure:
- return test_expectations.AUDIO
else:
raise ValueError("unclassifiable set of failures: "
+ str(failure_types))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
index 1f75c799a..985241ede 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
@@ -513,9 +513,9 @@ class PortTestCase(unittest.TestCase):
# Check that we read the expectations file
host = MockSystemHost()
host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations',
- 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = TEXT\n')
+ 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
port = TestWebKitPort(host=host)
- self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = TEXT\n')
+ self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
def test_build_driver(self):
output = OutputCapture()
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py
index e4615d570..afb2b84d4 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -260,18 +260,18 @@ def add_unit_tests_to_mock_filesystem(filesystem):
filesystem.write_text_file(LAYOUT_TEST_DIR + '/platform/test/TestExpectations', """
WONTFIX : failures/expected/crash.html = CRASH
WONTFIX : failures/expected/image.html = IMAGE
-WONTFIX : failures/expected/audio.html = AUDIO
+WONTFIX : failures/expected/audio.html = FAIL
WONTFIX : failures/expected/image_checksum.html = IMAGE
WONTFIX : failures/expected/mismatch.html = IMAGE
WONTFIX : failures/expected/missing_check.html = MISSING PASS
WONTFIX : failures/expected/missing_image.html = MISSING PASS
WONTFIX : failures/expected/missing_audio.html = MISSING PASS
WONTFIX : failures/expected/missing_text.html = MISSING PASS
-WONTFIX : failures/expected/newlines_leading.html = TEXT
-WONTFIX : failures/expected/newlines_trailing.html = TEXT
-WONTFIX : failures/expected/newlines_with_excess_CR.html = TEXT
+WONTFIX : failures/expected/newlines_leading.html = FAIL
+WONTFIX : failures/expected/newlines_trailing.html = FAIL
+WONTFIX : failures/expected/newlines_with_excess_CR.html = FAIL
WONTFIX : failures/expected/reftest.html = IMAGE
-WONTFIX : failures/expected/text.html = TEXT
+WONTFIX : failures/expected/text.html = FAIL
WONTFIX : failures/expected/timeout.html = TIMEOUT
WONTFIX SKIP : failures/expected/hang.html = TIMEOUT
WONTFIX SKIP : failures/expected/keyboard.html = CRASH
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
index 1f35857c4..1abc3cada 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
@@ -260,7 +260,7 @@ class LintTest(unittest.TestCase, StreamTestingMixin):
options, parsed_args = parse_args(['--lint-test-files'])
host = MockHost()
port_obj = host.port_factory.get(options.platform, options=options)
- port_obj.expectations_dict = lambda: {'': '# syntax error'}
+ port_obj.expectations_dict = lambda: {'': '-- syntax error'}
res, out, err = run_and_capture(port_obj, options, parsed_args)
self.assertEqual(res, -1)
@@ -549,7 +549,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
file_list = host.filesystem.written_files.keys()
file_list.remove('/tmp/layout-test-results/tests_run0.txt')
self.assertEquals(res, 1)
- expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"TEXT"},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}'
+ expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"FAIL"},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}'
json_string = host.filesystem.read_text_file('/tmp/layout-test-results/full_results.json')
self.assertTrue(json_string.find(expected_token) != -1)
self.assertTrue(json_string.find('"num_regressions":1') != -1)
@@ -764,7 +764,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
self.assertEquals(res, 1)
self.assertTrue('Clobbering old results' in err.getvalue())
self.assertTrue('flaky/text.html' in err.getvalue())
- self.assertTrue('Unexpected text failures' in out.getvalue())
+ self.assertTrue('Unexpected failures' in out.getvalue())
self.assertFalse('Unexpected flakiness' in out.getvalue())
self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
self.assertFalse(host.filesystem.exists('retries'))
diff --git a/Tools/Scripts/webkitpy/layout_tests/views/printing.py b/Tools/Scripts/webkitpy/layout_tests/views/printing.py
index 22a55ed2f..44500ecc7 100644
--- a/Tools/Scripts/webkitpy/layout_tests/views/printing.py
+++ b/Tools/Scripts/webkitpy/layout_tests/views/printing.py
@@ -35,7 +35,7 @@ import optparse
from webkitpy.tool import grammar
from webkitpy.common.net import resultsjsonparser
from webkitpy.layout_tests.models import test_expectations
-from webkitpy.layout_tests.models.test_expectations import TestExpectations
+from webkitpy.layout_tests.models.test_expectations import TestExpectations, TestExpectationParser
from webkitpy.layout_tests.views.metered_stream import MeteredStream
@@ -455,8 +455,9 @@ class Printer(object):
actual = result['actual'].split(" ")
expected = result['expected'].split(" ")
result = TestExpectations.EXPECTATIONS[key.lower()]
- new_expectations_list = list(set(actual) | set(expected))
- self._print_for_bot(" %s = %s" % (test, " ".join(new_expectations_list)))
+ # FIXME: clean this up once the old syntax is gone
+ new_expectations_list = [TestExpectationParser._inverted_expectation_tokens[exp] for exp in list(set(actual) | set(expected))]
+ self._print_for_bot(" %s [ %s ]" % (test, " ".join(new_expectations_list)))
self._print_for_bot("")
self._print_for_bot("")
@@ -467,7 +468,7 @@ class Printer(object):
self._print_for_bot("Regressions: Unexpected %s : (%d)" % (descriptions[result][0], len(tests)))
tests.sort()
for test in tests:
- self._print_for_bot(" %s = %s" % (test, key))
+ self._print_for_bot(" %s [ %s ] " % (test, TestExpectationParser._inverted_expectation_tokens[key]))
self._print_for_bot("")
if len(unexpected_results['tests']) and self._options.debug_rwt_logging:
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest.py b/Tools/Scripts/webkitpy/performance_tests/perftest.py
index 69d9363f4..79899f974 100644
--- a/Tools/Scripts/webkitpy/performance_tests/perftest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftest.py
@@ -114,8 +114,8 @@ class PerfTest(object):
_description_regex = re.compile(r'^Description: (?P<description>.*)$', re.IGNORECASE)
_result_classes = ['Time', 'JS Heap', 'Malloc']
_result_class_regex = re.compile(r'^(?P<resultclass>' + r'|'.join(_result_classes) + '):')
- _statistics_keys = ['avg', 'median', 'stdev', 'min', 'max', 'unit']
- _score_regex = re.compile(r'^(?P<key>' + r'|'.join(_statistics_keys) + r')\s+(?P<value>[0-9\.]+)\s*(?P<unit>.*)')
+ _statistics_keys = ['avg', 'median', 'stdev', 'min', 'max', 'unit', 'values']
+ _score_regex = re.compile(r'^(?P<key>' + r'|'.join(_statistics_keys) + r')\s+(?P<value>([0-9\.]+(,\s+)?)+)\s*(?P<unit>.*)')
def parse_output(self, output):
test_failed = False
@@ -138,7 +138,10 @@ class PerfTest(object):
score = self._score_regex.match(line)
if score:
key = score.group('key')
- value = float(score.group('value'))
+ if ', ' in score.group('value'):
+ value = [float(number) for number in score.group('value').split(', ')]
+ else:
+ value = float(score.group('value'))
unit = score.group('unit')
name = test_name
if result_class != 'Time':
@@ -208,23 +211,24 @@ class PageLoadingPerfTest(PerfTest):
continue
test_times.append(output.test_time * 1000)
- test_times = sorted(test_times)
+ sorted_test_times = sorted(test_times)
# Compute the mean and variance using a numerically stable algorithm.
squareSum = 0
mean = 0
- valueSum = sum(test_times)
- for i, time in enumerate(test_times):
+ valueSum = sum(sorted_test_times)
+ for i, time in enumerate(sorted_test_times):
delta = time - mean
sweep = i + 1.0
mean += delta / sweep
squareSum += delta * delta * (i / sweep)
middle = int(len(test_times) / 2)
- results = {'avg': mean,
- 'min': min(test_times),
- 'max': max(test_times),
- 'median': test_times[middle] if len(test_times) % 2 else (test_times[middle - 1] + test_times[middle]) / 2,
+ results = {'values': test_times,
+ 'avg': mean,
+ 'min': sorted_test_times[0],
+ 'max': sorted_test_times[-1],
+ 'median': sorted_test_times[middle] if len(sorted_test_times) % 2 else (sorted_test_times[middle - 1] + sorted_test_times[middle]) / 2,
'stdev': math.sqrt(squareSum),
'unit': 'ms'}
self.output_statistics(self.test_name(), results, '')
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
index 2b35e71ee..27a4bb385 100755
--- a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
@@ -50,6 +50,7 @@ class MainTest(unittest.TestCase):
'Ignoring warm-up run (1115)',
'',
'Time:',
+ 'values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ms',
'avg 1100 ms',
'median 1101 ms',
'stdev 11 ms',
@@ -60,7 +61,8 @@ class MainTest(unittest.TestCase):
try:
test = PerfTest(None, 'some-test', '/path/some-dir/some-test')
self.assertEqual(test.parse_output(output),
- {'some-test': {'avg': 1100.0, 'median': 1101.0, 'min': 1080.0, 'max': 1120.0, 'stdev': 11.0, 'unit': 'ms'}})
+ {'some-test': {'avg': 1100.0, 'median': 1101.0, 'min': 1080.0, 'max': 1120.0, 'stdev': 11.0, 'unit': 'ms',
+ 'values': [i for i in range(1, 20)]}})
finally:
pass
actual_stdout, actual_stderr, actual_logs = output_capture.restore_output()
@@ -76,6 +78,7 @@ class MainTest(unittest.TestCase):
'some-unrecognizable-line',
'',
'Time:'
+ 'values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ms',
'avg 1100 ms',
'median 1101 ms',
'stdev 11 ms',
@@ -109,12 +112,13 @@ class TestPageLoadingPerfTest(unittest.TestCase):
def test_run(self):
test = PageLoadingPerfTest(None, 'some-test', '/path/some-dir/some-test')
- driver = TestPageLoadingPerfTest.MockDriver([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
+ driver = TestPageLoadingPerfTest.MockDriver(range(1, 21))
output_capture = OutputCapture()
output_capture.capture_output()
try:
self.assertEqual(test.run(driver, None),
- {'some-test': {'max': 20000, 'avg': 11000.0, 'median': 11000, 'stdev': math.sqrt(570 * 1000 * 1000), 'min': 2000, 'unit': 'ms'}})
+ {'some-test': {'max': 20000, 'avg': 11000.0, 'median': 11000, 'stdev': math.sqrt(570 * 1000 * 1000), 'min': 2000, 'unit': 'ms',
+ 'values': [i * 1000 for i in range(2, 21)]}})
finally:
actual_stdout, actual_stderr, actual_logs = output_capture.restore_output()
self.assertEqual(actual_stdout, '')
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
index 34df002f7..e01b2aedb 100755
--- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
@@ -191,6 +191,11 @@ class PerfTestsRunner(object):
if not output:
return self.EXIT_CODE_BAD_MERGE
results_page_path = self._host.filesystem.splitext(output_json_path)[0] + '.html'
+ else:
+ # FIXME: Remove this code once webkit-perf.appspot.com supported "values".
+ for result in output['results'].values():
+ if isinstance(result, dict) and 'values' in result:
+ del result['values']
self._generate_output_files(output_json_path, results_page_path, output)
@@ -317,6 +322,6 @@ class PerfTestsRunner(object):
else:
_log.error('FAILED')
- _log.debug("Finished: %f s" % (time.time() - start_time))
+ _log.info("Finished: %f s" % (time.time() - start_time))
return new_results != None
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
index 6653857d8..d46d7e73e 100755
--- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
@@ -31,6 +31,7 @@
import StringIO
import json
+import re
import unittest
from webkitpy.common.host_mock import MockHost
@@ -48,6 +49,9 @@ class MainTest(unittest.TestCase):
def assertWritten(self, stream, contents):
self.assertEquals(stream.buflist, contents)
+ def normalizeFinishedTime(self, log):
+ return re.sub(r'Finished: [0-9\.]+ s', 'Finished: 0.1 s', log)
+
class TestDriver:
def run_test(self, driver_input, stop_when_done):
text = ''
@@ -88,6 +92,7 @@ Ignoring warm-up run (1502)
1471
Time:
+values 1504, 1505, 1510, 1504, 1507, 1509, 1510, 1487, 1488, 1472, 1472, 1488, 1473, 1472, 1475, 1487, 1486, 1486, 1475, 1471 ms
avg 1489.05 ms
median 1487 ms
stdev 14.46 ms
@@ -99,6 +104,7 @@ max 1510 ms
Ignoring warm-up run (1115)
Time:
+values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ms
avg 1100 ms
median 1101 ms
stdev 11 ms
@@ -110,6 +116,7 @@ max 1120 ms
Ignoring warm-up run (1115)
Time:
+values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ms
avg 1100 ms
median 1101 ms
stdev 11 ms
@@ -117,6 +124,7 @@ min 1080 ms
max 1120 ms
JS Heap:
+values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 bytes
avg 832000 bytes
median 829000 bytes
stdev 15000 bytes
@@ -124,6 +132,7 @@ min 811000 bytes
max 848000 bytes
Malloc:
+values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 bytes
avg 532000 bytes
median 529000 bytes
stdev 13000 bytes
@@ -234,7 +243,8 @@ max 548000 bytes
finally:
stdout, stderr, log = output.restore_output()
self.assertEqual(stderr, "Ready to run test?\n")
- self.assertEqual(log, "Running inspector/pass.html (1 of 1)\nRESULT group_name: test_name= 42 ms\n\n")
+ self.assertEqual(self.normalizeFinishedTime(log),
+ "Running inspector/pass.html (1 of 1)\nRESULT group_name: test_name= 42 ms\nFinished: 0.1 s\n\n")
def test_run_test_set_for_parser_tests(self):
runner, port = self.create_runner()
@@ -246,13 +256,15 @@ max 548000 bytes
finally:
stdout, stderr, log = output.restore_output()
self.assertEqual(unexpected_result_count, 0)
- self.assertEqual(log, '\n'.join(['Running Bindings/event-target-wrapper.html (1 of 2)',
+ self.assertEqual(self.normalizeFinishedTime(log), '\n'.join(['Running Bindings/event-target-wrapper.html (1 of 2)',
'RESULT Bindings: event-target-wrapper= 1489.05 ms',
'median= 1487.0 ms, stdev= 14.46 ms, min= 1471.0 ms, max= 1510.0 ms',
+ 'Finished: 0.1 s',
'',
'Running Parser/some-parser.html (2 of 2)',
'RESULT Parser: some-parser= 1100.0 ms',
'median= 1101.0 ms, stdev= 11.0 ms, min= 1080.0 ms, max= 1120.0 ms',
+ 'Finished: 0.1 s',
'', '']))
def test_run_memory_test(self):
@@ -267,7 +279,7 @@ max 548000 bytes
finally:
stdout, stderr, log = output.restore_output()
self.assertEqual(unexpected_result_count, 0)
- self.assertEqual(log, '\n'.join([
+ self.assertEqual(self.normalizeFinishedTime(log), '\n'.join([
'Running 1 tests',
'Running Parser/memory-test.html (1 of 1)',
'RESULT Parser: memory-test= 1100.0 ms',
@@ -276,11 +288,13 @@ max 548000 bytes
'median= 829000.0 bytes, stdev= 15000.0 bytes, min= 811000.0 bytes, max= 848000.0 bytes',
'RESULT Parser: memory-test: Malloc= 532000.0 bytes',
'median= 529000.0 bytes, stdev= 13000.0 bytes, min= 511000.0 bytes, max= 548000.0 bytes',
+ 'Finished: 0.1 s',
'', '']))
results = runner.load_output_json()[0]['results']
- self.assertEqual(results['Parser/memory-test'], {'min': 1080.0, 'max': 1120.0, 'median': 1101.0, 'stdev': 11.0, 'avg': 1100.0, 'unit': 'ms'})
- self.assertEqual(results['Parser/memory-test:JSHeap'], {'min': 811000.0, 'max': 848000.0, 'median': 829000.0, 'stdev': 15000.0, 'avg': 832000.0, 'unit': 'bytes'})
- self.assertEqual(results['Parser/memory-test:Malloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'})
+ values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
+ self.assertEqual(results['Parser/memory-test'], {'min': 1080.0, 'max': 1120.0, 'median': 1101.0, 'stdev': 11.0, 'avg': 1100.0, 'unit': 'ms', 'values': values})
+ self.assertEqual(results['Parser/memory-test:JSHeap'], {'min': 811000.0, 'max': 848000.0, 'median': 829000.0, 'stdev': 15000.0, 'avg': 832000.0, 'unit': 'bytes', 'values': values})
+ self.assertEqual(results['Parser/memory-test:Malloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes', 'values': values})
def _test_run_with_json_output(self, runner, filesystem, upload_suceeds=False, expected_exit_code=0):
filesystem.write_text_file(runner._base_path + '/inspector/pass.html', 'some content')
@@ -304,14 +318,16 @@ max 548000 bytes
stdout, stderr, logs = output_capture.restore_output()
if not expected_exit_code:
- self.assertEqual(logs, '\n'.join([
- 'Running 2 tests',
+ self.assertEqual(self.normalizeFinishedTime(logs),
+ '\n'.join(['Running 2 tests',
'Running Bindings/event-target-wrapper.html (1 of 2)',
'RESULT Bindings: event-target-wrapper= 1489.05 ms',
'median= 1487.0 ms, stdev= 14.46 ms, min= 1471.0 ms, max= 1510.0 ms',
+ 'Finished: 0.1 s',
'',
'Running inspector/pass.html (2 of 2)',
'RESULT group_name: test_name= 42 ms',
+ 'Finished: 0.1 s',
'',
'']))
@@ -320,6 +336,12 @@ max 548000 bytes
return logs
_event_target_wrapper_and_inspector_results = {
+ "Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46, "unit": "ms",
+ "values": [1504, 1505, 1510, 1504, 1507, 1509, 1510, 1487, 1488, 1472, 1472, 1488, 1473, 1472, 1475, 1487, 1486, 1486, 1475, 1471]},
+ "inspector/pass.html:group_name:test_name": 42}
+
+ # FIXME: Remove this variance once perf-o-matic supported "values".
+ _event_target_wrapper_and_inspector_results_without_values = {
"Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46, "unit": "ms"},
"inspector/pass.html:group_name:test_name": 42}
@@ -328,7 +350,7 @@ max 548000 bytes
'--test-results-server=some.host'])
self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True)
self.assertEqual(runner.load_output_json(), {
- "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results,
+ "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results_without_values,
"webkit-revision": "5678", "branch": "webkit-trunk"})
def test_run_with_description(self):
@@ -337,7 +359,7 @@ max 548000 bytes
self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True)
self.assertEqual(runner.load_output_json(), {
"timestamp": 123456789, "description": "some description",
- "results": self._event_target_wrapper_and_inspector_results,
+ "results": self._event_target_wrapper_and_inspector_results_without_values,
"webkit-revision": "5678", "branch": "webkit-trunk"})
def create_runner_and_setup_results_template(self, args=[]):
@@ -427,7 +449,7 @@ max 548000 bytes
port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '{"key": "value"}')
self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True)
self.assertEqual(runner.load_output_json(), {
- "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results,
+ "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results_without_values,
"webkit-revision": "5678", "branch": "webkit-trunk", "key": "value"})
def test_run_with_bad_slave_config_json(self):
@@ -446,7 +468,7 @@ max 548000 bytes
port.repository_paths = lambda: [('webkit', '/mock-checkout'), ('some', '/mock-checkout/some')]
self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True)
self.assertEqual(runner.load_output_json(), {
- "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results,
+ "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results_without_values,
"webkit-revision": "5678", "some-revision": "5678", "branch": "webkit-trunk"})
def test_run_with_upload_json(self):
diff --git a/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
index ab70ba202..c13b22764 100644
--- a/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -107,7 +107,7 @@ class TestExpectationsTestCase(unittest.TestCase):
self.assertTrue(self._error_collector.turned_off_filtering)
def test_valid_expectations(self):
- self.assert_lines_lint(["BUGCR1234 MAC : passes/text.html = PASS TEXT"], should_pass=True)
+ self.assert_lines_lint(["BUGCR1234 MAC : passes/text.html = PASS FAIL"], should_pass=True)
def test_invalid_expectations(self):
self.assert_lines_lint(["BUG1234 : passes/text.html = GIVE UP"], should_pass=False)
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index 115249916..1da17e48b 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -178,35 +178,35 @@ class PrintExpectationsTest(unittest.TestCase):
def test_basic(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('// For test-win-xp\n'
- 'failures/expected/image.html = IMAGE\n'
- 'failures/expected/text.html = TEXT\n'))
+ 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n'
+ 'failures/expected/text.html [ Failure WontFix ]\n'))
def test_multiple(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('// For test-win-vista\n'
- 'failures/expected/image.html = IMAGE\n'
- 'failures/expected/text.html = TEXT\n'
+ 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n'
+ 'failures/expected/text.html [ Failure WontFix ]\n'
'\n'
'// For test-win-win7\n'
- 'failures/expected/image.html = IMAGE\n'
- 'failures/expected/text.html = TEXT\n'
+ 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n'
+ 'failures/expected/text.html [ Failure WontFix ]\n'
'\n'
'// For test-win-xp\n'
- 'failures/expected/image.html = IMAGE\n'
- 'failures/expected/text.html = TEXT\n'),
+ 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n'
+ 'failures/expected/text.html [ Failure WontFix ]\n'),
platform='test-win-*')
def test_full(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('// For test-win-xp\n'
- 'WONTFIX : failures/expected/image.html = IMAGE\n'
- 'WONTFIX : failures/expected/text.html = TEXT\n'),
+ 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n'
+ 'failures/expected/text.html [ Failure WontFix ]\n'),
full=True)
def test_exclude(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('// For test-win-xp\n'
- 'failures/expected/text.html = TEXT\n'),
+ 'failures/expected/text.html [ Failure WontFix ]\n'),
exclude_keyword=['image'])
def test_include(self):
@@ -218,7 +218,7 @@ class PrintExpectationsTest(unittest.TestCase):
def test_csv(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('test-win-xp,failures/expected/image.html,WONTFIX,IMAGE\n'
- 'test-win-xp,failures/expected/text.html,WONTFIX,TEXT\n'),
+ 'test-win-xp,failures/expected/text.html,WONTFIX,FAIL\n'),
csv=True)
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues.py b/Tools/Scripts/webkitpy/tool/commands/queues.py
index 475e505d0..6993c2dea 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues.py
@@ -201,18 +201,21 @@ class AbstractPatchQueue(AbstractQueue):
return self._tool.status_server.update_status(self.name, message, patch, results_file)
def _next_patch(self):
- patch_id = self._tool.status_server.next_work_item(self.name)
- if not patch_id:
- return None
- patch = self._tool.bugs.fetch_attachment(patch_id)
- if not patch:
- # FIXME: Using a fake patch because release_work_item has the wrong API.
- # We also don't really need to release the lock (although that's fine),
- # mostly we just need to remove this bogus patch from our queue.
- # If for some reason bugzilla is just down, then it will be re-fed later.
- patch = Attachment({'id': patch_id}, None)
- self._release_work_item(patch)
- return None
+ # FIXME: Bugzilla accessibility should be checked here; if it's unaccessible,
+ # it should return None.
+ patch = None
+ while not patch:
+ patch_id = self._tool.status_server.next_work_item(self.name)
+ if not patch_id:
+ return None
+ patch = self._tool.bugs.fetch_attachment(patch_id)
+ if not patch:
+ # FIXME: Using a fake patch because release_work_item has the wrong API.
+ # We also don't really need to release the lock (although that's fine),
+ # mostly we just need to remove this bogus patch from our queue.
+ # If for some reason bugzilla is just down, then it will be re-fed later.
+ fake_patch = Attachment({'id': patch_id}, None)
+ self._release_work_item(fake_patch)
return patch
def _release_work_item(self, patch):
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 345f206fc..b2243566a 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -158,12 +158,14 @@ class AbstractPatchQueueTest(CommandsTest):
queue._options = Mock()
queue._options.port = None
self.assertEquals(queue._next_patch(), None)
- tool.status_server = MockStatusServer(work_items=[2, 10000])
+ tool.status_server = MockStatusServer(work_items=[2, 10000, 10001])
expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n" # A mock-only message to prevent us from making mistakes.
expected_stderr = "MOCK: release_work_item: None 2\n"
- patch_id = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
- self.assertEquals(patch_id, None) # 2 is an invalid patch id
- self.assertEquals(queue._next_patch().id(), 10000)
+ patch = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+ # The patch.id() == 2 is ignored because it doesn't exist.
+ self.assertEquals(patch.id(), 10000)
+ self.assertEquals(queue._next_patch().id(), 10001)
+ self.assertEquals(queue._next_patch(), None) # When the queue is empty
def test_upload_results_archive_for_patch(self):
queue = AbstractPatchQueue()
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index d16b55151..cb8fa001f 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -356,7 +356,7 @@ class RebaselineExpectations(AbstractParallelRebaselineCommand):
for port_name in tool.port_factory.all_port_names():
self._add_tests_to_rebaseline_for_port(port_name)
if not self._test_list:
- _log.warning("Did not find any tests marked REBASELINE.")
+ _log.warning("Did not find any tests marked Rebaseline.")
return
self._rebaseline(options, self._test_list)
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index cae01e813..22fb1704b 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -67,8 +67,8 @@ class TestRebaseline(unittest.TestCase):
tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), '')
for path in lion_port.expectations_files():
tool.filesystem.write_text_file(path, '')
- tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """BUGB MAC LINUX XP DEBUG : fast/dom/Window/window-postmessage-clone-really-deep-array.html = PASS
-BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT
+ tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ]
+Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ]
""")
tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/dom/Window/window-postmessage-clone-really-deep-array.html"), "Dummy test contents")
tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/css/large-list-of-rules-crash.html"), "Dummy test contents")
@@ -81,8 +81,8 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu
OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["Webkit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs)
new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file())
- self.assertEqual(new_expectations, """BUGB MAC LINUX XP DEBUG : fast/dom/Window/window-postmessage-clone-really-deep-array.html = PASS
-BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT
+ self.assertEqual(new_expectations, """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ]
+Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ]
""")
def test_rebaseline_updates_expectations_file(self):
@@ -92,7 +92,7 @@ BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT
lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7")
tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), '')
- tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "BUGX MAC : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")
+ tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents")
expected_logs = """Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png.
@@ -102,7 +102,7 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu
OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["Webkit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs)
new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file())
- self.assertEqual(new_expectations, "BUGX SNOWLEOPARD : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")
+ self.assertEqual(new_expectations, "Bug(x) [ SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
def test_rebaseline_does_not_include_overrides(self):
command = RebaselineTest()
@@ -111,8 +111,8 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu
lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7")
tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), '')
- tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "BUGX MAC : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")
- tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "BUGY MAC : other-test.html = TEXT\n")
+ tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
+ tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "Bug(y) [ Mac ] other-test.html [ Failure ]\n")
tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents")
expected_logs = """Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png.
@@ -122,7 +122,7 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu
OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["Webkit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs)
new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file())
- self.assertEqual(new_expectations, "BUGX SNOWLEOPARD : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")
+ self.assertEqual(new_expectations, "Bug(x) [ SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
def test_rebaseline_test(self):
command = RebaselineTest()
@@ -331,7 +331,7 @@ MOCK run_command: ['qmake', '-v'], cwd=None
OutputCapture().assert_outputs(self, command.execute, [options, args, tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr, expected_logs=expected_logs)
def test_rebaseline_expectations_noop(self):
- self._assert_command(RebaselineExpectations(), expected_logs='Did not find any tests marked REBASELINE.\n')
+ self._assert_command(RebaselineExpectations(), expected_logs='Did not find any tests marked Rebaseline.\n')
def test_overrides_are_included_correctly(self):
command = RebaselineExpectations()
@@ -346,13 +346,13 @@ MOCK run_command: ['qmake', '-v'], cwd=None
port._filesystem.write_text_file(expectations_path, expectations_contents)
port.expectations_dict = lambda: {
expectations_path: expectations_contents,
- 'overrides': ('BUGX REBASELINE : userscripts/another-test.html = TEXT\n'
- 'BUGY : userscripts/test.html = CRASH\n')}
+ 'overrides': ('Bug(x) userscripts/another-test.html [ Failure Rebaseline ]\n'
+ 'Bug(y) userscripts/test.html [ Crash ]\n')}
for path in port.expectations_files():
port._filesystem.write_text_file(path, '')
port._filesystem.write_text_file(port.layout_tests_dir() + '/userscripts/another-test.html', '')
- self.assertEquals(command._tests_to_rebaseline(port), {'userscripts/another-test.html': set(['txt'])})
+ self.assertEquals(command._tests_to_rebaseline(port), {'userscripts/another-test.html': set(['png', 'txt', 'wav'])})
self.assertEquals(port._filesystem.read_text_file(expectations_path), expectations_contents)
def test_rebaseline(self):
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
index 31adf16c1..f8b5e57da 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
@@ -505,7 +505,7 @@ function getExpectations(test, platform, buildType)
function filterBugs(modifiers)
{
- var bugs = modifiers.match(/\bBUG\S*/g);
+ var bugs = modifiers.match(/\b(Bug|webkit.org|crbug.com|code.google.com)\S*/g);
if (!bugs)
return {bugs: '', modifiers: modifiers};
for (var j = 0; j < bugs.length; j++)
@@ -588,22 +588,99 @@ function parsedExpectations()
var lines = g_expectations.split('\n');
lines.forEach(function(line) {
line = trimString(line);
- if (!line || startsWith(line, '//'))
+ if (!line || startsWith(line, '#'))
return;
- // FIXME: Make this robust against not having modifiers and/or expectations.
- // Right now, run-webkit-tests doesn't allow such lines, but it may in the future.
- var match = line.match(/([^:]+)*:([^=]+)=(.*)/);
- if (!match) {
- console.error('Line could not be parsed: ' + line);
- return;
+ // This code mimics _tokenize_line_using_new_format() in
+ // Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+ //
+ // FIXME: consider doing more error checking here.
+ //
+ // FIXME: Clean this all up once we've fully cut over to the new syntax.
+ var tokens = line.split(/\s+/)
+ var parsed_bugs = [];
+ var parsed_modifiers = [];
+ var parsed_path;
+ var parsed_expectations = [];
+ var state = 'start';
+
+ // This clones _configuration_tokens_list in test_expectations.py.
+ // FIXME: unify with the platforms constants at the top of the file.
+ var configuration_tokens = {
+ 'Release': 'RELEASE',
+ 'Debug': 'DEBUG',
+ 'Mac': 'MAC',
+ 'Win': 'WIN',
+ 'Linux': 'LINUX',
+ 'SnowLeopard': 'SNOWLEOPARD',
+ 'Lion': 'LION',
+ 'MountainLion': 'MOUNTAINLION',
+ 'Win7': 'WIN7',
+ 'XP': 'XP',
+ 'Vista': 'VISTA',
+ 'Android': 'ANDROID',
+ };
+
+ var expectation_tokens = {
+ 'Crash': 'CRASH',
+ 'Failure': 'FAIL',
+ 'ImageOnlyFailure': 'IMAGE',
+ 'Missing': 'MISSING',
+ 'Pass': 'PASS',
+ 'Rebaseline': 'REBASELINE',
+ 'Skip': 'SKIP',
+ 'Slow': 'SLOW',
+ 'Timeout': 'TIMEOUT',
+ 'WontFix': 'WONTFIX',
+ };
+
+
+ tokens.forEach(function(token) {
+ if (token.indexOf('Bug') != -1 ||
+ token.indexOf('webkit.org') != -1 ||
+ token.indexOf('crbug.com') != -1 ||
+ token.indexOf('code.google.com') != -1) {
+ parsed_bugs.push(token);
+ } else if (token == '[') {
+ if (state == 'start') {
+ state = 'configuration';
+ } else if (state == 'name_found') {
+ state = 'expectations';
+ }
+ } else if (token == ']') {
+ if (state == 'configuration') {
+ state = 'name';
+ } else if (state == 'expectations') {
+ state = 'done';
+ }
+ } else if (state == 'configuration') {
+ parsed_modifiers.push(configuration_tokens[token]);
+ } else if (state == 'expectations') {
+ if (token == 'Rebaseline' || token == 'Skip' || token == 'Slow' || token == 'WontFix') {
+ parsed_modifiers.push(token.toUpperCase());
+ } else {
+ parsed_expectations.push(expectation_tokens[token]);
+ }
+ } else if (token == '#') {
+ state = 'done';
+ } else if (state == 'name' || state == 'start') {
+ parsed_path = token;
+ state = 'name_found';
+ }
+ });
+
+ if (!parsed_expectations.length) {
+ if (parsed_modifiers.indexOf('Slow') == -1) {
+ parsed_modifiers.push('Skip');
+ parsed_expectations = ['Pass'];
+ }
}
// FIXME: Should we include line number and comment lines here?
expectations.push({
- modifiers: trimString(match[1]),
- path: trimString(match[2]),
- expectations: trimString(match[3])
+ modifiers: parsed_bugs.concat(parsed_modifiers).join(' '),
+ path: parsed_path,
+ expectations: parsed_expectations.join(' '),
});
});
return expectations;
@@ -895,20 +972,16 @@ function processMissingAndExtraExpectations(resultsForTest)
var BUG_URL_PREFIX = '<a href="http://';
-var BUG_URL_POSTFIX = '/$2">crbug.com/$2</a> ';
-var WEBKIT_BUG_URL_POSTFIX = '/$2">webkit.org/b/$2</a> ';
+var BUG_URL_POSTFIX = '/$1">crbug.com/$1</a> ';
+var WEBKIT_BUG_URL_POSTFIX = '/$1">webkit.org/b/$1</a> ';
var INTERNAL_BUG_REPLACE_VALUE = BUG_URL_PREFIX + 'b' + BUG_URL_POSTFIX;
var EXTERNAL_BUG_REPLACE_VALUE = BUG_URL_PREFIX + 'crbug.com' + BUG_URL_POSTFIX;
var WEBKIT_BUG_REPLACE_VALUE = BUG_URL_PREFIX + 'webkit.org/b' + WEBKIT_BUG_URL_POSTFIX;
function htmlForBugs(bugs)
{
- bugs = bugs.replace(/BUG(CR)?(\d{4})(\ |$)/g, EXTERNAL_BUG_REPLACE_VALUE);
- bugs = bugs.replace(/BUG(CR)?(\d{5})(\ |$)/g, EXTERNAL_BUG_REPLACE_VALUE);
- bugs = bugs.replace(/BUG(CR)?(1\d{5})(\ |$)/g, EXTERNAL_BUG_REPLACE_VALUE);
- bugs = bugs.replace(/BUG(CR)?([2-9]\d{5})(\ |$)/g, INTERNAL_BUG_REPLACE_VALUE);
- bugs = bugs.replace(/BUG(CR)?(\d{7})(\ |$)/g, INTERNAL_BUG_REPLACE_VALUE);
- bugs = bugs.replace(/BUG(WK)(\d{5}\d*?)(\ |$)/g, WEBKIT_BUG_REPLACE_VALUE);
+ bugs = bugs.replace(/crbug.com\/(\d+)(\ |$)/g, EXTERNAL_BUG_REPLACE_VALUE);
+ bugs = bugs.replace(/webkit.org\/b\/(\d+)(\ |$)/g, WEBKIT_BUG_REPLACE_VALUE);
return bugs;
}
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
index 7bdc34806..966f4cdb3 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
@@ -84,7 +84,7 @@ test('releaseFail', 2, function() {
var expectationsArray = [
{'modifiers': 'RELEASE', 'expectations': 'FAIL'}
];
- g_expectations = 'RELEASE : ' + test + ' = FAIL';
+ g_expectations = '[ Release ] ' + test + ' [ Failure ]';
runExpectationsTest(builder, test, 'FAIL', 'RELEASE');
});
@@ -96,8 +96,8 @@ test('releaseFailDebugCrashReleaseBuilder', 2, function() {
{'modifiers': 'RELEASE', 'expectations': 'FAIL'},
{'modifiers': 'DEBUG', 'expectations': 'CRASH'}
];
- g_expectations = 'RELEASE : ' + test + ' = FAIL\n' +
- 'DEBUG : ' + test + ' = CRASH';
+ g_expectations = '[ Release ] ' + test + ' [ Failure ]\n' +
+ '[ Debug ] ' + test + ' [ Crash ]';
runExpectationsTest(builder, test, 'FAIL', 'RELEASE');
});
@@ -109,24 +109,24 @@ test('releaseFailDebugCrashDebugBuilder', 2, function() {
{'modifiers': 'RELEASE', 'expectations': 'FAIL'},
{'modifiers': 'DEBUG', 'expectations': 'CRASH'}
];
- g_expectations = 'RELEASE : ' + test + ' = FAIL\n' +
- 'DEBUG : ' + test + ' = CRASH';
+ g_expectations = '[ Release ] ' + test + ' [ Failure ]\n' +
+ '[ Debug ] ' + test + ' [ Crash ]';
runExpectationsTest(builder, test, 'CRASH', 'DEBUG');
});
test('overrideJustBuildType', 12, function() {
resetGlobals();
var test = 'bar/1.html';
- g_expectations = 'WONTFIX : bar = FAIL PASS TIMEOUT\n' +
- 'WONTFIX MAC : ' + test + ' = FAIL\n' +
- 'LINUX DEBUG : ' + test + ' = CRASH';
+ g_expectations = 'bar [ WontFix Failure Pass Timeout ]\n' +
+ '[ Mac ] ' + test + ' [ WontFix Failure ]\n' +
+ '[ Linux Debug ] ' + test + ' [ Crash ]';
runExpectationsTest('Webkit Win', test, 'FAIL PASS TIMEOUT', 'WONTFIX');
runExpectationsTest('Webkit Win (dbg)(3)', test, 'FAIL PASS TIMEOUT', 'WONTFIX');
runExpectationsTest('Webkit Linux', test, 'FAIL PASS TIMEOUT', 'WONTFIX');
runExpectationsTest('Webkit Linux (dbg)(3)', test, 'CRASH', 'LINUX DEBUG');
- runExpectationsTest('Webkit Mac10.7', test, 'FAIL', 'WONTFIX MAC');
- runExpectationsTest('Webkit Mac10.7 (dbg)(3)', test, 'FAIL', 'WONTFIX MAC');
+ runExpectationsTest('Webkit Mac10.7', test, 'FAIL', 'MAC WONTFIX');
+ runExpectationsTest('Webkit Mac10.7 (dbg)(3)', test, 'FAIL', 'MAC WONTFIX');
});
test('platformAndBuildType', 76, function() {
@@ -185,9 +185,9 @@ test('platformAndBuildType', 76, function() {
});
test('realModifiers', 3, function() {
- equal(realModifiers('BUGFOO LINUX LION WIN DEBUG SLOW'), 'SLOW');
- equal(realModifiers('BUGFOO LUCID MAC XP RELEASE SKIP'), 'SKIP');
- equal(realModifiers('BUGFOO'), '');
+ equal(realModifiers('BUG(Foo) LINUX LION WIN DEBUG SLOW'), 'SLOW');
+ equal(realModifiers('BUG(Foo) LUCID MAC XP RELEASE SKIP'), 'SKIP');
+ equal(realModifiers('BUG(Foo)'), '');
});
test('allTestsWithSamePlatformAndBuildType', 14, function() {
@@ -197,12 +197,12 @@ test('allTestsWithSamePlatformAndBuildType', 14, function() {
});
test('filterBugs',4, function() {
- var filtered = filterBugs('SKIP BUG123 BUGCR123 BUGWK123 SLOW BUG_TONY DEBUG')
- equal(filtered.modifiers, 'SKIP SLOW DEBUG');
- equal(filtered.bugs, 'BUG123 BUGCR123 BUGWK123 BUG_TONY');
+ var filtered = filterBugs('Skip crbug.com/123 webkit.org/b/123 Slow Bug(Tony) Debug')
+ equal(filtered.modifiers, 'Skip Slow Debug');
+ equal(filtered.bugs, 'crbug.com/123 webkit.org/b/123 Bug(Tony)');
- filtered = filterBugs('SKIP SLOW DEBUG')
- equal(filtered.modifiers, 'SKIP SLOW DEBUG');
+ filtered = filterBugs('Skip Slow Debug')
+ equal(filtered.modifiers, 'Skip Slow Debug');
equal(filtered.bugs, '');
});
@@ -219,15 +219,15 @@ test('getExpectations', 11, function() {
}
}
- g_expectations = 'BUG123 : foo = FAIL PASS CRASH\n' +
- 'RELEASE BUGFOO : foo/test1.html = FAIL\n' +
- 'DEBUG : foo/test1.html = CRASH\n' +
- 'BUG456 : foo/test2.html = FAIL\n' +
- 'LINUX DEBUG : foo/test2.html = CRASH\n' +
- 'RELEASE : test1.html = FAIL\n' +
- 'DEBUG : test1.html = CRASH\n' +
- 'WIN7 : http/tests/appcache/interrupted-update.html = TIMEOUT\n' +
- 'MAC LINUX XP : http/tests/appcache/interrupted-update.html = FAIL\n';
+ g_expectations = 'Bug(123) foo [ Failure Pass Crash ]\n' +
+ 'Bug(Foo) [ Release ] foo/test1.html [ Failure ]\n' +
+ '[ Debug ] foo/test1.html [ Crash ]\n' +
+ 'Bug(456) foo/test2.html [ Failure ]\n' +
+ '[ Linux Debug ] foo/test2.html [ Crash ]\n' +
+ '[ Release ] test1.html [ Failure ]\n' +
+ '[ Debug ] test1.html [ Crash ]\n' +
+ '[ Win7 ] http/tests/appcache/interrupted-update.html [ Timeout ]\n' +
+ '[ Mac Linux XP ] http/tests/appcache/interrupted-update.html [ Failure ]\n';
processExpectations();
@@ -235,19 +235,19 @@ test('getExpectations', 11, function() {
equal(JSON.stringify(expectations), '{"modifiers":"DEBUG","expectations":"CRASH"}');
var expectations = getExpectations('foo/test1.html', 'LUCID', 'RELEASE');
- equal(JSON.stringify(expectations), '{"modifiers":"RELEASE BUGFOO","expectations":"FAIL"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"Bug(Foo) RELEASE","expectations":"FAIL"}');
var expectations = getExpectations('foo/test2.html', 'LUCID', 'RELEASE');
- equal(JSON.stringify(expectations), '{"modifiers":"BUG456","expectations":"FAIL"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"Bug(456)","expectations":"FAIL"}');
var expectations = getExpectations('foo/test2.html', 'LION', 'DEBUG');
- equal(JSON.stringify(expectations), '{"modifiers":"BUG456","expectations":"FAIL"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"Bug(456)","expectations":"FAIL"}');
var expectations = getExpectations('foo/test2.html', 'LUCID', 'DEBUG');
equal(JSON.stringify(expectations), '{"modifiers":"LINUX DEBUG","expectations":"CRASH"}');
var expectations = getExpectations('foo/test3.html', 'LUCID', 'DEBUG');
- equal(JSON.stringify(expectations), '{"modifiers":"BUG123","expectations":"FAIL PASS CRASH"}');
+ equal(JSON.stringify(expectations), '{"modifiers":"Bug(123)","expectations":"FAIL PASS CRASH"}');
var expectations = getExpectations('test1.html', 'XP', 'DEBUG');
equal(JSON.stringify(expectations), '{"modifiers":"DEBUG","expectations":"CRASH"}');
diff --git a/Tools/Tools.pro b/Tools/Tools.pro
index 1448c0105..3efb72c6a 100644
--- a/Tools/Tools.pro
+++ b/Tools/Tools.pro
@@ -31,7 +31,6 @@ OTHER_FILES = \
$$files(Scripts/webkitperl/*.p[l|m], true) \
qmake/README \
qmake/dump-features.pl \
- qmake/qt_webkit.pri \
qmake/config.tests/README \
qmake/config.tests/fontconfig/* \
qmake/config.tests/gccdepends/* \
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm b/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
index 40d92ead7..f2da64036 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
@@ -1,4 +1,5 @@
# Copyright (C) 2010 Apple Inc. All rights reserved.
+# Copyright (C) 2012 Samsung Electronics
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -29,11 +30,12 @@ package CodeGeneratorTestRunner;
sub new
{
- my ($class, $codeGenerator, $outputDir) = @_;
+ my ($class, $codeGenerator, $outputDir, $outputHeaderDir, $layerOnTop, $preprocessor, $writeDependencies, $verbose, $idlFilePath) = @_;
my $reference = {
codeGenerator => $codeGenerator,
outputDir => $outputDir,
+ idlFilePath => $idlFilePath,
};
bless($reference, $class);
@@ -72,12 +74,37 @@ sub _classRefGetter
return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($idlType)) . "Class";
}
-sub _fileHeaderString
+sub _parseLicenseBlock
{
- my ($filename) = @_;
+ my ($fileHandle) = @_;
+
+ my ($copyright, $readCount, $buffer, $currentCharacter, $previousCharacter);
+ my $startSentinel = "/*";
+ my $lengthOfStartSentinel = length($startSentinel);
+ $readCount = read($fileHandle, $buffer, $lengthOfStartSentinel);
+ return "" if ($readCount < $lengthOfStartSentinel || $buffer ne $startSentinel);
+ $copyright = $buffer;
+
+ while ($readCount = read($fileHandle, $currentCharacter, 1)) {
+ $copyright .= $currentCharacter;
+ return $copyright if $currentCharacter eq "/" && $previousCharacter eq "*";
+ $previousCharacter = $currentCharacter;
+ }
+
+ return "";
+}
+
+sub _parseLicenseBlockFromFile
+{
+ my ($path) = @_;
+ open my $fileHandle, "<", $path or die "Failed to open $path for reading: $!";
+ my $licenseBlock = _parseLicenseBlock($fileHandle);
+ close($fileHandle);
+ return $licenseBlock;
+}
- # FIXME: We should pull header out of the IDL file to get the copyright
- # year(s) right.
+sub _defaultLicenseBlock
+{
return <<EOF;
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
@@ -106,6 +133,16 @@ sub _fileHeaderString
EOF
}
+sub _licenseBlock
+{
+ my ($self) = @_;
+ return $self->{licenseBlock} if $self->{licenseBlock};
+
+ my $licenseBlock = _parseLicenseBlockFromFile($self->{idlFilePath}) || _defaultLicenseBlock();
+ $self->{licenseBlock} = $licenseBlock;
+ return $licenseBlock;
+}
+
sub _generateHeaderFile
{
my ($self, $interface) = @_;
@@ -117,7 +154,7 @@ sub _generateHeaderFile
my $implementationClassName = _implementationClassName($idlType);
my $filename = $className . ".h";
- push(@contents, _fileHeaderString($filename));
+ push(@contents, $self->_licenseBlock());
my $parentClassName = _parentClassName($interface);
@@ -184,7 +221,7 @@ sub _generateImplementationFile
my $implementationClassName = _implementationClassName($idlType);
my $filename = $className . ".cpp";
- push(@contentsPrefix, _fileHeaderString($filename));
+ push(@contentsPrefix, $self->_licenseBlock());
my $classRefGetter = $self->_classRefGetter($idlType);
my $parentClassName = _parentClassName($interface);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 4e3be91a0..6c345c575 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -209,9 +209,9 @@ bool InjectedBundle::booleanForKey(WKDictionaryRef dictionary, const char* key)
WKRetainPtr<WKStringRef> wkKey(AdoptWK, WKStringCreateWithUTF8CString(key));
WKTypeRef value = WKDictionaryGetItemForKey(dictionary, wkKey.get());
if (WKGetTypeID(value) != WKBooleanGetTypeID()) {
- stringBuilder()->append("Boolean value for key \"");
+ stringBuilder()->appendLiteral("Boolean value for key \"");
stringBuilder()->append(key);
- stringBuilder()->append("\" not found in dictionary\n");
+ stringBuilder()->appendLiteral("\" not found in dictionary\n");
return false;
}
return WKBooleanGetValue(static_cast<WKBooleanRef>(value));
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index c19d11a5e..23c00f9ba 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -1006,9 +1006,9 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
if (!InjectedBundle::shared().testRunner()->shouldDumpTitleChanges())
return;
- InjectedBundle::shared().stringBuilder()->appendLiteral("TITLE CHANGED: ");
+ InjectedBundle::shared().stringBuilder()->appendLiteral("TITLE CHANGED: '");
InjectedBundle::shared().stringBuilder()->append(toWTFString(title));
- InjectedBundle::shared().stringBuilder()->append('\n');
+ InjectedBundle::shared().stringBuilder()->appendLiteral("'\n");
}
void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
index 892bc215d..6197a794f 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
@@ -691,9 +691,14 @@ void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSString
WKRetainPtr<WKSerializedScriptValueRef> dataWK(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, data), 0));
WKRetainPtr<WKMutableDictionaryRef> intentInitDict(AdoptWK, WKMutableDictionaryCreate());
- WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("action"), actionWK.get());
- WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("type"), typeWK.get());
- WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("data"), dataWK.get());
+ WKRetainPtr<WKStringRef> actionKey(AdoptWK, WKStringCreateWithUTF8CString("action"));
+ WKDictionaryAddItem(intentInitDict.get(), actionKey.get(), actionWK.get());
+
+ WKRetainPtr<WKStringRef> typeKey(AdoptWK, WKStringCreateWithUTF8CString("type"));
+ WKDictionaryAddItem(intentInitDict.get(), typeKey.get(), typeWK.get());
+
+ WKRetainPtr<WKStringRef> dataKey(AdoptWK, WKStringCreateWithUTF8CString("data"));
+ WKDictionaryAddItem(intentInitDict.get(), dataKey.get(), dataWK.get());
WKRetainPtr<WKBundleIntentRef> wkIntent(AdoptWK, WKBundleIntentCreate(intentInitDict.get()));
WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntent.get());
diff --git a/Tools/qmake/config.tests/gccdepends/empty.cpp b/Tools/qmake/config.tests/gccdepends/empty.cpp
deleted file mode 100644
index e69de29bb..000000000
--- a/Tools/qmake/config.tests/gccdepends/empty.cpp
+++ /dev/null
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
index cdb73a7c0..5ed03c225 100644
--- a/Tools/qmake/mkspecs/features/default_post.prf
+++ b/Tools/qmake/mkspecs/features/default_post.prf
@@ -192,8 +192,6 @@ contains(QT, webkit) {
# FIXME: Replace this with putting the intermediate libraries in the prl file
}
-contains(TARGET, $$resolveFinalLibraryName($${QT.webkit.name})): CONFIG += creating_module
-
defineTest(needToLink) {
# The main dynamic library always needs to link in the intermediate libraries
creating_module: return(true)
@@ -223,25 +221,10 @@ needToLink() {
for(library, WEBKIT) {
library_identifier = $$lower($$library)
linkAgainstLibrary($$library, $$eval(WEBKIT.$${library_identifier}.root_source_dir))
- LIBS += $$eval(WEBKIT.$${library_identifier}.dependent_libs)
+ LIBS_PRIVATE += $$eval(WEBKIT.$${library_identifier}.dependent_libs)
}
}
-creating_module {
- # Sanitize PKGCONFIG and LIBS, as we don't want any of these libraries
- # to end up in as public API dependenices in the QtWebKit prl file.
- PKGCONFIG_PRIVATE *= $$PKGCONFIG
- unset(PKGCONFIG)
- LIBS_PRIVATE += $$LIBS
- unset(LIBS)
-
- # We do have a limited subset of Qt modules as dependencies for using
- # the public QtWebKit API. The rest of the modules go into QT_PRIVATE.
- QT_PRIVATE *= $$QT
- QT = $$QT_API_DEPENDS
- QT_PRIVATE -= $$QT
-}
-
equals(_PRO_FILE_, $${ROOT_WEBKIT_DIR}/WebKit.pro):!isEmpty(OVERRIDE_SUBDIRS) {
# The root WebKit project file is the only one that allows
# you to pass a set of subtargets on the comand line.
diff --git a/Tools/qmake/mkspecs/features/production_build.prf b/Tools/qmake/mkspecs/features/production_build.prf
index 866b04dc4..f5a4e69e3 100644
--- a/Tools/qmake/mkspecs/features/production_build.prf
+++ b/Tools/qmake/mkspecs/features/production_build.prf
@@ -7,7 +7,7 @@ CONFIG *= use_all_in_one_files
# resulting in the need of several gigabytes of memory at link-time. Reduce the pressure
# by compiling any static library like WTF or JSC with release flags instead and keep debug
# symbols for the static libraries that implement API.
-linux-*:CONFIG(debug, debug|release):contains(TEMPLATE, lib):staticlib {
+linux-*|win32-g++*:CONFIG(debug, debug|release):contains(TEMPLATE, lib):staticlib {
!equals(TARGET, WebKit2):!equals(TARGET, WebKit1) {
CONFIG += no_debug_info
QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE
diff --git a/Tools/qmake/mkspecs/features/webkit_modules.prf b/Tools/qmake/mkspecs/features/webkit_modules.prf
index 8d760272f..a156bcb36 100644
--- a/Tools/qmake/mkspecs/features/webkit_modules.prf
+++ b/Tools/qmake/mkspecs/features/webkit_modules.prf
@@ -36,3 +36,18 @@ for(library, WEBKIT) {
# macros synchronized with the code that it will be linked with statically.
!contains(QT, webkit): DEFINES += STATICALLY_LINKED_WITH_$$library
}
+
+contains(TARGET, $$resolveFinalLibraryName($${QT.webkit.name})): CONFIG += creating_module
+
+creating_module {
+ # Sanitize PKGCONFIG as we don't want any of these libraries
+ # to end up in as public API dependenices in the QtWebKit prl file.
+ PKGCONFIG_PRIVATE *= $$PKGCONFIG
+ unset(PKGCONFIG)
+
+ # We do have a limited subset of Qt modules as dependencies for using
+ # the public QtWebKit API. The rest of the modules go into QT_PRIVATE.
+ QT_PRIVATE *= $$QT
+ QT = $$QT_API_DEPENDS
+ QT_PRIVATE -= $$QT
+}